Skip to content

Commit 9d372ad

Browse files
committed
Instructions for all legs
Fixes 181
1 parent 07ebea2 commit 9d372ad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/controls/instructions.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export default class Instructions {
3838

3939
if (directions.length && shouldRender) {
4040
const direction = this.directions = directions[routeIndex];
41+
const allSteps = direction.legs.reduce((legs, leg) => legs.concat(leg.steps), []);
4142

4243
if (compile) {
4344
direction.legs.forEach(function(leg) {
@@ -50,7 +51,7 @@ export default class Instructions {
5051
this.container.innerHTML = instructionsTemplate({
5152
routeIndex,
5253
routes: directions.length,
53-
steps: direction.legs[0].steps, // Todo: Respect all legs,
54+
steps: allSteps,
5455
format: utils.format[unit],
5556
duration: utils.format[unit](direction.distance),
5657
distance: utils.format.duration(direction.duration)

0 commit comments

Comments
 (0)