Skip to content

[SPEC] gesture system enhancements #1748

Closed as not planned
Closed as not planned

Description

@josxha

Motivation

The user experience can be smoothend if we add zoom level transitions and animation while and after zooming.

Open for comments. It needs to be decided what should get added and what shouldn't or only optionally.

Potential features

  1. Use transparency to blend between zoom levels while zooming
    • Leaflet and the legacy Google raster map use this.
    • The vector map by google does not uses zoom layer blending.
  2. Animated zooming when using the scroll wheel
  3. Option to animate to a full zoom level after gesture input stops, not active by default.
    • GoogleMaps raster tiles are animating to the next full zoom level in the same direction.
    • Leaflet seems to animate to the nearest full zoom level
  4. Use canvas rather than widgets for tiles.
    • GoogleMaps prefered to for better control over the performance.
    • This might have different results with flutter.
  5. Don't request tiles if a zoom level gets skipped when the user zooms fast.
    • This gets calculated by the excepted time a zoom level will be visible according to the zoom speed.
    • Don't show downscaled tiles with a zoom level difference >1. (map would look cluttered, large amount of tiles to draw hurts performance)
  6. Preloading of tiles at surrounding zoom levels
    • Ensures a more smooth transition
    • Greater data consumption
  7. [FEATURE] Adjust fling animation (spring) physics for fast & small drag gestures #1768
  8. [FEATURE] Two fingers tap to zoom out #1432
  9. Animate the rotation of the the ctrl key + click gesture. (ref multi!: rewrite gesture handling #1809)

Scope for flutter_map

ID Feature Default behaviour Optional Requirements & additional information
1 Use transparency to blend between zoom levels while zooming ✅ ❌
2 Animated zooming when using the scroll wheel ✅ ❌
3 Animate to a full zoom level after pinch gesture ends ✅ ✅
5 Don't request tiles if a zoom level gets skipped when the user zooms fast ✅ ❌ only when not noticable
6 Preloading of tiles at surrounding zoom levels to ensure a smooth transition ✅ ✅ ensure that succounding tiles begin to load after the visible tiles are finished
7 More natural fling animation logic ✅ ❌
8 Add the twoFingerTapZoomOut gesture ✅ ✅
9 Animate the keyTriggerClickRotate gesture ✅ ❌

Resources

Activity

  1. JaffaKetchup commented on Dec 2, 2023

    @JaffaKetchup
  2. josxha commented on Dec 2, 2023

    @josxha
    Author
  3. added this to the v7.0 milestone on Dec 2, 2023
  4. JaffaKetchup commented on Dec 2, 2023

    @JaffaKetchup
  5. josxha commented on Dec 7, 2023

    @josxha
    Author
  6. changed the title [-][FEATURE] Improve UX when zooming[/-] [+][FEATURE] Improve UX for gesture input[/+] on Dec 13, 2023
  7. changed the title [-][FEATURE] Improve UX for gesture input[/-] [+][SPEC] Improve UX for gesture input[/+] on Dec 19, 2023
  8. changed the title [-][SPEC] Improve UX for gesture input[/-] [+][SPEC] Improve zooming gestures & system[/+] on Jan 15, 2024
  9. changed the title [-][SPEC] Improve zooming gestures & system[/-] [+][SPEC] gesture system enhancements[/+] on Jan 17, 2024
  10. JosefWN commented on Jan 18, 2024

    @JosefWN
    Contributor

    Minor (macOS/iOS): Essentially the opposite of #1768 (web).

    A small flick in Apple Maps moves the map (animated pan) about ~25 mm on screen, a small flick in flutter_map makes the map jump ~5 mm instantly (from what I can tell, eyeballing). So it feels slightly unnatural, almost as if the map is resting on a table with a lot of friction.

  11. JaffaKetchup commented on Jan 20, 2024

    @JaffaKetchup
    Member

    Ah, I wonder if FM feels so frictiony, at least in comparison to Google Maps because GM's 'friction' changes dependent on the cursor's distance from the equator. On the equator, the dragged point stays beneath the cursor the entire way, but on more extreme latitudes, the initially dragged point lags significantly behind the cursor.

    a small flick in flutter_map makes the map jump ~5 mm instantly (from what I can tell, eyeballing)

    I'm assuming you mean with the fling animation disabled?

  12. JosefWN commented on Jan 20, 2024

    @JosefWN
    Contributor

    I'm assuming you mean with the fling animation disabled?

    With the fling animation enabled, that's why it feels a bit off for lighter flicks on the touch pad (very small instant movement, no animation that I can perceive).

  13. mootw commented on Jul 5, 2024

    @mootw
    Contributor

    Considerations:

    I recently found trouble when trying to capture pan events. I needed to capture horizontalDrag and verticalDrag separately rather than what i would intuitively think would be a pan in GestureDetector with AbsorbPointer

    Also i noticed that gesture detector has support for mapping scroll events to scale events (scale = zoom in flutter gestures). I wonder if we can tap into that to integrate closer to how flutter handles gestures.

    Gesture Detector 'mapping' to our terminology:
    Scale would be zooming and rotation using a pinch gesture.
    pan would be a single finger drag
    (tap is tap... long... etc..)

  14. josxha commented on Jul 6, 2024

    @josxha
    ContributorAuthor

    I recently found trouble when trying to capture pan events. I needed to capture horizontalDrag and verticalDrag separately rather than what i would intuitively think would be a pan in GestureDetector with AbsorbPointer

    There is an open issue here: #1729

    Gesture Detector 'mapping' to our terminology:
    Scale would be zooming and rotation using a pinch gesture.
    pan would be a single finger drag
    (tap is tap... long... etc..)

    I tried to follow this approach in #1809. The pr uses the scale callbacks but doesn't use pinch at the moment. There was some incompatibility between some GestureDetector callbacks. Could be that that's the reason it isn't used but I'm not sure.

  15. removed this from the v7.0 milestone on Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions