geometry

fun geometry(value: Geometry, dataId: String = ""): GeoJsonSource

Add a Geometry to the GeojsonSource. The data will be scheduled and applied on a worker thread.

In order to capture events when actual data is drawn on the map please refer to Observer API and listen to SourceDataLoaded (optionally pass data-id to filter the events) or MapLoadingError with type = metadata if data parsing error has occurred.

Note: This method is not thread-safe. The Geometry is parsed on a worker thread, please make sure the Geometry is immutable as well as all collections that are used to build it.

Parameters

value

the geometry

dataId

optional metadata to filter the SOURCE_DATA_LOADED events later. Empty string is treated as no data id.