Skip to content

Conversation

@ben-milanko
Copy link

This PR makes some minor changes to the drag behaviour aimed at improving the experience on web and desktop.

First, if the cursor leaves the screen while dragging, the fling drag behaviour will send the map camera moving in the opposite direction.

Before:

Screen.Recording.2025-10-18.at.14.11.15.mov

After:

Screen.Recording.2025-10-18.at.14.09.54.mov

Secondly, I would like to modify the damping behaviour of the fling for desktop users. This has been made part of the public API via InteractionOptions the default has been left per the current.

I've found a value of 2 is closer to the behaviour of Google Maps on web.

@JaffaKetchup JaffaKetchup requested a review from a team October 18, 2025 09:53
@JaffaKetchup
Copy link
Member

Hey, thanks for submitting a PR! These look like good improvements.

It would be great if the new behaviour of reversing the direction of movement of the cursor leaves the edge of the screen was also toggleable. Does Google Maps and/or Leaflet on web behave the same way (sorry, I can't check right now)?

I'm not able to test any changes right now, but I'll review and hopefully merge once I return.

@ben-milanko
Copy link
Author

Hey @JaffaKetchup ,
The current behaviour is that the fling reverses direction as the cursor leaves the screen. The new behaviour proposed in this PR is that the fling maintains its direction. This new behaviour matches what I can see in Leaflet and Google Maps.

@JaffaKetchup
Copy link
Member

Ah sorry, misread! Ok, I'll have a look :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants