-
The underlying renderer object responsible for rendering the map
Declaration
Swift
public let __map: Map
-
Calculates a
CameraOptionsto fit aCoordinateBoundsDeclaration
Swift
public func camera(for coordinateBounds: CoordinateBounds, padding: UIEdgeInsets, bearing: Double?, pitch: Double?) -> CameraOptionsParameters
coordinateBoundsThe coordinate bounds that will be displayed within the viewport.
paddingThe new padding to be used by the camera.
bearingThe new bearing to be used by the camera.
pitchThe new pitch to be used by the camera.
Return Value
A
CameraOptionsthat fits the provided constraints -
Calculates a
CameraOptionsto fit a list of coordinates.Declaration
Swift
public func camera(for coordinates: [CLLocationCoordinate2D], padding: UIEdgeInsets, bearing: Double?, pitch: Double?) -> CameraOptionsParameters
coordinatesArray of coordinates that should fit within the new viewport.
paddingThe new padding to be used by the camera.
bearingThe new bearing to be used by the camera.
pitchThe new pitch to be used by the camera.
Return Value
A
CameraOptionsthat fits the provided constraints -
Calculates a
CameraOptionsto fit a list of coordinates into a sub-rect of the map.Adjusts the zoom of
camerato fitcoordinatesintorect.Declaration
Swift
public func camera(for coordinates: [CLLocationCoordinate2D], camera: CameraOptions, rect: CGRect) -> CameraOptionsParameters
coordinatesThe coordinates to frame within
rect.cameraThe camera for which the zoom should be adjusted to fit
coordinates.camera.centermust be non-nil.rectThe rectangle inside of the map that should be used to frame
coordinates.Return Value
A
CameraOptionsthat fits the provided constraints, orcameraOptionsif an error occurs. -
Calculates a
CameraOptionsto fit a geometryDeclaration
Swift
public func camera(for geometry: Geometry, padding: UIEdgeInsets, bearing: CGFloat?, pitch: CGFloat?) -> CameraOptionsParameters
geometryThe geoemtry that will be displayed within the viewport.
paddingThe new padding to be used by the camera.
bearingThe new bearing to be used by the camera.
pitchThe new pitch to be used by the camera.
Return Value
A
CameraOptionsthat fits the provided constraints
-
Returns the coordinate bounds corresponding to a given
CameraOptionsDeclaration
Swift
public func coordinateBounds(for camera: CameraOptions) -> CoordinateBoundsParameters
cameraThe camera for which the coordinate bounds will be returned.
Return Value
CoordinateBoundsfor the givenCameraOptions -
Converts a point in the mapView’s coordinate system to a geographic coordinate. The point must exist in the coordinate space of the
MapViewDeclaration
Swift
public func coordinate(for point: CGPoint) -> CLLocationCoordinate2DParameters
pointThe point to convert. Must exist in the coordinate space of the
MapViewReturn Value
A
CLLocationCoordinatethat represents the geographic location of the point. -
Converts a map coordinate to a
CGPoint, relative to theMapView.Declaration
Swift
public func point(for coordinate: CLLocationCoordinate2D) -> CGPointParameters
coordinateThe coordinate to convert.
Return Value
A
CGPointrelative to theUIView. -
Transforms a view’s frame into a set of coordinate bounds
Declaration
Swift
public func coordinateBounds(for rect: CGRect) -> CoordinateBoundsParameters
rectThe
rectwhose bounds will be transformed into a set of map coordinate bounds.Return Value
A
CoordinateBoundsobject that represents the southwest and northeast corners of the view’s bounds. -
Transforms a set of map coordinate bounds to a
CGRectrelative to theMapView.Declaration
Swift
public func rect(for coordinateBounds: CoordinateBounds) -> CGRectParameters
coordinateBoundsThe
coordinateBoundsthat will be converted into a rect relative to theMapViewReturn Value
A
CGRectwhose corners represent the vertices of a set ofCoordinateBounds.
MapboxMap Class Reference