diff --git a/WebContent/main.js b/WebContent/main.js index 2c0e81b0f..99ec8530e 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 30a7f798c..90974d988 100644 --- a/WebContent/printing/OSRM.Printing.js +++ b/WebContent/printing/OSRM.Printing.js @@ -36,15 +36,29 @@ init: function() { }, windowLoaded: function(){ - OSRM.printwindow.initialize(); OSRM.Printing.show( OSRM.G.response ); OSRM.printwindow.focus(); }, show: function(response) { + // create header + header = + '
'+header+' | ||
';
- route_desc += ' | ";
route_desc += '';
- route_desc += '';
- route_desc += response.route_instructions[i][0];
+ route_desc += ' ';
+
+ // build route description
if( i == 0 )
- route_desc += ' ' + OSRM.loc( response.route_instructions[i][6] );
- if( response.route_instructions[i][1] != "" ) {
- route_desc += ' on ';
- route_desc += '' + response.route_instructions[i][1] + '';
- }
- //route_desc += ' for ';
- route_desc += '';
+ 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]);
+ else
+ route_desc += OSRM.loc(OSRM.RoutingDescription.getDrivingInstruction(response.route_instructions[i][0])).replace(/\[(.*)\]/,"");
+
+ route_desc += ' ';
route_desc += " | ";
route_desc += ''; @@ -76,29 +91,31 @@ show: function(response) { route_desc += " | "; route_desc += "