]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/directions/graphhopper.js
Fallback to english locale when looking for community index templates
[rails.git] / app / assets / javascripts / index / directions / graphhopper.js
index 0a593f59bf9119286ebd1510a52f8189f4e78f68..e72f6d75f32528682ca816bbcc90003fa5e28c31 100644 (file)
@@ -9,12 +9,17 @@ function GraphHopperEngine(id, vehicleType) {
     "3": 3, // sharp right
     "4": 14, // finish reached
     "5": 14, // via reached
-    "6": 10 // roundabout
+    "6": 10, // roundabout
+    "-7": 19, // keep left
+    "7": 18, // keep right
+    "-98": 4, // unknown direction u-turn
+    "-8": 4, // left u-turn
+    "8": 4 // right u-turn
   };
 
   return {
     id: id,
-    creditline: "<a href=\"https://www.graphhopper.com/\" target=\"_blank\">Graphhopper</a>",
+    creditline: "<a href=\"https://www.graphhopper.com/\" target=\"_blank\">GraphHopper</a>",
     draggable: false,
 
     getRoute: function (points, callback) {
@@ -23,14 +28,13 @@ function GraphHopperEngine(id, vehicleType) {
       return $.ajax({
         url: OSM.GRAPHHOPPER_URL,
         data: {
-          "vehicle": vehicleType,
-          "locale": I18n.currentLocale(),
-          "key": "LijBPDQGfu7Iiq80w3HzwB4RUDJbMbhs6BU0dEnn",
-          "ch.disable": vehicleType === "car",
-          "elevation": false,
-          "instructions": true,
-          "turn_costs": true,
-          "point": points.map(function (p) { return p.lat + "," + p.lng; })
+          vehicle: vehicleType,
+          locale: I18n.currentLocale(),
+          key: "LijBPDQGfu7Iiq80w3HzwB4RUDJbMbhs6BU0dEnn",
+          elevation: false,
+          instructions: true,
+          turn_costs: vehicleType === "car",
+          point: points.map(function (p) { return p.lat + "," + p.lng; })
         },
         traditional: true,
         dataType: "json",