]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/directions/graphhopper.js
Vagrant: Virtualbox: increase RAM and put 2 CPUs
[rails.git] / app / assets / javascripts / index / directions / graphhopper.js
index 2292c6350c7636a15fd0249dea188a0a8f9b40c6..2d3455eeeda6ac1ca058de6f08bc71fc39c8f67a 100644 (file)
@@ -29,7 +29,7 @@ function GraphHopperEngine(id, vehicleType) {
           type: "jsonp",
           elevation: false,
           instructions: true,
-          point: points.map(function (p) { return p.lat + "," + p.lng })
+          point: points.map(function (p) { return p.lat + "," + p.lng; })
         },
         traditional: true,
         dataType: "jsonp",
@@ -58,12 +58,15 @@ function GraphHopperEngine(id, vehicleType) {
             ]); // TODO does graphhopper map instructions onto line indices?
           }
 
-          callback(null, {
+          callback(false, {
             line: line,
             steps: steps,
             distance: path.distance,
             time: path.time / 1000
           });
+        },
+        error: function () {
+          callback(true);
         }
       });
     }