-
Undocumented
Declaration
Swift
public private(set) var mapboxMap: MapboxMap! { get set } -
The
gesturesobject will be responsible for all gestures on the map.Declaration
Swift
public private(set) var gestures: GestureManager! { get } -
The
ornamentsobject will be responsible for all ornaments on the map.Declaration
Swift
public private(set) var ornaments: OrnamentsManager! { get } -
The
cameraobject manages a camera’s view lifecycle.Declaration
Swift
public private(set) var camera: CameraAnimationsManager! { get } -
The
locationobject handles location events of the map.Declaration
Swift
public private(set) var location: LocationManager! { get } -
Controls the addition/removal of annotations to the map.
Declaration
Swift
public private(set) var annotations: AnnotationOrchestrator! { get } -
Manages the configuration of custom view annotations on the map.
Declaration
Swift
public private(set) var viewAnnotations: ViewAnnotationManager! { get } -
Viewportis a high-level and extensible API for driving the map camera. It provides built-in states for following the location puck and showing an overview of a GeoJSON geometry, and enables the creation of custom states. Transitions between states can be animated with a built-in default transition and via custom transitions.Declaration
Swift
public private(set) var viewport: Viewport! { get } -
A Boolean value that indicates whether the underlying
CAMetalLayerof theMapViewpresents its content using a CoreAnimation transactionBy default, this is
falseresulting in the output of a rendering pass being displayed on theCAMetalLayeras quickly as possible (and asynchronously). This typically results in the fastest rendering performance.If, however, the
MapViewis overlaid with aUIKitelement which must be pinned to a particular lat-long, then setting this totruewill result in better synchronization and less jitter.Declaration
Swift
public var presentsWithTransaction: Bool { get set } -
The preferred frames per second used for map rendering. NOTE:
MapView.preferredFrameRateRangeis available for iOS 15.0 and above.Declaration
Swift
@available(iOS, deprecated: 1000000) public var preferredFramesPerSecond: Int { get set } -
The preferred range of frame refresh rates.
Declaration
Swift
@available(iOS 15.0, *) public var preferredFrameRateRange: CAFrameRateRange { get set } -
The map’s current camera
Declaration
Swift
public var cameraState: CameraState { get } -
The map’s current anchor, calculated after applying padding (if it exists)
Declaration
Swift
public var anchor: CGPoint { get } -
Initialize a MapView
Declaration
Swift
@available(iOSApplicationExtension, unavailable) public init(frame: CGRect, mapInitOptions: MapInitOptions = MapInitOptions())Parameters
frameframe for the MapView.
mapInitOptionsMapInitOptions; default usesResourceOptionsManager.defaultto retrieve a shared default resource option, including the access token. -
Initialize a MapView
Declaration
Swift
@available(iOS, deprecated: 13, message: "Use init(frame:mapInitOptions:urlOpener:﹚ instead") public init(frame: CGRect, mapInitOptions: MapInitOptions = MapInitOptions(), orientationProvider: InterfaceOrientationProvider, urlOpener: AttributionURLOpener)Parameters
frameframe for the MapView.
mapInitOptionsMapInitOptions; default usesResourceOptionsManager.defaultto retrieve a shared default resource option, including the access token.orientationProviderUser interface orientation provider
urlOpenerAttribution URL opener
-
Initialize a MapView
Declaration
Swift
@available(iOS 13.0, *) public init(frame: CGRect, mapInitOptions: MapInitOptions = MapInitOptions(), urlOpener: AttributionURLOpener)Parameters
frameframe for the MapView.
mapInitOptionsMapInitOptions; default usesResourceOptionsManager.defaultto retrieve a shared default resource option, including the access token.urlOpenerAttribution URL opener
-
Undocumented
Declaration
Swift
required public init?(coder: NSCoder) -
Undocumented
Declaration
Swift
open override func awakeFromNib() -
Undocumented
Declaration
Swift
open override func layoutSubviews() -
Undocumented
Declaration
Swift
@_spi(Metrics) public var metricsReporter: MapViewMetricsReporter? -
Undocumented
Declaration
Swift
open override func didMoveToWindow() -
Errors related to rendered snapshots
See moreDeclaration
Swift
@_spi(Experimental) public enum SnapshotError : Error -
Synchronously captures the rendered map as a
UIImage. The image does not include the ornaments (scale bar, compass, attribution, etc.) or any other custom subviews. UsedrawHierarchy(in:afterScreenUpdates:)directly to include the full hierarchy.Declaration
Swift
@_spi(Experimental) public func snapshot() throws -> UIImageReturn Value
A
UIImageof the rendered map
MapView Class Reference