Ios6 如何在iOS 6中使用Apple maps查找两个位置之间的距离?

Ios6 如何在iOS 6中使用Apple maps查找两个位置之间的距离?,ios6,cllocation,cllocationdistance,Ios6,Cllocation,Cllocationdistance,我的要求是在不使用GoogleAPI的情况下查找两个位置之间的距离(以英里为单位)。 我添加了如下代码: CLLocation* first = [[CLLocation alloc] initWithLatitude:35.779702 longitude:-78.641746]; CLLocation* second = [[CLLocation alloc] initWithLatitude:40.723779 longitude:-73.991289]; CLLocationDista

我的要求是在不使用GoogleAPI的情况下查找两个位置之间的距离(以英里为单位)。 我添加了如下代码:

CLLocation* first = [[CLLocation alloc] initWithLatitude:35.779702 longitude:-78.641746];
CLLocation* second = [[CLLocation alloc] initWithLatitude:40.723779 longitude:-73.991289];

CLLocationDistance distance = [first distanceFromLocation:second];
NSLog(@"distance  in Miles ::%f",distance*0.00062137);
它给出的距离是424.151386,但当我在iPad上登记时,它给出的距离是497英里


请给我这个差异的解决方案。

你是如何在iPad上检查的?我们在iPad上有默认的地图应用程序,我使用它检查地图应用程序是否允许你输入纬度/经度坐标并测量距离?或者你是在地图应用程序中查找行驶方向,该应用程序跟随道路?你在上面代码中所做的计算是直线上的距离,而不是公路上的行驶距离。也许它遗漏了地球半径的计算?这里有一些信息: