• Hi,

    First I’d like to thank you for your great plugin. I used it for some projects and I am always satisfied ! ??

    Unfortunately, I encountered a new problem since the current project I’m working on uses an AJAX navigation.

    The WPSL shortcode is called in the main content of a simple page, right here : https://www.sudradio.fr/frequences/
    Arriving on this page, you should see a working store locator with all the markers I created, nice ! ??

    BUT, if you first go on the homepage (https://www.sudradio.fr) for instance (reload the whole page, don’t click on the logo or another link) and then click on the “Fréquences” link in the top right corner of the page, you’ll reach the store locator page but the plugin won’t load at all ??
    Obviously, the reason is that the inline script needed to instanciate the plugin isn’t created (we can’t see it in the source code).

    So, the question is : is it possible to init the store locator in such a scenario ? Is there a way to init the map by calling manually a JavaScript function maybe ?

    Thanks in advance !

    And keep going with your great work, WPSL rocks !

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    Maybe it will work if you call initWpslMap() after the page has finished loading thought AJAX? This is normally only used by a third-party plugin to init the map, but may also fix this issue.

    Thread Starter Jérémy PETERSEN

    (@jerempetersen)

    Hi,

    Thanks for your quick reply.

    Calling this function seems interesting, but it doesn’t work since it’s not defined in my situation : ReferenceError: initWpslMap is not defined

    Indeed, the WPSL script wasn’t loaded if I come first from another page without any Store Locator in it.

    Should I load the script somewhere manually so I could get access to this function in order to be able to init WPSL ?

    Plugin Author Tijmen Smit

    (@tijmensmit)

    When I check the HTML source on the store locator page ( after going to another page and back again ), then the wpsl-gmaps.min.js is loaded. Maybe you called initWpslMap to early, as in before the WPSL script was loaded?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WPSL loading with AJAX nav’ is closed to new replies.