MapSnapshotter

open class MapSnapshotter(context: Context, options: MapSnapshotter.Options)

The map snapshotter creates a large of the map, rendered off the UI thread. The snapshotter itself must be used on the UI thread (for access to the main looper)

Constructors

Link copied to clipboard
constructor(context: Context, options: MapSnapshotter.Options)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
fun interface ErrorHandler

Can be used to get notified of errors in snapshot generation

Link copied to clipboard
interface Observer

Can be used to get notified on snapshotter style loading completion.

Link copied to clipboard
class Options(width: Int, height: Int)

MapSnapshotter options

Link copied to clipboard
fun interface SnapshotReadyCallback

Get notified on snapshot completion.

Functions

Link copied to clipboard
fun addImage(name: String, bitmap: Bitmap, sdf: Boolean)

Adds an image to be used in the snapshotter's style

Link copied to clipboard
fun cancel()

Must be called in on the thread the object was created on.

Link copied to clipboard
fun getLayer(layerId: String): Layer?

Returns Layer of a style that is used by a snapshotter

Link copied to clipboard
fun getSource(sourceId: String): Source?

Returns Source of a style that is used by a snapshotter

Link copied to clipboard
external fun setCameraPosition(cameraPosition: CameraPosition?)

Updates the snapshotter with a new CameraPosition

Link copied to clipboard

Sets observer for a snapshotter

Link copied to clipboard
external fun setRegion(region: LatLngBounds?)

Updates the snapshotter with a new LatLngBounds

Link copied to clipboard
external fun setSize(width: Int, height: Int)

Updates the snapshotter with a new size

Link copied to clipboard
external fun setStyleJson(styleJson: String?)

Updates the snapshotter with a new style json

Link copied to clipboard
external fun setStyleUrl(styleUrl: String?)

Updates the snapshotter with a new style url

Link copied to clipboard

Starts loading and rendering the snapshot. The callbacks will be fired on the calling thread.