
[英]how to show locations in ios 6 apple maps with sharedApplication
[英]How to find the distance between two locations using Apple maps in iOS 6?
我的要求是在不使用Google API的情况下找到两个位置之间的距离(以英里为单位)。 我将代码添加为:
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英里。
请给我解决这种差异的方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.