addLayer

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

Adds a new layer to the map.

Parameters

descriptor
  • The layer descriptor

id
  • A unique identifier for the layer.

config
  • The configuration options for the layer.

beforeId
  • The identifier of an existing map layer to insert the new layer before, which will result in the new layer appearing below the target layer. If not provided, then the new layer will be added to the end of the layer stack and above all other layers.