I18n.t('javascripts.directions.instructions.end_oneway') // 17
];
- var url = "http://router.project-osrm.org/viaroute?z=14&output=json&instructions=true";
+ var url = document.location.protocol + "//router.project-osrm.org/viaroute?z=14&output=json&instructions=true";
for (var i = 0; i < points.length; i++) {
url += "&loc=" + points[i].lat + ',' + points[i].lng;
url += "&checksum=" + hintData.checksum;
}
- $.ajax({
+ return $.ajax({
url: url,
dataType: 'json',
success: function (data) {
- if (data.status == 207)
+ if (data.status === 207)
return callback(true);
previousPoints = points;
if (instCodes[1]) {
instText += "exit " + instCodes[1] + " ";
}
- if (instCodes[0] != 15) {
+ if (instCodes[0] !== 15) {
instText += s[1] ? "<b>" + s[1] + "</b>" : I18n.t('javascripts.directions.instructions.unnamed');
}
if ((i + 1) < data.route_instructions.length) {
};
}
-OSM.Directions.addEngine(OSRMEngine(), false);
+OSM.Directions.addEngine(new OSRMEngine(), true);