function getIcon(iconId){ var baseIcon = new GIcon(G_DEFAULT_ICON); baseIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; baseIcon.iconSize = new GSize(30, 30); baseIcon.shadowSize = new GSize(25, 10); baseIcon.iconAnchor = new GLatLng(8, 8); baseIcon.infoWindowAnchor = new GLatLng(5, 10); if(iconId == ""){ iconGrafx = "http://static.dhd24.com/images/gmaps/dhdpins/group_marker_img.php?nr=&r=125&g=125&b=125&size=9&img=sammlung_big.png"; } else{ switch(iconId){ case '1': iconGrafx = "http://static.dhd24.com/images/gmaps/icons/png_optimiert/rubs_big.png"; break; case '2': iconGrafx = "http://static.dhd24.com/images/gmaps/icons/png_optimiert/personen_big.png"; break; case '3': iconGrafx = "http://static.dhd24.com/images/gmaps/icons/png_optimiert/tiere_big.png"; break; case '4': iconGrafx = "http://static.dhd24.com/images/gmaps/icons/png_optimiert/branchen_big.png"; break; case '5': iconGrafx = "http://static.dhd24.com/images/gmaps/dhdpins/pin_1.png"; baseIcon.shadow = ""; baseIcon.iconSize = new GSize(25, 25); break; case '6': iconGrafx = "http://static.dhd24.com/images/gmaps/dhdpins/pin_2.png"; baseIcon.shadow = ""; baseIcon.iconSize = new GSize(25, 25); break; default: iconGrafx = "http://static.dhd24.com/images/gmaps/dhdpins/group_marker_img.php?nr=&r=125&g=125&b=125&size=9&img=sammlung_big.png"; break; } } baseIcon.image = iconGrafx; markerOptions = { icon:baseIcon }; } function showMarker(){ point = new GLatLng(lat, lng); marker = new GMarker(point, markerOptions); if (html != "") { GEvent.addListener(marker, "click", function(){ marker.openInfoWindowHtml(html); }); } map.addOverlay(marker); } function jsonCallback(lat, lng, html, iconId){ // getIcon(iconId); //console.log(lat + " -> " + lng + " -> " + html + " -> " + iconId); // var currPoint = new GLatLng(lat, lng); // var markerTmp = new GMarker(currPoint, markerOptions); // var markerTmp = new GMarker(currPoint); //console.log(markerTmp); // GEvent.addListener(markerTmp, "click", function(){ // markerTmp.openInfoWindowHtml(html); // }); // map.addOverlay(markerTmp); // bounds.extend(currPoint); // map.setZoom(map.getBoundsZoomLevel(bounds)); // var clat = (bounds.getNorthEast().lat() + bounds.getSouthWest().lat()) /2; // var clng = (bounds.getNorthEast().lng() + bounds.getSouthWest().lng()) /2; // map.setCenter(new GLatLng(clat,clng)); } function load(mapType){ map = new GMap2(document.getElementById("map")); switch(mapControl){ case 1: map.addControl(new GSmallMapControl()); break; case 2: map.addControl(new GLargeMapControl()); break; default: break; } if(smallZoomControl != 0){ map.addControl(new GSmallZoomControl()); } if(MenuMapTypeControl != 0){ // map.addControl(new GMenuMapTypeControl()); } if(HierarchicalMapTypeControl != 0){ // map.addControl(new GHierarchicalMapTypeControl()); } if(OverviewMapControl != 0){ map.addControl(new GOverviewMapControl()); } if(MapTypeControl != 0){ map.addControl(new GMapTypeControl()); } if(ScaleControl != 0){ map.addControl(new GScaleControl()); } map.enableDoubleClickZoom(); map.enableContinuousZoom(); if(mapType == 'simple'){ // SimpleMap getIcon(iconId); map.setCenter(new GLatLng(lat, lng), zoom); showMarker(); } else{ // JsonMap bounds = new GLatLngBounds(); jQuery.getJSON(jsonUrl, function(json){ for(var i=0; i