addInteraction<T extends TypedFeaturesetFeature<FeaturesetDescriptor> > method
- @experimental
- TypedInteraction<
T> interaction, { - 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);
}