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

Polygon issues on IE11 #618

Open
Greigrm opened this issue Oct 22, 2016 · 21 comments
Open

Polygon issues on IE11 #618

Greigrm opened this issue Oct 22, 2016 · 21 comments
Labels

Comments

@Greigrm
Copy link

Greigrm commented Oct 22, 2016

Seeing a couple of issues with IE11 and the polygon feature. Release 0.4.1 / Leaflet 1.0

Firstly - intersections are constantly warned about (incorrectly) - can be seen in github example.
Secondly - you can never click the first point to complete the shape.

@ddproxy
Copy link
Member

ddproxy commented Oct 24, 2016

Notes:

  1. Something is not binding?
  2. Related to a touch handler

I'll look into this, thanks

@WangJi
Copy link

WangJi commented Oct 25, 2016

Draw Polygon fails on Edge too.
It's hard to click on the first point to close the polygon,
The node-icon displays in Edge is in 20px 20px size, while by default it should be 8px 8px.
image

@WangJi
Copy link

WangJi commented Oct 25, 2016

L.Browser.touch = false; is a ugly fix

@ddproxy
Copy link
Member

ddproxy commented Oct 25, 2016

I agree this is an issue with touch. Ugly fix too, but this is severely browser dependent.

@Greigrm
Copy link
Author

Greigrm commented Oct 25, 2016

Yes, setting L.Browser.touch to false only under IE works for me - thanks. Happy for you to close this.

@richardhinkamp
Copy link

Setting L.Browser.touch = false; gives normal sized node icon but closing the polygon is still nearly impossible. Same for ending a polyline by clicking on the last node.

I'm using leaflet 1.0.2 and draw 0.4.7.

Having this issue in IE11 and Edge, also with Safari on iPad.

With Chrome on Android it closes the polygon, but also adds an extra node close the starting node, so that seems to do both adding a node and closing the polygon.

@ddproxy
Copy link
Member

ddproxy commented Dec 8, 2016

Are you targeting touch devices or both?

@richardhinkamp
Copy link

We have users with ipads, android tablets, all desktop browsers and all desktop browsers with touchscreens, so pretty much everything. We might get away with disabling draw capabilities for touchscreens on desktop browsers, forcing them to use the mouse.

@B3nCr
Copy link

B3nCr commented Dec 8, 2016 via email

@richardhinkamp
Copy link

Well since L.Browser.touch is always true in IE, even with no touchscreen, that makes sense.

@richardhinkamp
Copy link

I've been doing a little digging. When enabling a L.Draw.Polygon on the first click 2 touch events and 1 mouse up event occur. So it adds 3 markers to the map at the same location. Clicking on that marker will click the one at the top, which is the 3rd and so you can never click the first marker. This is in IE11 which behaves as pointer AND touch. Will need to check what happens on ipad, maybe just 2 touch events which results in the same problem.

So there is a bug in the event handling, but maybe draw can get smarter too. When drawing a polyline or polygon, multiple consecutive markers at the same location make no sense and could be filtered?

@B3nCr
Copy link

B3nCr commented Dec 8, 2016 via email

@germanjoey
Copy link

germanjoey commented Dec 8, 2016 via email

@germanjoey
Copy link

germanjoey commented Dec 9, 2016 via email

@germanjoey
Copy link

germanjoey commented Dec 9, 2016 via email

@ddproxy
Copy link
Member

ddproxy commented Dec 9, 2016

So, this is legacy... old... detection code. Apparently the algorithm used doesn't detect some complex cases - which I can only imagine as spirals?

@richardhinkamp
Copy link

I got a simple fix for not adding double markers, which fixes some issues. iPad works, IE has still some issues because mouse+touch events. I noticed some more weird event stuff, 1 mousedown followed by a double mouseup, double touch events. I guess broken events should be fixed first. I'll see if I can find anything.

@richardhinkamp
Copy link

Double events seem to be a leaflet problem with PointerEvent, being worked on: Leaflet/Leaflet#5180 This occurs in IE11 and Chrome 55+. When that's fixed, this issue can (hopefully) be properly fixed.

@z0d14c
Copy link

z0d14c commented Dec 13, 2016

I have a fix for the "difficulty closing the polyline/polygon" issue in my PR: #654

Unfortunately, the duplicated pointerevent/clicks/touches issue persists. I have a fork of the 0.4.3 version of Leaflet-draw where this does not occur that we've been using in production, so it must be some changed in Leaflet/Leaflet-draw that has occurred since then (possibly in conjunction with chrome updates) which causes these issues.

@cosme-benito
Copy link

cosme-benito commented Dec 26, 2016

Any updates regarding the oversized square node icons?

I am aware that setting L.Browser.touch = false; might fix it but we have users with touch devices so this is not really desired... In the meanwhile I made a stupid workaround, which is far from perfect but at least mitigates the issue:
L.Browser.touch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0));

@mlazowik
Copy link

Some of these got resolved in #661, right?

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

No branches or pull requests

9 participants