flutter_map
flutter_map copied to clipboard
[FEATURE] Adjust fling animation (spring) physics for fast & small drag gestures
What is the bug?
On web, when using mousedown-drag-mouseup to move the map, even a small distance (e.g. 20px) causes the map to move a far distance (e.g. 1 full window width).
Expected behavior (industry standard) is much less acceleration. See Google Maps, Bing Maps, and Apple Maps.
How can we reproduce it?
Do you have a potential solution?
No response
Platforms
web
Severity
Obtrusive: Prevents normal functioning but causes no errors in the console
On web, when using mousedown-drag-mouseup to move the map, even a small distance (e.g. 20px) causes the map to move a far distance (e.g. 1 full window width).
Can't reproduce the described problem. See my video below. Please provide information about
- the browser you are using
- the operating system
- the specific version of flutter_map you are using
How can we reproduce it?
This input field has a reason. Please let us know
- if you are using the demo app
- if you use your own implementation. If yes, provide us with a minimal example of your FlutterMap widget.
https://github.com/fleaflet/flutter_map/assets/34318751/96b45d88-51d6-4ce0-96ec-da305d9f0e69
Thanks @josxha I have added a video: https://youtu.be/dpOsD97LxMk
flutter_map: small drag causes large position changes, up to a whole screen width (small fling causes high velocity) google maps: small drag causes small position change (small fling causes low velocity)
By the way, I vaguely remember Maplibre Native (for Flutter) had similar issues with getting "natural" (industry average) drag behavior (but that was for touch drag, not mouse pointer, but probably the same), but that it was fixed 3-6 months ago (in development branch). I haven't tested their code since, it's only now that I'm getting back into using a map widget.
My position is that it's easy to gain Flutter adoption if users are not surprised by the behavior of widgets. Users expect what they're used to, e.g. that of native Apple/Google Maps, so that is my reference for "expected behavior".
Thanks a lot for the additional information and video. I added it to https://github.com/fleaflet/flutter_map/pull/1733.
If you dont mind I'll ping you when the changes are implemented so that you can test it?