From 7c0b5bab07b33b80a04090338a00d14537e2dfaf Mon Sep 17 00:00:00 2001 From: Justine Fricou Date: Tue, 27 Aug 2024 16:06:40 +0200 Subject: [PATCH] Fix path layers not displayed at creation --- geotrek/core/static/core/multipath.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geotrek/core/static/core/multipath.js b/geotrek/core/static/core/multipath.js index 9d1b1236c0..cd8f3694ba 100644 --- a/geotrek/core/static/core/multipath.js +++ b/geotrek/core/static/core/multipath.js @@ -917,12 +917,12 @@ L.Handler.MultiPath = L.Handler.extend({ }) oldStepsIndexes = data.oldStepsIndexes newStepsIndexes = data.newStepsIndexes - var previousRouteLayer = this._routeLayer.getLayers() if (!this._routeLayer) { this._routeLayer = L.featureGroup() this.map.addLayer(this._routeLayer); } + var previousRouteLayer = this._routeLayer.getLayers() this.updateRouteLayers(data.geojson.geometries, oldStepsIndexes, newStepsIndexes) var isNewMarkerBeingCorrected = this._routeIsValid == false && this._previousStepsNb > previousRouteLayer.length + 1