bjorn2404 / jQuery-Store-Locator-Plugin

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

Zoom to nearest marker when triggering distance error #54

Closed a-harvie closed 9 years ago

a-harvie commented 9 years ago

Currently, if you search for a location that's greater than the distance specified in your distanceAlert value, it shows the error alert, then centers the map on the location you specified. It would be great to have the option to have the map still center on that location, but zoom out far enough to show the closest location(s).

Example: right now, there are no locations near Montreal in my setup, so I get this: http://screencast.com/t/Y6feLhFHcIPB Would be nice to be able to do something like this: http://screencast.com/t/ymUhpoj4

I understand you might not have time, but thought I'd mention this as a feature idea.

Thanks! Great plugin!

bjorn2404 commented 9 years ago

Good thought. I'm thinking I'll update to have it automatically center and zoom so all locations fit on the map with fitBounds. Otherwise it gets complicated with things like how many closest markers to show, etc.

bjorn2404 commented 9 years ago

I've made the update I described in my previous comment in v2.0.6.