How to disable map rotation in flutter_map while zooming?
I tried this way:
MapOptions(
interactiveFlags: InteractiveFlag.pinchZoom | InteractiveFlag.drag,
zoom: 15.0,
),
But this always disable rotation. I only want to temporarily disable rotation when zooming. Is this possible?
With the release of V6, you can achieve this via the interactionOptions parameter.
Here is a code sample for reference:
FlutterMap(
options: MapOptions(
//...
interactionOptions: const InteractionOptions(
enableMultiFingerGestureRace: true,
flags: InteractiveFlag.doubleTapDragZoom |
InteractiveFlag.doubleTapZoom |
InteractiveFlag.drag |
InteractiveFlag.flingAnimation |
InteractiveFlag.pinchZoom |
InteractiveFlag.scrollWheelZoom,
),
// ...