diff --git a/WebContent/main.js b/WebContent/main.js index 8755fbf8b..233075b5b 100644 --- a/WebContent/main.js +++ b/WebContent/main.js @@ -27,7 +27,7 @@ OSRM.init = function() { OSRM.Localization.init(); OSRM.GUI.init(); OSRM.Map.init(); - //OSRM.Printing.init(); + OSRM.Printing.init(); OSRM.Routing.init(); // check if the URL contains some GET parameter, e.g. for showing a route diff --git a/WebContent/printing/OSRM.Printing.js b/WebContent/printing/OSRM.Printing.js index b8a53428b..7d9a42343 100644 --- a/WebContent/printing/OSRM.Printing.js +++ b/WebContent/printing/OSRM.Printing.js @@ -95,12 +95,10 @@ show: function(response) { route_desc += '
'; // build route description - if( i == 0 ) - route_desc += OSRM.loc(OSRM.RoutingDescription.getDrivingInstruction(response.route_instructions[i][0])).replace(/\[(.*)\]/,"$1").replace(/%s/, OSRM.loc(response.route_instructions[i][6]) ); - else if( response.route_instructions[i][1] != "" ) - route_desc += OSRM.loc(OSRM.RoutingDescription.getDrivingInstruction(response.route_instructions[i][0])).replace(/\[(.*)\]/,"$1").replace(/%s/, response.route_instructions[i][1]); + if( response.route_instructions[i][1] != "" ) + route_desc += OSRM.loc(OSRM.RoutingDescription.getDrivingInstruction(response.route_instructions[i][0])).replace(/\[(.*)\]/,"$1").replace(/%s/, response.route_instructions[i][1]).replace(/%d/, OSRM.loc(response.route_instructions[i][6])); else - route_desc += OSRM.loc(OSRM.RoutingDescription.getDrivingInstruction(response.route_instructions[i][0])).replace(/\[(.*)\]/,""); + route_desc += OSRM.loc(OSRM.RoutingDescription.getDrivingInstruction(response.route_instructions[i][0])).replace(/\[(.*)\]/,"").replace(/%d/, OSRM.loc(response.route_instructions[i][6])); route_desc += '
'; route_desc += ""; @@ -115,8 +113,6 @@ show: function(response) { route_desc += ''; route_desc += ''; - - // put everything in DOM OSRM.printwindow.document.getElementById('description').innerHTML = route_desc; OSRM.printwindow.document.getElementById('overview-description').innerHTML = diff --git a/WebContent/printing/printing.html b/WebContent/printing/printing.html index 64a0d6809..dec97170b 100644 --- a/WebContent/printing/printing.html +++ b/WebContent/printing/printing.html @@ -35,10 +35,10 @@ or see http://www.gnu.org/licenses/agpl.txt. + -