// Route-fetching UI
- r.requestRoute=function(final) {
+ r.requestRoute=function(isFinal) {
if (r.route_from && r.route_to) {
r.awaitingRoute=true;
- r.chosenEngine.getRoute(final,[r.route_from,r.route_to]);
+ r.chosenEngine.getRoute(isFinal,[r.route_from,r.route_to]);
// then, when the route has been fetched, it'll call the engine's gotRoute function
} else if (r.route_from==false || r.route_to==false) {
// we're waiting for a Nominatim response before we can request a route
"TSHR": 4,
"TU": 5
}, // was half expecting to see TLDR in there
- getRoute: function(final,points) {
+ getRoute: function(isFinal,points) {
var url="http://routes.cloudmade.com/8ee2a50541944fb9bcedded5165f09d9/api/0.3/";
var p=[];
for (var i=0; i<points.length; i++) {
name: 'Bicycle (GraphHopper)',
draggable: true,
_hints: {},
- getRoute: function(final, points) {
+ getRoute: function(isFinal, points) {
var url = "http://graphhopper.com/routing/api/route?vehicle=bike&locale=en";
for (var i = 0; i < points.length; i++) {
var pair = points[i].join(',');
url += "&point=" + pair;
}
- if (final)
+ if (isFinal)
url += "&instructions=true";
this.requestJSONP(url + "&type=jsonp&callback=");
},
17: 8, // left fork
18: 1 // straight fork
},
- getRoute: function(final,points) {
+ getRoute: function(isFinal,points) {
var url="http://open.mapquestapi.com/directions/v2/route?key=Fmjtd%7Cluur290anu%2Crl%3Do5-908a0y";
var from=points[0]; var to=points[points.length-1];
url+="&from="+from.join(',');
name: 'Car (OSRM)',
draggable: true,
_hints: {},
- getRoute: function(final,points) {
+ getRoute: function(isFinal,points) {
var url="http://router.project-osrm.org/viaroute?z=14&output=json";
for (var i=0; i<points.length; i++) {
var pair=points[i].join(',');
url+="&loc="+pair;
if (this._hints[pair]) url+= "&hint="+this._hints[pair];
}
- if (final) url+="&instructions=true";
+ if (isFinal) url+="&instructions=true";
this.requestJSONP(url+"&jsonp=");
},
gotRoute: function(router,data) {