-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Disable drag rotate if touch detected #3457
Conversation
A long press touch is interpreted by the browser as a right click, which causes the drag rotate to start a rotation. Subsequent touches perform the rotation, which causes the map to erratically rotate around. If a touch start event is detected, just disable the feature.
this._enabled = false; | ||
} | ||
|
||
_onTouchStart() { | ||
this.disable(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we ever need to re-enable drag rotate after a touchstart event?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, on devices that have both touch screen and mouse (e.g Windows Surface Book and almost all modern Windows 10 laptops), drag rotate should be enabled when mouse interaction starts.
This can be tested on desktop chrome using the following steps:
- Use toggle device toolbar in desktop Chrome and switch to "Nexus 6P". Long press.
- In the same debugging session, tap on toggle device toolbar to switch back to regular desktop chrome. Dragpan rotate should work (at least after first mouse click instead of being permanently disabled).
Launch Checklist
|
My opinion is no. There is no meaningful way to interact with it in its |
I see. We're using the existence of the |
Some devices may have both touch events AND mouse events (i.e. the Chromebook Pixel). We can support those devices seamlessly if we enable the |
This may necessitate using a mechanism other than |
Launch Checklist
|
Hey @ChrisBellew -- I'm in the process of cleaning out our PR queue and it looks like there hasn't been any activity on this one recently. If you're still interested in coming back to it, please let us know and we'll be happy to help you get it to completion. Until then, I'm going to close it out. Thanks again for your contributions! |
A long press touch is interpreted by the browser as a right click,
which causes the drag rotate to start a rotation. Subsequent touches
perform the rotation, which causes the map to erratically rotate
around. If a touch start event is detected, just disable the feature.
As recommended by @bhousel in #2204