Listen To Events
When changes happen to FlutterMap's internal state (such as a change to the current MapCamera) it emits a MapEvent, which can be handled by you.
Catching All Events
There's two methods to catch all emitted MapEvents. These methods expose the raw MapEvent, and is recommended in cases where multiple events need to be caught, or there's no more specific callback method available in MapOptions (see Catching Specific Events).
Listening to a
MapController'smapEventStream, which exposes events via aStreamSpecifying a callback method in
MapOptions.onMapEvent
Catching Specific Events
If only a couple of events need to be caught, such as just an onTap handler, it is possible to avoid handling the raw Stream of MapEvents. Instead, MapOptions has callbacks available for the following events:
onTaponLongPressonPositionChangedonPointerDown/onPointerUp/onPointerHover/onPointerCancelonMapReadyPrimarily used for advancedMapControllerUsage Inside initState()
Last updated
Was this helpful?