Click Interaction
Defines the click interaction.
Refer to static factory methods to create the ClickInteraction:
Mapbox Standard Style interactive features in defined as
ClickInteraction.standard<featureset_name>
(e.g. ClickInteraction.Companion.standardPoi).featureset to register the click interaction for given
featuresetId
and optionalimportId
(when defining the interaction for an imported style).layer to register the click interaction for given
layerId
.invoke (meaning empty constructor in Kotlin and static method
map
in Java) to register the click interaction for the map surface itself.
Click interaction callback requires returning true
| false
where true
means that the interaction has been consumed and other registered click interactions will not have the callback invoked and false
means that the interactions has not been consumed and other registered click interactions (if any) will have the callback invoked.
Click interactions callbacks are fired in determined order:
For unique feature sets defined as FeaturesetDescriptor - the top most rendered feature will trigger the callback first.
ClickInteraction.invoke (map surface click interaction outside of all the feature sets) will always get triggered last.
When having several ClickInteractions with the same FeaturesetDescriptor / map surface (see point 2) - the last registered ClickInteraction will be triggered first.