]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/routing_engines/graphhopper.js
Merge pull request #19 from apmon/jsroute2
[rails.git] / app / assets / javascripts / routing_engines / graphhopper.js
index 6d83e26e2839b721454cd9722caf2352556105af..0f29c162b8ffe57da6ed290aef3577da15159560 100644 (file)
@@ -1,6 +1,7 @@
 GraphHopperEngine = function(vehicleName, vehicleParam, locale) {
     this.vehicleName = vehicleName;
     this.vehicleParam = vehicleParam;
+    //At this point the local system isn't correctly initialised yet, so we don't have accurate information about current locale
     this.locale = locale;
     if (!locale)
         this.locale = "en";
@@ -10,12 +11,13 @@ GraphHopperEngine.prototype.createConfig = function() {
     var that = this;
     return {
         name: "javascripts.directions.engines.graphhopper_"+this.vehicleName.toLowerCase(),
+            creditline: '<a href="http://graphhopper.com/" target="_blank">Graphhopper</a>',
         draggable: false,
         _hints: {},
         getRoute: function(isFinal, points) {
             var url = "http://graphhopper.com/routing/api/route?" 
                     + that.vehicleParam 
-                    + "&locale=" + that.locale;
+                    + "&locale=" + I18n.currentLocale();
             for (var i = 0; i < points.length; i++) {
                 var pair = points[i].join(',');
                 url += "&point=" + pair;