• Resolved Victoria

    (@vic3685)


    Hi! First of all, I love your plugin. It has all the features I would wish for and more πŸ™‚

    I’m having a bit of trouble with the geo search. It works great when the suggestions get loaded, but very often they don’t.

    The first time I load the page after clearing cache they work. I can tell because the “Near…” placeholder shows up in the input field. When I search, suggestions pop up automatically and the results are right.

    If I open an event and then hit back, the “Near” placeholder doesn’t show up and suggestions don’t load. When I hit search, results are not filtered by location.

    I’m guessing there is something that stops these lines from running:

    EM.geo_placeholder = ‘<?php echo esc_attr($args[‘geo_label’]); ?>’;
    jQuery(document).bind(’em_maps_loaded’, function(){ em_geo_search_init(); });

    but I can’t figure out what. Has anybody else run into this?

    https://wordpress.org/plugins/events-manager/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    hello,

    do you have sample link to your site with this issue for us to see and analyze?

    Thread Starter Victoria

    (@vic3685)

    Unfortunately I am working locally.

    I narrowed the issue down tho. When I reload the page without clearing the cache, this line in geo.js doesn’t get triggered:

    jQuery(document).bind('em_maps_loaded', function(){ em_geo_search_init(); });

    I have confirmed that

    jQuery(document).triggerHandler('em_maps_loaded');

    in events-manager.js runs.

    After a lot of testing, I ended up replacing the problematic line with this, and it works:

    jQuery(window).load(function() {em_geo_search_init();});

    It’s probably not the cleanest workaround, because it doesn’t actually confirm that Google Maps loaded properly, but the location search works every time.

    Plugin Support angelo_nwl

    (@angelo_nwl)

    sorry cannot seems to replicate this however when you say ‘then hit back’ did you mean the browser back button ?

    Thread Starter Victoria

    (@vic3685)

    Yes, I meant the browser back button. It also happens with a simple reload that doesn’t clear the cache.

    Plugin Support angelo_nwl

    (@angelo_nwl)

    I see what you mean now, let me check this and inform the devs if needed.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Location search doesn't work when page is reloaded’ is closed to new replies.