Snapshotter

open class Snapshotter

Snapshotter is high-level component responsible for taking map snapshot with given MapSnapshotOptions.

Constructors

Link copied to clipboard
fun Snapshotter(context: Context, options: MapSnapshotOptions, overlayOptions: SnapshotOverlayOptions = SnapshotOverlayOptions())

Types

Link copied to clipboard
object Companion

Static variables and methods.

Functions

Link copied to clipboard
fun cameraForCoordinates(coordinates: List<Point>, padding: EdgeInsets?, bearing: Double?, pitch: Double?): CameraOptions

Convenience method that returns the camera options object for given arguments

Link copied to clipboard
fun cancel()

Cancel taking snapshot if it was running.

Link copied to clipboard

Returns the coordinate bounds for a given camera.

Link copied to clipboard
fun destroy()

Destroy snapshotter.

Link copied to clipboard

Get the current camera state.

Link copied to clipboard
fun getSize(): Size

Gets the size of the snapshot

Link copied to clipboard

Get the JSON serialization string of the current Mapbox Style in use.

Link copied to clipboard

Get the URI of the current Mapbox Style in use.

Link copied to clipboard
fun setCamera(cameraOptions: CameraOptions)

Set the camera options of the snapshot.

Link copied to clipboard
fun setSize(size: Size)

Sets the size of the snapshot

Link copied to clipboard
fun setStyleJson(styleJson: String)

Load the style from a provided JSON string.

Link copied to clipboard

Set SnapshotStyleListener to listen to all events style related.

Link copied to clipboard
fun setStyleUri(styleUri: String)

Set the URI of the current Mapbox Style in use.

Link copied to clipboard
fun start(overlayCallback: SnapshotOverlayCallback? = null, resultCallback: SnapshotResultCallback)

Request a new snapshot. If there is a running snapshot request, it is cancelled and SnapshotResultCallback.onSnapshotResult for it will be called with snapshot=NULL.

Link copied to clipboard

Returns tileIDs that cover current map camera