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

Momentum/Inertial panning and zooming? #574

Closed
femski opened this issue Aug 10, 2018 · 8 comments
Closed

Momentum/Inertial panning and zooming? #574

femski opened this issue Aug 10, 2018 · 8 comments

Comments

@femski
Copy link

femski commented Aug 10, 2018

It seems when you pan and zoom Map - there is no inertial panning/zoom.
This affects mobile platforms like ios safari.
Original Mapbox-gl-gs does have it. so it must be that react-map-gl is suppressing it.
Is it possible to restore it ? Will you support inertial/momemum panning and zooming on mobile?

@femski femski changed the title Momentum/Interial panning and zooming? Momentum/Inertial panning and zooming? Aug 10, 2018
@pr1ntr
Copy link

pr1ntr commented Aug 27, 2018

I think this would be a really great touch

@mayteio
Copy link

mayteio commented Jul 4, 2019

+1

@derwaldgeist
Copy link

derwaldgeist commented Jan 19, 2020

Just stumbled upon this when I compared the features of this library to the alternative react-mapbox-gl library. It really feels weird that react-map-gl does not support inertia panning. It's 2020 :-)

@Pessimistress
Copy link
Collaborator

@derwaldgeist Sorry to disappoint you, but I'm maintaining this library on my own time and I do not have the devices needed to sufficiently test mobile support.

What needs to happen is in https://github.com/uber/react-map-gl/blob/a71cdf9ba27fcbec638b5326733cec1b1d5420aa/src/utils/map-controller.js#L252-L257 instead of stopping immediately we need to figure out a new end position with inertia taken into consideration, along with use a reasonable transition duration/easing function. I am happy to assist whoever wants to give this a shot.

@mayteio
Copy link

mayteio commented Jan 20, 2020

@Pessimistress you are a legend for maintaining this - I thought it was under the uber umbrella! Seems like the original code for mapbox-gl-js is here: https://github.com/mapbox/mapbox-gl-js/blob/master/src/ui/handler/drag_pan.js#L171 which includes touch events. I can give it a crack this week (and encourage anyone else to as well!)

@derwaldgeist
Copy link

derwaldgeist commented Jan 20, 2020

@Pessimistress @mayteio Thanks for answering that fast, highly appreciated!

@RobJacobson
Copy link

Ditto! I've also missed inertial panning. That's the default in both Google Maps and Mapbox GL JS, so it feels "weird" to me when panning stops abruptly when using a react-map-gl map.

I noticed that version 1.6.0 of the Mapbox library added support for "configurable inertia panning." Would this be useful for @mayteio?

@Pessimistress
Copy link
Collaborator

This will be addressed in v5.3/v6.1. Currently available in 6.1.0-beta.1.

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

No branches or pull requests

6 participants