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

Customize inertia values from drag pan #4851

Closed
jinkwon opened this issue Jun 19, 2017 · 9 comments
Closed

Customize inertia values from drag pan #4851

jinkwon opened this issue Jun 19, 2017 · 9 comments
Labels
feature 🍏 GL native → GL JS For feature parity with Mapbox Maps SDK on a native platform good first issue

Comments

@jinkwon
Copy link

jinkwon commented Jun 19, 2017

mapbox-gl-js version:
Latest version

Steps to Trigger Behavior

No steps. :)

Expected Behavior

There is no way to customize velocity value.
https://github.com/mapbox/mapbox-gl-js/blob/master/src/ui/handler/drag_pan.js#L153

Actual Behavior

I need options to configure velocity value.

@peterqliu
Copy link
Contributor

drag pan is set at a velocity such that the map position under the mouse stays constant throughout the panning motion. How would you propose a configurable velocity would work? Or do you mean the velocity after mouseup/touchend?

@mourner
Copy link
Member

mourner commented Jun 19, 2017

I guess we want these const values exposed as options. E.g. Leaflet allows their customization.

@jinkwon
Copy link
Author

jinkwon commented Jun 20, 2017

@mourner That's what I wanted. 👍

@1ec5 1ec5 added the GL native → GL JS For feature parity with Mapbox Maps SDK on a native platform label Jun 23, 2017
@1ec5
Copy link
Contributor

1ec5 commented Jun 24, 2017

Relatedly, on iOS, we abandoned these options in favor of a default inertial pan that lasts about one second regardless of the strength of the gesture (mapbox/mapbox-gl-native#1266), plus a decelerationRate option (mapbox/mapbox-gl-native#5504). The default was chosen for consistency with scroll views on that platform. It would be nice to be able to tailor the internal panning for touch devices (#949) differently than when using a mouse on a desktop platform.

@jinkwon
Copy link
Author

jinkwon commented Aug 17, 2017

Is there any working progress?

@mourner
Copy link
Member

mourner commented Aug 17, 2017

@jinkwon not at this moment, but we'd of course welcome a pull request.

@jinkwon
Copy link
Author

jinkwon commented Aug 17, 2017

@mourner OK. ;)

@jinkwon jinkwon closed this as completed Aug 17, 2017
@jinkwon jinkwon reopened this Aug 17, 2017
@jinkwon jinkwon changed the title Customize velocity value from drag pan Customize inertia values from drag pan Feb 13, 2018
@ansis
Copy link
Contributor

ansis commented Apr 7, 2020

This was implemented a while back in #8887

@ansis ansis closed this as completed Apr 7, 2020
@dimaShin
Copy link

Hi guys.
Thanks for this feature.
Unfortunately, it seems broken now.
The original implementation of the DragPan enable method had a check to ignore calls when already enabled. However, later this check was removed. This means that any call will rewrite the inertia options. I'm facing this behaviour with the draw library.

@ansis , Github blames you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🍏 GL native → GL JS For feature parity with Mapbox Maps SDK on a native platform good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants