setLayerProperties method

Future<void> setLayerProperties(
  1. String layerId,
  2. LayerProperties properties
)

Set one or multiple properties of a layer. You can only use properties that are supported for the layer's type. So you can e.g. only use LineLayerProperties on a line layer.

The returned Future completes after the change has been made on the platform side.

NOTE: The properties will not skip null values, so setting a property to null will potentially reset it to default.

Implementation

Future<void> setLayerProperties(
  String layerId,
  LayerProperties properties,
) async {
  await _maplibrePlatform.setLayerProperties(
    layerId,
    properties.toJson(skipNulls: false),
  );
}