X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/dd8a0f0dff457f27d6c6125a4f724f699d489588..ce52ba1e6ae4e5ae5fb03e64bde9c7df1dcae4ff:/app/assets/javascripts/index/directions/graphhopper.js diff --git a/app/assets/javascripts/index/directions/graphhopper.js b/app/assets/javascripts/index/directions/graphhopper.js index acbd776a0..3579fd168 100644 --- a/app/assets/javascripts/index/directions/graphhopper.js +++ b/app/assets/javascripts/index/directions/graphhopper.js @@ -21,16 +21,12 @@ function _processDirections(path) { const line = L.PolylineUtil.decode(path.points); - const steps = path.instructions.map(function (instr) { - const lineseg = line - .slice(instr.interval[0], instr.interval[1] + 1); - return [ - GH_INSTR_MAP[instr.sign], - instr.text, - instr.distance, - lineseg - ]; - }); + const steps = path.instructions.map(instr => [ + GH_INSTR_MAP[instr.sign], + instr.text, + instr.distance, + line.slice(instr.interval[0], instr.interval[1] + 1) + ]); steps.at(-1)[0] = "destination"; return {