Leaflet / Leaflet.draw

Vector drawing and editing plugin for Leaflet
https://leaflet.github.io/Leaflet.draw/docs/leaflet-draw-latest.html
MIT License
1.96k stars 992 forks source link

Cannot create property 'selectedPathOptions' on boolean 'true' #980

Open karthikkavin opened 4 years ago

karthikkavin commented 4 years ago

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)
itaross commented 3 years ago

I have the same issue, did you find a solution?

ArulRozario commented 2 years ago
this.drawOptions = {
      draw: {       
           polygon: false
      },
      edit: {
        edit: {}, // change from true to {}. 
        remove: false,
        featureGroup: <your-feature-group>
      }
    }
// refer Control.DrawConstructorOptions in @types/leaflet-draw