apneadiving / Google-Maps-for-Rails

Enables easy Google map + overlays creation in Ruby apps
https://apneadiving.github.io/
MIT License
2.26k stars 382 forks source link

Finding nearby locations within a given radius #115

Closed jayandra closed 12 years ago

jayandra commented 12 years ago

Hello there,

I have stored latitude and longitude for different interesting places in my database. Whenever a user clicks into any of the interesting places, the show page displays details of the location, along with a google map with a marker pointing at it.

Now I have been trying to implement a button to "Show nearby places", along with a drop-down for ranges (eg. 50km, 100km, 150km), but could not figure out how to do it.

I was wondering how to find the neighboring places withing a given range from a selected location, using the latitudes and longitudes I have in my database.

Sorry if I am being way too dumb

I have even posted the message in stackoverflow http://stackoverflow.com/questions/8113120/finding-nearby-locations-within-a-given-radius

Thanks

apneadiving commented 12 years ago

Just answered on stackoverflow.

Cheers,

Ben