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

Types

CustomGeometrySource
Link copied to clipboard

Custom Vector Source, allows using FeatureCollections.

<p> 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
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 StyleManagerInterface.addSource(source: StyleContract.StyleSourceExtension)
customGeometrySource
Link copied to clipboard

DSL function for CustomGeometrySource.

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

Returns the children of a cluster (on the next zoom level).

fun GeoJsonSource.getClusterChildren(clusterId: Int): MutableList<Feature>
getClusterLeaves
Link copied to clipboard

Returns all the leaves of a cluster (given its cluster_id), with pagination support: limit is the number of leaves to return (set to Infinity for all points), and offset is the amount of points to skip (for pagination).

fun GeoJsonSource.getClusterLeaves(clusterId: Int, limit: Int, offset: Int): MutableList<Feature>
getExpansionZoom
Link copied to clipboard

Returns the zoom on which the cluster expands into several children (useful for "click to zoom" feature).

fun GeoJsonSource.getExpansionZoom(clusterId: Int): Byte
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)