]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/routing_engines/mapquest.js
Minor fixes to the I18n code of routing
[rails.git] / app / assets / javascripts / routing_engines / mapquest.js
index fd17e59428857262b0f4e9dd4647c1f236aa4b85..39e47706aff72bcd4a6dd572cca971ea643e9689 100644 (file)
@@ -15,7 +15,7 @@ MapQuestEngine.prototype.createConfig = function() {
     var that = this;
     return {
         name: "javascripts.directions.engines.mapquest_"+this.vehicleName.toLowerCase(),
-        creditline: 'Directions courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png">',
+        creditline: '<a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png">',
         draggable: false,
         _hints: {},
         MQ_SPRITE_MAP: {
@@ -40,12 +40,12 @@ MapQuestEngine.prototype.createConfig = function() {
             18: 1  // straight fork
         },
         getRoute: function(isFinal,points) {
-            var url="http://open.mapquestapi.com/directions/v2/route?key=Fmjtd%7Cluur290anu%2Crl%3Do5-908a0y";
+            var url=document.location.protocol+"//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(',');
             url+="&to="+to.join(',');
             url+="&"+that.vehicleParam;
-            //url+="&locale=" + I18n.currentLocale(); //Doesn't actually work. MapQuest requires full locale e.g. "de_DE", but I18n only provides language, e.g. "de"
+            //url+="&locale=" + I18n.currentLocale(); //Doesn't actually work. MapQuest requires full locale e.g. "de_DE", but I18n may only provides language, e.g. "de"
             url+="&manMaps=false";
             url+="&shapeFormat=raw&generalize=0&unit=k";
             this.requestCORS(url);
@@ -88,7 +88,7 @@ MapQuestEngine.prototype.createConfig = function() {
     };
 };
 
-OSM.RoutingEngines.list.push(new MapQuestEngine("Bicycle", "routeType=bicycle").createConfig());
-OSM.RoutingEngines.list.push(new MapQuestEngine("Foot", "routeType=pedestrian").createConfig());
-OSM.RoutingEngines.list.push(new MapQuestEngine("Car", "routeType=fastest").createConfig());
+OSM.RoutingEngines.add(true, new MapQuestEngine("Bicycle", "routeType=bicycle").createConfig());
+OSM.RoutingEngines.add(true, new MapQuestEngine("Foot", "routeType=pedestrian").createConfig());
+OSM.RoutingEngines.add(true, new MapQuestEngine("Car", "routeType=fastest").createConfig());
 // can be: routeType=fastest|shortest|pedestrian|multimodal|bicycle