-
-
Notifications
You must be signed in to change notification settings - Fork 871
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
[FEATURE] Add option to zoom to map center instead of cursor location #2001
Comments
(This may be related (the solution) to #1905) |
(Sorry about that) |
(Also see #1905 (comment)) |
Trackpad zooming is bugged. See these lines: flutter_map/lib/src/gestures/map_interactive_viewer.dart Lines 630 to 647 in 48832da
These lines are also used when a touchscreen zoom is used. I'm not sure whether there is an easy way to change this, but it's causing issues. The existing lines (shown below) works correctly on touchscreen and when trying to move using two fingers on a trackpad. - final newCenterPt = oldCenterPt + zoomDifference + moveDifference;
+ final newCenterPt = oldCenterPt + zoomDifference; |
What do you want implemented?
At the moment, zooming with a cursor zooms into the cursor location, which is what most use cases would require. However, some applications may prefer to have the map zoom into the center, regardless of the cursor location.
This has been requested twice in the Discord server: https://discord.com/channels/951867686378409984/1317675189701705778/1317675189701705778, https://discord.com/channels/951867686378409984/1166739850137980958/1166739850137980958
This should work for trackpad as well, as requested in #1905.
What other alternatives are available?
The second link's workaround was to play an animation immediately after the gesture has stopped to move the map back to the desired center, and move the desired marker/widget around to stay in the correct geographic position instead of screen center.
It may also be possible to use constraints to prevent moving during zoom?
Can you provide any other information?
No response
Severity
Annoying: Currently have to use workarounds
The text was updated successfully, but these errors were encountered: