Skip to content

Commit

Permalink
added permalink functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
bitsteller committed Sep 22, 2011
1 parent a19d9bb commit 05a433a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion js/osm-isometric-3d.js
Expand Up @@ -225,7 +225,10 @@ function getCityByLatLon(lat,lon) {
}

function loadPermalink() {
//TODO
var center = map.center();
var lat = tile2lat(lat2tile(center.latitude,12)* 2.0,12);
var lon = center.longitude;
location.href = "map.html#" + lat + "," + lon + "," + map.zoom();
}

function loadCity() {
Expand Down
2 changes: 1 addition & 1 deletion map.html
Expand Up @@ -19,6 +19,6 @@
<div id="map"> </div>
<div id="attribution">Map data by <a href="www.openstreetmap.org">Openstreetmap</a> <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a></div></div>
</div>
<div id="footer"><div id="state"><div class="timestamp">Last update: unknown</div></div></div>
<div id="footer"><a id="permalink" href="javascript:void(0)" onClick="loadPermalink()">Permalink</a><div id="state"><div class="timestamp">Last update: unknown</div></div></div>
</body>
</html>
4 changes: 4 additions & 0 deletions style.css
Expand Up @@ -174,6 +174,10 @@ table {
z-index:1;
}

#permalink{
float:right;
}

#city_select {
font-size:large;
}
Expand Down

0 comments on commit 05a433a

Please sign in to comment.