+ const legSteps = leg.maneuvers.map(function (manoeuvre, idx) {
+ const num = `<b>${idx + 1}.</b> `;
+ const lineseg = legLine
+ .slice(manoeuvre.begin_shape_index, manoeuvre.end_shape_index + 1)
+ .map(([lat, lng]) => ({ lat, lng }));
+ return [
+ lineseg[0],
+ INSTR_MAP[manoeuvre.type],
+ num + manoeuvre.instruction,
+ manoeuvre.length * 1000,
+ lineseg
+ ];
+ });