skip to Main Content

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?

2

Answers


  1. To disable map rotation in flutter_map while zooming, you can use the MapOptions class and set the interactiveFlags property. However, the InteractiveFlag.pinchZoom flag is not specifically related to map rotation. To disable map rotation, you can use the InteractiveFlag.rotate flag

    MapOptions(
      interactiveFlags: InteractiveFlag.pinchZoom | InteractiveFlag.drag | InteractiveFlag.rotate,
      zoom: 15.0,
    ),
    
    Login or Signup to reply.
  2. Add "InteractiveFlag.rotate" inside.

    MapOptions(
    
    interactiveFlags: InteractiveFlag.pinchZoom | InteractiveFlag.drag | 
    InteractiveFlag.rotate,
    zoom: 15.0,
    ),
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search