]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/directions/osrm.js
OSRM and Graphhopper support HTTPS
[rails.git] / app / assets / javascripts / index / directions / osrm.js
index 69b78c25ee2f7be16b635ba3fbcf46ec53505d98..cc275685843babc6fd72e6be8745b81cab389c82 100644 (file)
@@ -54,11 +54,9 @@ function OSRMEngine() {
           previousPoints = points;
           hintData = data.hint_data;
 
-          var line = L.PolylineUtil.decode(data.route_geometry);
-          for (var i = 0; i < line.length; i++) {
-            line[i].lat /= 10;
-            line[i].lng /= 10;
-          }
+          var line = L.PolylineUtil.decode(data.route_geometry, {
+            precision: 6
+          });
 
           var steps = [];
           for (i = 0; i < data.route_instructions.length; i++) {
@@ -93,4 +91,4 @@ function OSRMEngine() {
   };
 }
 
-OSM.Directions.addEngine(OSRMEngine(), false);
+OSM.Directions.addEngine(OSRMEngine(), true);