Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] pinchZoomWinGestures, rotationThreshold (etc.?) not working #1887

Open
micheljung opened this issue May 22, 2024 · 1 comment
Open
Labels
bug This issue reports broken functionality or another error needs triage This new bug report needs reproducing and prioritizing

Comments

@micheljung
Copy link

micheljung commented May 22, 2024

What is the bug?

Based on the default options (see below), I would expect that when I pinch-zoom, the map doesn't rotate (because of pinchZoomWinGestures: MultiFingerGesture.pinchZoom | MultiFingerGesture.pinchMove) and that when I pinch-rotate, I need to rotate at least 20° before rotation starts (because of rotationThreshold: 20.0).

However, these settings don't seem to be respected as it's practically impossible to zoom the map without rotating it.

I'm doubting myself because 6.1.0 is 5 months old. This is super basic, and it would surely have been noticed and fixed, but I can't find an open issue.

How can we reproduce it?

flutter_map: 6.1.0
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';

void main() async {
  runApp(
    MaterialApp(
      builder: (context, child) => FlutterMap(
        options: const MapOptions(
          // These are the default options
          interactionOptions: InteractionOptions(
            flags: InteractiveFlag.all,
            debugMultiFingerGestureWinner: false,
            enableMultiFingerGestureRace: false,
            rotationThreshold: 20.0,
            rotationWinGestures: MultiFingerGesture.rotate,
            pinchZoomThreshold: 0.5,
            pinchZoomWinGestures:
                MultiFingerGesture.pinchZoom | MultiFingerGesture.pinchMove,
            pinchMoveThreshold: 40.0,
            pinchMoveWinGestures:
                MultiFingerGesture.pinchZoom | MultiFingerGesture.pinchMove,
            enableScrollWheel: false,
            scrollWheelVelocity: 0.005,
            cursorKeyboardRotationOptions: CursorKeyboardRotationOptions(),
          ),
        ),
        children: [
          TileLayer(
            urlTemplate: "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
            userAgentPackageName: "com.example",
          ),
        ],
      ),
    ),
  );
}
  1. Run on Android
  2. Try zooming without rotating the map

Do you have a potential solution?

No response

Platforms

Android 13 (Galaxy A51)

Severity

Obtrusive: Prevents normal functioning but causes no errors in the console

@micheljung micheljung added bug This issue reports broken functionality or another error needs triage This new bug report needs reproducing and prioritizing labels May 22, 2024
@nkming2
Copy link

nkming2 commented Sep 17, 2024

You need to set enableMultiFingerGestureRace to true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue reports broken functionality or another error needs triage This new bug report needs reproducing and prioritizing
Projects
Status: To do
Development

No branches or pull requests

2 participants