It is very simple, simple:
@property (nonatomic, strong) GMSMapView *mapView; - (void)didTapFitBoundsWithMarkers:(NSArray *)markers { GMSCoordinateBounds *bounds = [[GMSCoordinateBounds alloc] init];; for (GMSMarker *marker in markers) { bounds = [bounds includingCoordinate:marker.position]; } GMSCameraUpdate *update = [GMSCameraUpdate fitBounds:bounds]; [self.mapView moveCamera:update]; [self.mapView animateToViewingAngle:50]; }
source share