setStyleImage method

Future<CommandCompletion> setStyleImage(
  1. String imageId,
  2. PremultipliedRgba8Image image, {
  3. StyleImageOptions? options,
})

Adds an image to the map's style, or replaces the image named imageId.

See mln_map_set_style_image in the C API reference.

Errors:

  • Status.invalidState while the style isn't loaded, as MapHandle.setStyleUrl() describes.

Implementation

Future<CommandCompletion> setStyleImage(
  String imageId,
  PremultipliedRgba8Image image, {
  StyleImageOptions? options,
}) => _command(
  (arena, completion) => raw.mln_map_set_style_image(
    _handle.raw,
    nativeStringView(imageId, arena).value,
    _writePremultipliedRgba8Image(image, arena),
    options == null ? nullptr : _writeStyleImageOptions(options, arena),
    completion,
    nativeDiagnostic,
  ),
);