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) asyncParameters
bearingThe 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) asyncParameters
centerGeographical center of the map.
-
flyTo(_:Asynchronousoptions: animationOptions: ) 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?) asyncParameters
centerGeographical center of the map.
optionsFlyTo options.
animationOptionsanimation options.
-
easeTo(_:Asynchronousoptions: animationOptions: ) 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? ) asyncParameters
centerGeographical center of the map.
optionsCamera options.
animationOptionsanimation options.
-
jumpTo(_:Asynchronousoptions: ) Changes any combination of center, zoom, bearing, and pitch, without an animated transition
Declaration
Swift
@MainActor func jumpTo(_ center: CLLocationCoordinate2D, options: MTCameraOptions?) asyncParameters
centerGeographical center of the map.
optionsCamera options.
-
panBy(_:Asynchronous) Pans the map by the specified offset.
Declaration
Swift
@MainActor func panBy(_ offset: MTPoint) asyncParameters
offsetOffset to pan by.
-
panTo(_:Asynchronous) Pans the map to the specified location with an animated transition.
Declaration
Swift
@MainActor func panTo(_ coordinates: CLLocationCoordinate2D) asyncParameters
coordinatesCoordinates to pan to.
-
setPadding(_:Asynchronous) Sets the padding in pixels around the viewport.
Declaration
Swift
@MainActor func setPadding(_ options: MTPaddingOptions) asyncParameters
optionsPadding options.
-
setIsCenterClampedToGround(_:Asynchronous) 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) asyncParameters
isCenterClampedToGroundBoolean 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) asyncParameters
elevationDesired elevation.
-
setMaxPitch(_:Asynchronous) Sets the map’s maximum pitch.
Declaration
Swift
@MainActor func setMaxPitch(_ maxPitch: Double?) async throwsParameters
maxPitchDesired pitch.
-
setMaxZoom(_:Asynchronous) Sets the map’s maximum zoom.
Declaration
Swift
@MainActor func setMaxZoom(_ maxZoom: Double?) async throwsParameters
maxZoomDesired zoom.
-
setMinPitch(_:Asynchronous) Sets the map’s minimum pitch.
Declaration
Swift
@MainActor func setMinPitch(_ minPitch: Double?) async throwsParameters
minPitchDesired pitch.
-
setMinZoom(_:Asynchronous) Sets the map’s minimum zoom.
Declaration
Swift
@MainActor func setMinZoom(_ minZoom: Double?) async throwsParameters
minZoomDesired zoom.
-
setPitch(_:Asynchronous) Sets the map’s pitch.
Declaration
Swift
@MainActor func setPitch(_ pitch: Double) asyncParameters
pitchThe 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) asyncParameters
rollDesired roll.
-
getPitch()AsynchronousReturns the map’s current pitch.
Declaration
Swift
@MainActor func getPitch() async -> Double -
getCenter()AsynchronousReturns the map’s current center.
Declaration
Swift
@MainActor func getCenter() async -> CLLocationCoordinate2D -
getBearing()AsynchronousReturns the map’s current bearing.
Declaration
Swift
@MainActor func getBearing() async -> Double -
getRoll()AsynchronousReturns the map’s current roll.
Declaration
Swift
@MainActor func getRoll() async -> Double