Leaflet.draw icon indicating copy to clipboard operation
Leaflet.draw copied to clipboard

Cannot create property 'selectedPathOptions' on boolean 'true'

Open karthikkavin opened this issue 4 years ago • 2 comments

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)

karthikkavin avatar Jan 01 '20 08:01 karthikkavin

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

itaross avatar Nov 04 '20 17:11 itaross

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

ArulRozario avatar Jul 19 '22 06:07 ArulRozario