]> git.openstreetmap.org Git - rails.git/commitdiff
Apparently 'final' is a reserved word in JS...
authorRichard Fairhurst <richard@systemeD.net>
Thu, 23 Jan 2014 22:29:09 +0000 (22:29 +0000)
committerRichard Fairhurst <richard@systemeD.net>
Thu, 23 Jan 2014 22:29:09 +0000 (22:29 +0000)
app/assets/javascripts/routing.js.erb
app/assets/javascripts/routing_engines/cloudmade_foot.js
app/assets/javascripts/routing_engines/graphhopper_bicycle.js
app/assets/javascripts/routing_engines/mapquest_bicycle.js
app/assets/javascripts/routing_engines/osrm_car.js

index ce8ec93e8442f21c6404e98eaf7a4e7975e6516d..7f18aa472d612f12d37b56240c5c80f3b57c70b9 100644 (file)
@@ -159,10 +159,10 @@ OSM.Routing=function(map,name,jqSearch) {
        
        // 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
index 7aa147e5cf60ef711dbd2660900bdb9608cc0c8e..5193c647245067b5a51dca4f62bf476b7d6bcc57 100644 (file)
@@ -16,7 +16,7 @@ OSM.RoutingEngines.list.push({
                "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++) {
index 39c7bca595e9ccba42fef8b48a606f63fa9eeb46..7f7c83c80116c44a16a95e17a5d086a721bf03a0 100644 (file)
@@ -4,13 +4,13 @@ OSM.RoutingEngines.list.push({
     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=");
     },
index 2f7642de9e72bf625283e79712f26bc95d522d9a..f74ccba151951c9032b5be80ea9c4dd7a8daec60 100644 (file)
@@ -30,7 +30,7 @@ OSM.RoutingEngines.list.push({
                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(',');
index e3eb6b44c0cc44b539efda866310dde42be473d4..cb80c5615ba3d7fd2e23a5f59aba707c11197a5f 100644 (file)
@@ -6,14 +6,14 @@ OSM.RoutingEngines.list.push({
        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) {