Package-level declarations

Types

Link copied to clipboard

Contains an attribution to be displayed when the map is shown to a user.

Link copied to clipboard
data class Bounds(val value: Value)

An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: [sw.lng, sw.lat, ne.lng, ne.lat]. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL.

Link copied to clipboard
data class Buffer(val value: Value)

Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance.

Link copied to clipboard
data class Cluster(val value: Value)

If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new Point features in the source with additional properties: cluster Is true if the point is a cluster cluster_id A unqiue id for the cluster to be used in conjunction with the cluster inspection methods point_count Number of original points grouped into this cluster point_count_abbreviated An abbreviated point count

Link copied to clipboard

Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15.

Link copied to clipboard

An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form {"property_name": [operator, map_expression]}. operator is any expression function that accepts at least 2 operands (e.g. "+" or "max") — it accumulates the property value from clusters/points the cluster contains; map_expression produces the value of a single point. Example: {"sum": ["+", ["get", "scalerank"]]}. For more advanced use cases, in place of operator, you can use a custom reduce expression that references a special ["accumulated"] value, e.g.: {"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}

Link copied to clipboard

Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile.

Link copied to clipboard

Corners of image specified in longitude, latitude pairs. Note: When using globe projection, the image will be centered at the North or South Pole in the respective hemisphere if the average latitude value exceeds 85 degrees or falls below -85 degrees.

Link copied to clipboard

The encoding used by this source. Mapbox Terrain RGB is used by default

Link copied to clipboard

Whether to generate ids for the geojson features. When enabled, the feature.id property will be auto assigned based on its index in the features array, over-writing any previous values.

Link copied to clipboard

The GeoJSONData that drives the GeoJsonSource.

Link copied to clipboard
class GeoJsonSourceState(val sourceId: String = generateRandomSourceId("geojson"), initialData: GeoJSONData = GeoJSONData.default, initialBuilderProperties: Map<String, Value> = mapOf(), initialProperties: Map<String, Value> = mapOf()) : SourceState

A GeoJSON data source.

Link copied to clipboard
class ImageSourceState(val sourceId: String = generateRandomSourceId("image"), initialBuilderProperties: Map<String, Value> = mapOf(), initialProperties: Map<String, Value> = mapOf()) : SourceState

An image data source.

Link copied to clipboard

Whether to calculate line distance metrics. This is required for line layers that specify line-gradient values.

Link copied to clipboard

When a set of tiles for a current zoom level is being rendered and some of the ideal tiles that cover the screen are not yet loaded, parent tile could be used instead. This might introduce unwanted rendering side-effects, especially for raster tiles that are overscaled multiple times. This property sets the maximum limit for how much a parent tile can be overscaled.

Link copied to clipboard
data class MaxZoom(val value: Value)

Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels.

Link copied to clipboard

Minimum tile update interval in seconds, which is used to throttle the tile update network requests. If the given source supports loading tiles from a server, sets the minimum tile update interval. Update network requests that are more frequent than the minimum tile update interval are suppressed.

Link copied to clipboard
data class MinZoom(val value: Value)

Minimum zoom level for which tiles are available, as in the TileJSON spec.

Link copied to clipboard

When loading a map, if PrefetchZoomDelta is set to any number greater than 0, the map will first request a tile at zoom level lower than zoom - delta, but so that the zoom level is multiple of delta, in an attempt to display a full map at lower resolution as quick as possible. It will get clamped at the tile source minimum zoom. The default delta is 4.

Link copied to clipboard

A property to use as a feature id (for feature state). Either a property name, or an object of the form {<sourceLayer>: <propertyName>}. If specified as a string for a vector tile source, the same property is used across all its source layers. If specified as an object only specified source layers will have id overriden, others will fallback to original feature id

Link copied to clipboard
class RasterArraySourceState(val sourceId: String = generateRandomSourceId("raster-array"), initialBuilderProperties: Map<String, Value> = mapOf(), initialProperties: Map<String, Value> = mapOf()) : SourceState

A raster array source

Link copied to clipboard
class RasterDemSourceState(val sourceId: String = generateRandomSourceId("raster-dem"), initialBuilderProperties: Map<String, Value> = mapOf(), initialProperties: Map<String, Value> = mapOf()) : SourceState

A RGB-encoded raster DEM source

Link copied to clipboard

Contains the description of the raster data layers and the bands contained within the tiles.

Link copied to clipboard
class RasterSourceState(val sourceId: String = generateRandomSourceId("raster"), initialBuilderProperties: Map<String, Value> = mapOf(), initialProperties: Map<String, Value> = mapOf()) : SourceState

A raster tile source.

Link copied to clipboard
data class Scheme(val value: Value)

Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed.

Link copied to clipboard

This property defines a source-specific resource budget, either in tile units or in megabytes. Whenever the tile cache goes over the defined limit, the least recently used tile will be evicted from the in-memory cache. Note that the current implementation does not take into account resources allocated by the visible tiles.

Link copied to clipboard

For the tiled sources, this property sets the tile network requests delay. The given delay comes in action only during an ongoing animation or gestures. It helps to avoid loading the transient tiles from the network and thus to avoid redundant network requests. Note that tile-network-requests-delay value is superseded with tile-requests-delay property value, if both are provided.

Link copied to clipboard

For the tiled sources, this property sets the tile requests delay. The given delay comes in action only during an ongoing animation or gestures. It helps to avoid loading, parsing and rendering of the transient tiles and thus to improve the rendering performance, especially on low-end devices.

Link copied to clipboard
data class Tiles(val value: Value)

An array of one or more tile source URLs, as in the TileJSON spec.

Link copied to clipboard

The minimum visual size to display tiles for this layer. Only configurable for raster layers.

Link copied to clipboard

Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance).

