GeoJsonSource

class GeoJsonSource(builder: GeoJsonSource.Builder) : Source

A GeoJSON data source.

See also

Constructors

GeoJsonSource
Link copied to clipboard
fun GeoJsonSource(builder: GeoJsonSource.Builder)

Types

Builder
Link copied to clipboard
class Builder(sourceId: String)
Builder for GeoJsonSource.
Companion
Link copied to clipboard
object Companion
Static variables and methods.

Functions

bindTo
Link copied to clipboard
open override fun bindTo(delegate: StyleInterface)
Add the source to the Style.
data
Link copied to clipboard
fun data(value: String): GeoJsonSource
A URL to a GeoJSON file, or inline GeoJSON.
feature
Link copied to clipboard
fun feature(value: Feature): GeoJsonSource
Add a Feature to the GeojsonSource.
featureCollection
Link copied to clipboard
fun featureCollection(value: FeatureCollection): GeoJsonSource
Add a Feature Collection to the GeojsonSource.
geometry
Link copied to clipboard
fun geometry(value: Geometry): GeoJsonSource
Add a Geometry to the GeojsonSource.
prefetchZoomDelta
Link copied to clipboard
fun prefetchZoomDelta(value: Long = 4L): GeoJsonSource
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.
toString
Link copied to clipboard
open override fun toString(): String
Returns a human readable string that includes the cached properties of the source.
url
Link copied to clipboard
fun url(value: String): GeoJsonSource
A URL to a GeoJSON file, or inline GeoJSON.

Properties

attribution
Link copied to clipboard
val attribution: String?
Contains an attribution to be displayed when the map is shown to a user.
buffer
Link copied to clipboard
val buffer: Long?
Size of the tile buffer on each side.
cluster
Link copied to clipboard
val cluster: Boolean?
If the data is a collection of point features, setting this to true clusters the points by radius into groups.
clusterMaxZoom
Link copied to clipboard
val clusterMaxZoom: Long?
Max zoom on which to cluster points if clustering is enabled.
clusterProperties
Link copied to clipboard
val clusterProperties: HashMap<String, Any>?
An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points.
clusterRadius
Link copied to clipboard
val clusterRadius: Long?
Radius of each cluster if clustering is enabled.
data
Link copied to clipboard
val data: String?
A URL to a GeoJSON file, or inline GeoJSON.
generateId
Link copied to clipboard
val generateId: Boolean?
Whether to generate ids for the geojson features.
lineMetrics
Link copied to clipboard
val lineMetrics: Boolean?
Whether to calculate line distance metrics.
maxzoom
Link copied to clipboard
val maxzoom: Long?
Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels).
prefetchZoomDelta
Link copied to clipboard
val prefetchZoomDelta: Long?
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.
promoteId
Link copied to clipboard
val promoteId: PromoteId?
A property to use as a feature id (for feature state).
sourceId
Link copied to clipboard
val sourceId: String
The ID of the Source.
tolerance
Link copied to clipboard
val tolerance: Double?
Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance).