Answer the question
In order to leave comments, you need to log in
How to lazy load GoogleMap?
Hello!
I am looking for a method for implementing the loading of Google maps via Ajax.
The site uses the following plugins:
Comprehensive Google Map plugin or Maps Marker Pro
Everything works fine.
It was required to make an ajax-loading of the map. This is where the problem arose:
when loading the map into a separate block of the page, the map data is loaded (seen by the page code), but the display does not work (the inscription "map is loading" lights up). Apparently, it does not call for any scripts, although all of them, in fact, were previously uploaded to this page. Either some action is missing to initialize the map (or something like that, I don’t know how to formulate it correctly).
There were attempts to load the map as a result of processing a shortcode, as a result of processing a widget, and even as a separate . In all cases, the map is not displayed.
The Maps Marker Pro plugin has the ability to grab GeoJSON data for the desired map, but it is not clear how to apply it for this plugin (no examples were found). It is also not known whether this data will help to trigger the display of the map itself after loading it with AJAX.
jquery 1.11.1
On the pages themselves, there are no problems with displaying maps, that is, if the same map is loaded immediately when the page is loaded, then everything is OK, but there is a problem with post-loading.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question