From: Tom Hughes Date: Sun, 5 Mar 2017 10:34:23 +0000 (+0000) Subject: Merge remote-tracking branch 'openstreetmap/pull/1437' X-Git-Tag: live~3568 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/b954416a70fb167b9cae0a3937de16bd9a93d239?hp=e35748567c431c3a092816bfbab0d2f5043284b1 Merge remote-tracking branch 'openstreetmap/pull/1437' --- diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 2a1e045da..11601c5b2 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -207,8 +207,13 @@ OSM.Directions = function (map) { '' + I18n.t('javascripts.directions.directions') + '

' + I18n.t('javascripts.directions.distance') + ': ' + formatDistance(route.distance) + '. ' + - I18n.t('javascripts.directions.time') + ': ' + formatTime(route.time) + '.

' + - ''; + I18n.t('javascripts.directions.time') + ': ' + formatTime(route.time) + '.'; + if (typeof route.ascend !== 'undefined' && typeof route.descend !== 'undefined') { + html += '
' + + I18n.t('javascripts.directions.ascend') + ': ' + Math.round(route.ascend) + 'm. ' + + I18n.t('javascripts.directions.descend') + ': ' + Math.round(route.descend) +'m.'; + } + html += '

'; $('#sidebar_content') .html(html); diff --git a/app/assets/javascripts/index/directions/graphhopper.js b/app/assets/javascripts/index/directions/graphhopper.js index 7a5d77d9b..4bb4e4ed6 100644 --- a/app/assets/javascripts/index/directions/graphhopper.js +++ b/app/assets/javascripts/index/directions/graphhopper.js @@ -66,7 +66,9 @@ function GraphHopperEngine(id, vehicleType) { line: line, steps: steps, distance: path.distance, - time: path.time / 1000 + time: path.time / 1000, + ascend: path.ascend, + descend: path.descend }); }, error: function () { diff --git a/config/locales/en.yml b/config/locales/en.yml index d71568ceb..7edeea7d0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2250,6 +2250,7 @@ en: comment: Comment edit_help: Move the map and zoom in on a location you want to edit, then click here. directions: + ascend: "Ascend" engines: graphhopper_bicycle: "Bicycle (GraphHopper)" graphhopper_foot: "Foot (GraphHopper)" @@ -2260,6 +2261,7 @@ en: mapzen_bicycle: "Bicycle (Mapzen)" mapzen_car: "Car (Mapzen)" mapzen_foot: "Foot (Mapzen)" + descend: "Descend" directions: "Directions" distance: "Distance" errors: