From 161bd0601b8e8d8bd808857e2708abfbcf74722a Mon Sep 17 00:00:00 2001 From: JustineFricou Date: Thu, 30 May 2024 11:06:43 +0200 Subject: [PATCH] Fix wrong marker being deleted after trying to create an unsnapped marker --- geotrek/core/static/core/multipath.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/geotrek/core/static/core/multipath.js b/geotrek/core/static/core/multipath.js index 0bcfff8cef..6abf0ad425 100644 --- a/geotrek/core/static/core/multipath.js +++ b/geotrek/core/static/core/multipath.js @@ -520,7 +520,7 @@ L.Handler.MultiPath = L.Handler.extend({ // Remove an existing step by clicking on it removeViaStepFromRoute: function(pop) { var step_idx = this.getStepIdx(pop) - this.removeViaStep(pop, step_idx) + this.removeViaStep(pop) this._previousStepsNb = this._currentStepsNb this._currentStepsNb = this.steps.length this.fetchRoute( @@ -531,7 +531,8 @@ L.Handler.MultiPath = L.Handler.extend({ }, // Remove a step from the steps list - removeViaStep: function(pop, step_idx) { + removeViaStep: function(pop) { + var step_idx = this.getStepIdx(pop) this.steps.splice(step_idx, 1) this.map.removeLayer(pop.marker) },