I've been looking around countless tutorials and stack overflow posts and found nothing on this subject. I'm trying to allow users to set a numerical value (i.e. 5, 10, 15) of miles and then only showing map markers which are within that distance of the users' current location.
So, I have the users location value and I have a database of markers each with their own lat/lng values. What I want to do is:
- Get users' current location in Lat/Lng.
- Get the required distance value (5, 10, 15 miles).
- Get all the map marker location which are 5 miles away from the users' location.
- Hide all other markers that aren't.
It's pretty standard functionality when using Google Maps as a user but I just can't find any documentation on it at all. Could any provide any helpful links or some sample code?
I've been looking into LatLngBounds
and I believe I can use this in my solution. Am I looking down the right path?