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

TouchExtend brakes map dragging #935

Closed
johnd0e opened this issue May 22, 2019 · 2 comments
Closed

TouchExtend brakes map dragging #935

johnd0e opened this issue May 22, 2019 · 2 comments

Comments

@johnd0e
Copy link

johnd0e commented May 22, 2019

How to reproduce

  • Leaflet / Draw versions are same as in official examples
  • Browser (with version) I'm using: Google Chrome 74.0.3729.157 (Official Build) (32-bit)
  • OS/Platform (with version) I'm using: Windows 10 (32-bit)

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

When in polyline/polygon drawing mode it's possible to drag the map, but besides of dragging every click makes new point, which is undesirable.

It's possible to fix this by disabling touch handler (map.touchExtend.disable()).
After this:

  • we can drag safely, without making unneeded points
  • we still can make new points with simple clicks (without dragging)

Unfortunately with disabled handler we lost 2 abilities

  • draw circle/rectangle on touch device
  • draw anything with mouse attached to touch device

I suppose we need to completely revise TouchEvents.js, as there are too many bugs (see Issues)

Minimal example reproducing the issue

https://leaflet.github.io/Leaflet.draw/docs/examples/full.html

@johnd0e
Copy link
Author

johnd0e commented Jan 17, 2020

Seems same issue as #695, #729

@johnd0e
Copy link
Author

johnd0e commented Jan 22, 2020

Fix:

  L.Draw.Polyline.prototype._onTouch = L.Util.falseFn;

Note:
Make sure that L.Map.Tap handler is not enabled.

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

No branches or pull requests

1 participant