From d585ae96c39abe04572f7b7e9ac2c4ce264f93e5 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 6 Dec 2008 17:38:58 +0000 Subject: added location info --- map.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'map.js') 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 = '
'; + html += '' + locations[this.locid].name + ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + if(locations[this.locid].gallery_link) { + html += ''; + } else { + html += ''; + } + html += '
Breitengrad: ' + convertCoords(locations[this.locid].point.lat()) + '
Längengrad: ' + convertCoords(locations[this.locid].point.lng()) + '
Datenbank: Link
Smokeping: Link
Galerie: Link
Galerie: Link
'; + html += '
'; + 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:
\n" + point; return html; -- cgit v1.2.1