setStyleLayerProperty method

Future<CommandCompletion> setStyleLayerProperty(
  1. String layerId,
  2. String propertyName,
  3. Object? value
)

Sets a property of a layer in the map's style.

propertyName is one of the layer's layout or paint [properties](https://maplibre.org/maplibre-style-spec/layers/), or filter, minzoom, maxzoom, source, or source-layer. A null value resets any of these but source and source-layer to its default.

See mln_map_set_style_layer_property in the C API reference.

Errors:

  • Status.notFound when the style has no layer named layerId.
  • Status.invalidState while the style isn't loaded, as MapHandle.setStyleUrl() describes.

Implementation

Future<CommandCompletion> setStyleLayerProperty(
  String layerId,
  String propertyName,
  Object? value,
) => _command(
  (arena, completion) => raw.mln_map_set_style_layer_property(
    _handle.raw,
    nativeStringView(layerId, arena).value,
    nativeStringView(propertyName, arena).value,
    _nativeJsonView(value, arena),
    completion,
    nativeDiagnostic,
  ),
);