Link copied to clipboard
data class Url(val value: Value)

A URL to a TileJSON resource. Supported protocols are http:, https:, and mapbox://<Tileset ID>.

Link copied to clipboard
class VectorSourceState(val sourceId: String = generateRandomSourceId("vector"), initialBuilderProperties: Map<String, Value> = mapOf(), initialProperties: Map<String, Value> = mapOf()) : SourceState

A vector tile source.

Link copied to clipboard

A setting to determine whether a source's tiles are cached locally.

Functions

Link copied to clipboard
inline fun rememberGeoJsonSourceState(key: String? = null, sourceId: String = remember { generateRandomSourceId("geojson") }, crossinline init: GeoJsonSourceState.() -> Unit = {}): GeoJsonSourceState

Create and rememberSaveable a GeoJsonSourceState using GeoJsonSourceState.Saver. init will be called when the GeoJsonSourceState is first created to configure its initial state.

Link copied to clipboard
inline fun rememberImageSourceState(key: String? = null, sourceId: String = remember { generateRandomSourceId("image") }, crossinline init: ImageSourceState.() -> Unit = {}): ImageSourceState

Create and rememberSaveable a ImageSourceState using ImageSourceState.Saver. init will be called when the ImageSourceState is first created to configure its initial state.

Link copied to clipboard
inline fun rememberRasterArraySourceState(key: String? = null, sourceId: String = remember { generateRandomSourceId("raster-array") }, crossinline init: RasterArraySourceState.() -> Unit = {}): RasterArraySourceState

Create and rememberSaveable a RasterArraySourceState using RasterArraySourceState.Saver. init will be called when the RasterArraySourceState is first created to configure its initial state.

Link copied to clipboard
inline fun rememberRasterDemSourceState(key: String? = null, sourceId: String = remember { generateRandomSourceId("raster-dem") }, crossinline init: RasterDemSourceState.() -> Unit = {}): RasterDemSourceState

Create and rememberSaveable a RasterDemSourceState using RasterDemSourceState.Saver. init will be called when the RasterDemSourceState is first created to configure its initial state.

Link copied to clipboard
inline fun rememberRasterSourceState(key: String? = null, sourceId: String = remember { generateRandomSourceId("raster") }, crossinline init: RasterSourceState.() -> Unit = {}): RasterSourceState

Create and rememberSaveable a RasterSourceState using RasterSourceState.Saver. init will be called when the RasterSourceState is first created to configure its initial state.

Link copied to clipboard
inline fun rememberVectorSourceState(key: String? = null, sourceId: String = remember { generateRandomSourceId("vector") }, crossinline init: VectorSourceState.() -> Unit = {}): VectorSourceState

Create and rememberSaveable a VectorSourceState using VectorSourceState.Saver. init will be called when the VectorSourceState is first created to configure its initial state.