Skip to content

updateLayerInContext() ​

updateLayerInContext(context, layerModel, layerUpdates): MapContext

Updates an existing layer in the context by applying partial changes.

Note: setting a property to undefined in the partial layer updates will remove that property from the existing layer.

Parameters ​

ParameterTypeDescription
contextMapContextThe current map context.
layerModelMapContextLayerThe layer to be updated.
layerUpdatesPartial<MapContextLayer>A partial layer object containing the properties to update on the existing layer.

Returns ​

MapContext

The new map context with the updated layer.