LongClickInteraction

Defines the long click interaction.

Refer to static factory methods to create the LongClickInteraction:

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

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

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

  4. invoke (meaning empty constructor in Kotlin and static method map in Java) to register the long click interaction for the map surface itself.

Long click interaction callback requires returning true | false where true means that the interaction has been consumed and other registered long click interactions will not have the callback invoked and false means that the interactions has not been consumed and other registered long click interactions (if any) will have the callback invoked.

Long 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. LongClickInteraction.invoke (map surface long click interaction outside of all the feature sets) will always get triggered last.

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

Types

Link copied to clipboard
object Companion

Static variables and methods.