]> git.openstreetmap.org Git - rails.git/commitdiff
Merge pull request #11 from danstowell/jsrouting-pulldownchange
authorRichard Fairhurst <richard@systemeD.net>
Fri, 7 Mar 2014 15:58:04 +0000 (15:58 +0000)
committerRichard Fairhurst <richard@systemeD.net>
Fri, 7 Mar 2014 15:58:04 +0000 (15:58 +0000)
refresh search if showing and user changes provider

app/assets/javascripts/routing.js.erb
app/assets/javascripts/routing_engines/cloudmade_foot.js
app/assets/javascripts/routing_engines/graphhopper_bicycle.js
app/assets/javascripts/routing_engines/mapquest_bicycle.js
app/assets/javascripts/routing_engines/osrm_car.js
app/assets/stylesheets/common.css.scss

index 4ea30fa000759677b03f8c20c1757e62d9af54f4..fbec3e7e3ada6e072eea4fd87ffdd670782dd837 100644 (file)
@@ -211,6 +211,8 @@ OSM.Routing=function(map,name,jqSearch) {
                        $('#turnbyturn').append(row);
                        cumulative+=step[3];
                }
+               $('#sidebar_content').append('<p id="routing_credit">' + r.chosenEngine.creditline + '</p>');
+
        };
        r.clickTurn=function(num,latlng) {
                r.popup=L.popup().setLatLng(latlng).setContent("<p>"+(num+1)+"</p>").openOn(r.map);
index 5c1ba0e9716ab1088042640fab5f7470230a7a90..bee9e448a931be071d34349579f45e94c3b208f5 100644 (file)
@@ -5,6 +5,7 @@
 
 OSM.RoutingEngines.list.push({
        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,
index 6245124b1cd1ea5349027aac9e94195c719b3cb3..bec855f88dd44e0f1b07f6cd21a537ddf18055ab 100644 (file)
@@ -2,6 +2,7 @@
 
 OSM.RoutingEngines.list.push({    
     name: "javascripts.directions.engines.graphhopper_bike",
+    creditline: 'Directions courtesy of <a href="http://graphhopper.com/routing/" target="_blank">Graphhopper</a>',
     draggable: true,
     _hints: {},
     getRoute: function(isFinal, points) {
index b080969558400c03fd2d012a7d86b0697d65daed..c7995246ab22466a84aeed019eac1d86c1f26498 100644 (file)
@@ -3,10 +3,9 @@
 // http://open.mapquestapi.com/directions/
 // https://github.com/apmon/openstreetmap-website/blob/21edc353a4558006f0ce23f5ec3930be6a7d4c8b/app/controllers/routing_controller.rb#L153
 
-// *** needs to give credit
-
 OSM.RoutingEngines.list.push({
        name: "javascripts.directions.engines.mapquest_bike",
+       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">',
        draggable: false,
        _hints: {},
        MQ_SPRITE_MAP: {
index 0011b02058167d33ed4fdce606e09418a6d81a2b..da94adf053aa8356c385a1aff8b9ad9562850545 100644 (file)
@@ -4,6 +4,7 @@
 
 OSM.RoutingEngines.list.push({
        name: "javascripts.directions.engines.osrm_car",
+       creditline: 'Directions courtesy of <a href="http://project-osrm.org/" target="_blank">OSRM</a>',
        draggable: true,
        _hints: {},
        getRoute: function(isFinal,points) {
index 0f306b6d3036b865c9d679ef28a621a6bc06be6c..a8fba1943fa0eee84d150d4e1cadae6185a4c45f 100644 (file)
@@ -1217,6 +1217,15 @@ tr.turn:hover {
   }
 }
 
+/* Rules for the routing sidebar */
+
+#sidebar_content {
+  #routing_credit {
+    text-align: center;
+    padding: 0.5em;
+  }
+}
+
 /* Rules for edit pages */
 
 .site-edit {