setImageSourceCoordinates method
Moves the image of an image source.
coordinates are the image's four corners, clockwise from the top left.
See mln_map_set_image_source_coordinates in the
C API reference.
Errors:
Status.notFoundwhen the style has no source namedsourceId.Status.invalidArgumentwhen the source namedsourceIdisn't an image source.Status.invalidStatewhile the style isn't loaded, asMapHandle.setStyleUrl()describes.
Implementation
Future<CommandCompletion> setImageSourceCoordinates(
String sourceId,
List<LatLng> coordinates,
) => _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_set_image_source_coordinates(
_handle.raw,
nativeStringView(sourceId, arena).value,
nativecoordinates,
coordinates.length,
completion,
nativeDiagnostic,
);
});