fix error when drawing polylines
This commit is contained in:
parent
6ab87d13aa
commit
fb3d3a7811
@ -136,11 +136,13 @@ window.plugin.drawTools.enhancePolyLine = function() {
|
|||||||
|
|
||||||
// remove polyline markers because they get in the way
|
// remove polyline markers because they get in the way
|
||||||
L.Polyline.Draw.prototype._updateMarkerHandler = function() {
|
L.Polyline.Draw.prototype._updateMarkerHandler = function() {
|
||||||
|
if(!this._markers) return;
|
||||||
|
|
||||||
if(this._markers.length >= 2)
|
if(this._markers.length >= 2)
|
||||||
this._markerGroup.removeLayer(this._markers.shift());
|
this._markerGroup.removeLayer(this._markers.shift());
|
||||||
|
|
||||||
if(this._markers.length >= 1)
|
if(this._markers.length >= 1)
|
||||||
this._markers[this._markers.length - 1].on('click', this._finishShape(), this);
|
this._markers[this._markers.length - 1].on('click', this._finishShape, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user