地图相关知识点

计算两个经纬度的距离

CLLocation *orig=[[[CLLocation alloc] initWithLatitude:[mainDelegate.latitude_self doubleValue]  longitude:[mainDelegate.longitude_self doubleValue]] autorelease];  
CLLocation* dist=[[[CLLocation alloc] initWithLatitude:[tmpNewsModel.latitude doubleValue] longitude:[tmpNewsModel.longitude doubleValue] ] autorelease];  
CLLocationDistance kilometers=[orig distanceFromLocation:dist]/1000;  
NSLog(@"距离:",kilometers);

你可能感兴趣的:(地图相关知识点)