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

Closed
micheljung opened this issue May 22, 2024 · 2 comments
Closed

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

micheljung opened this issue May 22, 2024 · 2 comments
Labels
bug This issue reports broken functionality or another error S: core Scoped to the core flutter_map functionality stale This issue has not been received updates for a long time.

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

@JaffaKetchup JaffaKetchup added S: core Scoped to the core flutter_map functionality stale This issue has not been received updates for a long time. and removed needs triage This new bug report needs reproducing and prioritizing labels Dec 3, 2024
@JaffaKetchup
Copy link
Member

If this issue still persists after setting enableMultiFingerGestureRace, please ping me! I'll try to remember to document this somewhere.

@JaffaKetchup JaffaKetchup closed this as not planned Won't fix, can't repro, duplicate, stale Dec 3, 2024
@github-project-automation github-project-automation bot moved this from To do to Done in Development Dec 3, 2024
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 S: core Scoped to the core flutter_map functionality stale This issue has not been received updates for a long time.
Projects
Archived in project
Development

No branches or pull requests

3 participants