GeoJsonOptions

data class GeoJsonOptions(val minZoom: Int = 0, val maxZoom: Int = 18, val buffer: Int = 128, val tolerance: Float = 0.375f, val cluster: Boolean = false, val clusterRadius: Int = 50, val clusterMinPoints: Int = 2, val clusterMaxZoom: Int = maxZoom - 1, val clusterProperties: Map<String, GeoJsonOptions.ClusterProperty> = emptyMap(), val lineMetrics: Boolean = false)(source)

Parameters

minZoom

Minimum zoom level at which to create vector tiles (lower means more field of view detail at low zoom levels).

maxZoom

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

buffer

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 at the cost of slower performance.

tolerance

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

cluster

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 unique id for the cluster to be used in conjunction with the cluster inspection methods. (TODO which are not implemented yet on GeoJsonSource - #80) * point_count: Number of original points grouped into this cluster * point_count_abbreviated: An abbreviated point count

clusterRadius

Radius of each cluster when clustering points, measured in 1/512ths of a tile. I.e. a value of 512 indicates a radius equal to the width of a tile.

clusterMaxZoom

Max zoom to cluster points on. Clusters are re-evaluated at integer zoom levels. So, setting the max zoom to 14 means that the clusters will still be displayed on zoom 14.9.

clusterMinPoints

Note: Not supported on native platforms, see maplibre-native#261

Minimum number of points necessary to form a cluster if clustering is enabled.

clusterProperties

A map defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. The keys are the property names, the values are expressions.

TODO examples missing, see https://maplibre.org/maplibre-style-spec/sources/#clusterproperties

lineMetrics

Whether to calculate line distance metrics. This is required for LineLayers that specify a gradient.

Constructors

Link copied to clipboard
constructor(minZoom: Int = 0, maxZoom: Int = 18, buffer: Int = 128, tolerance: Float = 0.375f, cluster: Boolean = false, clusterRadius: Int = 50, clusterMinPoints: Int = 2, clusterMaxZoom: Int = maxZoom - 1, clusterProperties: Map<String, GeoJsonOptions.ClusterProperty> = emptyMap(), lineMetrics: Boolean = false)

Types

Link copied to clipboard
data class ClusterProperty(val operator: String, val mapper: Expression<*>)

Properties

Link copied to clipboard
val buffer: Int = 128
Link copied to clipboard
val cluster: Boolean = false
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val clusterRadius: Int = 50
Link copied to clipboard
val lineMetrics: Boolean = false
Link copied to clipboard
val maxZoom: Int = 18
Link copied to clipboard
val minZoom: Int = 0
Link copied to clipboard
val tolerance: Float = 0.375f