X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/8df1212b59748341295da8d5bb08b4045dc59ad7..5e27978d3cd55b267f0222d51d9e8efa26e389e9:/app/assets/javascripts/index/directions/mapzen.js diff --git a/app/assets/javascripts/index/directions/mapzen.js b/app/assets/javascripts/index/directions/mapzen.js index 915e665f5..1b775ba51 100644 --- a/app/assets/javascripts/index/directions/mapzen.js +++ b/app/assets/javascripts/index/directions/mapzen.js @@ -28,7 +28,7 @@ function MapzenEngine(id, costing) { 1, // kMerge = 25; 11, // kRoundaboutEnter = 26; 12, // kRoundaboutExit = 27; - 1, // kFerryEnter = 28; + 18, // kFerryEnter = 28; 1 // kFerryExit = 29; ]; @@ -39,15 +39,14 @@ function MapzenEngine(id, costing) { getRoute: function (points, callback) { return $.ajax({ - url: document.location.protocol + "//valhalla.mapzen.com/route", + url: document.location.protocol + OSM.MAPZEN_VALHALLA_URL, data: { api_key: OSM.MAPZEN_VALHALLA_KEY, json: JSON.stringify({ locations: points.map(function (p) { return { lat: p.lat, lon: p.lng }; }), costing: costing, directions_options: { - units: "km", - language: I18n.currentLocale() + units: "km" } }) }, @@ -93,6 +92,9 @@ function MapzenEngine(id, costing) { } else { callback(true); } + }, + error: function () { + callback(true); } }); }