zakjan / leaflet-lasso

Lasso selection plugin for Leaflet

Home Page:https://zakjan.github.io/leaflet-lasso/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Workarounds to make leaflet-lasso work with touch devices (with Leaflet version 1.6.0 and above)

bucherc opened this issue · comments

Hello,

There is a closed issue:
#27

where you added support for touch devices by adding touch events to the map container (thank you!)

This works great with leaflet version 1.5.1 (your demo link uses this version of leaflet)

Unfortunately when you uptick the version of leaflet to anything above 1.5.1 the touch events no longer work on mobile / tablet touchscreen devices

Here is the change log for leaflet:
https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md

Would you be able to point me in the right direction to resolve this as we are using Leaflet 1.7.1 and can not go down to version 1.5.1.

Any help would be greatly appreciated.

Thanks,
-Chris Bucher

Thanks @bucherc for the report! I found out that it's caused by Leaflet simulating touch events with mouse events. Since leaflet-lasso handles touch events explicitly, it seems safe to ignore these simulated events. Could you test just released 2.2.4?

The screenshot didn't come through :)

Looks good! I worked on a similar water system map in past as well.