Skip to content

Commit

Permalink
Fix wrong marker being deleted after trying to create an unsnapped ma…
Browse files Browse the repository at this point in the history
…rker
  • Loading branch information
JustineFricou committed May 30, 2024
1 parent de4ef8f commit 161bd06
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions geotrek/core/static/core/multipath.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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)
},
Expand Down

0 comments on commit 161bd06

Please sign in to comment.