]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/directions/mapquest.js
Merge remote-tracking branch 'openstreetmap/pull/954'
[rails.git] / app / assets / javascripts / index / directions / mapquest.js
index 24be65de770024bfce445eef2d5486f33f44b527..0f645ceeb7f35e621369d080517887f82154595d 100644 (file)
@@ -36,7 +36,7 @@ function MapQuestEngine(id, routeType) {
       var to = points[points.length - 1];
 
       return $.ajax({
-        url: document.location.protocol + "//open.mapquestapi.com/directions/v2/route",
+        url: document.location.protocol + OSM.MAPQUEST_DIRECTIONS_URL,
         data: {
           key: OSM.MAPQUEST_KEY,
           from: from.lat + "," + from.lng,
@@ -83,12 +83,15 @@ function MapQuestEngine(id, routeType) {
             steps.push([L.latLng(s.startPoint.lat, s.startPoint.lng), d, s.narrative, s.distance * 1000, lineseg]);
           }
 
-          callback(null, {
+          callback(false, {
             line: line,
             steps: steps,
             distance: data.route.distance * 1000,
             time: data.route.time
           });
+        },
+        error: function () {
+          callback(true);
         }
       });
     }