MTNavigable

@MainActor
public protocol MTNavigable

Defines methods for navigating the map.

  • setBearing(_:) Asynchronous

    Sets bearing of the map.

    Declaration

    Swift

    @MainActor
    func setBearing(_ bearing: Double) async

    Parameters

    bearing

    The bearing of the map, measured in degrees counter-clockwise from north.

  • setCenter(_:) Asynchronous

    Sets the geographical center of the map.

    Declaration

    Swift

    @MainActor
    func setCenter(_ center: CLLocationCoordinate2D) async

    Parameters

    center

    Geographical center of the map.

  • Changes any combination of center, zoom, bearing, and pitch, animating the transition along a curve that evokes flight.

    Declaration

    Swift

    @MainActor
    func flyTo(_ center: CLLocationCoordinate2D, options: MTFlyToOptions?, animationOptions: MTAnimationOptions?) async

    Parameters

    center

    Geographical center of the map.

    options

    FlyTo options.

    animationOptions

    animation options.

  • Changes any combination of center, zoom, bearing and pitch with an animated transition between old and new values.

    Declaration

    Swift

    @MainActor
    func easeTo(
        _ center: CLLocationCoordinate2D,
        options: MTCameraOptions?,
        animationOptions: MTAnimationOptions?
    ) async

    Parameters

    center

    Geographical center of the map.

    options

    Camera options.

    animationOptions

    animation options.

  • jumpTo(_:options:) Asynchronous

    Changes any combination of center, zoom, bearing, and pitch, without an animated transition

    Declaration

    Swift

    @MainActor
    func jumpTo(_ center: CLLocationCoordinate2D, options: MTCameraOptions?) async

    Parameters

    center

    Geographical center of the map.

    options

    Camera options.

  • panBy(_:) Asynchronous

    Pans the map by the specified offset.

    Declaration

    Swift

    @MainActor
    func panBy(_ offset: MTPoint) async

    Parameters

    offset

    Offset to pan by.

  • panTo(_:) Asynchronous

    Pans the map to the specified location with an animated transition.

    Declaration

    Swift

    @MainActor
    func panTo(_ coordinates: CLLocationCoordinate2D) async

    Parameters

    coordinates

    Coordinates to pan to.

  • setPadding(_:) Asynchronous

    Sets the padding in pixels around the viewport.

    Declaration

    Swift

    @MainActor
    func setPadding(_ options: MTPaddingOptions) async

    Parameters

    options

    Padding options.

  • Sets the center clamped to the ground.

    If true, the elevation of the center point will automatically be set to the terrain elevation (or zero if terrain is not enabled). If false, the elevation of the center point will default to sea level and will not automatically update.

    Declaration

    Swift

    @MainActor
    func setIsCenterClampedToGround(_ isCenterClampedToGround: Bool) async

    Parameters

    isCenterClampedToGround

    Boolean indicating whether center is clamped to the ground.

  • setCenterElevation(_:) Asynchronous

    Sets the elevation of the map’s center point, in meters above sea level.

    Declaration

    Swift

    @MainActor
    func setCenterElevation(_ elevation: Double) async

    Parameters

    elevation

    Desired elevation.

  • setMaxPitch(_:) Asynchronous

    Sets the map’s maximum pitch.

    Declaration

    Swift

    @MainActor
    func setMaxPitch(_ maxPitch: Double?) async throws

    Parameters

    maxPitch

    Desired pitch.

  • setMaxZoom(_:) Asynchronous

    Sets the map’s maximum zoom.

    Declaration

    Swift

    @MainActor
    func setMaxZoom(_ maxZoom: Double?) async throws

    Parameters

    maxZoom

    Desired zoom.

  • setMinPitch(_:) Asynchronous

    Sets the map’s minimum pitch.

    Declaration

    Swift

    @MainActor
    func setMinPitch(_ minPitch: Double?) async throws

    Parameters

    minPitch

    Desired pitch.

  • setMinZoom(_:) Asynchronous

    Sets the map’s minimum zoom.

    Declaration

    Swift

    @MainActor
    func setMinZoom(_ minZoom: Double?) async throws

    Parameters

    minZoom

    Desired zoom.

  • setPitch(_:) Asynchronous

    Sets the map’s pitch.

    Declaration

    Swift

    @MainActor
    func setPitch(_ pitch: Double) async

    Parameters

    pitch

    The pitch to set, measured in degrees away from the plane of the screen (0-60).

  • setRoll(_:) Asynchronous

    Sets the map’s roll angle.

    Declaration

    Swift

    @MainActor
    func setRoll(_ roll: Double) async

    Parameters

    roll

    Desired roll.

  • getPitch() Asynchronous

    Returns the map’s current pitch.

    Declaration

    Swift

    @MainActor
    func getPitch() async -> Double
  • getCenter() Asynchronous

    Returns the map’s current center.

    Declaration

    Swift

    @MainActor
    func getCenter() async -> CLLocationCoordinate2D