Reputation: 1067
I am nearly sure, that i have seen a method (provided by the Apple-SDK) a time ago, that could find the distance between 2 MKAnnotations. That time i havent seen a use in the funktion. But, how it goes, now i would like to have this function but i can´t find it anymore.
Can anyone please help me ? Maybe I have just something wrong in my mind or sth, but i have searched and i am a bit confused.
Upvotes: 1
Views: 669
Reputation: 21
You can use this
MKMapPoint point1 = MKMapPointForCoordinate(annotation1.coordinate);
MPMapPoint point2 = MKMapPointForCoordinate(annotation2.coordinate);
CLLocationDistance distance = MKMetersBetweenMapPoints(point1,point2);
Upvotes: 2
Reputation: 1067
ok, on googles 10th page i have found it: http://developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CLLocation_Class/CLLocation/CLLocation.html
distanceFromLocation: is what i have searched for
Upvotes: 1