Leaflet.draw
Leaflet.draw copied to clipboard
Cannot create property 'selectedPathOptions' on boolean 'true'
Hi, I am getting these errors in my browser console. Unable to show leaflet draw options on the map. How to resolve this issue. Please help?
ERROR TypeError: Cannot create property 'selectedPathOptions' on boolean 'true'
at NewClass.initialize (leaflet.draw.js:9)
at new NewClass (leaflet-src.js:301)
at NewClass.initialize (leaflet.draw.js:9)
at new NewClass (leaflet-src.js:301)
at LeafletDrawDirective.push../node_modules/@asymmetrik/ngx-leaflet-draw/dist/leaflet-draw/core/leaflet-draw.directive.js.LeafletDrawDirective.ngOnInit (leaflet-draw.directive.js:45)
at checkAndUpdateDirectiveInline (core.js:31910)
at checkAndUpdateNodeInline (core.js:44367)
at checkAndUpdateNode (core.js:44306)
at debugCheckAndUpdateNode (core.js:45328)
at debugCheckDirectivesFn (core.js:45271)
I have the same issue, did you find a solution?
this.drawOptions = {
draw: {
polygon: false
},
edit: {
edit: {}, // change from true to {}.
remove: false,
featureGroup: <your-feature-group>
}
}
// refer Control.DrawConstructorOptions in @types/leaflet-draw