MapSnapshotterInterface

interface MapSnapshotterInterface : CameraManagerInterface

MapSnapshotter exposes functionality to capture static map images.

Functions

addPersistentStyleCustomLayer
Link copied to clipboard
abstract fun addPersistentStyleCustomLayer(@NonNull layerId: String, @NonNull layerHost: CustomLayerHost, @Nullable layerPosition: LayerPosition): Expected<String, None>
Adds a new [style custom layer](https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers).
addPersistentStyleLayer
Link copied to clipboard
abstract fun addPersistentStyleLayer(@NonNull properties: Value, @Nullable layerPosition: LayerPosition): Expected<String, None>
Adds a new [style layer](https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers).
addStyleCustomGeometrySource
Link copied to clipboard
abstract fun addStyleCustomGeometrySource(@NonNull sourceId: String, @NonNull options: CustomGeometrySourceOptions): Expected<String, None>
Adds a custom geometry to be used in the style.
addStyleCustomLayer
Link copied to clipboard
abstract fun addStyleCustomLayer(@NonNull layerId: String, @NonNull layerHost: CustomLayerHost, @Nullable layerPosition: LayerPosition): Expected<String, None>
Adds a new [style custom layer](https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers).
addStyleImage
Link copied to clipboard
abstract fun addStyleImage(@NonNull imageId: String, scale: Float, @NonNull image: Image, sdf: Boolean, @NonNull stretchX: List<ImageStretches>, @NonNull stretchY: List<ImageStretches>, @Nullable content: ImageContent): Expected<String, None>
Adds an image to be used in the style.
addStyleLayer
Link copied to clipboard
abstract fun addStyleLayer(@NonNull properties: Value, @Nullable layerPosition: LayerPosition): Expected<String, None>
Adds a new [style layer](https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers).
addStyleModel
Link copied to clipboard
abstract fun addStyleModel(@NonNull modelId: String, @NonNull modelUri: String): Expected<String, None>
Adds a model to be used in the style.
addStyleSource
Link copied to clipboard
abstract fun addStyleSource(@NonNull sourceId: String, @NonNull properties: Value): Expected<String, None>
Adds a new [style source](https://docs.mapbox.com/mapbox-gl-js/style-spec/#sources).
cameraForCoordinateBounds
Link copied to clipboard
abstract fun cameraForCoordinateBounds(@NonNull bounds: CoordinateBounds, @NonNull padding: EdgeInsets, @Nullable bearing: Double, @Nullable pitch: Double): CameraOptions
Convenience method that returns the `camera options` object for given parameters.
cameraForCoordinates
Link copied to clipboard
abstract fun cameraForCoordinates(@NonNull coordinates: List<Point>, @NonNull camera: CameraOptions, @NonNull box: ScreenBox): CameraOptions
Convenience method that adjusts the provided `camera options` object for given parameters.
abstract fun cameraForCoordinates(@NonNull coordinates: List<Point>, @NonNull padding: EdgeInsets, @Nullable bearing: Double, @Nullable pitch: Double): CameraOptions
Convenience method that returns the `camera options` object for given parameters.
cameraForGeometry
Link copied to clipboard
abstract fun cameraForGeometry(@NonNull geometry: Geometry, @NonNull padding: EdgeInsets, @Nullable bearing: Double, @Nullable pitch: Double): CameraOptions
Convenience method that returns the `camera options` object for given parameters.
cancel
Link copied to clipboard
abstract fun cancel()
Cancel the current snapshot operation.
coordinateBoundsForCamera
Link copied to clipboard
abstract fun coordinateBoundsForCamera(@NonNull camera: CameraOptions): CoordinateBounds
Returns the `coordinate bounds` for a given camera.
coordinateBoundsForCameraUnwrapped
Link copied to clipboard
abstract fun coordinateBoundsForCameraUnwrapped(@NonNull camera: CameraOptions): CoordinateBounds
Returns the `coordinate bounds` for a given camera.
coordinateBoundsZoomForCamera
Link copied to clipboard
abstract fun coordinateBoundsZoomForCamera(@NonNull camera: CameraOptions): CoordinateBoundsZoom
Returns the `coordinate bounds` and the `zoom` for a given `camera`.
coordinateBoundsZoomForCameraUnwrapped
Link copied to clipboard
Returns the unwrapped `coordinate bounds` and `zoom` for a given `camera`.
coordinateForPixel
Link copied to clipboard
abstract fun coordinateForPixel(@NonNull pixel: ScreenCoordinate): Point
Calculates a geographical `coordinate` (i.e., longitude-latitude pair) that corresponds to a `screen coordinate`.
coordinateInfoForPixel
Link copied to clipboard
abstract fun coordinateInfoForPixel(@NonNull pixel: ScreenCoordinate): CoordinateInfo
Calculates the geographical coordinate information that corresponds to a given screen coordinate.
coordinatesForPixels
Link copied to clipboard
abstract fun coordinatesForPixels(@NonNull pixels: List<ScreenCoordinate>): List<Point>
Calculates geographical `coordinates` (i.e., longitude-latitude pairs) that correspond to `screen coordinates`.
coordinatesInfoForPixels
Link copied to clipboard
abstract fun coordinatesInfoForPixels(@NonNull pixels: List<ScreenCoordinate>): List<CoordinateInfo>
Calculates the geographical coordinates information that corresponds to the given screen coordinates.
dragEnd
Link copied to clipboard
abstract fun dragEnd()
Ends the ongoing drag gesture.
dragStart
Link copied to clipboard
abstract fun dragStart(@NonNull point: ScreenCoordinate)
Prepares the drag gesture to use the provided screen coordinate as a pivot `point`.
getBounds
Link copied to clipboard
abstract fun getBounds(): CameraBounds
Returns the `camera bounds` of the map.
getCameraState
Link copied to clipboard
abstract fun getCameraState(): CameraState
Returns the current `camera state`.
getDragCameraOptions
Link copied to clipboard
abstract fun getDragCameraOptions(@NonNull fromPoint: ScreenCoordinate, @NonNull toPoint: ScreenCoordinate): CameraOptions
Calculates target point where camera should move after drag.
getElevation
Link copied to clipboard
abstract fun getElevation(@NonNull coordinate: Point): Double
Get elevation for the given coordinate.
getFreeCameraOptions
Link copied to clipboard
abstract fun getFreeCameraOptions(): FreeCameraOptions
Gets the map's current free camera options.
getRenderWorldCopies
Link copied to clipboard
abstract fun getRenderWorldCopies(): Boolean
Returns whether multiple copies of the world are being rendered side by side beyond -180 and 180 degrees longitude.
getSize
Link copied to clipboard
abstract fun getSize(): Size
Gets the size of the snapshot
getStyleAtmosphereProperty
Link copied to clipboard
abstract fun getStyleAtmosphereProperty(@NonNull property: String): StylePropertyValue
Gets the value of a style atmosphere property.
getStyleDefaultCamera
Link copied to clipboard
abstract fun getStyleDefaultCamera(): CameraOptions
Returns the map style's default camera, if any, or a default camera otherwise.
getStyleImage
Link copied to clipboard
abstract fun getStyleImage(@NonNull imageId: String): Image
Get an `image` from the style.
getStyleJSON
Link copied to clipboard
abstract fun getStyleJSON(): String
Get the JSON serialization string of the current style in use.
getStyleLayerProperties
Link copied to clipboard
abstract fun getStyleLayerProperties(@NonNull layerId: String): Expected<String, Value>
Gets style layer properties.
getStyleLayerProperty
Link copied to clipboard
abstract fun getStyleLayerProperty(@NonNull layerId: String, @NonNull property: String): StylePropertyValue
Gets the value of style layer property.
getStyleLayers
Link copied to clipboard
abstract fun getStyleLayers(): List<StyleObjectInfo>
Returns the existing style layers.
getStyleLightProperty
Link copied to clipboard
abstract fun getStyleLightProperty(@NonNull property: String): StylePropertyValue
Gets the value of a style light property.
abstract fun getStyleLightProperty(@NonNull id: String, @NonNull property: String): StylePropertyValue
getStyleLights
Link copied to clipboard
abstract fun getStyleLights(): List<StyleObjectInfo>
getStyleProjectionProperty
Link copied to clipboard
abstract fun getStyleProjectionProperty(@NonNull property: String): StylePropertyValue
Gets the value of a style projection property.
getStyleSourceProperties
Link copied to clipboard
abstract fun getStyleSourceProperties(@NonNull sourceId: String): Expected<String, Value>
Gets style source properties.
getStyleSourceProperty
Link copied to clipboard
abstract fun getStyleSourceProperty(@NonNull sourceId: String, @NonNull property: String): StylePropertyValue
Gets the value of style source property.
getStyleSources
Link copied to clipboard
abstract fun getStyleSources(): List<StyleObjectInfo>
Returns the existing style sources.
getStyleTerrainProperty
Link copied to clipboard
abstract fun getStyleTerrainProperty(@NonNull property: String): StylePropertyValue
Gets the value of a style terrain property.
getStyleTransition
Link copied to clipboard
abstract fun getStyleTransition(): TransitionOptions
Returns the map style's transition options.
getStyleURI
Link copied to clipboard
abstract fun getStyleURI(): String
Get the URI of the current style in use.
hasStyleImage
Link copied to clipboard
abstract fun hasStyleImage(@NonNull imageId: String): Boolean
Checks whether an image exists.
hasStyleModel
Link copied to clipboard
abstract fun hasStyleModel(@NonNull modelId: String): Boolean
Checks whether a model exists.
abstract fun invalidateStyleCustomGeometrySourceRegion(@NonNull sourceId: String, @NonNull bounds: CoordinateBounds): Expected<String, None>
Invalidate region for provided custom geometry source.
invalidateStyleCustomGeometrySourceTile
Link copied to clipboard
abstract fun invalidateStyleCustomGeometrySourceTile(@NonNull sourceId: String, @NonNull tileId: CanonicalTileID): Expected<String, None>
Invalidate tile for provided custom geometry source.
isInTileMode
Link copied to clipboard
abstract fun isInTileMode(): Boolean
Returns `true` if the snapshotter is in the tile mode.
isStyleLayerPersistent
Link copied to clipboard
abstract fun isStyleLayerPersistent(@NonNull layerId: String): Expected<String, Boolean>
Checks if a style layer is persistent.
isStyleLoaded
Link copied to clipboard
abstract fun isStyleLoaded(): Boolean
Check if the style is completely loaded.
moveStyleLayer
Link copied to clipboard
abstract fun moveStyleLayer(@NonNull layerId: String, @Nullable layerPosition: LayerPosition): Expected<String, None>
Moves an existing style layer
pixelForCoordinate
Link copied to clipboard
abstract fun pixelForCoordinate(@NonNull coordinate: Point): ScreenCoordinate
Calculates a `screen coordinate` that corresponds to a geographical coordinate (i.e., longitude-latitude pair).
pixelsForCoordinates
Link copied to clipboard
abstract fun pixelsForCoordinates(@NonNull coordinates: List<Point>): List<ScreenCoordinate>
Calculates `screen coordinates` that correspond to geographical `coordinates` (i.e., longitude-latitude pairs).
reduceMemoryUse
Link copied to clipboard
abstract fun reduceMemoryUse()
removeStyleImage
Link copied to clipboard
abstract fun removeStyleImage(@NonNull imageId: String): Expected<String, None>
Removes an image from the style.
removeStyleLayer
Link copied to clipboard
abstract fun removeStyleLayer(@NonNull layerId: String): Expected<String, None>
Removes an existing style layer.
removeStyleModel
Link copied to clipboard
abstract fun removeStyleModel(@NonNull modelId: String): Expected<String, None>
Removes a model from the style.
removeStyleSource
Link copied to clipboard
abstract fun removeStyleSource(@NonNull sourceId: String): Expected<String, None>
Removes an existing style source.
setBounds
Link copied to clipboard
abstract fun setBounds(@NonNull options: CameraBoundsOptions): Expected<String, None>
Sets the `camera bounds options` of the map.
setCamera
Link copied to clipboard
abstract fun setCamera(@NonNull cameraOptions: CameraOptions)
Changes the map view by any combination of center, zoom, bearing, and pitch, without an animated transition.
abstract fun setCamera(@NonNull freeCameraOptions: FreeCameraOptions)
Sets the map view with the free camera options.
setRenderWorldCopies
Link copied to clipboard
abstract fun setRenderWorldCopies(renderWorldCopies: Boolean)
Sets whether multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude.
setSize
Link copied to clipboard
abstract fun setSize(@NonNull size: Size)
Sets the `size` of the snapshot
setStyleAtmosphere
Link copied to clipboard
abstract fun setStyleAtmosphere(@NonNull properties: Value): Expected<String, None>
Sets the style global [atmosphere](https://docs.mapbox.com/mapbox-gl-js/style-spec/#fog) properties.
setStyleAtmosphereProperty
Link copied to clipboard
abstract fun setStyleAtmosphereProperty(@NonNull property: String, @NonNull value: Value): Expected<String, None>
Sets a value to the the style atmosphere property.
setStyleCustomGeometrySourceTileData
Link copied to clipboard
abstract fun setStyleCustomGeometrySourceTileData(@NonNull sourceId: String, @NonNull tileId: CanonicalTileID, @NonNull featureCollection: List<Feature>): Expected<String, None>
Set tile data of a custom geometry.
setStyleGeoJSONSourceData
Link copied to clipboard
abstract fun setStyleGeoJSONSourceData(@NonNull sourceId: String, @NonNull data: GeoJSONSourceData): Expected<String, None>
abstract fun setStyleGeoJSONSourceData(@NonNull sourceId: String, @NonNull dataId: String, @NonNull data: GeoJSONSourceData): Expected<String, None>
setStyleJSON
Link copied to clipboard
abstract fun setStyleJSON(@NonNull json: String)
Load the style from a provided JSON string.
setStyleLayerProperties
Link copied to clipboard
abstract fun setStyleLayerProperties(@NonNull layerId: String, @NonNull properties: Value): Expected<String, None>
Sets style layer properties.
setStyleLayerProperty
Link copied to clipboard
abstract fun setStyleLayerProperty(@NonNull layerId: String, @NonNull property: String, @NonNull value: Value): Expected<String, None>
Sets a value to a style layer property.
setStyleLight
Link copied to clipboard
abstract fun setStyleLight(@NonNull properties: Value): Expected<String, None>
Sets the style global [light](https://docs.mapbox.com/mapbox-gl-js/style-spec/#light) properties.
setStyleLightProperty
Link copied to clipboard
abstract fun setStyleLightProperty(@NonNull property: String, @NonNull value: Value): Expected<String, None>
Sets a value to the the style light property.
abstract fun setStyleLightProperty(@NonNull id: String, @NonNull property: String, @NonNull value: Value): Expected<String, None>
setStyleLights
Link copied to clipboard
abstract fun setStyleLights(@NonNull lights: Value): Expected<String, None>
setStyleProjection
Link copied to clipboard
abstract fun setStyleProjection(@NonNull properties: Value): Expected<String, None>
Sets the map's [projection](https://docs.mapbox.com/mapbox-gl-js/style-spec/projection/).
setStyleProjectionProperty
Link copied to clipboard
abstract fun setStyleProjectionProperty(@NonNull property: String, @NonNull value: Value): Expected<String, None>
Sets a value to the the style projection property.
setStyleSourceProperties
Link copied to clipboard
abstract fun setStyleSourceProperties(@NonNull sourceId: String, @NonNull properties: Value): Expected<String, None>
Sets style source properties.
setStyleSourceProperty
Link copied to clipboard
abstract fun setStyleSourceProperty(@NonNull sourceId: String, @NonNull property: String, @NonNull value: Value): Expected<String, None>
Sets a value to a style source property.
setStyleTerrain
Link copied to clipboard
abstract fun setStyleTerrain(@NonNull properties: Value): Expected<String, None>
Sets the style global [terrain](https://docs.mapbox.com/mapbox-gl-js/style-spec/#terrain) properties.
setStyleTerrainProperty
Link copied to clipboard
abstract fun setStyleTerrainProperty(@NonNull property: String, @NonNull value: Value): Expected<String, None>
Sets a value to the the style terrain property.
setStyleTransition
Link copied to clipboard
abstract fun setStyleTransition(@NonNull transitionOptions: TransitionOptions)
Overrides the map style's transition options with user-provided options.
setStyleURI
Link copied to clipboard
abstract fun setStyleURI(@NonNull uri: String)
Load style from provided URI.
setTileMode
Link copied to clipboard
abstract fun setTileMode(set: Boolean)
Sets the snapshotter to the tile mode.
start
Link copied to clipboard
abstract fun start(@NonNull callback: SnapshotCompleteCallback)
Start the rendering of a snapshot.
styleLayerExists
Link copied to clipboard
abstract fun styleLayerExists(@NonNull layerId: String): Boolean
Checks whether a given style layer exists.
styleSourceExists
Link copied to clipboard
abstract fun styleSourceExists(@NonNull sourceId: String): Boolean
Checks whether a given style source exists.
subscribe
Link copied to clipboard
abstract fun subscribe(@NonNull observer: Observer, @NonNull events: List<String>)
Subscribes an `observer` to a provided array of event types.
tileCover
Link copied to clipboard
abstract fun tileCover(@NonNull tileCoverOptions: TileCoverOptions, @Nullable cameraOptions: CameraOptions): List<CanonicalTileID>
unsubscribe
Link copied to clipboard
abstract fun unsubscribe(@NonNull observer: Observer)
Unsubscribes an `observer` from all events.
abstract fun unsubscribe(@NonNull observer: Observer, @NonNull events: List<String>)
Unsubscribes an `observer` from a provided array of event types.
updateStyleImageSourceImage
Link copied to clipboard
abstract fun updateStyleImageSourceImage(@NonNull sourceId: String, @NonNull image: Image): Expected<String, None>
Updates the image of an [image style source](https://docs.mapbox.com/mapbox-gl-js/style-spec/#sources-image).