Skip to content

Commit

Permalink
Added credits to html
Browse files Browse the repository at this point in the history
  • Loading branch information
David Troy committed May 30, 2008
1 parent 01e7a14 commit e2e7b91
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
23 changes: 15 additions & 8 deletions geohash-demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,14 @@ function wheelZoom(a) { (a.detail || -a.wheelDelta) < 0 ? map.zoomIn() : map.zoo
function sizeMap() {
var dims = getWindowDimensions();
var mapdiv = document.getElementById("map");
mapdiv.style.height = dims.height-105;
mapdiv.style.height = dims.height-120;
mapdiv.style.width = dims.width;

var headerdiv = document.getElementById("header");
headerdiv.style.width = dims.width-15;
headerdiv.style.width = dims.width-30;

var creditsdiv = document.getElementById("credits");
creditsdiv.style.left = dims.width-180;

map = new GMap2(mapdiv);
map.setCenter(new GLatLng(39.024,-76.51), 9);
Expand Down Expand Up @@ -107,6 +110,12 @@ function geocodeAddress () {
}

function plotGeoHash (gLatLng) {
if (gLatLng==null) {
setText('boxList', 'Location not found!');
setText('searchInfo', '');
return false;
}

var geohash = encodeGeoHash(gLatLng.lat(), gLatLng.lng());
document.getElementById("geoHash").value = geohash;
var resolution = document.getElementById("hashResolution").value;
Expand Down Expand Up @@ -145,20 +154,18 @@ function plotGeoHash (gLatLng) {
// map.addOverlay(myMarker);
}

function clearSpan(s) {
function setText(s,t) {
sp = document.getElementById(s);
sp.innerHTML = "";
sp.innerHTML = t;
}

function cleanUp() {
map.clearOverlays();
clearSpan('boxList');
clearSpan('searchInfo');
setText('boxList','');
setText('searchInfo','');
}


window.onload = function () {

if (GBrowserIsCompatible()) {
window.onresize = sizeMap;
sizeMap();
Expand Down
7 changes: 6 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
font-family: 'Helvetica';
text-transform: uppercase;
}
a {color: #3199ee;text-decoration:none} a:hover {color:#fa0;}a img{border: 0;}
</style>
</head>
<body>
<div style="background: #000; height: 90px; padding-left: 15px; padding-top: 15px;" id="header">
<div style="background: #000; height: 90px; padding: 15px;" id="header">
<input type="text" value="1600 Pennsylvania Ave, Washington, DC" id="address" name="address" size="50">
<input type="text" value="" id="geoHash" name="geoHash">
<select id="hashResolution" name="hashResolution">
Expand All @@ -40,6 +41,10 @@
<div id="boxList"></div>
<div id="searchInfo"></div>
</div>
<div style="position:absolute; top:15px; width: 150px; text-align:right;" id="credits">
<a href="http://github.com/davetroy/geohash-js/tree/master" target="new">source code</a><br>
&copy; 2008 David Troy
</div>
<div id="map"/>
</body>
</html>

0 comments on commit e2e7b91

Please sign in to comment.