]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/routing_engines/osrm_car.js
Merge pull request #6 from apmon/jsroute
[rails.git] / app / assets / javascripts / routing_engines / osrm_car.js
index e3eb6b44c0cc44b539efda866310dde42be473d4..0011b02058167d33ed4fdce606e09418a6d81a2b 100644 (file)
@@ -3,17 +3,17 @@
 // *** need to clear hints at some point
 
 OSM.RoutingEngines.list.push({
-       name: 'Car (OSRM)',
+       name: "javascripts.directions.engines.osrm_car",
        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) {
@@ -34,7 +34,7 @@ OSM.RoutingEngines.list.push({
                        var instText="<b>"+(i+1)+".</b> ";
                        instText+=TURN_INSTRUCTIONS[instCodes[0]];
                        if (instCodes[1]) { instText+="exit "+instCodes[1]+" "; }
-                       if (instCodes[0]!=15) { instText+=s[1] ? "<b>"+s[1]+"</b>" : "(unnamed)"; }
+                       if (instCodes[0]!=15) { instText+=s[1] ? "<b>"+s[1]+"</b>" : I18n.t('javascripts.directions.instructions.unnamed'); }
                        steps.push([line[s[3]], s[0].split('-')[0], instText, s[2]]);
                }
                if (steps.length) router.setItinerary({ steps: steps });