I'm working with google maps API and have a few coordinates (markers) around the world. How is the best way to get a marker list of the points inside a mile with an 'A' marker on center ?
The first way I think is calculate the distance between the point A and all others points and sort the array. It works, but takes n interactions.
The second way would store the coordinates and a 'chunk' (city, state, country), and repeat the previous method, searching only inside this "chunk". It's still n, but now the 'n' is smaller.
What is the best way to store the data and work on it ?