Snapshotter

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

class Snapshotter : MapSnapshotterObserver

Constructors

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

Types

Companion
Link copied to clipboard

Static variables and methods.

object Companion
SnapshotReadyCallback
Link copied to clipboard

Callback for getting snapshot when it's finished.

interface SnapshotReadyCallback

Functions

cameraForCoordinates
Link copied to clipboard

Convenience method that returns the camera options object for given arguments

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

Cancel taking snapshot if it was running.

fun cancel()
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
finalize
Link copied to clipboard
open override fun finalize()
getCameraOptions
Link copied to clipboard

Get the current camera options

fun getCameraOptions(): CameraOptions
getJson
Link copied to clipboard

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

fun getJson(): String
getRegion
Link copied to clipboard

Get the previously set rectangular bounds.

fun getRegion(): CoordinateBounds
getSize
Link copied to clipboard

Gets the size of the snapshot

fun getSize(): Size
getUri
Link copied to clipboard

Get the URI of the current Mapbox Style in use.

fun getUri(): String
hashCode
Link copied to clipboard
open override fun hashCode(): Int
isInTileMode
Link copied to clipboard

Returns TRUE if the snapshotter is in the tile mode.

fun isInTileMode(): Boolean
onDidFailLoadingStyle
Link copied to clipboard

Notifies the client about style load errors

open override fun onDidFailLoadingStyle(message: String)
onDidFinishLoadingStyle
Link copied to clipboard

Notifies the client when style loading finished.

open override fun onDidFinishLoadingStyle()
onStyleImageMissing
Link copied to clipboard

Notifies the client about a missing style image.

open override fun onStyleImageMissing(imageId: String)
setCameraOptions
Link copied to clipboard

Set the camera options of the snapshot.

fun setCameraOptions(cameraOptions: CameraOptions)
setJson
Link copied to clipboard

Load the style from a provided JSON string.

This method should be called on the same thread where @see Map object is initialized.

fun setJson(styleJson: String)
setSize
Link copied to clipboard

Sets the size of the snapshot

fun setSize(size: Size)
setTileMode
Link copied to clipboard

Sets the snapshotter to the tile mode.

In the tile mode, the snapshotter fetches the still image of a single tile.

fun setTileMode(set: Boolean)
setUri
Link copied to clipboard

Set the URI of the current Mapbox Style in use.

fun setUri(uri: String)
start
Link copied to clipboard

Start taking a snapshot.

fun start(callback: Snapshotter.SnapshotReadyCallback)
subscribe
Link copied to clipboard

Subscribes an Observer to a provided list of event types. Observable will hold a strong reference to an Observer instance, therefore, in order to stop receiving notifications, caller must call unsubscribe with an Observer instance used for an initial subscription.

fun subscribe(observer: Observer, list: MutableList<String>)
toString
Link copied to clipboard
open override fun toString(): String
unsubscribe
Link copied to clipboard

Unsubscribes an Observer from all events.

fun unsubscribe(observer: Observer)

Unsubscribes an Observer from a provided list of event types.

fun unsubscribe(observer: Observer, list: MutableList<String>)

Properties

peer
Link copied to clipboard
override val peer: Long