Leaflet: TouchZoom Disable causes dragging to not work correctly

Created on 13 Sep 2017  路  2Comments  路  Source: Leaflet/Leaflet

How to reproduce

  • Leaflet version I'm using: 1.2.0
  • Browser (with version) I'm using: Chrome Version 61.0.3163.79 (Official Build) (64-bit)
  • OS/Platform (with version) I'm using: Windows 10

Call map.touchZoom.disable(); and then begin panning the map using touch events.

What behaviour I'm expecting and which behaviour I'm seeing

Expect panning the map to continue to work the way it does before touchZoom is disabled.
Instead, the map moves a few pixels and then a pointer cancel event causes the pan to stop.
If you do not have a touch screen, you may open Chrome developer tools and toggle the device toolbar to select a mobile device and simulate touch events with a mouse.

Minimal example reproducing the issue

http://jsfiddle.net/3jprmbjv/

bug

Most helpful comment

I've managed to solve this issue which affected mobile chrome browsers. You need to edit leaflet.css, add the following to .leaflet-container at line 243.
-ms-touch-action: none; touch-action: none;

You should then end up with:
.leaflet-container { background: #ddd; outline: 0; -ms-touch-action: none; touch-action: none; }

Fixed it for me!

All 2 comments

This is probably a terrible, horrible, no good, very bad idea, but as a temporary workaround I attempted to set L.Browser.pointer = false, which would not stick for some reason, so I am instead setting window.PointerEvent = null before the app starts up. With minimal testing, it seems to be working for my needs.

I've managed to solve this issue which affected mobile chrome browsers. You need to edit leaflet.css, add the following to .leaflet-container at line 243.
-ms-touch-action: none; touch-action: none;

You should then end up with:
.leaflet-container { background: #ddd; outline: 0; -ms-touch-action: none; touch-action: none; }

Fixed it for me!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

arminghm picture arminghm  路  3Comments

timwis picture timwis  路  3Comments

onethread picture onethread  路  3Comments

JonnyBGod picture JonnyBGod  路  4Comments

zdila picture zdila  路  3Comments