MTMapView

@MainActor
open class MTMapView : UIView, Sendable
extension MTMapView: MTControllable
extension MTMapView: MTNavigable
extension MTMapView: MTRendering
extension MTMapView: MTStylable
extension MTMapView: MTZoomable
extension MTMapView: MTLocationManagerDelegate

Object representing the map on the screen.

Exposes methods and properties that enable changes to the map, and fires events that can be interacted with.

  • Proxy style object of the map.

    Declaration

    Swift

    @MainActor
    public private(set) var style: MTStyle? { get }
  • Undocumented

    Declaration

    Swift

    @MainActor
    public private(set) var locationManager: MTLocationManager? { get set }
  • Current options of the map object.

    Declaration

    Swift

    @MainActor
    public var options: MTMapOptions?
  • Service responsible for gestures handling

    Declaration

    Swift

    @MainActor
    public var gestureService: MTGestureService!
  • Delegate object responsible for event propagation

    Declaration

    Swift

    @MainActor
    public weak var delegate: MTMapViewDelegate?
  • Boolean indicating whether map is initialized,

    Declaration

    Swift

    @MainActor
    public private(set) var isInitialized: Bool { get }
  • Triggers when map initializes for the first time.

    Declaration

    Swift

    @MainActor
    public var didInitialize: (() -> Void)?
  • Initializes the map with the frame.

    Declaration

    Swift

    @MainActor
    override public init(frame: CGRect)
  • Initializes the map with the coder.

    Declaration

    Swift

    @MainActor
    required public init?(coder: NSCoder)
  • Initializes the map with the frame, options and style.

    Declaration

    Swift

    @MainActor
    convenience public init(
        frame: CGRect,
        options: MTMapOptions,
        referenceStyle: MTMapReferenceStyle,
        styleVariant: MTMapStyleVariant? = nil
    )
  • Initializes the map with the options.

    Declaration

    Swift

    @MainActor
    convenience public init(options: MTMapOptions?)
  • Initializes location tracking manager.

    In order to track user location you have to initialize the MLLocationManager, add necessary Privacy Location messages to Info.plist, subscribe to MTLocationManagerDelegate and start location updates and/or request location once via the locationManager property on MTMapView.

    Declaration

    Swift

    @MainActor
    public func initLocationTracking(using manager: CLLocationManager? = nil, accuracy: CLLocationAccuracy? = nil)

    Parameters

    manager

    Optional external CLLocationManager to use.

    accuracy

    Optional desired accuracy to use.

  • Undocumented

    Declaration

    Swift

    @MainActor
    open override func layoutSubviews()
  • Reloads the map view.

    Declaration

    Swift

    @MainActor
    public func reload()
  • Adds Maptiler logo to the map.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func addMapTilerLogoControl(
        position: MTMapCorner,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    position

    The corner position of the logo.

    completionHandler

    A handler block to execute when function finishes.

  • Adds logo control to the map.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func addLogoControl(
        name: String,
        logoURL: URL,
        linkURL: URL,
        position: MTMapCorner,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    name

    Unique name of the logo.

    logoURL

    URL of logo image.

    linkURL

    URL of logo link.

    position

    The corner position of the logo.

    completionHandler

    A handler block to execute when function finishes.

  • Adds Maptiler logo to the map.

    Declaration

    Swift

    @MainActor
    public func addMapTilerLogoControl(position: MTMapCorner) async

    Parameters

    name

    Unique name of the logo.

    position

    The corner position of the logo.

  • Adds logo control to the map.

    Declaration

    Swift

    @MainActor
    public func addLogoControl(name: String, logoURL: URL, linkURL: URL, position: MTMapCorner) async

    Parameters

    name

    Unique name of the logo.

    logoURL

    URL of logo image.

    linkURL

    URL of logo link.

    position

    The corner position of the logo.

  • Sets the bearing of the map.

    The bearing is the compass direction that is “up”; for example, a bearing of 90° orients the map so that east is up.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setBearing(_ bearing: Double, completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    bearing

    The desired bearing.

    completionHandler

    A handler block to execute when function finishes.

  • Sets the map’s geographical centerpoint.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setCenter(
        _ center: CLLocationCoordinate2D,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    center

    The desired center coordinate.

    completionHandler

    A handler block to execute when function finishes.

  • Changes any combination of center, zoom, bearing, and pitch.

    The animation seamlessly incorporates zooming and panning to help the user maintain her bearings even after traversing a great distance.

    Note

    The animation will be skipped, and this will behave equivalently to jumpTo if the user has the reduced motion accessibility feature enabled, unless options includes essential: true.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func flyTo(
        _ center: CLLocationCoordinate2D,
        options: MTFlyToOptions?,
        animationOptions: MTAnimationOptions?,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    center

    The desired center coordinate.

    options

    Custom options to use.

    animationOptions

    Optional animation options to use.

    completionHandler

    A handler block to execute when function finishes.

  • Changes any combination of center, zoom, bearing, pitch, and padding.

    The map will retain its current values for any details not specified in options.

    Note

    The transition will happen instantly if the user has enabled the reduced motion accessibility feature, unless options includes essential: true.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func easeTo(
        _ center: CLLocationCoordinate2D,
        options: MTCameraOptions?,
        animationOptions: MTAnimationOptions?,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    center

    The desired center coordinate.

    options

    Custom options to use.

    animationOptions

    Optional animation options to use.

    completionHandler

    A handler block to execute when function finishes.

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

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func jumpTo(
        _ center: CLLocationCoordinate2D,
        options: MTCameraOptions?,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    center

    The desired center coordinate.

    options

    Custom options to use.

    completionHandler

    A handler block to execute when function finishes.

  • Fits the map so the provided bounds are fully visible within the viewport.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func fitBounds(
        _ bounds: MTBounds,
        options fitOptions: MTFitBoundsOptions? = nil,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    bounds

    Geographic bounds to display.

    fitOptions

    Additional configuration that controls the fitting animation.

    completionHandler

    A handler block to execute when function finishes.

  • Sets the padding in pixels around the viewport.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setPadding(_ options: MTPaddingOptions, completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    options

    Custom options to use.

    completionHandler

    A handler block to execute when function finishes.

  • Fits the map to the bounds inferred from the current IP address.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func fitToIpBounds(completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Centers the map on the location inferred from the current IP address.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func centerOnIpPoint(completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Sets the value of centerClampedToGround.

    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. Needs to be set to false to keep the camera above ground when pitch > 90 degrees.

    Note

    Defaults to true.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setIsCenterClampedToGround(
        _ isCenterClampedToGround: Bool,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    isCenterClampedToGround

    The boolean value indicating if center will be clamped to ground.

    completionHandler

    A handler block to execute when function finishes.

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

    Note

    Triggers the following events: moveStart and moveEnd.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setCenterElevation(_ elevation: Double, completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    elevation

    The desired elevation.

    completionHandler

    A handler block to execute when function finishes.

  • Sets or clears the map’s maximum pitch.

    If the map’s current pitch is higher than the new maximum, the map will pitch to the new maximum. If null is provided, the function removes the current maximum pitch (sets it to 60).

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setMaxPitch(_ maxPitch: Double?, completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    maxPitch

    The maximum pitch to set (0-85).

    completionHandler

    A handler block to execute when function finishes.

  • Sets or clears the map’s maximum zoom.

    If the map’s current zoom level is higher than the new maximum, the map will zoom to the new maximum. If null or undefined is provided, the function removes the current maximum zoom (sets it to 22).

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setMaxZoom(_ maxZoom: Double?, completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    maxZoom

    The maximum zoom level to set.

    completionHandler

    A handler block to execute when function finishes.

  • Sets or clears the map’s minimum pitch.

    If the map’s current pitch is lower than the new minimum, the map will pitch to the new minimum. If null is provided, the function removes the current minimum pitch (i.e. sets it to 0).

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setMinPitch(_ minPitch: Double?, completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    minPitch

    The minimum pitch to set (0-85)

    completionHandler

    A handler block to execute when function finishes.

  • Sets or clears the map’s minimum zoom.

    If the map’s current zoom level is lower than the new minimum, the map will zoom to the new minimum. If null is provided, the function removes the current minimum zoom (i.e. sets it to -2).

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setMinZoom(_ minZoom: Double?, completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    minZoom

    The minimum zoom level to set (-2 - 24).

    completionHandler

    A handler block to execute when function finishes.

  • Sets or clears the map’s maximum bounds constraint.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setMaxBounds(
        _ bounds: MTBounds?,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    bounds

    The bounds to constrain panning to, or nil to remove the constraint.

    completionHandler

    A handler block to execute when function finishes.

  • Sets the map’s pitch (tilt).

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setPitch(_ pitch: Double, completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    pitch

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

    completionHandler

    A handler block to execute when function finishes.

  • Sets the map’s roll angle.

    Note

    Triggers the following events: moveStart, moveEnd, rollStart, and rollEnd.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setRoll(_ roll: Double, completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    roll

    The roll to set, measured in degrees about the camera boresight.

    completionHandler

    A handler block to execute when function finishes.

  • Set combination of center, bearing, pitch, roll and elevation.

    Declaration

    Swift

    @MainActor
    public func setViewport(with cameraHelper: MTMapCameraHelper, zoomLevel: Double? = nil)

    Parameters

    cameraHelper

    Helper to use for setting the viewport.

    zoomLevel

    Desired zoom level to set.

  • Returns the map’s current pitch (tilt).

    The map’s current pitch, measured in degrees away from the plane of the screen.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getPitch(completionHandler: @escaping (Result<Double, MTError>) -> Void)

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Returns the map’s maximum pitch (tilt).

    The map’s maximum pitch, measured in degrees away from the plane of the screen.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getMaxPitch(completionHandler: @escaping (Result<Double, MTError>) -> Void)

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Returns the map’s maximum zoom.

    The map’s maximum zoom level.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getMaxZoom(completionHandler: @escaping (Result<Double, MTError>) -> Void)

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Returns the map’s minimum pitch (tilt).

    The map’s minimum pitch, measured in degrees away from the plane of the screen.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getMinPitch(completionHandler: @escaping (Result<Double, MTError>) -> Void)

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Returns the map’s minimum zoom.

    The map’s minimum zoom level.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getMinZoom(completionHandler: @escaping (Result<Double, MTError>) -> Void)

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Pans the map by the specified offset.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func panBy(_ offset: MTPoint, completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    offset

    The x and y coordinates by which to pan the map.

    completionHandler

    A handler block to execute when function finishes.

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

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func panTo(
        _ coordinates: CLLocationCoordinate2D,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    coordinates

    The location to pan the map to.

    completionHandler

    A handler block to execute when function finishes.

  • Returns the map’s current center.

    The map’s current geographical center.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getCenter(completionHandler: @escaping (Result<CLLocationCoordinate2D, MTError>) -> Void)
  • Returns the map’s current geographic bounds.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getBounds(completionHandler: @escaping (Result<MTBounds, MTError>) -> Void)

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Returns the maximum bounds constraint applied to the map, if any.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getMaxBounds(completionHandler: @escaping (Result<MTBounds?, MTError>) -> Void)

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Returns whether the map’s center is clamped to the ground.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getCenterClampedToGround(completionHandler: @escaping (Result<Bool, MTError>) -> Void)

    Parameters

    completionHandler

    A handler block to execute when function finishes.

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

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getCenterElevation(completionHandler: @escaping (Result<Double, MTError>) -> Void)

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Returns the elevation for the point where the camera is looking, in meters above sea level multiplied by exaggeration.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getCameraTargetElevation(completionHandler: @escaping (Result<Double, MTError>) -> Void)

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Project coordinates to point on the container.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func project(
        coordinates: CLLocationCoordinate2D,
        completionHandler: @escaping (Result<CLLocationCoordinate2D, MTError>) -> Void
    )

    Parameters

    coordinates

    The location to project.

    completionHandler

    A handler block to execute when function finishes.

  • Returns the map’s current bearing.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getBearing(completionHandler: @escaping (Result<Double, MTError>) -> Void)

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Returns the map’s current roll.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getRoll(completionHandler: @escaping (Result<Double, MTError>) -> Void)

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • setBearing(_:) Asynchronous

    Sets the bearing of the map.

    The bearing is the compass direction that is “up”; for example, a bearing of 90° orients the map so that east is up.

    Declaration

    Swift

    @MainActor
    public func setBearing(_ bearing: Double) async

    Parameters

    bearing

    The desired bearing.

  • setCenter(_:) Asynchronous

    Sets the map’s geographical centerpoint.

    Declaration

    Swift

    @MainActor
    public func setCenter(_ center: CLLocationCoordinate2D) async

    Parameters

    center

    The desired center coordinate.

  • Changes any combination of center, zoom, bearing, and pitch.

    The animation seamlessly incorporates zooming and panning to help the user maintain her bearings even after traversing a great distance.

    Note

    The animation will be skipped, and this will behave equivalently to jumpTo if the user has the reduced motion accessibility feature enabled, unless options includes essential: true.

    Declaration

    Swift

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

    Parameters

    center

    The desired center coordinate.

    options

    Custom options to use.

    animationOptions

    Optional animation options to use.

    completionHandler

    A handler block to execute when function finishes.

  • Changes any combination of center, zoom, bearing, pitch, and padding.

    The map will retain its current values for any details not specified in options.

    Note

    The transition will happen instantly if the user has enabled the reduced motion accessibility feature, unless options includes essential: true.

    Declaration

    Swift

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

    Parameters

    center

    The desired center coordinate.

    options

    Custom options to use.

    animationOptions

    Optional animation options to use.

    completionHandler

    A handler block to execute when function finishes.

  • jumpTo(_:options:) Asynchronous

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

    Declaration

    Swift

    @MainActor
    public func jumpTo(_ center: CLLocationCoordinate2D, options: MTCameraOptions?) async
  • fitBounds(_:options:) Asynchronous

    Fits the map so the provided bounds are fully visible within the viewport.

    Declaration

    Swift

    @MainActor
    public func fitBounds(_ bounds: MTBounds, options fitOptions: MTFitBoundsOptions? = nil) async

    Parameters

    bounds

    Geographic bounds to display.

    fitOptions

    Additional configuration that controls the fitting animation.

  • setPadding(_:) Asynchronous

    Sets the padding in pixels around the viewport.

    Declaration

    Swift

    @MainActor
    public func setPadding(_ options: MTPaddingOptions) async
  • fitToIpBounds() Asynchronous

    Fits the map to the bounds inferred from the current IP address.

    Declaration

    Swift

    @MainActor
    public func fitToIpBounds() async
  • centerOnIpPoint() Asynchronous

    Centers the map on the location inferred from the current IP address.

    Declaration

    Swift

    @MainActor
    public func centerOnIpPoint() async
  • Sets the value of centerClampedToGround.

    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. Needs to be set to false to keep the camera above ground when pitch > 90 degrees.

    Note

    Defaults to true.

    Declaration

    Swift

    @MainActor
    public func setIsCenterClampedToGround(_ isCenterClampedToGround: Bool) async

    Parameters

    isCenterClampedToGround

    The boolean value indicating if center will be clamped to ground.

  • setCenterElevation(_:) Asynchronous

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

    Note

    Triggers the following events: moveStart and moveEnd.

    Declaration

    Swift

    @MainActor
    public func setCenterElevation(_ elevation: Double) async

    Parameters

    elevation

    The desired elevation.

  • setMaxPitch(_:) Asynchronous

    Sets or clears the map’s maximum pitch.

    If the map’s current pitch is higher than the new maximum, the map will pitch to the new maximum. If null is provided, the function removes the current maximum pitch (sets it to 60).

    Throws

    A MTError if maxPitch is out of bounds.

    Declaration

    Swift

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

    Parameters

    maxPitch

    The maximum pitch to set (0-85).

  • setMaxZoom(_:) Asynchronous

    Sets or clears the map’s maximum zoom.

    If the map’s current zoom level is higher than the new maximum, the map will zoom to the new maximum. If null or undefined is provided, the function removes the current maximum zoom (sets it to 22).

    Throws

    A MTError if maxZoom is out of bounds.

    Declaration

    Swift

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

    Parameters

    maxZoom

    The maximum zoom level to set.

  • setMinPitch(_:) Asynchronous

    Sets or clears the map’s minimum pitch.

    If the map’s current pitch is lower than the new minimum, the map will pitch to the new minimum. If null is provided, the function removes the current minimum pitch (i.e. sets it to 0).

    Throws

    A MTError if minPitch is out of bounds.

    Declaration

    Swift

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

    Parameters

    minPitch

    The minimum pitch to set (0-85)

  • setMinZoom(_:) Asynchronous

    Sets or clears the map’s minimum zoom.

    If the map’s current zoom level is lower than the new minimum, the map will zoom to the new minimum. If null is provided, the function removes the current minimum zoom (i.e. sets it to -2).

    Throws

    A MTError if minZoom is out of bounds.

    Declaration

    Swift

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

    Parameters

    minZoom

    The minimum zoom level to set (-2 - 24).

  • setMaxBounds(_:) Asynchronous

    Sets or clears the map’s maximum bounds constraint.

    Declaration

    Swift

    @MainActor
    public func setMaxBounds(_ bounds: MTBounds?) async throws

    Parameters

    bounds

    The bounds to constrain panning to, or nil to remove the constraint.

  • setPitch(_:) Asynchronous

    Sets the map’s pitch (tilt).

    Declaration

    Swift

    @MainActor
    public 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.

    Note

    Triggers the following events: moveStart, moveEnd, rollStart, and rollEnd.

    Declaration

    Swift

    @MainActor
    public func setRoll(_ roll: Double) async

    Parameters

    roll

    The roll to set, measured in degrees about the camera boresight.

  • getPitch() Asynchronous

    Returns the map’s current pitch (tilt).

    The map’s current pitch, measured in degrees away from the plane of the screen.

    Declaration

    Swift

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

    Returns the map’s maximum pitch (tilt).

    The map’s maximum pitch, measured in degrees away from the plane of the screen.

    Declaration

    Swift

    @MainActor
    public func getMaxPitch() async -> Double
  • getMaxZoom() Asynchronous

    Returns the map’s maximum zoom.

    The map’s maximum zoom level.

    Declaration

    Swift

    @MainActor
    public func getMaxZoom() async -> Double
  • getMinPitch() Asynchronous

    Returns the map’s minimum pitch (tilt).

    The map’s minimum pitch, measured in degrees away from the plane of the screen.

    Declaration

    Swift

    @MainActor
    public func getMinPitch() async -> Double
  • getMinZoom() Asynchronous

    Returns the map’s minimum zoom.

    The map’s minimum zoom level.

    Declaration

    Swift

    @MainActor
    public func getMinZoom() async -> Double
  • panBy(_:) Asynchronous

    Pans the map by the specified offset.

    Declaration

    Swift

    @MainActor
    public func panBy(_ offset: MTPoint) async

    Parameters

    offset

    The x and y coordinates by which to pan the map.

  • panTo(_:) Asynchronous

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

    Declaration

    Swift

    @MainActor
    public func panTo(_ coordinates: CLLocationCoordinate2D) async

    Parameters

    coordinates

    The location to pan the map to.

  • getCenter() Asynchronous

    Returns the map’s current center.

    The map’s current geographical center.

    Declaration

    Swift

    @MainActor
    public func getCenter() async -> CLLocationCoordinate2D
  • getBounds() Asynchronous

    Returns the map’s current geographic bounds.

    Declaration

    Swift

    @MainActor
    public func getBounds() async -> MTBounds
  • getMaxBounds() Asynchronous

    Returns the maximum bounds constraint applied to the map, if any.

    Declaration

    Swift

    @MainActor
    public func getMaxBounds() async -> MTBounds?
  • Returns whether the map’s center point is clamped to the ground.

    Declaration

    Swift

    @MainActor
    public func getCenterClampedToGround() async -> Bool
  • getCenterElevation() Asynchronous

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

    Declaration

    Swift

    @MainActor
    public func getCenterElevation() async -> Double
  • Returns the elevation for the point where the camera is looking, in meters above sea level multiplied by exaggeration.

    Declaration

    Swift

    @MainActor
    public func getCameraTargetElevation() async -> Double
  • project(coordinates:) Asynchronous

    Project coordinates to point on the container.

    Declaration

    Swift

    @MainActor
    public func project(coordinates: CLLocationCoordinate2D) async -> MTPoint

    Parameters

    coordinates

    The location to project.

  • getBearing() Asynchronous

    Returns the map’s current bearing.

    Declaration

    Swift

    @MainActor
    public func getBearing() async -> Double
  • getRoll() Asynchronous

    Returns the map’s current roll.

    Declaration

    Swift

    @MainActor
    public func getRoll() async -> Double
  • Returns the pixel ratio currently used by the map.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getPixelRatio(completionHandler: @escaping (Result<Double, MTError>) -> Void)

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Sets the pixel ratio used by the map.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setPixelRatio(
        _ pixelRatio: Double,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    pixelRatio

    Pixel ratio value to apply.

    completionHandler

    A handler block to execute when function finishes.

  • getPixelRatio() Asynchronous

    Returns the pixel ratio currently used by the map.

    Declaration

    Swift

    @MainActor
    public func getPixelRatio() async -> Double
  • setPixelRatio(_:) Asynchronous

    Sets the pixel ratio used by the map.

    Declaration

    Swift

    @MainActor
    public func setPixelRatio(_ pixelRatio: Double) async

    Parameters

    pixelRatio

    Pixel ratio value to apply.

  • Sets the value of the style’s glyphs property.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setGlyphs(
        url: URL,
        options: MTStyleSetterOptions?,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    url

    URL of the Glyph

    options

    Supporting type to add validation to another style related type.

    completionHandler

    A handler block to execute when function finishes.

  • Sets the map labels language.

    The language generally depends on the style. Whenever a label is not supported in the defined language, it falls back to MTLanguage.latin.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setLanguage(_ language: MTLanguage, completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    language

    The language to be applied.

    completionHandler

    A handler block to execute when function finishes.

  • Sets the any combination of light values.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setLight(
        _ light: MTLight,
        options: MTStyleSetterOptions?,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    light

    Light properties to set.

    options

    Supporting type to add validation to another style related type.

    completionHandler

    A handler block to execute when function finishes.

  • Sets the space background for globe projection (cubemap/spacebox).

    Note

    Make sure space is enabled and projection is set to Globe before initializing the map via MTMapOptions.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setSpace(
        _ space: MTSpaceOption,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    space

    Space configuration or a boolean to enable default.

    completionHandler

    A handler block to execute when function finishes.

  • Sets the atmospheric halo (glow) around the globe.

    Note

    Make sure halo is enabled and projection is set to Globe before initializing the map via MTMapOptions.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setHalo(
        _ halo: MTHaloOption,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    halo

    Halo configuration or a boolean to enable default.

    completionHandler

    A handler block to execute when function finishes.

  • Disables state transitions/animations for halo updates.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func disableHaloAnimations(
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Disables state transitions/animations for space updates.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func disableSpaceAnimations(
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Sets the state of shouldRenderWorldCopies.

    If true , multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude. If set to false: When the map is zoomed out far enough that a single representation of the world does not fill the map’s entire container, there will be blank space beyond 180 and -180 degrees longitude. When the map is zoomed out far enough that a single representation of the world does not fill the map’s entire container, there will be blank space beyond 180 and -180 degrees longitude. Features that cross 180 and -180 degrees longitude will be cut in two (with one portion on the right edge of the map and the other on the left edge of the map) at every zoom level.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setShouldRenderWorldCopies(
        _ shouldRenderWorldCopies: Bool,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    shouldRenderWorldCopies

    Boolean indicating whether world copies should be rendered.

    completionHandler

    A handler block to execute when function finishes.

  • Registers an image with the current style so it can be referenced by layers and annotations.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func addImage(
        name: String,
        image: UIImage,
        options: MTStyleImageOptions? = nil,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    name

    Unique identifier for the image.

    image

    Image to register.

    options

    Additional configuration that controls how the image is rendered.

    completionHandler

    A handler block to execute when function finishes.

  • Registers a sprite with the current style so it can be referenced by layers and annotations.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func addSprite(
        id: String,
        url: URL,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    id

    Unique identifier for the sprite.

    url

    URL pointing to the sprite resource.

    completionHandler

    A handler block to execute when function finishes.

  • Adds a marker to the map.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func addMarker(_ marker: MTMarker, completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    marker

    Marker to be added to the map.

    completionHandler

    A handler block to execute when function finishes.

  • Adds multiple markers to the map.

    Batch adding is preferred way of adding multiple markers to the map.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func addMarkers(
        _ markers: [MTMarker],
        withSingleIcon: UIImage?,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    markers

    Markers to be added to the map.

    withSingleIcon

    Optional single image to use for all markers.

    completionHandler

    A handler block to execute when function finishes.

  • Removes a marker from the map.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func removeMarker(_ marker: MTMarker, completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    marker

    Marker to be removed from the map.

    completionHandler

    A handler block to execute when function finishes.

  • Removes multiple markers from the map.

    Batch removing is preferred way of removing multiple markers from the map.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func removeMarkers(_ markers: [MTMarker], completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    markers

    Markers to be removed from the map.

    completionHandler

    A handler block to execute when function finishes.

  • Adds a text popup to the map.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func addTextPopup(_ popup: MTTextPopup, completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    popup

    Popup to be added to the map.

    completionHandler

    A handler block to execute when function finishes.

  • Removes a text popup from the map.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func removeTextPopup(_ popup: MTTextPopup, completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    popup

    Popup to be removed from the map.

    completionHandler

    A handler block to execute when function finishes.

  • Returns the projection currently active on the map.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getProjection(completionHandler: ((Result<MTProjectionType, MTError>) -> Void)? = nil)

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Enables the globe projection visualization.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func enableGlobeProjection(completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Enables the mercator projection visualization.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func enableMercatorProjection(completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Enables the 3D terrain visualization.

    Note

    Default is 1.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func enableTerrain(
        exaggerationFactor: Double = 1.0,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    exaggerationFactor

    Factor for volume boosting.

    completionHandler

    A handler block to execute when function finishes.

  • Disables the 3D terrain visualization.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func disableTerrain(completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Sets the map’s vertical field of view, in degrees.

    The internal camera has a default vertical field of view of a wide ~36.86 degrees. In globe mode, such a large FOV reduces the amount of the Earth that can be seen at once and exaggerates the central part, comparably to a fisheye lens. In many cases, a narrower FOV is preferable.

    Note

    Default is 36.87.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setVerticalFieldOfView(
        degrees: Double = 36.87,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )

    Parameters

    degrees

    The vertical field of view to set, in degrees (0-180).

    completionHandler

    A handler block to execute when function finishes.

  • Returns boolean value indicating whether the source with provided id is loaded.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func isSourceLoaded(
        id: String,
        completionHandler: ((Result<Bool, MTError>) -> Void)? = nil
    )

    Parameters

    id

    The id of the source.

    completionHandler

    A handler block to execute when function finishes.

  • Returns boolean value indicating whether all tiles required for the current viewport are loaded.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func areTilesLoaded(
        completionHandler: ((Result<Bool, MTError>) -> Void)? = nil
    )

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Returns boolean value indicating whether the map is fully loaded.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func isMapLoaded(
        completionHandler: ((Result<Bool, MTError>) -> Void)? = nil
    )

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Returns boolean value indicating whether the map renders world copies.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getRenderWorldCopies(
        completionHandler: ((Result<Bool, MTError>) -> Void)? = nil
    )

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Undocumented

    Declaration

    Swift

    @MainActor
    public func setFilter(forLayerId layerId: String, filter: MTPropertyValue) async
  • Undocumented

    Declaration

    Swift

    @MainActor
    public func setLayoutProperty(forLayerId layerId: String, name: String, value: MTPropertyValue) async
  • Undocumented

    Declaration

    Swift

    @MainActor
    public func setPaintProperty(forLayerId layerId: String, name: String, value: MTPropertyValue) async

Typed property setters (async)

  • Sets a symbol layout property using a typed key (async).

    Declaration

    Swift

    @MainActor
    public func setLayoutProperty(
        forLayerId layerId: String,
        property: MTSymbolLayoutProperty,
        value: MTPropertyValue
    ) async

    Parameters

    layerId

    Identifier of the target layer.

    property

    Typed symbol layout property key.

    value

    Property value or expression.

  • Sets a circle paint property using a typed key (async).

    Declaration

    Swift

    @MainActor
    public func setPaintProperty(
        forLayerId layerId: String,
        property: MTCirclePaintProperty,
        value: MTPropertyValue
    ) async

    Parameters

    layerId

    Identifier of the target layer.

    property

    Typed circle paint property key.

    value

    Property value or expression.

  • Sets a symbol paint property using a typed key (async).

    Declaration

    Swift

    @MainActor
    public func setPaintProperty(
        forLayerId layerId: String,
        property: MTSymbolPaintProperty,
        value: MTPropertyValue
    ) async

    Parameters

    layerId

    Identifier of the target layer.

    property

    Typed symbol paint property key.

    value

    Property value or expression.

  • Sets the value of the style’s glyphs property.

    Declaration

    Swift

    @MainActor
    public func setGlyphs(url: URL, options: MTStyleSetterOptions?) async

    Parameters

    url

    URL of the Glyph

    options

    Supporting type to add validation to another style related type.

  • setLanguage(_:) Asynchronous

    Sets the map labels language.

    The language generally depends on the style. Whenever a label is not supported in the defined language, it falls back to MTLanguage.latin.

    Declaration

    Swift

    @MainActor
    public func setLanguage(_ language: MTLanguage) async

    Parameters

    language

    The language to be applied.

  • setLight(_:options:) Asynchronous

    Sets the any combination of light values.

    Declaration

    Swift

    @MainActor
    public func setLight(_ light: MTLight, options: MTStyleSetterOptions?) async

    Parameters

    light

    Light properties to set.

    options

    Supporting type to add validation to another style related type.

  • setSpace(_:) Asynchronous

    Sets the space background for globe projection (cubemap/spacebox).

    Note

    Make sure space is enabled and projection is set to Globe before initializing the map via MTMapOptions.

    Declaration

    Swift

    @MainActor
    public func setSpace(_ space: MTSpaceOption) async

    Parameters

    space

    Space configuration or a boolean to enable default.

  • Sets the state of shouldRenderWorldCopies.

    If true , multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude. If set to false: When the map is zoomed out far enough that a single representation of the world does not fill the map’s entire container, there will be blank space beyond 180 and -180 degrees longitude. When the map is zoomed out far enough that a single representation of the world does not fill the map’s entire container, there will be blank space beyond 180 and -180 degrees longitude. Features that cross 180 and -180 degrees longitude will be cut in two (with one portion on the right edge of the map and the other on the left edge of the map) at every zoom level.

    Declaration

    Swift

    @MainActor
    public func setShouldRenderWorldCopies(_ shouldRenderWorldCopies: Bool) async

    Parameters

    shouldRenderWorldCopies

    Boolean indicating whether world copies should be rendered.

  • Registers an image with the current style so it can be referenced by layers and annotations.

    Declaration

    Swift

    @MainActor
    public func addImage(name: String, image: UIImage, options: MTStyleImageOptions? = nil) async

    Parameters

    name

    Unique identifier for the image.

    image

    Image to register.

    options

    Additional configuration that controls how the image is rendered.

  • addSprite(id:url:) Asynchronous

    Registers a sprite with the current style so it can be referenced by layers and annotations.

    Declaration

    Swift

    @MainActor
    public func addSprite(id: String, url: URL) async

    Parameters

    id

    Unique identifier for the sprite.

    url

    URL pointing to the sprite resource.

  • addMarker(_:) Asynchronous

    Adds a marker to the map.

    Declaration

    Swift

    @MainActor
    public func addMarker(_ marker: MTMarker) async

    Parameters

    marker

    Marker to be added to the map.

  • Adds multiple markers to the map.

    Batch adding is preferred way of adding multiple markers to the map.

    Declaration

    Swift

    @MainActor
    public func addMarkers(_ markers: [MTMarker], withSingleIcon: UIImage?) async

    Parameters

    markers

    Markers to be added to the map.

    withSingleIcon

    Optional single image to use for all markers.

  • removeMarker(_:) Asynchronous

    Removes a marker from the map.

    Declaration

    Swift

    @MainActor
    public func removeMarker(_ marker: MTMarker) async

    Parameters

    marker

    Marker to be removed from the map.

  • removeMarkers(_:) Asynchronous

    Removes multiple markers from the map.

    Batch removing is preferred way of removing multiple markers from the map.

    Declaration

    Swift

    @MainActor
    public func removeMarkers(_ markers: [MTMarker]) async

    Parameters

    markers

    Markers to be removed from the map.

  • addTextPopup(_:) Asynchronous

    Adds a text popup to the map.

    Declaration

    Swift

    @MainActor
    public func addTextPopup(_ popup: MTTextPopup) async

    Parameters

    popup

    Popup to be added to the map.

  • removeTextPopup(_:) Asynchronous

    Removes a text popup from the map.

    Declaration

    Swift

    @MainActor
    public func removeTextPopup(_ popup: MTTextPopup) async

    Parameters

    marker

    Popup to be removed from the map.

  • getProjection() Asynchronous

    Returns the projection currently active on the map.

    Declaration

    Swift

    @MainActor
    public func getProjection() async -> MTProjectionType
  • Enables the globe projection visualization.

    Declaration

    Swift

    @MainActor
    public func enableGlobeProjection() async
  • Enables the mercator projection visualization.

    Declaration

    Swift

    @MainActor
    public func enableMercatorProjection() async
  • Enables the 3D terrain visualization.

    Note

    Default is 1.

    Declaration

    Swift

    @MainActor
    public func enableTerrain(exaggerationFactor: Double = 1.0) async

    Parameters

    exaggerationFactor

    Factor for volume boosting.

  • disableTerrain() Asynchronous

    Disables the 3D terrain visualization.

    Declaration

    Swift

    @MainActor
    public func disableTerrain() async
  • Sets the map’s vertical field of view, in degrees.

    The internal camera has a default vertical field of view of a wide ~36.86 degrees. In globe mode, such a large FOV reduces the amount of the Earth that can be seen at once and exaggerates the central part, comparably to a fisheye lens. In many cases, a narrower FOV is preferable.

    Note

    Default is 36.87.

    Declaration

    Swift

    @MainActor
    public func setVerticalFieldOfView(degrees: Double = 36.87) async

    Parameters

    degrees

    The vertical field of view to set, in degrees (0-180).

  • setHalo(_:) Asynchronous

    Sets the atmospheric halo (glow) around the globe.

    Note

    Make sure halo is enabled and projection is set to Globe before initializing the map via MTMapOptions.

    Declaration

    Swift

    @MainActor
    public func setHalo(_ halo: MTHaloOption) async

    Parameters

    halo

    Halo configuration or a boolean to enable default.

  • Disables state transitions/animations for halo updates.

    Declaration

    Swift

    @MainActor
    public func disableHaloAnimations() async
  • Disables state transitions/animations for space updates.

    Declaration

    Swift

    @MainActor
    public func disableSpaceAnimations() async
  • isSourceLoaded(id:) Asynchronous

    Returns boolean value indicating whether the source with provided id is loaded.

    Declaration

    Swift

    @MainActor
    public func isSourceLoaded(id: String) async -> Bool

    Parameters

    id

    The id of the source.

  • areTilesLoaded() Asynchronous

    Returns boolean value indicating whether all tiles required for the current viewport are loaded.

    Declaration

    Swift

    @MainActor
    public func areTilesLoaded() async -> Bool
  • isMapLoaded() Asynchronous

    Returns boolean value indicating whether the map is fully loaded.

    Declaration

    Swift

    @MainActor
    public func isMapLoaded() async -> Bool
  • getRenderWorldCopies() Asynchronous

    Returns boolean value indicating whether the map renders world copies.

    Declaration

    Swift

    @MainActor
    public func getRenderWorldCopies() async -> Bool
  • Increases the map’s zoom level by 1.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func zoomIn(completionHandler: ((Result<Void, MTError>) -> Void)? = nil)
  • Decreases the map’s zoom level by 1.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func zoomOut(completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Returns the map’s current zoom level.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getZoom(completionHandler: @escaping (Result<Double, MTError>) -> Void)

    Parameters

    completionHandler

    A handler block to execute when function finishes.

  • Sets the map’s zoom level.

    Declaration

    Swift

    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setZoom(_ zoom: Double, completionHandler: ((Result<Void, MTError>) -> Void)? = nil)

    Parameters

    zoom

    The zoom level to set (0-20).

    completionHandler

    A handler block to execute when function finishes.

  • zoomIn() Asynchronous

    Increases the map’s zoom level by 1.

    Declaration

    Swift

    @MainActor
    public func zoomIn() async
  • zoomOut() Asynchronous

    Decreases the map’s zoom level by 1.

    Declaration

    Swift

    @MainActor
    public func zoomOut() async
  • getZoom() Asynchronous

    Returns the map’s current zoom level.

    Declaration

    Swift

    @MainActor
    public func getZoom() async -> Double
  • setZoom(_:) Asynchronous

    Sets the map’s zoom level.

    Declaration

    Swift

    @MainActor
    public func setZoom(_ zoom: Double) async
  • Declaration

    Swift

    @MainActor
    public func didUpdateLocation(_ location: CLLocation)
  • Declaration

    Swift

    @MainActor
    public func didFailWithError(_ error: Error)
  • Pins the map view to its superview edges using auto layout.

    Note

    Map view must be added to the superview before calling the function.

    Declaration

    Swift

    @MainActor
    func pinToSuperviewEdges()