commit 0cba9b0cc0dc5ff8aeabe605467c2aa4850c830e
parent 469cb753c1ebb0877ea8691542f0fdbdaa5c9d3d
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Mon, 5 Nov 2018 22:21:39 +0100
[track edit] change direction when starting to draw line and only one node exists
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/lib/leaflet.polyline-edit/index.js b/src/lib/leaflet.polyline-edit/index.js
@@ -224,10 +224,10 @@ L.Polyline.EditMixin = {
if ((this._drawingDirection === -1 && nodeIndex === 1) ||
((this._drawingDirection === 1 && nodeIndex === latlngs_n - 2))) {
this.stopDrawingLine();
- } else if (nodeIndex === 0) {
- this.startDrawingLine(-1, e);
} else if (nodeIndex === this.getLatLngs().length - 1) {
this.startDrawingLine(1, e);
+ } else if (nodeIndex === 0) {
+ this.startDrawingLine(-1, e);
}
},