From: Marwin Hochfelsner <50826859+hlfan@users.noreply.github.com> Date: Sun, 6 Apr 2025 17:41:11 +0000 (+0200) Subject: Append all turn-by-turn rows together X-Git-Tag: live~67^2~7 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/2af72b2e6f4e4c1c0775f16f102f50a59bdeb0c3?ds=inline;hp=-c Append all turn-by-turn rows together --- 2af72b2e6f4e4c1c0775f16f102f50a59bdeb0c3 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);