feature

fun feature(value: Feature, dataId: String = ""): GeoJsonSource

Add a Feature 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 = source if data parsing error has occurred.

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

Parameters

value

the feature

dataId

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