Google Maps iOS SDK: How do I get accurate latitude and longitude coordinates from a camera's visibleRegion?

前端 未结 5 1573
野的像风
野的像风 2020-12-11 04:20

EDIT: This is now a confirmed bug with this SDK

I\'m using version 1.1.1.2311 of the Google Maps for iOS SDK, and I\'m looking to find the bounding latitude and long

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-11 04:55

    To get the bounding latitude and longitude you have to do the following steps:

    GMSCoordinateBounds *bounds = [[GMSCoordinateBounds alloc] initWithRegion:self.googleMapsView.projection.visibleRegion];
    
    CLLocationCoordinate2D northEast = bounds.northEast;
    CLLocationCoordinate2D northWest = CLLocationCoordinate2DMake(bounds.northEast.latitude, bounds.southWest.longitude);
    CLLocationCoordinate2D southEast = CLLocationCoordinate2DMake(bounds.southWest.latitude, bounds.northEast.longitude);
    CLLocationCoordinate2D southWest = bounds.southWest;
    

    Best regards Robert

提交回复
热议问题