summaryrefslogtreecommitdiff
path: root/map.js
diff options
context:
space:
mode:
authorChristian Pointner <equinox@ffgraz.net>2008-12-06 17:38:58 +0000
committerChristian Pointner <equinox@ffgraz.net>2008-12-06 17:38:58 +0000
commitd585ae96c39abe04572f7b7e9ac2c4ce264f93e5 (patch)
treecd4d95256be496f0d9fc8a66b185d6ad734946e8 /map.js
parent551c3222b65f5c68d2e0e45ddff7c5e814316ed1 (diff)
added location info
Diffstat (limited to 'map.js')
-rw-r--r--map.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/map.js b/map.js
index bd03cc0..c43552e 100644
--- a/map.js
+++ b/map.js
@@ -115,6 +115,7 @@ function drawLocations(xmlData) {
var marker = new GMarker(locations[id].point, {icon: makeIcon(locations[id].state)});
marker.overlaytype = "location";
marker.locid = id;
+ GEvent.addListener(marker, "click", onLocationClick);
map.addOverlay(marker);
}
}
@@ -133,6 +134,31 @@ function Location(element) {
return location;
}
+function onLocationClick(latlng) {
+ var html = '<div class="locinfo">';
+ html += '<b>' + locations[this.locid].name + '</b>';
+ html += '<table class="locinfo">';
+ html += '<tr><td>Breitengrad:</td><td>&nbsp;</td><td>' + convertCoords(locations[this.locid].point.lat()) + '</td></tr>';
+ html += '<tr><td>Längengrad:</td><td>&nbsp;</td><td>' + convertCoords(locations[this.locid].point.lng()) + '</td></tr>';
+ html += '<tr><td>Datenbank:</td><td>&nbsp;</td><td><a href="http://manman.graz.funkfeuer.at/location/show/' + this.locid + '">Link</td></tr>';
+ html += '<tr><td>Smokeping:</td><td>&nbsp;</td><td><a href="http://www.graz.funkfeuer.at/cgi-bin/smokeping.cgi?target=FunkFeuer.' + locations[this.locid].name + '">Link</td></tr>';
+ if(locations[this.locid].gallery_link) {
+ html += '<tr><td>Galerie:</td><td>&nbsp;</td><td><a href="' + locations[this.locid].gallery_link + '">Link</td></tr>';
+ } else {
+ html += '<tr><td>Galerie:</td><td>&nbsp;</td><td><a href="http://gallery.funkfeuer.at/v/Graz/Knoten/">Link</td></tr>';
+ }
+ html += '</table>';
+ html += '</div>';
+ this.openInfoWindowHtml(html);
+}
+
+function convertCoords(x) {
+ var deg = Math.floor(x);
+ var min = (x - deg) * 60;
+ var sec = (min - Math.floor(min)) * 60;
+ return deg + "° " + Math.floor(min) + "' " + sec.toFixed(0) + "\"";
+}
+
function addNewNodeText(point) {
var html = "adding location at: <br />\n" + point;
return html;