Ответ 1
Я предполагаю, что это проблема алгоритма. Некоторое приближение, которое останавливается, когда достигается определенная точность. Вот почему нет коммутации. Вы можете попробовать пример кода, чтобы получить расстояние между двумя точками на карте, не используя MKMapPoints:
- (float) distanceToLPU {
useDelegate
CLLocationCoordinate2D pointACoordinate = appDelegate.usrLoc;
CLLocation *pointALocation = [[CLLocation alloc] initWithLatitude:pointACoordinate.latitude longitude:pointACoordinate.longitude];
CLLocationCoordinate2D pointBCoordinate;
pointBCoordinate.latitude = [self.latitude doubleValue];
pointBCoordinate.longitude = [self.longitude doubleValue];
CLLocation *pointBLocation = [[CLLocation alloc] initWithLatitude:pointBCoordinate.latitude longitude:pointBCoordinate.longitude];
float distanceMeters = [pointALocation distanceFromLocation:pointBLocation];
[pointALocation release];
[pointBLocation release];
NSString *dist = [NSString stringWithFormat:@" (%.0f м)", distanceMeters];
NSLog(@"Distance to this LPU:%@", dist);
return distanceMeters;
}