-
Notifications
You must be signed in to change notification settings - Fork 994
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
leaflet draw not working with latest angular version 10 #1005
Comments
@archanatiwari this issue is occurring for me as well when I upgraded from angular 9 to 11. I think I know the problem too. The readableArea function is using an undefined variable. It seems that in the upgrade to ng10/11 "strict" mode has been turned on. Thus, the use of an undeclared variable is not allowed. Fixing this should be a matter of adding the "type" variable to the list of variable declarations in the readableArea function. It looks like someone has already raised a PR to fix this issue here. |
It seems quite a few people have raised PRs to fix this issue but, there's no approvals going on it seems. In the meantime my current "hack" to get around this issue is to do this:
I reset the value of the variable on component destroy (in angular) so... hopefully no leaking will occur. |
It is pretty clear that this plugin is abandoned, see https://github.com/Leaflet/Leaflet.draw/graphs/contributors Not sure is there a viable replacement - alternative project or a maintained fork |
How to reproduce
What behaviour I'm expecting and which behaviour I'm seeing
Steps:
at Object.readableArea (leaflet.draw.js:9)
at NewClass._getMeasurementString (leaflet.draw.js:8)
at NewClass._getTooltipText (leaflet.draw.js:8)
at NewClass._updateTooltip (leaflet.draw.js:8)
at NewClass._vertexChanged (leaflet.draw.js:8)
at NewClass._vertexChanged (leaflet.draw.js:8)
at NewClass.addVertex (leaflet.draw.js:8)
at NewClass._endPoint (leaflet.draw.js:8)
at NewClass._onTouch (leaflet.draw.js:8)
at NewClass.fire (leaflet-src.js:588)
The text was updated successfully, but these errors were encountered: