Support » Plugin: WP Store Locator » Access map and markers by JavaScript

  • Resolved Jason Yingling


    Hi there,

    I’m implementing WP Store Locator a bit custom. I’ve gotten away for the most part using the available filters and hooks, but I’ve recently run into a couple issues that have required me to make edits to the wpsl-gmap.js file.

    One is trying to implement hover states on the markers using mouseover and mouseout. That could be solved if I were able to access the markersArray array outside of the plugin’s JS file.

    The other is a map zoom issue due to hiding the map in a window that has display: none;. I was able to fix this by calling the fitBounds() function on clicking the button that shows the map. If I were able to access that outside the plugin’s JS as well I could get by without making an plugin edits.

    Any chance you could make those available globally? Or if you have the plugin on github I can take a crack at opening a PR for you to review. Or just let me know if I completely missed how to do this in the plugin already.


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


    The 3.0 update contains a complete rewrite of the JS code where everything is namespaced, and you can access the markers, active maps and other values. It will also make it easier to add support for other map providers like OpenStreetMaps ( included ) and Mapbox.

    I hope to have a public beta version ready of the 3.0 update late August.

    Awesome! If you need any testing done ahead of that let me know.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.