);
// 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 = $("<tr class='turn'/>");
if (direction) {
row.append("<td class='border-0'><svg width='20' height='20' class='d-block'><use href='#routing-sprite-" + direction + "' /></svg></td>");
map.removeLayer(highlight);
});
- turnByTurnTable.append(row);
- }
+ return row;
+ }));
const blob = new Blob([JSON.stringify(polyline.toGeoJSON())], { type: "application/json" });
URL.revokeObjectURL(downloadURL);