Skip to content

Unintentional rotation of the map when zooming in or out #2232

Description

@Steeve-movi

What is the bug?

Unexpected map rotation when zooming on mobile devices

Description

Hello flutter_map team,

I noticed an unexpected behavior when using flutter_map on mobile devices.

When performing a pinch-to-zoom gesture, the map sometimes rotates automatically even though the user did not intend to rotate the map.

Steps to reproduce

  1. Open a Flutter application using flutter_map.
  2. Display a map on an Android or iOS device.
  3. Use two fingers to perform a normal pinch zoom gesture.
  4. Slightly move the fingers during the zoom action.

Expected behavior

The map should only zoom in/out and keep the current rotation unchanged.

Actual behavior

The map rotates during the zoom gesture without an explicit rotation gesture from the user.

Environment

  • Package: flutter_map
  • Platform: Android / iOS
  • Device: Physical mobile device
  • Flutter version: [add version]
  • flutter_map version: [add version]

Possible improvement

It could be useful to add a gesture threshold or a configuration option to disable accidental rotation during pinch zoom, especially on mobile devices.

Thank you for your work on this package.

unintentional_rotation._map.mp4

How can we reproduce it?

How can we reproduce it?

  1. Create a Flutter app using flutter_map.
  2. Add a FlutterMap widget with default gesture interactions enabled.
  3. Run the app on a physical mobile device (Android/iOS).
  4. Place two fingers on the map and perform a normal pinch-to-zoom gesture.
  5. While zooming, slightly change the distance/position of the fingers (without intentionally rotating).

The map may start rotating even though no rotation gesture was intended.

Do you have a potential solution?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis new bug report needs reproducing and prioritizing

    Type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions