Package com.mapbox.maps.extension.style.sources

Types

CustomGeometrySource
Link copied to clipboard

Custom Vector Source, allows using FeatureCollections.

CustomGeometrySource uses a coalescing model for frequent data updates targeting the same tile id, which means, that the in-progress request as well as the last scheduled request are guaranteed to finish. Any requests scheduled meanwhile can be canceled.

class CustomGeometrySource(id: String, options: CustomGeometrySourceOptions) : StyleContract.StyleSourceExtension
OnGeoJsonParsed
Link copied to clipboard

Interface used to notify when geojson's data set through GeoJsonSource.featureCollection, GeoJsonSource.feature or GeoJsonSource.geometry is parsed.

fun fun interface OnGeoJsonParsed
Source
Link copied to clipboard

Base class for sources.

Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided.

abstract class Source(sourceId: String) : StyleContract.StyleSourceExtension
TileSet
Link copied to clipboard

Tile set, allows using TileJson specification as source. Note that encoding is only relevant to raster-dem sources, and is not supported in the TileJson spec.

class TileSet : HashMap<String, Value>

Functions

addSource
Link copied to clipboard

Extension function to add a Source provided by the Style Extension to the Style.

fun StyleInterface.addSource(source: StyleContract.StyleSourceExtension)
customGeometrySource
Link copied to clipboard

DSL function for CustomGeometrySource.

fun customGeometrySource(id: String, block: CustomGeometrySourceOptions.Builder.() -> Unit): CustomGeometrySource
getSource
Link copied to clipboard

Extension function to get a Source provided by the Style Extension by source id.

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

Tries to cast the Source to T.

inline fun <T : Source> StyleManagerInterface.getSourceAs(sourceId: String): T?
updateImage
Link copied to clipboard

Updates the image of an image style source.

See https://docs.mapbox.com/mapbox-gl-js/style-spec/#sources-image

fun ImageSource.updateImage(image: Image)