Skip to content

addLayerToContext() ​

addLayerToContext(context, layerModel, position?): MapContext

Adds a layer to the context at a specific position or at the end if no position is specified.

Parameters ​

ParameterTypeDescription
contextMapContextThe current map context.
layerModelMapContextLayerThe layer to be added.
position?numberThe position at which to add the layer. If not specified, the layer is added at the end.

Returns ​

MapContext

The new map context with the added layer.