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

Consider adding "Gesture Handling" #129

Closed
Malvoz opened this issue Aug 12, 2020 · 4 comments
Closed

Consider adding "Gesture Handling" #129

Malvoz opened this issue Aug 12, 2020 · 4 comments

Comments

@Malvoz
Copy link
Member

Malvoz commented Aug 12, 2020

Use case:
https://maps4html.org/HTML-Map-Element-UseCases-Requirements/#use-case-require-interaction

Real-world issue in regards to Leaflet maps, described here:
https://gis.stackexchange.com/questions/200189/cant-continue-scrolling-on-mobile-devices-when-a-map-occupy-all-the-screen

Leaflet plugin:
https://github.com/elmarquis/Leaflet.GestureHandling (see demo).

@prushforth
Copy link
Member

What might the MapML API for this be? Would it be accessible via attributes, properties or both, or some other means ?

@Malvoz
Copy link
Member Author

Malvoz commented Aug 18, 2020

I'm not sure... anyhow it may be that the GestureHandling plugin is inadequate though, because unlike Google Maps' "cooperative gesture handling", it doesn't allow single finger dragging to pan after the fact that you've used 2 fingers to initialize panning, which makes it kinda awkward because it's impossible to pan the map display without also making it zoom at the same time.

@prushforth
Copy link
Member

I worry about adding innovative things like the Google cooperative gesture handling without their being directly involved, for the reason that stuff like that may be patented, and it's hard to tell. Anyway we can keep it here and maybe Google will show up and help us with the implementation. FWIW it looks like it the markup "interface" might be as simple as a boolean attroproperty.

@Malvoz
Copy link
Member Author

Malvoz commented Sep 14, 2020

I was only making a comparison between the 2 implementations; one implementation improves the user experience, and the other one tries to, but makes it worse in some sense (i.e. the suggested plugin is inadequate).

There's a more subtle approach which isn't as robust but helps in avoiding users getting trapped in the map when "drive-by" scrolling: https://github.com/CliffCloud/Leaflet.Sleep. I've found that I usually don't get trapped when quickly scrolling over a map with a mouse pointer on desktop, perhaps due to browser heuristics, however on a mobile device it seems that I get scroll captured in the default Leaflet implementation, but not in the Leaflet.Sleep demo.

Anyhow, I'm starting to doubt that there should be standardization around "require interaction before allowing pan/zoom", as stated in the UCR issue: this is a problem with iframes too (or any overflowing element that takes up enough space in the viewport). Perhaps developers should just take responsibility and make sure they don't trap their users, unless of course, it is the intention that the map should take up all of the viewport.

@Malvoz Malvoz closed this as completed Sep 14, 2020
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

2 participants