X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/31c80f66463a143c12b3d6e1395a034d11a812ba..38180c56c9be9d99406c9088b60f5912c2648a04:/app/assets/javascripts/index/directions/mapquest.js?ds=sidebyside diff --git a/app/assets/javascripts/index/directions/mapquest.js b/app/assets/javascripts/index/directions/mapquest.js index 24be65de7..0f645ceeb 100644 --- a/app/assets/javascripts/index/directions/mapquest.js +++ b/app/assets/javascripts/index/directions/mapquest.js @@ -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); } }); }