addLayer

fun <P : LayerPaint> addLayer(descriptor: LayerDescriptor<P>, beforeID: String?): TileLayer?

Adds a new layer to the map.

Return

The new TileLayer, or null if the source is missing or the descriptor is unsupported.

Parameters

descriptor

Layer definition referencing an existing source id and paint.

beforeID

Optional existing layer id to insert below in the stack; null appends on top.