Permalink
Browse files

Added credits to html

  • Loading branch information...
1 parent 01e7a14 commit e2e7b91a00ed23d3f9e342f29fc0884c81f9f687 David Troy committed May 30, 2008
Showing with 21 additions and 9 deletions.
  1. +15 −8 geohash-demo.js
  2. +6 −1 index.html
View
@@ -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);
@@ -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;
@@ -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();
View
@@ -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">
@@ -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.