queryRenderedFeatures

fun queryRenderedFeatures(offset: DpOffset, layerIds: Set<String>? = null, predicate: Expression<BooleanValue> = const(true)): List<Feature>(source)

Returns a list of features that are rendered at the given offset from the top-left corner of the map composable, optionally limited to layers with the given layerIds and filtered by the given predicate. The result is sorted by render order, i.e. the feature in front is first in the list.

Parameters

offset

position from the top-left corner of the map composable to query for

layerIds

the ids of the layers to limit the query to. If not specified, features in any layer are returned

predicate

expression that has to evaluate to true for a feature to be included in the result


fun queryRenderedFeatures(rect: DpRect, layerIds: Set<String>? = null, predicate: Expression<BooleanValue> = const(true)): List<Feature>(source)

Returns a list of features whose rendered geometry intersect with the given rect, optionally limited to layers with the given layerIds and filtered by the given predicate. The result is sorted by render order, i.e. the feature in front is first in the list.

Parameters

rect

rectangle to intersect with rendered geometry

layerIds

the ids of the layers to limit the query to. If not specified, features in any layer are returned

predicate

expression that has to evaluate to true for a feature to be included in the result