I know from documentation we can find distance between two CLLocation
points using the function, distanceFromLocation:
. But my problem is I dont have CLLocation data type with me, I have the CLLocationCoordinate2D points. So how can I find distance between two CLLocationCoordinate2D points. I have seen the post post but not helpful for me.
You should create an object of CLLocation using,
- (id)initWithLatitude:(CLLocationDegrees)latitude longitude:(CLLocationDegrees)longitude;
Then, you should be able to calculate the distance using
[location1 distanceFromLocation:location2];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With