enabled printing

This commit is contained in:
DennisSchiefer 2012-04-23 14:48:09 +01:00
parent 2060088c6b
commit 44c38146c9
3 changed files with 5 additions and 9 deletions

View File

@ -27,7 +27,7 @@ OSRM.init = function() {
OSRM.Localization.init(); OSRM.Localization.init();
OSRM.GUI.init(); OSRM.GUI.init();
OSRM.Map.init(); OSRM.Map.init();
//OSRM.Printing.init(); OSRM.Printing.init();
OSRM.Routing.init(); OSRM.Routing.init();
// check if the URL contains some GET parameter, e.g. for showing a route // check if the URL contains some GET parameter, e.g. for showing a route

View File

@ -95,12 +95,10 @@ show: function(response) {
route_desc += '<div class="result-item">'; route_desc += '<div class="result-item">';
// build route description // build route description
if( i == 0 ) if( response.route_instructions[i][1] != "" )
route_desc += OSRM.loc(OSRM.RoutingDescription.getDrivingInstruction(response.route_instructions[i][0])).replace(/\[(.*)\]/,"$1").replace(/%s/, OSRM.loc(response.route_instructions[i][6]) ); 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 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 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 += '</div>'; route_desc += '</div>';
route_desc += "</td>"; route_desc += "</td>";
@ -115,8 +113,6 @@ show: function(response) {
route_desc += '</tbody>'; route_desc += '</tbody>';
route_desc += '</table>'; route_desc += '</table>';
// put everything in DOM // put everything in DOM
OSRM.printwindow.document.getElementById('description').innerHTML = route_desc; OSRM.printwindow.document.getElementById('description').innerHTML = route_desc;
OSRM.printwindow.document.getElementById('overview-description').innerHTML = OSRM.printwindow.document.getElementById('overview-description').innerHTML =

View File

@ -35,10 +35,10 @@ or see http://www.gnu.org/licenses/agpl.txt.
<link rel="stylesheet" href="printing.css" type="text/css"/> <link rel="stylesheet" href="printing.css" type="text/css"/>
<!-- scripts --> <!-- scripts -->
<script src="printing.js" type="text/javascript"></script>
<script src="../leaflet/leaflet-src.js" type="text/javascript"></script> <script src="../leaflet/leaflet-src.js" type="text/javascript"></script>
<script src="../base/osrm/OSRM.MapView.js" type="text/javascript"></script> <script src="../base/osrm/OSRM.MapView.js" type="text/javascript"></script>
<script src="../base/OSRM.Map.js" type="text/javascript"></script> <script src="../base/OSRM.Map.js" type="text/javascript"></script>
<script src="printing.js" type="text/javascript"></script>
</head> </head>