Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added thumbnails to city list
  • Loading branch information
bitsteller committed Oct 5, 2011
1 parent a01447b commit 68b4878
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.html
Expand Up @@ -32,7 +32,7 @@ <h2>Isometric 3D maps of some cities</h2>
<p>
<table id="city_list">
<thead>
<tr><th>City</th> <th>Last update</th> <th> </th></tr>
<tr><th></th><th>City</th> <th>Last update</th> <th> </th></tr>
</thead>
<tbody>
<tr><td><img src="loading.gif"/> Loading...</td><td>(Javascript has to be enabled)</td><td></td></tr>
Expand All @@ -41,7 +41,7 @@ <h2>Isometric 3D maps of some cities</h2>
</p>
</p>

<p>The OSM data of the renderings might be up to 5 days older than the rendering date. To get notified when a new rendering is finished, follow us on Twitter: <a href="https://twitter.com/bitstellerOSM" class="twitter-follow-button">Follow @bitstellerOSM</a> </p>
<p>The OSM data of the renderings might be up to 5 days older than the rendering date. To get notified when a new rendering is finished, follow on Twitter: <a href="https://twitter.com/bitstellerOSM" class="twitter-follow-button">Follow @bitstellerOSM</a> </p>
</div>
<div class="box">
<h2>osm-isometric-3d</h2>
Expand Down
12 changes: 12 additions & 0 deletions js/osm-isometric-3d.js
Expand Up @@ -90,7 +90,18 @@ function refreshCityTable() {
var state_date = citiesXml.evaluate("//cities/city[@id='" + city_id + "']/state/@date" , citiesXml, null, XPathResult.STRING_TYPE, null).stringValue;
var state_type = citiesXml.evaluate("//cities/city[@id='" + city_id + "']/state/@type" , citiesXml, null, XPathResult.STRING_TYPE, null).stringValue;
var state_message = citiesXml.evaluate("//cities/city[@id='" + city_id + "']/state/@message" , citiesXml, null, XPathResult.STRING_TYPE, null).stringValue;
var area_left = citiesXml.evaluate("//cities/city[@id='" + city_id + "']/area/@left" , citiesXml, null, XPathResult.NUMBER_TYPE, null).numberValue;
var area_top = citiesXml.evaluate("//cities/city[@id='" + city_id + "']/area/@top" , citiesXml, null, XPathResult.NUMBER_TYPE, null).numberValue;
var area_right = citiesXml.evaluate("//cities/city[@id='" + city_id + "']/area/@right" , citiesXml, null, XPathResult.NUMBER_TYPE, null).numberValue;
var area_bottom = citiesXml.evaluate("//cities/city[@id='" + city_id + "']/area/@bottom" , citiesXml, null, XPathResult.NUMBER_TYPE, null).numberValue;

var row = document.createElement("tr");
var cell0 = document.createElement("td");
var image = document.createElement("img");
image.setAttribute("src", "tiles/14/" + Math.round(long2tile((area_left+area_right)/2.0,14)) + "/" + Math.round(lat2tile((area_top+area_bottom)/2.0,14)/2.0) + ".png");
image.setAttribute("class", "thumbnail");
cell0.appendChild(image);

var cell1 = document.createElement("td");
var link = document.createElement("a");
link.setAttribute("href", "map.html#" + city_id);
Expand Down Expand Up @@ -127,6 +138,7 @@ function refreshCityTable() {

}
}
row.appendChild(cell0);
row.appendChild(cell1);
row.appendChild(cell2);
row.appendChild(cell3);
Expand Down
5 changes: 5 additions & 0 deletions style.css
Expand Up @@ -115,6 +115,11 @@ table {
float:right;
}

.thumbnail {
width:48px;
height:48px;
}

#page{
max-width:800px;
clear: both;
Expand Down

0 comments on commit 68b4878

Please sign in to comment.