-
A
styleobject that can be manipulated to set different styles for a snapshotDeclaration
Swift
public let style: Style -
Initialize a
SnapshotterinstanceDeclaration
Swift
public init(options: MapSnapshotOptions)Parameters
optionsOptions describing an intended snapshot
-
The size of the snapshot
Declaration
Swift
public var snapshotSize: CGSize { get set } -
The current camera state of the snapshotter
Declaration
Swift
public var cameraState: CameraState { get } -
Sets the camera of the snapshotter
Declaration
Swift
public func setCamera(to cameraOptions: CameraOptions)Parameters
cameraOptionsThe target camera options
-
In the tile mode, the snapshotter fetches the still image of a single tile.
Declaration
Swift
public var tileMode: Bool { get set } -
Request a new snapshot. If there is a pending snapshot request, it is cancelled automatically.
Declaration
Swift
public func start(overlayHandler: SnapshotOverlayHandler?, completion: @escaping (Result<UIImage, SnapshotError>) -> Void)Parameters
overlayHandlerThe optional block to call after the base map finishes drawing, but before the final snapshot has been drawn. This block provides a
SnapshotOverlayHandlertype, which can be used with Core Graphics to draw custom content directly over the snapshot image.completionThe block to call once the snapshot has been generated, providing a
Result<UIImage, SnapshotError>type. -
Cancels the current snapshot operation.The callback passed to the start method is called with error parameter set.
Declaration
Swift
public func cancel() -
Undocumented
See moreDeclaration
Swift
public enum SnapshotError : Error
-
Returns the coordinate bounds corresponding to a given
CameraOptionsDeclaration
Swift
public func coordinateBounds(for camera: CameraOptions) -> CoordinateBoundsParameters
cameraThe camera for which the coordinate bounds will be returned.
Return Value
CoordinateBoundsfor the givenCameraOptions -
Calculates a
CameraOptionsto fit a list of coordinates.Declaration
Swift
public func camera(for coordinates: [CLLocationCoordinate2D], padding: UIEdgeInsets, bearing: Double?, pitch: Double?) -> CameraOptionsParameters
coordinatesArray of coordinates that should fit within the new viewport.
paddingThe new padding to be used by the camera.
bearingThe new bearing to be used by the camera.
pitchThe new pitch to be used by the camera.
Return Value
A
CameraOptionsthat fits the provided constraints
-
Declaration
Swift
public func subscribe(_ observer: Observer, events: [String]) -
Declaration
Swift
public func unsubscribe(_ observer: Observer, events: [String] = []) -
Declaration
Swift
@discardableResult public func onNext(_ eventType: MapEvents.EventKind, handler: @escaping (Event) -> Void) -> Cancelable -
Declaration
Swift
@discardableResult public func onEvery(_ eventType: MapEvents.EventKind, handler: @escaping (Event) -> Void) -> Cancelable
-
Clears temporary map data.
Clears temporary map data from the data path defined in the given resource options. Useful to reduce the disk usage or in case the disk cache contains invalid data.
Note
Calling this API will affect all maps that use the same data path and does not affect persistent map data like offline style packages.
Declaration
Swift
public func clearData(completion: @escaping (Error?) -> Void)Parameters
completionCalled once the request is complete
Snapshotter Class Reference