I'm working on an app where I would need to return points (Lat, Long) in a radius of size X (Km) from the user's location (Lat, Long). I have come up with the following logic:
- Get the user's current location
-
Enter the location of the user as the tip of the radius, and the distance of that radius as the point B, in latitude and longitude.
But I'm struggling to figure out how to calculate and convert this distance to meters or kilometers.
The points that will be searched are stored in the app, not requiring requests from a webservice.
In the end I will list in an array the points that are within the radius.
Someone knows about an API or methods that can help you build this function.
I'm using the google maps iOS API to show the map, I'm storing the points of the locations that will be searched within the radius of the app itself. I'm using the coordinates of Google Maps.
Image to Illustrate: