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,
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);
}
});
}