0

I'm trying to load the objective HTML Google Maps extension with Ajax. But i don't get it to work. Before i loaded the map without ajax and that works perfect.

This is the code i use:

In the Template:
$('.ajax-map').load('/site/ajax_google');

<div class="ajax-map"></div>

ajax google maps file
{exp:gmap:init
<!--General-->
    id="map" 
    class="ajax-map" 
    language="nl"
    scrollwheel="false"
    script_tag="false"

    etc...

The page does find the google maps file but doesn't load the map. Anybody a idea?

2
  • In what way doesn't it work? Are you just seeing grey tiles where the map should be?
    – foamcow
    Commented Sep 4, 2014 at 11:35
  • When adding script_tag="false" the map doesn't load at all everything stays blank. Without script_tag="false" it loads on the site/ajax_google but not with the jQuery load method.
    – Eddyfever
    Commented Sep 8, 2014 at 8:00

1 Answer 1

1

If a Google map is being "revealed" with Javascript then it is necessary to trigger the map resize event when it is displayed.

If you're using Google Maps for ExpressionEngine then there is GmapHelper which you can grab and call at the appropriate time to fire the resize event.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.