added miles/feet display (without gui option at the moment)

This commit is contained in:
shiin
2012-05-06 18:37:23 +02:00
parent 222e4e8916
commit 0e9dcc30b7
5 changed files with 26 additions and 13 deletions
@@ -92,7 +92,7 @@ show: function(response) {
body += '<td class="description-body-distance">';
if( i != response.route_instructions.length-1 )
body += '<b>'+OSRM.Utils.metersToDistance(response.route_instructions[i][2])+'</b>';
body += '<b>'+OSRM.Utils.toHumanDistance(response.route_instructions[i][2])+'</b>';
body += "</td>";
body += "</tr>";
@@ -100,7 +100,7 @@ show: function(response) {
body += '</table>';
// build header
header = OSRM.RoutingDescription._buildHeader(OSRM.Utils.metersToDistance(response.route_summary.total_distance), OSRM.Utils.secondsToTime(response.route_summary.total_time), route_link, gpx_link);
header = OSRM.RoutingDescription._buildHeader(OSRM.Utils.toHumanDistance(response.route_summary.total_distance), OSRM.Utils.toHumanTime(response.route_summary.total_time), route_link, gpx_link);
// update DOM
document.getElementById('information-box-header').innerHTML = header;
@@ -110,7 +110,7 @@ show: function(response) {
// simple description
showSimple: function(response) {
// build header
header = OSRM.RoutingDescription._buildHeader(OSRM.Utils.metersToDistance(response.route_summary.total_distance), OSRM.Utils.secondsToTime(response.route_summary.total_time), "", "");
header = OSRM.RoutingDescription._buildHeader(OSRM.Utils.toHumanDistance(response.route_summary.total_distance), OSRM.Utils.toHumanTime(response.route_summary.total_time), "", "");
// update DOM
document.getElementById('information-box-header').innerHTML = header;