]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/routing_engines/graphhopper_bicycle.js
Merge pull request #6 from apmon/jsroute
[rails.git] / app / assets / javascripts / routing_engines / graphhopper_bicycle.js
index 39c7bca595e9ccba42fef8b48a606f63fa9eeb46..6245124b1cd1ea5349027aac9e94195c719b3cb3 100644 (file)
@@ -1,16 +1,16 @@
 // GraphHopper bicycle engine
 
 OSM.RoutingEngines.list.push({    
-    name: 'Bicycle (GraphHopper)',
+    name: "javascripts.directions.engines.graphhopper_bike",
     draggable: true,
     _hints: {},
-    getRoute: function(final, points) {
-        var url = "http://graphhopper.com/routing/api/route?vehicle=bike&locale=en";
+    getRoute: function(isFinal, points) {
+        var url = "http://graphhopper.com/routing/api/route?vehicle=bike&locale=" + I18n.currentLocale();
         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=");
     },