addCustomGeometrySource method
- String sourceId,
- CustomGeometrySourceOptions options
Adds a source whose GeoJSON tiles come from callbacks.
See mln_map_add_custom_geometry_source 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> addCustomGeometrySource(
String sourceId,
CustomGeometrySourceOptions options,
) => _command((arena, completion) {
final registrations = _NativeRegistrations(_callbackRoots);
return registrations.run(
() => raw.mln_map_add_custom_geometry_source(
_handle.raw,
nativeStringView(sourceId, arena).value,
registrations.add(
_prepareCustomGeometrySourceOptions(options, registrations.roots),
),
completion,
nativeDiagnostic,
),
);
});