ClickInteraction

Defines the click interaction.

Refer to static factory methods to create the ClickInteraction:

  1. Mapbox Standard Style interactive features in defined as ClickInteraction.standard<featureset_name> (e.g. ClickInteraction.Companion.standardPoi).

  2. featureset to register the click interaction for given featuresetId and optional importId (when defining the interaction for an imported style).

  3. layer to register the click interaction for given layerId.

  4. 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:

  1. For unique feature sets defined as FeaturesetDescriptor - the top most rendered feature will trigger the callback first.

  2. ClickInteraction.invoke (map surface click interaction outside of all the feature sets) will always get triggered last.

  3. When having several ClickInteractions with the same FeaturesetDescriptor / map surface (see point 2) - the last registered ClickInteraction will be triggered first.

Types

Link copied to clipboard
object Companion

Static variables and methods.