]> git.openstreetmap.org Git - rails.git/commitdiff
added manoeuvre numbering
authorChristian Beiwinkel <chrstn.bwnkl@gmail.com>
Thu, 22 Dec 2022 16:33:20 +0000 (17:33 +0100)
committerChristian Beiwinkel <chrstn.bwnkl@gmail.com>
Thu, 22 Dec 2022 16:33:20 +0000 (17:33 +0100)
app/assets/javascripts/index/directions/valhalla.js

index 1e424caba884ca188302f2542a45c4b4463534a9..2b946b783119eaa1f674a29bb30281b0eca1cd90 100644 (file)
@@ -73,13 +73,13 @@ function ValhallaEngine(id, costing) {
 
               line = line.concat(legLine);
 
-              leg.maneuvers.forEach(function (manoeuvre) {
+              leg.maneuvers.forEach(function (manoeuvre, idx) {
                 var point = legLine[manoeuvre.begin_shape_index];
 
                 steps.push([
                   { lat: point[0], lng: point[1] },
                   INSTR_MAP[manoeuvre.type],
-                  manoeuvre.instruction,
+                  "<b>" + (idx + 1) + ".</b> " + manoeuvre.instruction,
                   manoeuvre.length * 1000,
                   []
                 ]);