- for (const leg of tripLegs) {
- const legLine = L.PolylineUtil.decode(leg.shape, {
- precision: 6
- });
-
- const legSteps = leg.maneuvers.map(function (manoeuvre) {
- 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],
- manoeuvre.instruction,
- manoeuvre.length * 1000,
- lineseg
- ];
- });
-
- line = line.concat(legLine);
- steps = steps.concat(legSteps);
- distance += leg.summary.length;
- time += leg.summary.time;
- }
+ const steps = leg.maneuvers.map(manoeuvre => {
+ const lineseg = line
+ .slice(manoeuvre.begin_shape_index, manoeuvre.end_shape_index + 1)
+ .map(([lat, lng]) => ({ lat, lng }));
+ return [
+ lineseg[0],
+ INSTR_MAP[manoeuvre.type],
+ manoeuvre.instruction,
+ manoeuvre.length * 1000,
+ lineseg
+ ];
+ });