// global arrays to hold copies of the markers used by the side_bar var gmarkers = []; var gmarkersYellow = []; var gmarkersGreen = []; var map; var xmlhttp; var xmlData=""; var baseIcon; // This function picks up the click and opens the corresponding info window function myclick(i,anim) { GEvent.trigger(gmarkers[i], "click"); map.setCenter(gmarkers[i].getLatLng(), 17); if (anim==true) { $(viewer).slideUp('slow'); } } function myclickYellow(i,anim) { GEvent.trigger(gmarkersYellow[i], "click"); map.setCenter(gmarkersYellow[i].getLatLng(), 17); if (anim==true) { $(viewer).slideUp('slow'); } } function myclickGreen(i,anim) { GEvent.trigger(gmarkersGreen[i], "click"); map.setCenter(gmarkersGreen[i].getLatLng(), 17); if (anim==true) { $(viewer).slideUp('slow'); } } function close_viewer() { $(viewer).slideUp('slow'); } function showred() { $(viewer).slideUp('slow'); document.getElementById("red").src="images/nav_red1.gif"; document.getElementById("yellow").src="images/nav_yellow0.gif"; document.getElementById("green").src="images/nav_green0.gif"; showRedMarkers(true); document.getElementById("list_red").style.visibility="visible"; document.getElementById("list_yellow").style.visibility="hidden"; //document.getElementById("list_green").style.visibility="hidden"; document.getElementById("thumbs_1").style.visibility="visible"; document.getElementById("thumbs_2").style.visibility="hidden"; document.getElementById("thumbs_3").style.visibility="hidden"; } function showyellow() { $(viewer).slideUp('slow'); document.getElementById("red").src="images/nav_red0.gif"; document.getElementById("yellow").src="images/nav_yellow1.gif"; document.getElementById("green").src="images/nav_green0.gif"; showYellowMarkers(true); document.getElementById("list_yellow").style.visibility="visible"; document.getElementById("list_red").style.visibility="hidden"; //document.getElementById("list_green").style.visibility="hidden"; document.getElementById("thumbs_1").style.visibility="hidden"; document.getElementById("thumbs_2").style.visibility="visible"; document.getElementById("thumbs_3").style.visibility="hidden"; } function showgreen() { //$(viewer).slideUp('slow'); document.getElementById("red").src="images/nav_red0.gif"; document.getElementById("yellow").src="images/nav_yellow0.gif"; document.getElementById("green").src="images/nav_green1.gif"; showGreenMarkers(true); document.getElementById("list_yellow").style.visibility="hidden"; document.getElementById("list_red").style.visibility="hidden"; document.getElementById("list_green").style.visibility="visible"; document.getElementById("thumbs_1").style.visibility="hidden"; document.getElementById("thumbs_2").style.visibility="hidden"; document.getElementById("thumbs_3").style.visibility="visible"; } function showall() { $(viewer).slideUp('slow'); document.getElementById("red").src="images/nav_red1.gif"; document.getElementById("yellow").src="images/nav_yellow1.gif"; document.getElementById("green").src="images/nav_green1.gif"; showGreenMarkers(true); showYellowMarkers(false); showRedMarkers(false); document.getElementById("list_yellow").style.visibility="visible"; document.getElementById("list_red").style.visibility="visible"; //document.getElementById("list_green").style.visibility="visible"; document.getElementById("thumbs_1").style.visibility="visible"; document.getElementById("thumbs_2").style.visibility="visible"; document.getElementById("thumbs_3").style.visibility="visible"; } function createMarker(point,index,haus,url,urlbez,bez,links,aktiv) { // Create a lettered icon for this point using our icon class var letter = index; var letteredIcon = new GIcon(baseIcon); if (aktiv==1) {letteredIcon.image = "images/marker/marker_red.png";} else {letteredIcon.image = "images/marker/marker_gray.png";} // Set up our GMarkerOptions object markerOptions = { icon:letteredIcon }; var marker = new GMarker(point, markerOptions); GEvent.addListener(marker, "click", function() { if (map.getZoom()<16){ map.setCenter(marker.getLatLng(),16); } marker.openInfoWindowHtml('
' + haus + '
'+urlbez+'
'+links+'
'); }); gmarkers[index] = marker; return marker; } function createYellowMarker(point,index,haus,url,urlbez,bez,links,aktiv) { // Create a lettered icon for this point using our icon class var letter = index; var letteredIcon = new GIcon(baseIcon); if (aktiv==1) {letteredIcon.image = "images/marker/marker_yellow.png";} else {letteredIcon.image = "images/marker/marker_gray.png";} // Set up our GMarkerOptions object markerOptions = { icon:letteredIcon }; var marker = new GMarker(point, markerOptions); GEvent.addListener(marker, "click", function() { if (map.getZoom()<16){ map.setCenter(marker.getLatLng(),16); } marker.openInfoWindowHtml('
' + haus + '
'+urlbez+'
'+links+'
'); }); gmarkersYellow[index] = marker; return marker; } function createGreenMarker(point,index,haus,url,urlbez,bez,links,aktiv) { // Create a lettered icon for this point using our icon class var letter = index; var letteredIcon = new GIcon(baseIcon); if (aktiv==1) {letteredIcon.image = "images/marker/marker_green.png";} else {letteredIcon.image = "images/marker/marker_gray.png";} // Set up our GMarkerOptions object markerOptions = { icon:letteredIcon }; var marker = new GMarker(point, markerOptions); GEvent.addListener(marker, "click", function() { if (map.getZoom()<16){ map.setCenter(marker.getLatLng(),16); } marker.openInfoWindowHtml('
' + haus + '     #'+index+'
'+urlbez+'
'+links+'
'); }); gmarkersGreen[index] = marker; return marker; } function loadXMLDoc(url) { xmlhttp=null; if (window.XMLHttpRequest) {// code for all new browsers xmlhttp=new XMLHttpRequest(); } else if (window.ActiveXObject) {// code for IE5 and IE6 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } if (xmlhttp!=null) { xmlhttp.onreadystatechange=state_Change; xmlhttp.open('GET',url,true); xmlhttp.send(null); } else { alert("Your browser does not support XMLHTTP."); } return xmlData; } function state_Change() { if (xmlhttp.readyState==4) {// 4 = "loaded" xmlData=xmlhttp.responseText; writeMarker(xmlData); } } function openWindow(url, w, h) { var padding; (navigator.appName == "Microsoft Internet Explorer") ? (padding = 10) : (padding = 0); var screenw = screen.availWidth; var screenh = screen.availHeight; var winw = w;//(w + 15 + padding); var winh = h;//(h + 15 + padding); var posx = (screenw / 2) - (winw / 2); var posy = (screenh / 2) - (winh / 2); var mywin = window.open(url,"mywin","top="+posy+",left="+posx+",width="+winw+",height="+winh+",menubar=no,locationbar=no,statusbar=no,resizable=no,toolbar=no,dependent=yes,scrollbars=no"); mywin.focus(); } function writeMarker(data) { eval(data); showred();} function initialize() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map_canvas")); //map.setCenter(new GLatLng(53.7273, 7.3745), 16); map.setCenter(new GLatLng(53.72856500736053, 7.37249446153645), 17); map.addControl(new GLargeMapControl()); //map.addControl(new GSmallZoomControl()); //map.addControl(new GMapTypeControl()); map.setMapType(G_SATELLITE_MAP); // Create a base icon for all of our markers that specifies the // shadow, icon dimensions, etc. baseIcon = new GIcon(); baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png"; baseIcon.iconSize = new GSize(27, 20); baseIcon.shadowSize = new GSize(9, 9); baseIcon.iconAnchor = new GPoint(9, 9); baseIcon.infoWindowAnchor = new GPoint(9, 2); baseIcon.infoShadowAnchor = new GPoint(18, 25); //------------------------------------------------------- loadXMLDoc("getData.php?loc=baltrum"); //------------------------------------------------------- } } function showRedMarkers(clear){ if(clear){ this.map.clearOverlays(); } var len = gmarkers.length; for (i=1; i