GeoJsonSourceState

class GeoJsonSourceState(val sourceId: String = generateRandomSourceId("geojson"), initialData: GeoJSONData = GeoJSONData.default, initialProperties: List<Triple<String, Boolean, Value>> = emptyList()) : SourceState

A GeoJSON data source.

See also

Parameters

sourceId

The id of the source state, by default a random generated ID will be used.

initialProperties

The initial mutable properties of the source.

initialData

The initial GeoJSONData of the source.

Constructors

Link copied to clipboard
fun GeoJsonSourceState(sourceId: String = generateRandomSourceId("geojson"), initialData: GeoJSONData = GeoJSONData.default, initialProperties: List<Triple<String, Boolean, Value>> = emptyList())

Types

Link copied to clipboard
object Companion

Public companion object.

Functions

Link copied to clipboard
open override fun toString(): String

Overrides the toString method to print more meaningful information.

Properties

Link copied to clipboard

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

Link copied to clipboard

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

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:

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.

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

Sets GeoJson data property as GeoJSONData.

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

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

Link copied to clipboard

Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels).

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>}.

Link copied to clipboard
open override val sourceId: String
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

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