Results 1 to 2 of 2

Thread: Jquery Breaks Google Maps API

  1. #1
    Join Date
    Nov 2008
    Thanked 0 Times in 0 Posts

    Default Jquery Breaks Google Maps API

    I have been using the Google Maps API successfully for a few years. Now I am creating a page re-design where the page contains a series of tabs which are controlled by jquery. I have tried to put a Google Maps page in one of the tabs and it completely fails to function.

    The jquery stuff was very kindly provided on this forum by jscheur1, and it works perfectly in every other respect. A single tab containing a separate file is called by:
    <div id='location' style="display:none;">
    <script type="text/javascript">
    $('#locationarea').load('location.php', 'hid=' + hid);
    <div id="locationarea"></div>
    location.php contains the Google Map. Inside the main tabbed page in just comes up blank. When called as a separate file from the browser address bar it works perfectly.

    Surely jquery and Google Maps cannot be totally incompatible?!!!

  2. #2
    Join Date
    Mar 2006
    Illinois, USA
    Thanked 690 Times in 678 Posts


    Here's a guess based on what you described:
    I don't think it's a problem with jQuery and Google Maps. Instead, the problem is that you aren't loading the map when the page loads. It's hidden. Then when you do load it, the map hasn't been loaded because it wasn't active.
    I'm not sure what the best solution is for this, but you would either need to trick the browser into believing that the map is active, or just start the page with the map active.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts