MapboxMap

public final class MapboxMap

Undocumented

  • The underlying renderer object responsible for rendering the map

    Declaration

    Swift

    public let __map: Map
  • Calculates a CameraOptions to fit a CoordinateBounds

    Declaration

    Swift

    public func camera(for coordinateBounds: CoordinateBounds,
                       padding: UIEdgeInsets,
                       bearing: Double?,
                       pitch: Double?) -> CameraOptions

    Parameters

    coordinateBounds

    The coordinate bounds that will be displayed within the viewport.

    padding

    The new padding to be used by the camera.

    bearing

    The new bearing to be used by the camera.

    pitch

    The new pitch to be used by the camera.

    Return Value

    A CameraOptions that fits the provided constraints

  • Calculates a CameraOptions to fit a list of coordinates.

    Declaration

    Swift

    public func camera(for coordinates: [CLLocationCoordinate2D],
                       padding: UIEdgeInsets,
                       bearing: Double?,
                       pitch: Double?) -> CameraOptions

    Parameters

    coordinates

    Array of coordinates that should fit within the new viewport.

    padding

    The new padding to be used by the camera.

    bearing

    The new bearing to be used by the camera.

    pitch

    The new pitch to be used by the camera.

    Return Value

    A CameraOptions that fits the provided constraints

  • Calculates a CameraOptions to fit a list of coordinates into a sub-rect of the map.

    Adjusts the zoom of camera to fit coordinates into rect.

    Declaration

    Swift

    public func camera(for coordinates: [CLLocationCoordinate2D],
                       camera: CameraOptions,
                       rect: CGRect) -> CameraOptions

    Parameters

    coordinates

    The coordinates to frame within rect.

    camera

    The camera for which the zoom should be adjusted to fit coordinates. camera.center must be non-nil.

    rect

    The rectangle inside of the map that should be used to frame coordinates.

    Return Value

    A CameraOptions that fits the provided constraints, or cameraOptions if an error occurs.

  • Calculates a CameraOptions to fit a geometry

    Declaration

    Swift

    public func camera(for geometry: Geometry,
                       padding: UIEdgeInsets,
                       bearing: CGFloat?,
                       pitch: CGFloat?) -> CameraOptions

    Parameters

    geometry

    The geoemtry that will be displayed within the viewport.

    padding

    The new padding to be used by the camera.

    bearing

    The new bearing to be used by the camera.

    pitch

    The new pitch to be used by the camera.

    Return Value

    A CameraOptions that fits the provided constraints

  • Returns the coordinate bounds corresponding to a given CameraOptions

    Declaration

    Swift

    public func coordinateBounds(for camera: CameraOptions) -> CoordinateBounds

    Parameters

    camera

    The camera for which the coordinate bounds will be returned.

    Return Value

    CoordinateBounds for the given CameraOptions

  • Converts a point in the mapView’s coordinate system to a geographic coordinate. The point must exist in the coordinate space of the MapView

    Declaration

    Swift

    public func coordinate(for point: CGPoint) -> CLLocationCoordinate2D

    Parameters

    point

    The point to convert. Must exist in the coordinate space of the MapView

    Return Value

    A CLLocationCoordinate that represents the geographic location of the point.

  • Converts a map coordinate to a CGPoint, relative to the MapView.

    Declaration

    Swift

    public func point(for coordinate: CLLocationCoordinate2D) -> CGPoint

    Parameters

    coordinate

    The coordinate to convert.

    Return Value

    A CGPoint relative to the UIView.

  • Transforms a view’s frame into a set of coordinate bounds

    Declaration

    Swift

    public func coordinateBounds(for rect: CGRect) -> CoordinateBounds

    Parameters

    rect

    The rect whose bounds will be transformed into a set of map coordinate bounds.

    Return Value

    A CoordinateBounds object that represents the southwest and northeast corners of the view’s bounds.

  • Transforms a set of map coordinate bounds to a CGRect relative to the MapView.

    Declaration

    Swift

    public func rect(for coordinateBounds: CoordinateBounds) -> CGRect

    Parameters

    coordinateBounds

    The coordinateBounds that will be converted into a rect relative to the MapView

    Return Value

    A CGRect whose corners represent the vertices of a set of CoordinateBounds.