dondre

  //当前屏幕中心点的经纬度

    CGFloat centerLongitude = self.mapView.region.center.longitude;

    CGFloat centerLatitude = self.mapView.region.center.latitude;

    //当前屏幕显示范围的经纬度

    CLLocationDegrees pointssLongitudeDelta = self.mapView.region.span.longitudeDelta;

    CLLocationDegrees pointssLatitudeDelta = self.mapView.region.span.latitudeDelta;

   

    //左上角

    CGFloat leftUpLong = centerLongitude - pointssLongitudeDelta/2.0;

    CGFloat leftUpLati = centerLatitude - pointssLatitudeDelta/2.0;

    //右上角

    CGFloat rightUpLong = centerLongitude + pointssLongitudeDelta/2.0;

    CGFloat rightUpLati = centerLatitude - pointssLatitudeDelta/2.0;

    //左下角

    CGFloat leftDownLong = centerLongitude - pointssLongitudeDelta/2.0;

    CGFloat leftDownlati = centerLatitude + pointssLatitudeDelta/2.0;

    //右下角

    CGFloat rightDownLong = centerLongitude + pointssLongitudeDelta/2.0;

    CGFloat rightDownLati = centerLatitude + pointssLatitudeDelta/2.0;

   

    NSLog(@"\n 左上   %f,%f---------\n 右上   %f,%f-------\n 左下  %f,%f----- \n 右下  %f,%f",leftUpLong,leftUpLati,rightUpLong,rightUpLati,leftDownLong,leftDownlati,rightDownLong,rightDownLati);

分类:

技术点:

相关文章:

  • 2021-06-07
  • 2022-12-23
  • 2021-12-04
  • 2021-11-17
  • 2021-12-14
  • 2021-10-04
  • 2021-12-03
猜你喜欢
  • 2021-12-18
  • 2021-11-17
  • 2022-12-23
  • 2021-10-26
  • 2022-12-23
  • 2022-02-06
  • 2022-12-23
相关资源
相似解决方案