GMSCameraUpdate
@interface GMSCameraUpdate : NSObjectGMSCameraUpdate represents an update that may be applied to a GMSMapView.
It encapsulates some logic for modifying the current camera.
It should only be constructed using the factory helper methods below.
-
Returns a
GMSCameraUpdatethat zooms in on the map.The zoom increment is 1.0.
Declaration
Swift
class func zoomIn() -> GMSCameraUpdateObjective-C
+ (nonnull GMSCameraUpdate *)zoomIn; -
Returns a
GMSCameraUpdatethat zooms out on the map.The zoom increment is -1.0.
Declaration
Swift
class func zoomOut() -> GMSCameraUpdateObjective-C
+ (nonnull GMSCameraUpdate *)zoomOut; -
Returns a
GMSCameraUpdatethat changes the zoom by the specified amount.Declaration
Swift
class func zoom(by delta: Float) -> GMSCameraUpdateObjective-C
+ (nonnull GMSCameraUpdate *)zoomBy:(float)delta; -
Returns a
GMSCameraUpdatethat sets the zoom to the specified amount.Declaration
Swift
class func zoom(to zoom: Float) -> GMSCameraUpdateObjective-C
+ (nonnull GMSCameraUpdate *)zoomTo:(float)zoom; -
Returns a
GMSCameraUpdatethat sets the camera target to the specified coordinate.Declaration
Swift
class func setTarget(_ target: CLLocationCoordinate2D) -> GMSCameraUpdateObjective-C
+ (nonnull GMSCameraUpdate *)setTarget:(CLLocationCoordinate2D)target; -
Returns a
GMSCameraUpdatethat sets the camera target and zoom to the specified values.Declaration
Swift
class func setTarget(_ target: CLLocationCoordinate2D, zoom: Float) -> GMSCameraUpdateObjective-C
+ (nonnull GMSCameraUpdate *)setTarget:(CLLocationCoordinate2D)target zoom:(float)zoom; -
Returns a
GMSCameraUpdatethat sets the camera to the specifiedGMSCameraPosition.Declaration
Swift
class func setCamera(_ camera: GMSCameraPosition) -> GMSCameraUpdateObjective-C
+ (nonnull GMSCameraUpdate *)setCamera:(nonnull GMSCameraPosition *)camera; -
Returns a
GMSCameraUpdatethat 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: GMSCoordinateBounds) -> GMSCameraUpdateObjective-C
+ (nonnull GMSCameraUpdate *)fitBounds:(nonnull GMSCoordinateBounds *)bounds; -
This is similar to
+fitBounds:but allows specifying the padding (in points) in order to inset the bounding box from the view’s edges.If the requested
paddingis 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: GMSCoordinateBounds, withPadding padding: CGFloat) -> GMSCameraUpdateObjective-C
+ (nonnull GMSCameraUpdate *)fitBounds:(nonnull GMSCoordinateBounds *)bounds withPadding:(CGFloat)padding; -
This is similar to
+fitBounds:but allows specifying edge insets in order to inset the bounding box from the view’s edges.If the requested
edgeInsetsare 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: GMSCoordinateBounds, with edgeInsets: UIEdgeInsets) -> GMSCameraUpdateObjective-C
+ (nonnull GMSCameraUpdate *)fitBounds:(nonnull GMSCoordinateBounds *)bounds withEdgeInsets:(UIEdgeInsets)edgeInsets; -
Returns a
GMSCameraUpdatethat 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) -> GMSCameraUpdateObjective-C
+ (nonnull GMSCameraUpdate *)scrollByX:(CGFloat)dX Y:(CGFloat)dY; -
Returns a
GMSCameraUpdatethat zooms with a focus point; the focus point stays fixed on screen.Declaration
Swift
class func zoom(by zoom: Float, at point: CGPoint) -> GMSCameraUpdateObjective-C
+ (nonnull GMSCameraUpdate *)zoomBy:(float)zoom atPoint:(CGPoint)point;