7

How can I retrieve the GMSCoordinateBounds from a GMSCameraPosition? I want to know the visible coordinates on the map (at least Northeast/Southwest points) everytime the user moves the camera as in:

(void)mapView:(GMSMapView *)mapView didChangeCameraPosition:(GMSCameraPosition *)position
Arman H
  • 5,488
  • 10
  • 51
  • 76
apinho
  • 2,235
  • 3
  • 25
  • 39

1 Answers1

17
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;
friedbunny
  • 2,421
  • 1
  • 23
  • 38