]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/routing_engines/cloudmade_foot.js
add a credits line for each routing service
[rails.git] / app / assets / javascripts / routing_engines / cloudmade_foot.js
index 7aa147e5cf60ef711dbd2660900bdb9608cc0c8e..bee9e448a931be071d34349579f45e94c3b208f5 100644 (file)
@@ -4,7 +4,8 @@
 // http://cloudmade.com/documentation/routing
 
 OSM.RoutingEngines.list.push({
-       name: 'Foot (CloudMade)',
+       name: "javascripts.directions.engines.cloudmade_foot",
+       creditline: 'Directions courtesy of <a href="http://cloudmade.com/products/routing" target="_blank">Cloudmade</a>',
        draggable: false,
        CM_SPRITE_MAP: {
                "C": 1,
@@ -16,7 +17,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++) {
@@ -25,7 +26,8 @@ OSM.RoutingEngines.list.push({
                }
                url+=p.join(',');
                url+="/foot.js";
-               this.requestJSONP(url+"?callback=");
+        url+="?lang=" + I18n.currentLocale();
+               this.requestJSONP(url+"&callback=");
        },
        gotRoute: function(router,data) {
                router.setPolyline(data.route_geometry);