individual ids/classes for geocoder search results

This commit is contained in:
DennisSchiefer 2012-04-27 08:55:11 +01:00
parent 448e6cfdc7
commit fbe722465d
2 changed files with 54 additions and 19 deletions

View File

@ -84,20 +84,20 @@ _showResults: function(response, parameters) {
// show possible results for input
var html = "";
html += '<table class="description medium-font">';
html += '<table class="results medium-font">';
for(var i=0; i < response.length; i++){
var result = response[i];
//odd or even ?
var rowstyle='description-body-odd';
if(i%2==0) { rowstyle='description-body-even'; }
var rowstyle='results-body-odd';
if(i%2==0) { rowstyle='results-body-even'; }
html += '<tr class="'+rowstyle+'">';
html += '<td class="description-body-counter"><span">'+(i+1)+'.</span></td>';
html += '<td class="description-body-items">';
html += '<td class="results-body-counter"><span">'+(i+1)+'.</span></td>';
html += '<td class="results-body-items">';
if(result.display_name){
html += '<div class="description-body-item" onclick="OSRM.Geocoder._onclickResult(\''+parameters.marker_id+'\', '+result.lat+', '+result.lon+');">'+result.display_name+'</div>';
html += '<div class="results-body-item" onclick="OSRM.Geocoder._onclickResult(\''+parameters.marker_id+'\', '+result.lat+', '+result.lon+');">'+result.display_name+'</div>';
}
html += "</td></tr>";
}

View File

@ -269,7 +269,54 @@ html, body {
}
/* style for information-box table (search results, driving directions) */
/* style for information-box table (general) */
.no-results
{
text-align:center;
margin:28px;
}
/* style for information-box table (search results) */
.results
{
border-spacing:0px;
width:100%;
}
.results-body-odd
{
background-color: #FFFDE3;
}
.results-body-even
{
background-color: #FFF9BB;
}
.results-body-counter
{
text-align:right;
vertical-align:top;
font-weight:bold;
padding:1px 5px 1px 5px;
}
.results-body-items
{
text-align:left;
vertical-align: middle;
width:100%;
padding:1px;
}
.results-body-item
{
cursor:pointer;
color:#000000
}
.results-body-item:hover
{
color:#ff0000
}
/* style for information-box table (driving directions) */
.description
{
border-spacing:0px;
@ -283,13 +330,6 @@ html, body {
{
background-color: #FFF9BB;
}
.description-body-counter
{
text-align:right;
vertical-align:top;
font-weight:bold;
padding:1px 5px 1px 5px;
}
.description-body-items
{
text-align:left;
@ -324,11 +364,6 @@ html, body {
{
color:#ff0000
}
.no-results
{
text-align:center;
margin:28px;
}
/* buttons */