MapboxMap

public final class MapboxMap
extension MapboxMap: MapEventsObservable

Undocumented

  • The underlying renderer object responsible for rendering the map

    Declaration

    Swift

    public let __map: Map
  • The style object supports run time styling.

    Declaration

    Swift

    public internal(set) var style: Style { get }
  • Loads a style from a StyleURI, calling a completion closure when the style is fully loaded or there has been an error during load.

    Declaration

    Swift

    public func loadStyleURI(_ styleURI: StyleURI, completion: ((Result<Style, Error>) -> Void)? = nil)

    Parameters

    styleURI

    StyleURI to load

    completion

    Closure called when the style has been fully loaded. The Result type encapsulates the Style or error that occurred. See MapLoadingError

  • Loads a style from a JSON string, calling a completion closure when the style is fully loaded or there has been an error during load.

    Declaration

    Swift

    public func loadStyleJSON(_ JSON: String, completion: ((Result<Style, Error>) -> Void)? = nil)

    Parameters

    styleURI

    Style JSON string

    completion

    Closure called when the style has been fully loaded. The Result type encapsulates the Style or error that occurred. See MapLoadingError

  • 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.

  • Declaration

    Swift

    public func subscribe(_ observer: Observer, events: [String])
  • Declaration

    Swift

    public func unsubscribe(_ observer: Observer, events: [String] = [])