【问题标题】:didChangeCameraPosition get bounding box/ rectangle of available coordinatesdidChangeCameraPosition 获取可用坐标的边界框/矩形
【发布时间】:2014-05-20 22:26:20
【问题描述】:

如何从 GMSCameraPosition 中检索 GMSCoordinateBounds?我想知道每次用户移动相机时地图上的可见坐标(至少东北/西南点):

(void)mapView:(GMSMapView *)mapView didChangeCameraPosition:(GMSCameraPosition *)position

【问题讨论】:

    标签: ios google-maps google-maps-sdk-ios gmsmapview


    【解决方案1】:
    GMSVisibleRegion visibleRegion = mapView.projection.visibleRegion;
    GMSCoordinateBounds *bounds = [[GMSCoordinateBounds alloc] initWithRegion:visibleRegion];
    
    // we've got what we want, but here are NE and SW points
    CLLocationCoordinate2D northEast = bounds.northEast;
    CLLocationCoordinate2D southWest = bounds.southWest;
    

    【讨论】:

      猜你喜欢
      • 2010-10-11
      • 1970-01-01
      • 2019-01-05
      • 1970-01-01
      • 1970-01-01
      • 2015-08-08
      • 1970-01-01
      • 2021-12-25
      • 2020-08-07
      相关资源
      最近更新 更多