bjorn2404 / jQuery-Store-Locator-Plugin

A store locator plugin using Google Maps API version 3
MIT License
495 stars 235 forks source link

display markers with parameters through url like city, zip, region or else... #50

Closed angeenes closed 9 years ago

angeenes commented 9 years ago

Hi,

Is it possible to pass an url parameter ? And display directly the correct markers on the map the first time the page load?

For example "http://www.mydomain.com/storelocator?city=london This would display all the London markers to someone coming from another page ( he clicked on a link on the previous page for example )

Thanks for this great plugin, very usefull.

angeenes commented 9 years ago

I see that there is the option ''querystringParams' : true,' that activate what I want but I can't make it work, should I pass ?origAddress=london in the URL ? or another parameter ?

angeenes commented 9 years ago

Ok guys, I found it so I post it here for all the other newbies as me.

Actually the query string is the on the name of the input like "bh-sl-address" for example which you can pass any adress, city, etc ... like this http://www.mydomain.com/bh-sl-address?=london

The store locator will then understand and load the correct list.

I still have a zoom problem once the list is loaded this way but this is something else.

Closing this issue then!

bjorn2404 commented 9 years ago

Yeah, sorry I get a lot of questions and it's difficult to keep up. It will look for what you're using for the addressID setting for the address (default bh-sl-address) and will also check for the searchID setting whether or not you're using the name search option (default bh-sl-search). You can basically feed it any address parameters with the address and the other searches pretty much everything.

angeenes commented 9 years ago

Hi, thanks for your reply.I am not surprised you get a lot of questions with such quality work, your plugin drags a lot of interest. I am now using the url to pass a city query coming from a search field on the previous page, all is fine. Good job! :-)

monocraft commented 9 years ago

How would you pass address directly though link?

bjorn2404 commented 9 years ago

The same way that angenees described above: http://www.mydomain.com/store-locator-page?bh-sl-address=address goes here