Closest Location Feature
The Closest Location feature allows you to have the map adjust to the closest location from your user's location.
Here is how it works;
1. When you first load the map you are getting your regular default settings to display.
2. Shortly after the page loades, the browser will display a grant access pop up (built into the browser). If the user allows you access to their location information….
(Note: This is a user privacy issue and there is no way to force this permission)
3. The map will auto zoom to the location and display the closest options.
So in my case I live in Assonet MA (USA). The map after a couple seconds will reposition to the US and display the nearest options based on my location at the same zoom set in the default settings.
The results will show the map centered based on my location.
The way this is enabled is under the map options settings. We also added the Allow mouse Wheel features to be disabled which further improves the user experience.
Please feel free to test this on the live demo to see how the feature works.
Note: To test this you will need to refresh the map by reloading your browser. As the Browser refreshes the popup will appear.