feature

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

Add a Feature to the GeojsonSource. Data will be parsed from collection to String in a worker thread and use main thread to pass this data to gl-native.

In order to capture events when actual data is drawn on the map please refer to Observer API and listen to MapEvents.SOURCE_DATA_LOADED (optionally pass data-id to filter the events) or MapEvents.MAP_LOADING_ERROR with type = metadata 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

Throws