From 2af72b2e6f4e4c1c0775f16f102f50a59bdeb0c3 Mon Sep 17 00:00:00 2001 From: Marwin Hochfelsner <50826859+hlfan@users.noreply.github.com> Date: Sun, 6 Apr 2025 19:41:11 +0200 Subject: [PATCH] Append all turn-by-turn rows together --- app/assets/javascripts/index/directions.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 34b930168..588c09afd 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -184,9 +184,7 @@ OSM.Directions = function (map) { ); // Add each row - for (const [i, step] of route.steps.entries()) { - const [ll, direction, instruction, dist, lineseg] = step; - + turnByTurnTable.append(route.steps.map(([ll, direction, instruction, dist, lineseg], i) => { const row = $(""); if (direction) { row.append(""); @@ -211,8 +209,8 @@ OSM.Directions = function (map) { map.removeLayer(highlight); }); - turnByTurnTable.append(row); - } + return row; + })); const blob = new Blob([JSON.stringify(polyline.toGeoJSON())], { type: "application/json" }); URL.revokeObjectURL(downloadURL); -- 2.39.5