CustomLayer

data class CustomLayer(val id: String, val uri: String, val refreshToken: Int = 0, val icons: Set<String> = emptySet(), val groundOverlays: List<LayerGroundOverlay> = emptyList())(source)

A user-imported overlay, already reduced to GeoJSON.

The host resolves whatever the user actually imported — a local file, a network URL, a KML archive — into one of these; this module never touches the filesystem.

Parameters

uri

a file://, https:// or data URI MapLibre can fetch GeoJSON from.

refreshToken

bumped by the host when the user asks to refresh this layer. A network layer keeps the same URI across a refresh, so without something that changes there is nothing to tell the map its contents moved on — see CustomLayers.

groundOverlays

images the layer drapes over the map (KML <GroundOverlay>), already resolved to local files with their corners computed.

icons

the distinct icon images the layer's features ask for, found by the host with geoJsonIconUrls. Supplied rather than discovered because MapLibre picks an icon per feature from a fixed set of style images, which has to exist before the layer composes.

Constructors

Link copied to clipboard
constructor(id: String, uri: String, refreshToken: Int = 0, icons: Set<String> = emptySet(), groundOverlays: List<LayerGroundOverlay> = emptyList())

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val id: String
Link copied to clipboard
Link copied to clipboard
val uri: String