您的位置:首页 > 移动开发 > IOS开发

通过经纬度计算两个之间的距离

2014-07-30 11:26 453 查看
+(double)distanceBetweenOrderBy:(double)lat1 :(double)lat2 :(double)lng1 :(double)lng2{
CLLocation* curLocation = [[CLLocation alloc] initWithLatitude:lat1 longitude:lng1];
CLLocation* otherLocation = [[CLLocation alloc] initWithLatitude:lat2 longitude:lng2];
double distance  = [curLocation distanceFromLocation:otherLocation];
return distance;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ios xcode 地图 经纬度