]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/directions/fossgis_valhalla.js
Label boundaries by regional official designations
[rails.git] / app / assets / javascripts / index / directions / fossgis_valhalla.js
index 41ad6a9725fcb332b3ec63030f36fad0f3c60343..493d0907208bcea6fd7406ac0d4ec79afb39aa70 100644 (file)
@@ -1,36 +1,36 @@
 (function () {
 (function () {
-  function FOSSGISValhallaEngine(id, costing) {
+  function FOSSGISValhallaEngine(modeId, costing) {
     const INSTR_MAP = [
     const INSTR_MAP = [
-      0, // kNone = 0;
-      8, // kStart = 1;
-      8, // kStartRight = 2;
-      8, // kStartLeft = 3;
-      14, // kDestination = 4;
-      14, // kDestinationRight = 5;
-      14, // kDestinationLeft = 6;
-      0, // kBecomes = 7;
-      0, // kContinue = 8;
-      1, // kSlightRight = 9;
-      2, // kRight = 10;
-      3, // kSharpRight = 11;
-      4, // kUturnRight = 12;
-      4, // kUturnLeft = 13;
-      7, // kSharpLeft = 14;
-      6, // kLeft = 15;
-      5, // kSlightLeft = 16;
-      0, // kRampStraight = 17;
-      24, // kRampRight = 18;
-      25, // kRampLeft = 19;
-      24, // kExitRight = 20;
-      25, // kExitLeft = 21;
-      0, // kStayStraight = 22;
-      1, // kStayRight = 23;
-      5, // kStayLeft = 24;
-      20, // kMerge = 25;
-      10, // kRoundaboutEnter = 26;
-      10, // kRoundaboutExit = 27;
-      17, // kFerryEnter = 28;
-      0, // kFerryExit = 29;
+      "straight", // kNone = 0;
+      "start", // kStart = 1;
+      "start", // kStartRight = 2;
+      "start", // kStartLeft = 3;
+      "destination", // kDestination = 4;
+      "destination", // kDestinationRight = 5;
+      "destination", // kDestinationLeft = 6;
+      "straight", // kBecomes = 7;
+      "straight", // kContinue = 8;
+      "slight-right", // kSlightRight = 9;
+      "right", // kRight = 10;
+      "sharp-right", // kSharpRight = 11;
+      "u-turn", // kUturnRight = 12;
+      "u-turn", // kUturnLeft = 13;
+      "sharp-left", // kSharpLeft = 14;
+      "left", // kLeft = 15;
+      "slight-left", // kSlightLeft = 16;
+      "straight", // kRampStraight = 17;
+      "exit-right", // kRampRight = 18;
+      "exit-left", // kRampLeft = 19;
+      "exit-right", // kExitRight = 20;
+      "exit-left", // kExitLeft = 21;
+      "straight", // kStayStraight = 22;
+      "slight-right", // kStayRight = 23;
+      "slight-left", // kStayLeft = 24;
+      "merge-left", // kMerge = 25;
+      "roundabout", // kRoundaboutEnter = 26;
+      "roundabout", // kRoundaboutExit = 27;
+      "ferry", // kFerryEnter = 28;
+      "straight", // kFerryExit = 29;
       null, // kTransit = 30;
       null, // kTransitTransfer = 31;
       null, // kTransitRemainOn = 32;
       null, // kTransit = 30;
       null, // kTransitTransfer = 31;
       null, // kTransitRemainOn = 32;
@@ -38,8 +38,8 @@
       null, // kTransitConnectionTransfer = 34;
       null, // kTransitConnectionDestination = 35;
       null, // kPostTransitConnectionDestination = 36;
       null, // kTransitConnectionTransfer = 34;
       null, // kTransitConnectionDestination = 35;
       null, // kPostTransitConnectionDestination = 36;
-      21, // kMergeRight = 37;
-      20 // kMergeLeft = 38;
+      "merge-right", // kMergeRight = 37;
+      "merge-left" // kMergeLeft = 38;
     ];
 
     function _processDirections(tripLegs) {
     ];
 
     function _processDirections(tripLegs) {
@@ -82,7 +82,8 @@
     }
 
     return {
     }
 
     return {
-      id: id,
+      mode: modeId,
+      provider: "fossgis_valhalla",
       creditline:
       "<a href='https://gis-ops.com/global-open-valhalla-server-online/' target='_blank'>Valhalla (FOSSGIS)</a>",
       draggable: false,
       creditline:
       "<a href='https://gis-ops.com/global-open-valhalla-server-online/' target='_blank'>Valhalla (FOSSGIS)</a>",
       draggable: false,
     };
   }
 
     };
   }
 
-  OSM.Directions.addEngine(new FOSSGISValhallaEngine("fossgis_valhalla_car", "auto"), true);
-  OSM.Directions.addEngine(new FOSSGISValhallaEngine("fossgis_valhalla_bicycle", "bicycle"), true);
-  OSM.Directions.addEngine(new FOSSGISValhallaEngine("fossgis_valhalla_foot", "pedestrian"), true);
+  OSM.Directions.addEngine(new FOSSGISValhallaEngine("car", "auto"), true);
+  OSM.Directions.addEngine(new FOSSGISValhallaEngine("bicycle", "bicycle"), true);
+  OSM.Directions.addEngine(new FOSSGISValhallaEngine("foot", "pedestrian"), true);
 }());
 }());