addInteraction<T extends TypedFeaturesetFeature<FeaturesetDescriptor>> method

  1. @experimental
void addInteraction<T extends TypedFeaturesetFeature<FeaturesetDescriptor>>(
  1. TypedInteraction<T> interaction, {
  2. String? interactionID,
})

Add an interaction to the map An identifier can be provided, which you can use to remove the interaction with .removeInteraction(interactionID)

Implementation

@experimental
void addInteraction<T extends TypedFeaturesetFeature<FeaturesetDescriptor>>(
    TypedInteraction<T> interaction,
    {String? interactionID}) {
  final id = interactionID ?? UniqueKey().toString();
  _interactionsMap.interactions[id] = _InteractionListener<T>(
    onInteractionListener: interaction.action,
    interactionID: id,
  );
  _InteractionsListener.setUp(_interactionsMap,
      binaryMessenger: _mapboxMapsPlatform.binaryMessenger,
      messageChannelSuffix: _mapboxMapsPlatform.channelSuffix.toString());
  _mapboxMapsPlatform.addInteractionsListeners(interaction, id);
}