Events Made Easy Forums How do I … Externally controlling the map

Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #44074
    Anonymous
    Inactive

    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!

    #50780
    Franky
    Keymaster

    The 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?”

    #50781
    Anonymous
    Inactive

    Franky,

    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!

    #50782
    Franky
    Keymaster

    I’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 …

    #50783
    Anonymous
    Inactive

    Franky,

    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!

    #50784
    Franky
    Keymaster

    Yes, 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 …

    See http://api.jquery.com/jQuery.ajax/

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘How do I …’ is closed to new topics and replies.
Scroll to Top