1 //广州经纬度
 2 CLLocationCoordinate2D guangZhouLocation;
 3 guangZhouLocation.latitude = 23.20;
 4 guangZhouLocation.longitude = 113.30;
 5 BMKMapPoint guangZhou = BMKMapPointForCoordinate(guangZhouLocation);
 6 
 7 //深圳经纬度
 8 CLLocationCoordinate2D shenZhenLocation;
 9 shenZhenLocation.latitude = 22.33;
10 shenZhenLocation.longitude = 114.07;
11 BMKMapPoint shenZhen = BMKMapPointForCoordinate(shenZhenLocation);
12 
  //计算广州与深圳的距离
13
CLLocationDistance distance = BMKMetersBetweenMapPoints(guangZhou,shenZhen); 14 NSLog(@"距离:%f",distance);

 

相关文章:

  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
  • 2021-04-25
  • 2022-02-16
  • 2021-12-01
  • 2022-01-25
  • 2021-05-28
猜你喜欢
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2022-01-23
  • 2022-12-23
相关资源
相似解决方案