IOS中計(jì)算兩個(gè)經(jīng)緯度之間的距離:
-(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;
}