Open cmrRose opened 7 years ago
When this error happens, the L.Draw.Event.CREATED event does happen, but the L.Draw.Event.DRAWSTOP does not happen. If I can eventually get DRAWSTOP to happen, this seems to end the errors. No longer seems to be the case. I can get DRAWSTOP to occur, yet still get this error.
May be related to the .bringToFront(); method?
I have now added a function disableLeafletDraw() that is called on both L.Draw.Event.DRAWSTOP and on L.Draw.Event.CREATED. This eliminates the problem of leaflet trying to continue drawing a second shape. It still, however, produces the same error (el.parentNode is null) on occasion, and I can't figure out what causes it.
Although the new Leaflet Draw shape appears to be complete, somehow this error prevents my code from continuing to query using the geometry of the new shape.
It seems that leafletFeatureLayer.bringToFront(); was throwing the error and causing the code to stop before calling the function to query for geometry.
I moved 'bringToFront' after the query function call. I continue to get the same error, but at least it doesn't stop the query from happening. The only problem it causes now is that the draw polygon remains on top of some (not all) of the sections, blocking the user from clicking on a section to see a popup.
Here is a work-around: https://gis.stackexchange.com/questions/238166/allow-popups-to-show-through-another-layer
I sometimes end up triggering this error when using the Draw capability: el.parentNode is null
I haven't figured out how to cause it exactly. It seems to disrupt the draw-end event somehow. Once this occurs, any attempt to draw a polygon produces the same error.