diff --git a/WebContent/main.css b/WebContent/main.css index bf85c17bb..a40f9ba8a 100644 --- a/WebContent/main.css +++ b/WebContent/main.css @@ -248,6 +248,11 @@ html, body { font-weight:bold; margin-bottom:10px; } +.header-label +{ + font-weight:normal; + padding:0px 5px 0px 0px; +} .header-content { font-weight:normal; @@ -265,57 +270,57 @@ html, body { /* style for information-box table (search results, driving directions) */ -.results-table +.description { border-spacing:0px; width:100%; } -.results-odd +.description-body-odd { background-color: #FFFDE3; } -.results-even +.description-body-even { background-color: #FFF9BB; } -.result-counter +.description-body-counter { text-align:right; vertical-align:top; font-weight:bold; padding:1px 5px 1px 5px; } -.result-items +.description-body-items { text-align:left; vertical-align: middle; width:100%; padding:1px; } -.result-directions +.description-body-directions { text-align:left; vertical-align: middle; padding:1px 5px 1px 5px; } -.result-direction +.description-body-direction { width:18px; height:18px; } -.result-distance +.description-body-distance { text-align:right; vertical-align: middle; padding:1px 1px 1px 5px; } -.result-item +.description-body-item { cursor:pointer; color:#000000 } -.result-item:hover +.description-body-item:hover { color:#ff0000 } @@ -496,4 +501,8 @@ html, body { display:table-cell; text-align:center; vertical-align:middle; +} +.stretch +{ + width:100%; } \ No newline at end of file diff --git a/WebContent/printing/OSRM.Printing.js b/WebContent/printing/OSRM.Printing.js index b63f6638c..00cc2ae68 100644 --- a/WebContent/printing/OSRM.Printing.js +++ b/WebContent/printing/OSRM.Printing.js @@ -89,15 +89,15 @@ show: function(response) { body += ''; body += ''; - body += ''; + body += ''; body += ""; // build route description body += ''; if( response.route_instructions[i][1] != "" ) - body += 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])); + body += 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 - body += OSRM.loc(OSRM.RoutingDescription.getDrivingInstruction(response.route_instructions[i][0])).replace(/\[(.*)\]/,"").replace(/%d/, OSRM.loc(response.route_instructions[i][6])); + body += OSRM.loc(OSRM.RoutingDescription._getDrivingInstruction(response.route_instructions[i][0])).replace(/\[(.*)\]/,"").replace(/%d/, OSRM.loc(response.route_instructions[i][6])); body += ""; body += ''; diff --git a/WebContent/routing/OSRM.RoutingDescription.js b/WebContent/routing/OSRM.RoutingDescription.js index 915c51306..03c91ab7d 100644 --- a/WebContent/routing/OSRM.RoutingDescription.js +++ b/WebContent/routing/OSRM.RoutingDescription.js @@ -58,78 +58,53 @@ show: function(response) { var gpx_link = '['+OSRM.loc("GPX_FILE")+']'; // create route description - var route_desc = ""; - route_desc += ''; - + var body = ""; + + body += '
'; for(var i=0; i < response.route_instructions.length; i++){ //odd or even ? - var rowstyle='results-odd'; - if(i%2==0) { rowstyle='results-even'; } + var rowstyle='description-body-odd'; + if(i%2==0) { rowstyle='description-body-even'; } - route_desc += ''; + body += ''; - route_desc += ''; + body += ''; - route_desc += '"; + body += ''; + body += ""; - route_desc += '"; + body += ''+OSRM.Utils.metersToDistance(response.route_instructions[i][2])+''; + body += ""; - route_desc += ""; + body += ""; } - route_desc += '
'; - route_desc += ''; - route_desc += ''; + body += ''; + body += ''; - route_desc += '
'; + body += '
'; + body += '
'; // build route description 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])); + body += 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(/\[(.*)\]/,"").replace(/%d/, OSRM.loc(response.route_instructions[i][6])); + body += OSRM.loc(OSRM.RoutingDescription._getDrivingInstruction(response.route_instructions[i][0])).replace(/\[(.*)\]/,"").replace(/%d/, OSRM.loc(response.route_instructions[i][6])); - route_desc += '
'; - route_desc += "
'; + body += ''; if( i != response.route_instructions.length-1 ) - route_desc += ''+OSRM.Utils.metersToDistance(response.route_instructions[i][2])+''; - route_desc += "
'; + body += ''; - // create header - header = - '
' + OSRM.loc("ROUTE_DESCRIPTION") + '
' + - '
' + - '
' + - '
' + OSRM.loc("DISTANCE")+":" + '
' + - '
' + OSRM.Utils.metersToDistance(response.route_summary.total_distance) + '
' + - '' + - '
' + - '
' + - '
' + OSRM.loc("DURATION")+":" + '
' + - '
' + OSRM.Utils.secondsToTime(response.route_summary.total_time) + '
' + - '
' + gpx_link + '
' + - '
' + - '
'; + // 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); // update DOM document.getElementById('information-box-header').innerHTML = header; - document.getElementById('information-box').innerHTML = route_desc; + document.getElementById('information-box').innerHTML = body; }, // simple description showSimple: function(response) { - header = - '
' + OSRM.loc("ROUTE_DESCRIPTION") + '
' + - '
' + - '
' + - '
' + OSRM.loc("DISTANCE")+":" + '
' + - '
' + OSRM.Utils.metersToDistance(response.route_summary.total_distance) + '
' + - '' + - '
' + - '
' + - '
' + OSRM.loc("DURATION")+":" + '
' + - '
' + OSRM.Utils.secondsToTime(response.route_summary.total_time) + '
' + - '
' + - '
' + - '
'; + // build header + header = OSRM.RoutingDescription._buildHeader(OSRM.Utils.metersToDistance(response.route_summary.total_distance), OSRM.Utils.secondsToTime(response.route_summary.total_time), "", ""); // update DOM document.getElementById('information-box-header').innerHTML = header; @@ -138,28 +113,68 @@ showSimple: function(response) { // no description showNA: function( display_text ) { - header = - '
' + OSRM.loc("ROUTE_DESCRIPTION") + '
' + - '
' + - '
' + - '
' + OSRM.loc("DISTANCE")+":" + '
' + - '
' + "N/A" + '
' + - '' + - '
' + - '
' + - '
' + OSRM.loc("DURATION")+":" + '
' + - '
' + "N/A" + '
' + - '
' + - '
' + - '
'; + // build header + header = OSRM.RoutingDescription._buildHeader("N/A", "N/A", "", ""); // update DOM document.getElementById('information-box-header').innerHTML = header; document.getElementById('information-box').innerHTML = "
"+display_text+"
"; }, +// build header +_buildHeader: function(distance, duration, route_link, gpx_link) { + var temp = + '
' + OSRM.loc("ROUTE_DESCRIPTION") + '
' + + + '
' + + '
' + + + '
' + + '
' + + '
' + + '
' + OSRM.loc("DISTANCE")+":" + '
' + + '
' + distance + '
' + + '
' + + '
' + + '
' + OSRM.loc("DURATION")+":" + '
' + + '
' + duration + '
' + + '
' + + '
' + + '
' + + + '
' + + '
' + + '
' + + '' + + '
' + + '
' + + '
' + gpx_link + '
' + + '
' + + '
' + + '
' + + + '
' + + '
' + + + ''; +// '
' + OSRM.loc("ROUTE_DESCRIPTION") + '
' + +// '
' + +// '
' + +// '
' + OSRM.loc("DISTANCE")+":" + '
' + +// '
' + distance + '
' + +// '' + +// '
' + +// '
' + +// '
' + OSRM.loc("DURATION")+":" + '
' + +// '
' + duration + '
' + +// '
' + gpx_link + '
' + +// '
' + +// '
'; + return temp; +}, + // retrieve driving instruction icon from instruction id -getDrivingInstructionIcon: function(server_instruction_id) { +_getDrivingInstructionIcon: function(server_instruction_id) { var local_icon_id = "direction_"; server_instruction_id = server_instruction_id.replace(/^11-\d{1,}$/,"11"); // dumb check, if there is a roundabout (all have the same icon) local_icon_id += server_instruction_id; @@ -171,7 +186,7 @@ getDrivingInstructionIcon: function(server_instruction_id) { }, // retrieve driving instructions from instruction ids -getDrivingInstruction: function(server_instruction_id) { +_getDrivingInstruction: function(server_instruction_id) { var local_instruction_id = "DIRECTION_"; server_instruction_id = server_instruction_id.replace(/^11-\d{2,}$/,"11-x"); // dumb check, if there are 10+ exits on a roundabout (say the same for exit 10+) local_instruction_id += server_instruction_id;