Clusterer=function(map) {this.map=map;this.markers=[];this.clusters=[];this.timeout=null;this.currentZoomLevel=map.getZoom();this.maxVisibleMarkers=Clusterer.defaultMaxVisibleMarkers;this.gridSize=Clusterer.defaultGridSize;this.minMarkersPerCluster=Clusterer.defaultMinMarkersPerCluster;this.maxLinesPerInfoBox=Clusterer.defaultMaxLinesPerInfoBox;this.icon=Clusterer.defaultIcon;GEvent.addListener(map,'zoomend',Clusterer.MakeCaller(Clusterer.Display,this));GEvent.addListener(map,'moveend',Clusterer.MakeCaller(Clusterer.Display,this));GEvent.addListener(map,'infowindowclose',Clusterer.MakeCaller(Clusterer.PopDown,this));};Clusterer.defaultMaxVisibleMarkers=150;Clusterer.defaultGridSize=5;Clusterer.defaultMinMarkersPerCluster=5;Clusterer.defaultMaxLinesPerInfoBox=10;Clusterer.defaultIcon=new GIcon();Clusterer.defaultIcon.image='http://www.mordort.de/images/icons/cluster.png';Clusterer.defaultIcon.shadow='http://www.mordort.de/images/icons/shadow-cluster.png';Clusterer.defaultIcon.iconSize=new GSize(27,35);Clusterer.defaultIcon.shadowSize=new GSize(45,35);Clusterer.defaultIcon.iconAnchor=new GPoint(13,34);Clusterer.defaultIcon.infoWindowAnchor=new GPoint(13,3);Clusterer.defaultIcon.infoShadowAnchor=new GPoint(27,37);Clusterer.prototype.SetIcon=function(icon) {this.icon=icon;};Clusterer.prototype.SetMaxVisibleMarkers=function(n) {this.maxVisibleMarkers=n;};Clusterer.prototype.SetMinMarkersPerCluster=function(n) {this.minMarkersPerCluster=n;};Clusterer.prototype.SetMaxLinesPerInfoBox=function(n) {this.maxLinesPerInfoBox=n;};Clusterer.prototype.AddMarker=function(marker,title) {if(marker.setMap!=null) marker.setMap(this.map);marker.title=title;marker.onMap=false;this.markers.push(marker);this.DisplayLater();};Clusterer.prototype.RemoveMarker=function(marker) {for(var i=0;iclusterer.maxVisibleMarkers) {var latRange=bounds.getNorthEast().lat()-bounds.getSouthWest().lat();var latInc=latRange/clusterer.gridSize;var lngInc=latInc/Math.cos((bounds.getNorthEast().lat()+bounds.getSouthWest().lat())/2.0*Math.PI/180.0);for(var lat=bounds.getSouthWest().lat();lat<=bounds.getNorthEast().lat();lat+=latInc) for(var lng=bounds.getSouthWest().lng();lng<=bounds.getNorthEast().lng();lng+=lngInc) {cluster=new Object();cluster.clusterer=clusterer;cluster.bounds=new GLatLngBounds(new GLatLng(lat,lng),new GLatLng(lat+latInc,lng+lngInc));cluster.markers=[];cluster.markerCount=0;cluster.onMap=false;cluster.marker=null;clusterer.clusters.push(cluster);} for(i=0;i=0;--i) if(clusterer.clusters[i]!=null) break;else --clusterer.clusters.length;for(i=0;i';else html+='';html+=''+marker.title+'';if(n==clusterer.maxLinesPerInfoBox-1&&cluster.markerCount>clusterer.maxLinesPerInfoBox) {html+='...und '+(cluster.markerCount-n)+' weitere';break;}}} html+='';clusterer.map.closeInfoWindow();cluster.marker.openInfoWindowHtml(html);clusterer.poppedUpCluster=cluster;};Clusterer.RePop=function(clusterer) {if(clusterer.poppedUpCluster!=null) Clusterer.PopUp(clusterer.poppedUpCluster);};Clusterer.PopDown=function(clusterer) {clusterer.poppedUpCluster=null;};Clusterer.prototype.ClearCluster=function(cluster) {var i,marker;for(i=0;i