Support » Plugin: Google Maps WordPress Store Locator » Find Locations with Blank Address Input

  • How can I make the map load all locations just like when it is the first time the page is loaded after trying to search for locations? For example, all locations load by default, this is great. Then I search in a city and see some locations, this is also great. But now I want to clear the Address search field and click on Find Locations but I get an alert saying this: “Not found”. If you could inform me on what is needed to allow all locations to be loaded when the input field is blank, then I would greatly appreciate it. I will need this functionality since I don’t have the capability of reloading the page where I’m displaying the map.

    https://wordpress.org/plugins/store-locator/

Viewing 1 replies (of 1 total)
  • I’ve been able to deminify your javascript for the store-locator.js file and able to find the searchLocations() function that gets called when the Find Locations button is clicked. If I am able to get the address from the input as such:

    var address = document.getElementById(‘addressInput’).value;

    and check that the address is blank, what do I need to do to reset the map and show all locations as if I just reloaded the page? How do I clear the auto locate functionality as well?

    if(address.length == 0) {
    //some code here to clear auto location coordinates and allow map to load with all location markers.
    }

Viewing 1 replies (of 1 total)
  • The topic ‘Find Locations with Blank Address Input’ is closed to new replies.