distanceFromLocation在iOS 8和iOS 9之间返回不同的结果

时间:2016-01-28 02:10:26

标签: ios8 location ios9 distance cllocation

我使用 CLLocation distanceFromLocation方法计算2个位置之间的距离,如下所示。它在iOS 8和iOS 9之间返回不同的结果 谁知道为什么?感谢。

CLLocation *locationA = [[CLLocation alloc] initWithLatitude:39.861667 longitude:-104.673167];
CLLocation *locationB = [[CLLocation alloc] initWithLatitude:33.942500 longitude:-118.408075];

// Calculate distance between 2 locations
CLLocationDistance routeDistance = [locationA distanceFromLocation:locationB];

NSLog(@"Distance A - B : %f", routeDistance);

==>结果:
距离A - B:
iOS 8: 1383761 .019303
iOS 9: 1387015 .203345

0 个答案:

没有答案