diff options
-rw-r--r-- | map.css | 5 | ||||
-rw-r--r-- | map.js | 26 |
2 files changed, 31 insertions, 0 deletions
@@ -72,3 +72,8 @@ div.btn { #reloadbtn { width: 10em; } + +*.locinfo { + font-size: 8pt; + color: black; +} @@ -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> </td><td>' + convertCoords(locations[this.locid].point.lat()) + '</td></tr>'; + html += '<tr><td>Längengrad:</td><td> </td><td>' + convertCoords(locations[this.locid].point.lng()) + '</td></tr>'; + html += '<tr><td>Datenbank:</td><td> </td><td><a href="http://manman.graz.funkfeuer.at/location/show/' + this.locid + '">Link</td></tr>'; + html += '<tr><td>Smokeping:</td><td> </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> </td><td><a href="' + locations[this.locid].gallery_link + '">Link</td></tr>'; + } else { + html += '<tr><td>Galerie:</td><td> </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; |