Open Greigrm opened 8 years ago
Notes:
I'll look into this, thanks
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.
L.Browser.touch = false;
is a ugly fix
I agree this is an issue with touch. Ugly fix too, but this is severely browser dependent.
Yes, setting L.Browser.touch to false only under IE works for me - thanks. Happy for you to close this.
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.
Are you targeting touch devices or both?
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.
Forcing them to use the mouse might not fix the issue.
Back in 4.3 we had users with touch screen laptops that only used mouse and they still had the issue and also users that didn't have touch screens and still had the issue in IE.
On Thu, Dec 8, 2016 at 7:56 AM, Richard Hinkamp notifications@github.com wrote:
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.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Leaflet/Leaflet.draw/issues/618#issuecomment-265676346, or mute the thread https://github.com/notifications/unsubscribe-auth/ABN9VCZ1YtxXTybWY5qx3xu1ElniNFGUks5rF7g3gaJpZM4Kd-TW .
Well since L.Browser.touch
is always true in IE, even with no touchscreen, that makes sense.
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?
That's basically what my PR addressed. I checked to see if the event was handled and then didn't handle it more than once.
On Thu, Dec 8, 2016 at 10:56 AM, Richard Hinkamp notifications@github.com wrote:
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?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Leaflet/Leaflet.draw/issues/618#issuecomment-265712660, or mute the thread https://github.com/notifications/unsubscribe-auth/ABN9VPRDMl1M5-5RL5ikGU29r_qQzEcmks5rF-JXgaJpZM4Kd-TW .
@Richard Hinklamp - I'm honestly surprised that the code that checks for poly self-intersections doesn't prevent multiple consecutive markers already.
On Thu, Dec 8, 2016 at 2:56 AM, Richard Hinkamp notifications@github.com wrote:
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?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Leaflet/Leaflet.draw/issues/618#issuecomment-265712660, or mute the thread https://github.com/notifications/unsubscribe-auth/AAzNEv02GOKsZeI3i4CY3zsg3gHS65Jtks5rF-JXgaJpZM4Kd-TW .
Oh, interesting, it seems that the poly intersection check only happens when editing a polygon/polyline, not when drawing a new one. That shouldn't be too hard to fix, lemme see if I can do that right now.
On Thu, Dec 8, 2016 at 1:43 PM, Joseph Ryan jfr7p@virginia.edu wrote:
@Richard Hinklamp - I'm honestly surprised that the code that checks for poly self-intersections doesn't prevent multiple consecutive markers already.
On Thu, Dec 8, 2016 at 2:56 AM, Richard Hinkamp notifications@github.com wrote:
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?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Leaflet/Leaflet.draw/issues/618#issuecomment-265712660, or mute the thread https://github.com/notifications/unsubscribe-auth/AAzNEv02GOKsZeI3i4CY3zsg3gHS65Jtks5rF-JXgaJpZM4Kd-TW .
What does this comment mean? I could perhaps fix this but I need to know what "degenerate cases" means.
// @method newLatLngIntersects(): boolean // Check for intersection if new latlng was added to this polyline. // NOTE: does not support detecting intersection for degenerate cases.
// @method newPointIntersects(): boolean
// Check for intersection if new point was added to this polyline. // newPoint must be a layer point. // NOTE: does not support detecting intersection for degenerate cases.
On Thu, Dec 8, 2016 at 4:19 PM, Joseph Ryan jfr7p@virginia.edu wrote:
Oh, interesting, it seems that the poly intersection check only happens when editing a polygon/polyline, not when drawing a new one. That shouldn't be too hard to fix, lemme see if I can do that right now.
On Thu, Dec 8, 2016 at 1:43 PM, Joseph Ryan jfr7p@virginia.edu wrote:
@Richard Hinklamp - I'm honestly surprised that the code that checks for poly self-intersections doesn't prevent multiple consecutive markers already.
On Thu, Dec 8, 2016 at 2:56 AM, Richard Hinkamp <notifications@github.com
wrote:
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?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Leaflet/Leaflet.draw/issues/618#issuecomment-265712660, or mute the thread https://github.com/notifications/unsubscribe-auth/AAzNEv02GOKsZeI3i4CY3zsg3gHS65Jtks5rF-JXgaJpZM4Kd-TW .
So, this is legacy... old... detection code. Apparently the algorithm used doesn't detect some complex cases - which I can only imagine as spirals?
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.
Double events seem to be a leaflet problem with PointerEvent
, being worked on: https://github.com/Leaflet/Leaflet/issues/5180 This occurs in IE11 and Chrome 55+. When that's fixed, this issue can (hopefully) be properly fixed.
I have a fix for the "difficulty closing the polyline/polygon" issue in my PR: https://github.com/Leaflet/Leaflet.draw/pull/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.
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));
Some of these got resolved in #661, right?
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.