- steps.push([line[s[3]], s[0].split('-')[0], instText, s[2]]);
+ if ((i+1)<data.route_instructions.length) {
+ linesegend = data.route_instructions[i+1][3] + 1;
+ } else {
+ linesegend = s[3] + 1;
+ }
+ steps.push([line[s[3]], s[0].split('-')[0], instText, s[2], line.slice(s[3], linesegend)]);