//console.log(""); //console.log("4"); //console.log("6"); //console.log(""); //console.log(""); //var yyy = ''; //alert (yyy); var map; var bounds; var northEast; var southWest; var centerLatitude = 47.8426; var centerLongitude = 13.183593; var centerLatitudeSuche; var centerLongitudeSuche; var userAdresse = null; var showinfofenster = 'n'; var nZoomStufe; var gCenterPoint; var infoWindow = null; var markers = []; var suchmarker; //var ruhezonenLayer; if ('4' > 0) //zoomstufe für tourtypfilter { var startZoom = 4; } else { if ('' == "") //zoomstufe für portalcodeintegration { var startZoom = 7; } else { var startZoom = 6; } } if ('6' > 0) //zoomstufe für tourtypfilter { var startZoom = parseInt('6'); } if ('' == 'WS09FD49ZA') //Parameter überschreiben für Wintersport.at { startZoom = 9; centerLatitude = 47.6764844422132; centerLongitude = 14.019584655761718; } //alert (startZoom); var zoomSize = new Array(3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); //Symbol für die Cluster-Marker erzeugen var iconCluster = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/icons/Lupe_Map.png', new google.maps.Size(28, 28), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var iconClusterShadow = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/icons/Schatten.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var iconShadow = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/shadow.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); // NEUE ICONS var reiten_l = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/reiten_l.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var reiten_m = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/reiten_m.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var reiten_s = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/reiten_s.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var wandern_l = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/wandern_l.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var wandern_m = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/wandern_m.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var wandern_s = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/wandern_s.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var snowshoe_l = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/snowshoe_l.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var snowshoe_m = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/snowshoe_m.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var snowshoe_s = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/snowshoe_s.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var snowboard_l = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/snowboard_l.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var snowboard_m = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/snowboard_m.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var snowboard_s = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/snowboard_s.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var skitour_l = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/skitour_l.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var skitour_m = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/skitour_m.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var skitour_s = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/skitour_s.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var rodeln_l = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/rodeln_l.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var rodeln_m = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/rodeln_m.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var rodeln_s = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/rodeln_s.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var radfahren_l = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/radfahren_l.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var radfahren_m = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/radfahren_m.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var radfahren_s = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/radfahren_s.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var mountain_l = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/mountain_l.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var mountain_m = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/mountain_m.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var mountain_s = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/mountain_s.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var nordic_walking_l = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/nordic_walking_l.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var nordic_walking_m = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/nordic_walking_m.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var nordic_walking_s = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/nordic_walking_s.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var klettersteig_l = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/klettersteig_l.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var klettersteig_m = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/klettersteig_m.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var klettersteig_s = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/klettersteig_s.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var klettern_l = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/klettern_l.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var klettern_m = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/klettern_m.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var klettern_s = new google.maps.MarkerImage('http://www.alpintouren.com/AT2006/GoogleMapsIntegrationen/tourliste/icons/klettern_s.png', new google.maps.Size(38, 38), new google.maps.Point(0,0), new google.maps.Point(0, 32)); // ###################################################################################################### // CS NEU für ein und ausblenden function toggleGroup(strTourTypBez) { for (var i = 0; i < g_tourtyp.length; i++) { if (g_tourtyp[i].indexOf(strTourTypBez) > -1 ) { var tmp_marker = gmarkers[i]; if (tmp_marker.isHidden()) { tmp_marker.show(); } else { tmp_marker.hide(); } // end if } // end if } // end for } // end function // ###################################################################################################### function init() { var mapTypeIds = []; for (var type in google.maps.MapTypeId) { mapTypeIds.push(google.maps.MapTypeId[type]); } mapTypeIds.push("G_OSM_MAP"); mapTypeIds.push("G_OSM_Cycle_MAP"); var mapOptions = { zoom: startZoom , center: new google.maps.LatLng(centerLatitude, centerLongitude), scaleControl: true, overviewMapControl: true, overviewMapControlOptions:{opened:true}, mapTypeId: google.maps.MapTypeId.TERRAIN, mapTypeControlOptions: { mapTypeIds: mapTypeIds, style: google.maps.MapTypeControlStyle.DROPDOWN_MENU , position: google.maps.ControlPosition.RIGHT_TOP }, scaleControl: true }; map = new google.maps.Map(document.getElementById("map"), mapOptions); map.mapTypes.set("G_OSM_MAP", new google.maps.ImageMapType({ getTileUrl: function (coord, zoom) { // "Wrap" x (logitude) at 180th meridian properly // NB: Don't touch coord.x because coord param is by reference, and changing its x property breakes something in Google's lib var tilesPerGlobe = 1 << zoom; var x = coord.x % tilesPerGlobe; if (x < 0) { x = tilesPerGlobe + x; } // Wrap y (latitude) in a like manner if you want to enable vertical infinite scroll return "http://tile.openstreetmap.org/" + zoom + "/" + x + "/" + coord.y + ".png"; }, tileSize: new google.maps.Size(256, 256), name: "Open Street Map", maxZoom: 18 })); map.mapTypes.set("G_OSM_Cycle_MAP", new google.maps.ImageMapType({ getTileUrl: function (coord, zoom) { // "Wrap" x (logitude) at 180th meridian properly // NB: Don't touch coord.x because coord param is by reference, and changing its x property breakes something in Google's lib var tilesPerGlobe = 1 << zoom; var x = coord.x % tilesPerGlobe; if (x < 0) { x = tilesPerGlobe + x; } // Wrap y (latitude) in a like manner if you want to enable vertical infinite scroll return "http://c.tiles.wmflabs.org/hikebike/" + zoom + "/" + x + "/" + coord.y + ".png"; }, tileSize: new google.maps.Size(256, 256), name: "Open Street Map - Hike & Bike", maxZoom: 18 })); google.maps.event.addListener(map, 'idle', function() { //alert('idle'); bounds = map.getBounds(); northEast = bounds.getNorthEast(); southWest = bounds.getSouthWest(); if (showinfofenster == "n") { updateMarkers('fromIdle'); } else { showinfofenster = 'n'; } }); mygeocoder = new google.maps.Geocoder(); map.setCenter(new google.maps.LatLng(centerLatitude, centerLongitude)); //ruhezonenLayer = new google.maps.KmlLayer('http://www.alpintouren.com/AT2006/GoogleMaps/RuhezonenSbg/RUHEZONEN.kml', {preserveViewport:true} ); //map.setZoom(1); updateMarkers(); //map.fitBounds(map.getBounds()); // AJAX Load ausblenden //document.getElementById("ajaxload").style.display = 'none'; } // end init // ###################################################################################################### function DeleteAllMarkers() { for (var i = 0; i < markers.length; i++) { markers[i].setMap(null); // Marker auf Map entfernen } // Array der Marker löschen markers = []; } // end DeleteAllMarkers var firstTimeOpened = false; // ###################################################################################################### function updateMarkers(caller) { //Vorhandene Punkte entfernen DeleteAllMarkers(); if (!firstTimeOpened && caller != "fromIdle") { map.setZoom(0); } var getVars = 'ne=' + northEast.toUrlValue() + '&sw=' + southWest.toUrlValue(); nZoomStufe = map.getZoom(); //Punkte übernehmen if (window.XMLHttpRequest) { // Mozilla, Safari, ... request = new XMLHttpRequest(); } else if (window.ActiveXObject) { // IE try { request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } //alert ('serverids.php?' + getVars); request.open('GET', 'serverids.php?' + getVars + "&tt=" + '4' + "&z=" + nZoomStufe + "&f=" + '' + "&pc=" + '' + "&psd=" + '', true); request.onreadystatechange = function() { if (request.readyState == 4) { var jscript = request.responseText; var points; //alert(jscript); eval(jscript); nZoomStufe = map.getZoom(); var bounds = new google.maps.LatLngBounds(); //Punkte aus der Liste erzeugen for (i in points) { //console.log(i); var point = new google.maps.LatLng(points[i].lat, points[i].lng); var marker = createMarker(point, points[i].type, points[i].htmltext, points[i].tour_schw, points[i].anz_cluster, nZoomStufe); marker.setMap(map); bounds.extend(marker.getPosition()); //Marker in Array merken markers.push(marker); } // end for //console.log(firstTimeOpened); //console.log(caller); if(!firstTimeOpened) { //console.dir(bounds); firstTimeOpened = true; //map.setCenter(bounds.getCenter()); map.fitBounds(bounds); //console.log(map.getZoom()); if(map.getZoom() < 2) { map.setCenter({lat:47.809490, lng:13.05501}); map.setZoom(4); } if(map.getZoom() > 8) { map.setZoom(8); } } document.getElementById("ajaxload").style.display = 'none'; // Ruhezonen SBG anzeigen //if (map.getZoom() >= 12) { // ruhezonenLayer.setMap(null); // ruhezonenLayer.setMap(map); // //alert("if" + map.getZoom()); // //ruhezonenLayer.visible //} //else //{ // ruhezonenLayer.setMap(null); // //alert("else" + map.getZoom()); //} } } request.send(null); } // end function updateMarkers // ###################################################################################################### // ###################################################################################################### function createMarker(point, type, html, pschw, anzTouren, nZ) { //Marker mit entsprechendem Symbol erzeugen if(type=='c') { // CLUSTER MARKER gCenterPoint = point; var marker = new google.maps.Marker({ position: point, map: map, icon: iconCluster, shadow: iconClusterShadow, title: 'In dieser Region befinden sich ' + anzTouren + ' Touren. Klicken Sie auf das Icon um Touren in dieser Region anzuzeigen.' }); google.maps.event.addListener(marker, "click", function() { map.setCenter(point); map.setZoom(map.getZoom()+zoomSize[nZ]); }); } else { var marker = new google.maps.Marker({ position: point, map: map, icon: eval(pschw), shadow: iconShadow }); google.maps.event.addListener(marker, "click", function() { showinfofenster = 'y'; if (infoWindow) { infoWindow.close(); } infoWindow = new google.maps.InfoWindow(); infoWindow.setContent(html); infoWindow.setOptions({disableAutoPan: false}); infoWindow.open(map, marker); }); } return marker; } // end function createMarker // ###################################################################################################### // ###################################################################################################### function ShowAdressInMap2(adresse) { if (mygeocoder) { mygeocoder.getLatLng(adresse, function(point) { if (!point) { alert("Die angegebene Adresse " + adresse + " konnte nicht gefunden werden."); } else { userAdresse = point; map.setZoom(12); map.panTo(point); //addUserMarker(); } }); } } // ###################################################################################################### function ShowAdressInMap(adresse) { if (suchmarker) { suchmarker.setMap(null); //Suchmarker löschen } mygeocoder.geocode( { 'address': adresse}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); map.setZoom(12); var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location, icon: 'https://maps.gstatic.com/mapfiles/ms2/micons/red-pushpin.png', title: adresse }); if (infoWindow) { infoWindow.close(); } infoWindow = new google.maps.InfoWindow(); infoWindow.setContent(adresse); infoWindow.setOptions({disableAutoPan: false}); infoWindow.open(map, marker); suchmarker = marker; } else { alert("Die angegebene Adresse " + adresse + " konnte nicht gefunden werden." + status); } }); } // ###################################################################################################### window.onload = init;