Az én alkalmazások szoktam MKDirections hogy autós (séta) távolság két helyen.
CLLocationCoordinate2D startCoordinates = YOUR_START_COORDINATES;
CLLocationCoordinate2D endCoordinates = YOUR_END_COORDINATES;
MKPlacemark *startPoint = [[MKPlacemark alloc] initWithCoordinate:startCoordinates];
MKPlacemark *endPoint = [[MKPlacemark alloc] initWithCoordinate:endCoordinates];
MKMapItem *startItem = [[MKMapItem alloc] initWithPlacemark:startPoint];
MKMapItem *endItem = [[MKMapItem alloc] initWithPlacemark:endPoint];
MKDirectionsRequest *request = [[MKDirectionsRequest alloc] init];
request.source = startItem;
request.destination = endItem;
request.transportType = MKDirectionsTransportTypeAutomobile; //here you can choose a transport type you need
MKDirections *direction = [[MKDirections alloc] initWithRequest:request];
[direction calculateDirectionsWithCompletionHandler:^(MKDirectionsResponse * _Nullable response, NSError * _Nullable error) {
if (response) {
for (MKRoute *route in response.routes) {
NSLog(@"Distance : %f", route.distance);
}
}
}];
Ha Ön helyét a címe, így használhatja a módszert CLGeocoder, amely megadja szélességi és hosszúsági a címet
- (void)geocodeAddressString:(NSString *)addressString completionHandler:(CLGeocodeCompletionHandler)completionHandler;
Ha összehasonlítjuk a követési távolságot eredmény felhasználásával MKDirections az egyik a Google Maps, akkor láthatjuk, hogy azok eltérnek. Kerestem ezzel kapcsolatban, és jött át a következő link http://www.macworld.co.uk/review/reference-education/apple-maps-vs-google-maps-3464377/
Annak ellenére, hogy az Apple már javítva térképszolgáltatás, mégis elismerik a pontosság a Google (IMO), legalább egy kérdés a követési távolságot. Tehát, ha a pontosság nem kiemelkedően fontos az Ön esetében, így követheti végig az Apple. Egyébként én ajánlom megnézni a Google API-t.