getStyleLayerProperty method

Future<Object?> getStyleLayerProperty(
  1. String layerId,
  2. String propertyName
)

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

The value can differ in form from the value that was set: a color set as "#ff0000" reads back as ["rgba", 255, 0, 0, 1].

Completes with no value when the layer doesn't set the property.

See mln_map_get_style_layer_property in the C API reference.

Errors:

  • Status.notFound when the style has no layer named layerId.

Implementation

Future<Object?> getStyleLayerProperty(String layerId, String propertyName) =>
    _queryOptional(
      _resultObjectOrNull,
      (arena, completion) => raw.mln_map_get_style_layer_property(
        _handle.raw,
        nativeStringView(layerId, arena).value,
        nativeStringView(propertyName, arena).value,
        completion,
        nativeDiagnostic,
      ),
    );