How to get the nearest marker to a know point in the visible map area with Google Maps API v.3? -


I have already read, but I have some regrets to apply in my situation because I have many markers (ATMs) ~ 5000, everyday).

In my application, the user places his marker (it is called marker A) by clicking on the map or by address via geocode; I know that there is a marker in the specific scope of marker A.

As I said, I can not start all the markers again, this is likely to kill the user browser, and if possible, to avoid AJAX requests to search in my database to love.

Actually I insert markers on the map via

Is there a way to search between markers in the visible area of ​​the map?

After several research, I ended up with the recurrence solution ().

To reduce the number of repeated objects, I divided into the state base (this time has been implemented), maybe in the future I can add more divisions.

If it can be useful to someone else, my 'solution' means an array:

  places = {"this": ["Rome", "Venice"], "fr": ["Paris", "Lyon"], "Es": ["Madrid", "Barcelona", "Girona"]}   

To get a google geoded state with marker ('fr', 'this') where the places are looking for.

Comments