]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/directions.js
Merge remote-tracking branch 'openstreetmap/pull/1437'
[rails.git] / app / assets / javascripts / index / directions.js
index 2a1e045dae4efc2bf61a5c5c75ce80ac54849f65..11601c5b2312819b752626b4738e48162d99dd86 100644 (file)
@@ -207,8 +207,13 @@ OSM.Directions = function (map) {
         '<span class="icon close"></span></a>' + I18n.t('javascripts.directions.directions') +
         '</h2><p id="routing_summary">' +
         I18n.t('javascripts.directions.distance') + ': ' + formatDistance(route.distance) + '. ' +
-        I18n.t('javascripts.directions.time') + ': ' + formatTime(route.time) + '.</p>' +
-        '<table id="turnbyturn" />';
+        I18n.t('javascripts.directions.time') + ': ' + formatTime(route.time) + '.';
+      if (typeof route.ascend !== 'undefined' && typeof route.descend !== 'undefined') {
+        html += '<br />' +
+          I18n.t('javascripts.directions.ascend') + ': ' + Math.round(route.ascend) + 'm. ' +
+          I18n.t('javascripts.directions.descend') + ': ' + Math.round(route.descend) +'m.';
+      }
+      html += '</p><table id="turnbyturn" />';
 
       $('#sidebar_content')
         .html(html);