我正在检查两个坐标之间的距离,以下两个坐标返回2.8英里。但是,如果我在google地图服务上进行检查,它会返回行驶距离4.1英里,最短距离是3.6英里。为什么会有这种差异?
- (IBAction)deliveryBtnClicked:(id)sender {
CLLocation *loc1 = [[CLLocation alloc] initWithLatitude:-95.414640
longitude:29.715660];
CLLocation *loc2 = [[CLLocation alloc] initWithLatitude:-95.455080
longitude:29.684080];
CLLocationDistance distance = [loc1 distanceFromLocation:loc2];
NSLog(@"%f", distance/1609.344);
}