addImageSourceImage method
- String sourceId,
- List<
LatLng> coordinates, - PremultipliedRgba8Image image
Adds an image source that shows image.
coordinates are the image's four corners, clockwise from the top left.
See mln_map_add_image_source_image in the
C API reference.
Errors:
Status.alreadyExistswhen the style already has a source namedsourceId.Status.invalidStatewhile the style isn't loaded, asMapHandle.setStyleUrl()describes.
Implementation
Future<CommandCompletion> addImageSourceImage(
String sourceId,
List<LatLng> coordinates,
PremultipliedRgba8Image image,
) => _command((arena, completion) {
final nativecoordinates = arena<raw.mln_lat_lng>(
coordinates.isEmpty ? 1 : coordinates.length,
);
for (var index = 0; index < coordinates.length; index++) {
_writeLatLng(coordinates[index], arena, into: nativecoordinates + index);
}
return raw.mln_map_add_image_source_image(
_handle.raw,
nativeStringView(sourceId, arena).value,
nativecoordinates,
coordinates.length,
_writePremultipliedRgba8Image(image, arena),
completion,
nativeDiagnostic,
);
});