Skip to content

Commit

Permalink
Always enable instructions; fix typo.
Browse files Browse the repository at this point in the history
We do not have waypointIndices unless instructions are enabled.

Close #6.
  • Loading branch information
perliedman committed Aug 12, 2015
1 parent 23b02b3 commit 46b5c84
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/L.Routing.GraphHopper.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@

buildRouteUrl: function(waypoints, options) {
var computeInstructions =
!(options && options.geometryOnly),
/* Instructions are always needed,
since we do not have waypoint indices otherwise */
true,
//!(options && options.geometryOnly),
locs = [],
i,
baseUrl;
Expand Down Expand Up @@ -197,7 +200,7 @@
wpIndices.push(0);
wps.push(new L.Routing.Waypoint(coordinates[0], waypoints[0].name));

for (i = 0; i < instructions && instructions.length; i++) {
for (i = 0; instructions && i < instructions.length; i++) {
if (instructions[i].sign === 5) { // VIA_REACHED
idx = instructions[i].interval[0];
wpIndices.push(idx);
Expand Down

0 comments on commit 46b5c84

Please sign in to comment.