BaseMapView

open class BaseMapView : UIView

Undocumented

  • Undocumented

    Declaration

    Swift

    public private(set) var mapboxMap: MapboxMap! { get set }
  • The map’s current camera

    Declaration

    Swift

    public var cameraOptions: CameraOptions { get }
  • The map’s current center coordinate.

    Declaration

    Swift

    public var centerCoordinate: CLLocationCoordinate2D { get }
  • The map’s current zoom level.

    Declaration

    Swift

    public var zoom: CGFloat { get }
  • The map’s current bearing, measured clockwise from 0° north.

    Declaration

    Swift

    public var bearing: CLLocationDirection { get }
  • The map’s current pitch, falling within a range of 0 to 60.

    Declaration

    Swift

    public var pitch: CGFloat { get }
  • The map’s current anchor, calculated after applying padding (if it exists)

    Declaration

    Swift

    public var anchor: CGPoint { get }
  • The map’s camera padding

    Declaration

    Swift

    public var padding: UIEdgeInsets { get }
  • Converts a point in a given view’s coordinate system to a geographic coordinate.

    Declaration

    Swift

    public func coordinate(for point: CGPoint, in view: UIView? = nil) -> CLLocationCoordinate2D

    Parameters

    point

    The point to convert.

    view

    An optional view the point is relative to. Omitting this value assumes the point is relative to the MapView.

    Return Value

    A CLLocationCoordinate that represents the geographic location of the point.

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

    Declaration

    Swift

    public func point(for coordinate: CLLocationCoordinate2D, in view: UIView? = nil) -> CGPoint

    Parameters

    coordinate

    The coordinate to convert.

    view

    An optional view the resulting point will be relative to. Omitting this value assumes resulting CGPoint will be expressed relative to the MapView.

    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 view: UIView) -> CoordinateBounds

    Parameters

    view

    The UIView 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.

    Declaration

    Swift

    public func rect(for coordinateBounds: CoordinateBounds, in view: UIView? = nil) -> CGRect

    Parameters

    view

    An optional UIView whose coordinate space the resulting CGRect will be relative to. Omitting this value assumes the resulting CGRect will be expressed relative to the MapView.

    Return Value

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

  • Undocumented

    Declaration

    Swift

    public var observable: Observable? { get }
  • Undocumented

    See more

    Declaration

    Swift

    public enum QueryRenderedFeaturesError : Error
  • Asynchronous query for a list of rendered map features that intersect with the given rect.

    Declaration

    Swift

    public func visibleFeatures(in rect: CGRect,
                                styleLayers: Set<String>? = nil,
                                filter: Expression? = nil,
                                completion: @escaping (Result<[QueriedFeature], QueryRenderedFeaturesError>) -> Void)

    Parameters

    rect

    The rect at which we should query for features

    styleLayers

    An optional set of style layer identifiers to query for. If not specified, the query will search for features in all layers belonging to the map’s style.

    filter

    An optional expression to use in order to filter features from the result.

    completion

    A closure that receives and operates on Result<[Feature], QueryRenderedFeaturesError>

  • Asynchronous query for a list of rendered map features that intersect with the given point.

    Declaration

    Swift

    public func visibleFeatures(at point: CGPoint,
                                styleLayers: Set<String>? = nil,
                                filter: Expression? = nil,
                                completion: @escaping (Result<[QueriedFeature], QueryRenderedFeaturesError>) -> Void)

    Parameters

    point

    The point at which we should query for features

    styleLayers

    An optional set of style layer identifiers to query for. If not specified, the query will search for features in all layers belonging to the map’s style.

    filter

    An optional expression to use in order to filter features from the result.

    completion

    A closure that receives and operates on Result<[Feature], QueryRenderedFeaturesError>