Open neel opened 4 years ago
I am trying to clear all points in the polyline
while(!this._route.isEmpty()){ this._route.editor.pop(); }
getting exception
TypeError: Cannot read property 'length' of undefined at e.pop (map.js:12) at a.clear (map.js:12)
The Leaflet.Editable pop() function doesn't get _drawnLatLngs
_drawnLatLngs
pop: function () { if (this._drawnLatLngs.length <= 1) return; var latlng; if (this._drawing === L.Editable.FORWARD) latlng = this._drawnLatLngs[this._drawnLatLngs.length - 1]; else latlng = this._drawnLatLngs[0]; this.removeLatLng(latlng); if (this._drawing === L.Editable.FORWARD) this.tools.anchorForwardLineGuide(this._drawnLatLngs[this._drawnLatLngs.length - 1]); else this.tools.anchorForwardLineGuide(this._drawnLatLngs[0]); return latlng; },
How to fix ?
I am trying to clear all points in the polyline
getting exception
The Leaflet.Editable pop() function doesn't get
_drawnLatLngs
How to fix ?