# GoogleMaps Framework Reference

# GMSCameraUpdate

    @interface GMSCameraUpdate : NSObject

`GMSCameraUpdate` represents an update that may be applied to a `https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html`.

It encapsulates some logic for modifying the current camera.

It should only be constructed using the factory helper methods below.
- `


  ### [+zoomIn](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCameraUpdate#/c:objc(cs)GMSCameraUpdate(cm)zoomIn)


  ` Returns a `GMSCameraUpdate` that zooms in on the map.

  The zoom increment is 1.0.

  #### Declaration

  Swift

      class func zoomIn() -> GMSCameraUpdate

  Objective-C

      + (nonnull GMSCameraUpdate *)zoomIn;

- `


  ### [+zoomOut](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCameraUpdate#/c:objc(cs)GMSCameraUpdate(cm)zoomOut)


  ` Returns a `GMSCameraUpdate` that zooms out on the map.

  The zoom increment is -1.0.

  #### Declaration

  Swift

      class func zoomOut() -> GMSCameraUpdate

  Objective-C

      + (nonnull GMSCameraUpdate *)zoomOut;

- `


  ### [+zoomBy:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCameraUpdate#/c:objc(cs)GMSCameraUpdate(cm)zoomBy:)


  ` Returns a `GMSCameraUpdate` that changes the zoom by the specified amount.

  #### Declaration

  Swift

      class func zoom(by delta: Float) -> GMSCameraUpdate

  Objective-C

      + (nonnull GMSCameraUpdate *)zoomBy:(float)delta;

- `


  ### [+zoomTo:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCameraUpdate#/c:objc(cs)GMSCameraUpdate(cm)zoomTo:)


  ` Returns a `GMSCameraUpdate` that sets the zoom to the specified amount.

  #### Declaration

  Swift

      class func zoom(to zoom: Float) -> GMSCameraUpdate

  Objective-C

      + (nonnull GMSCameraUpdate *)zoomTo:(float)zoom;

- `


  ### [+setTarget:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCameraUpdate#/c:objc(cs)GMSCameraUpdate(cm)setTarget:)


  ` Returns a `GMSCameraUpdate` that sets the camera target to the specified coordinate.

  #### Declaration

  Swift

      class func setTarget(_ target: CLLocationCoordinate2D) -> GMSCameraUpdate

  Objective-C

      + (nonnull GMSCameraUpdate *)setTarget:(CLLocationCoordinate2D)target;

- `


  ### [+setTarget:zoom:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCameraUpdate#/c:objc(cs)GMSCameraUpdate(cm)setTarget:zoom:)


  ` Returns a `GMSCameraUpdate` that sets the camera target and zoom to the specified values.

  #### Declaration

  Swift

      class func setTarget(_ target: CLLocationCoordinate2D, zoom: Float) -> GMSCameraUpdate

  Objective-C

      + (nonnull GMSCameraUpdate *)setTarget:(CLLocationCoordinate2D)target
                                        zoom:(float)zoom;

- `


  ### [+setCamera:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCameraUpdate#/c:objc(cs)GMSCameraUpdate(cm)setCamera:)


  ` Returns a `GMSCameraUpdate` that sets the camera to the specified `https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCameraPosition.html`.

  #### Declaration

  Swift

      class func setCamera(_ camera: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCameraPosition.html) -> GMSCameraUpdate

  Objective-C

      + (nonnull GMSCameraUpdate *)setCamera:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCameraPosition.html *)camera;

- `


  ### [+fitBounds:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCameraUpdate#/c:objc(cs)GMSCameraUpdate(cm)fitBounds:)


  ` Returns a `GMSCameraUpdate` that transforms the camera such that the specified bounds are
  centered on screen at the greatest possible zoom level. The bounds will have a default padding of
  64 points.

  The returned camera update will set the camera's bearing and tilt to their default zero values
  (i.e., facing north and looking directly at the Earth).

  #### Declaration

  Swift

      class func fit(_ bounds: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCoordinateBounds.html) -> GMSCameraUpdate

  Objective-C

      + (nonnull GMSCameraUpdate *)fitBounds:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCoordinateBounds.html *)bounds;

- `


  ### [+fitBounds:withPadding:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCameraUpdate#/c:objc(cs)GMSCameraUpdate(cm)fitBounds:withPadding:)


  ` This is similar to `https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCameraUpdate.html#/c:objc(cs)GMSCameraUpdate(cm)fitBounds:` but allows specifying the padding (in points) in order to inset
  the bounding box from the view's edges.

  If the requested `padding` is larger than the view size in either the vertical or horizontal
  direction the map will be maximally zoomed out.

  #### Declaration

  Swift

      class func fit(_ bounds: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCoordinateBounds.html, withPadding padding: CGFloat) -> GMSCameraUpdate

  Objective-C

      + (nonnull GMSCameraUpdate *)fitBounds:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCoordinateBounds.html *)bounds
                                 withPadding:(CGFloat)padding;

- `


  ### [+fitBounds:withEdgeInsets:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCameraUpdate#/c:objc(cs)GMSCameraUpdate(cm)fitBounds:withEdgeInsets:)


  ` This is similar to `https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCameraUpdate.html#/c:objc(cs)GMSCameraUpdate(cm)fitBounds:` but allows specifying edge insets in order to inset the bounding
  box from the view's edges.

  If the requested `edgeInsets` are larger than the view size in either the vertical or horizontal
  direction the map will be maximally zoomed out.

  #### Declaration

  Swift

      class func fit(_ bounds: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCoordinateBounds.html, with edgeInsets: UIEdgeInsets) -> GMSCameraUpdate

  Objective-C

      + (nonnull GMSCameraUpdate *)fitBounds:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCoordinateBounds.html *)bounds
                              withEdgeInsets:(UIEdgeInsets)edgeInsets;

- `


  ### [+scrollByX:Y:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCameraUpdate#/c:objc(cs)GMSCameraUpdate(cm)scrollByX:Y:)


  ` Returns a `GMSCameraUpdate` that shifts the center of the view by the specified number of points
  in the x and y directions. X grows to the right, Y grows down.

  #### Declaration

  Swift

      class func scrollBy(x dX: CGFloat, y dY: CGFloat) -> GMSCameraUpdate

  Objective-C

      + (nonnull GMSCameraUpdate *)scrollByX:(CGFloat)dX Y:(CGFloat)dY;

- `


  ### [+zoomBy:atPoint:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCameraUpdate#/c:objc(cs)GMSCameraUpdate(cm)zoomBy:atPoint:)


  ` Returns a `GMSCameraUpdate` that zooms with a focus point; the focus point stays fixed on screen.

  #### Declaration

  Swift

      class func zoom(by zoom: Float, at point: CGPoint) -> GMSCameraUpdate

  Objective-C

      + (nonnull GMSCameraUpdate *)zoomBy:(float)zoom atPoint:(CGPoint)point;