码迷,mamicode.com
首页 > 其他好文 > 详细

根据经纬度计算距离

时间:2015-09-25 12:53:41      阅读:101      评论:0      收藏:0      [点我收藏+]

标签:

+(double)getDistanceWithOtherLatitde:(double)olat otherLongitude:(double)olon myLatitde:(double)mlat myLongitude:(double)mlon //计算出相聚多少米
{
    CLLocation*otherLocation=[[CLLocation alloc]initWithLatitude:olat longitude:olon];
    CLLocation*myLocation=[[CLLocation alloc]initWithLatitude:mlat longitude:mlon];
    CLLocationDistance meters=[otherLocation distanceFromLocation:myLocation];
    return meters;
}

 

根据经纬度计算距离

标签:

原文地址:http://www.cnblogs.com/liaods/p/4837741.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!