Events Made Easy › Forums › How do I … › Externally controlling the map
Tagged: google map
- This topic has 5 replies, 2 voices, and was last updated 11 years, 2 months ago by Franky.
-
AuthorPosts
-
Fri 4 Oct 2013 at 17:07 #44074AnonymousInactive
Franky,
Several months ago, under an older version of the plugin, I had successfully created a select menu of states which would recenter the map to a particular lat/long for viewing ‘event locations in my state’. It seems that this no longer works, perhaps because the map object is now no longer available globally. On change of the select menu, I get a JS error “map.setCenter is not a function”. Do you have any insight on this or is there a different method now that might re-enable my map recentering?
Thanks Franky!
Fri 4 Oct 2013 at 23:51 #50780FrankyKeymasterThe javascript file for the google maps (js/eme_location_map.js) hasn’t changed at concerning that after version 1.0.0. The map variable is and has always been defined in the js function loadGMap().
Edit: maybe you should try the EME setting “Always include JS in header?”
Mon 7 Oct 2013 at 15:26 #50781AnonymousInactiveFranky,
On the site with the following URL (where I have the map failing to load with no errors) I have done what you suggested and set always include JS to true, but the map is still failing to load. The list of locations does load but the map placeholder is still there (“map”) and no map. Please reference the following URL –
http://www.americancheesemonth.org/event-locations-map/
Im seeing no JS errors or any indications of the problem. Any ideas? Thanks Franky!
Mon 7 Oct 2013 at 20:47 #50782FrankyKeymasterI’m guessing it’s the size of the json data being returned that’s the problem (getJSON in jquery is just a short form of $.ajax) See here:
http://stackoverflow.com/questions/10165543/ajax-response-size-limit
I changed the code to return only the values needed in the json response:
http://plugins.trac.wordpress.org/changeset/784120
Otherwise I need to start messing with multiple json requests as mentioned in the first link, which is ugly …
Mon 7 Oct 2013 at 22:36 #50783AnonymousInactiveFranky,
I updated eme_people.php and the map still fails to load at all (http://www.americancheesemonth.org/event-locations-map/). So do you think its the pure bulk of locations that is causing the map to fail? Thanks for your help with this!
Tue 8 Oct 2013 at 09:10 #50784FrankyKeymasterYes, that is the problem.
If you know some javascript, you can try to change the .getJSON call to .ajax and use the setting “dataType” with value “text json”. “text json” will force jquery to think it’s just text and then convert it internally to json. But also no guarantee there either …
-
AuthorPosts
- The forum ‘How do I …’ is closed to new topics and replies.