Clusterer=function(map){ this.map=map; this.markers=[]; this.clusters=[]; this.timeout=null; this.name=''; this.currentZoomLevel=map.getZoom(); this.maxVisibleMarkers=Clusterer.defaultMaxVisibleMarkers; this.gridSize=Clusterer.defaultGridSize; this.minMarkersPerCluster=Clusterer.defaultMinMarkersPerCluster; this.maxLinesPerInfoBox=Clusterer.defaultMaxLinesPerInfoBox; this.icon=Clusterer.defaultIcon; this.maxX; this.maxY; this.minX; this.minY; this.autoCenter=false; 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=50; Clusterer.defaultGridSize=5; Clusterer.defaultMinMarkersPerCluster=5; Clusterer.defaultMaxLinesPerInfoBox=20; Clusterer.defaultIcon=new GIcon(); Clusterer.defaultIcon.image='http://www.acme.com/resources/images/markers/blue_large.PNG'; Clusterer.defaultIcon.shadow='http://www.acme.com/resources/images/markers/shadow_large.PNG'; Clusterer.defaultIcon.iconSize=new GSize(30,51); Clusterer.defaultIcon.shadowSize=new GSize(56,51); 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,id){ if(marker.setMap!=null) marker.setMap(this.map); marker.title=''; //title; marker.onMap=false; marker.id = id; 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;imarker.getPoint().lng()) clusterer.minX=marker.getPoint().lng(); if(clusterer.minY==0 || clusterer.minY>marker.getPoint().lat()) clusterer.minY=marker.getPoint().lat(); if(clusterer.maxX==0 || clusterer.maxX'; } for(i=0;i=250) {if(request.responseText.length>0) {var cl=null;try {cl=request.getResponseHeader('content-length');} catch(e) {} var progress;if(cl!=null) progress=Math.round(request.responseText.length*100/cl)+'%';else progress=request.responseText.length+' bytes';data.progressCallback(request,progress);} data.prevProgressReport=now;}}}} function DefaultFailCallback(request) {if(request==null) alert('XMLHttpRequest create failed!');else alert('XML fetch failed! ('+request.status+' '+request.statusText+')');} function HttpGetProxy(url,okCallback,failCallback,progressCallback) {if(url.substring(0,7)=='http://') {var host=url.substring(7);var slash=host.indexOf('/');if(slash!=-1) host=host.substring(0,slash);if(host!=window.location.host) url='/resources/proxy.cgi?url='+encodeURIComponent(url);} HttpGet(url,okCallback,failCallback,progressCallback);} function GetXmlText(element) {var value='';var child=element.firstChild;while(child!=null) {if(value!='') value+=' ';value+=child.nodeValue;child=child.nextSibling;} return value;} function GetXmlValue(elements) {var values='';for(var i=0;i';else if(entity=='amp')outStr+='&';else outStr+='&'+entity+';';i+=entity.length+1;}}} return outStr;} function DeEntityize(inStr) {var outStr='';for(var i=0;i',i);if(gt!=-1) i=gt;}} return outStr;} function DeHtmlize(str) {return DeEntityize(EntityToIso8859(DeElementize(str)));} function MakeCaller(func,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) {return function(){func(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);};} function GetParameters() {var query_string=location.search.substring(1,location.search.length);var namevals=query_string.split('&');var params=[];for(var i=0;i0) {if(str.substr(0,fromLen)==from) {newStr+=to;str=str.substr(fromLen);} else {newStr+=str.charAt(0);str=str.substr(1);}} return newStr;} function Props(o) {var s='';for(p in o) {if(s.length!=0) s+='\n';s+=p+': '+o[p];} return s;} function GetBrowserWidth() {var width=null;try {width=innerWidth;} catch(e1) {try {width=document.documentElement.offsetWidth;} catch(e2) {try {width=document.documentElement.clientWidth;} catch(e2) {try {width=document.body.clientWidth;} catch(e2) {}}}} return width;} function GetBrowserHeight() {var height=null;try {height=innerHeight;} catch(e1) {try {height=document.documentElement.offsetHeight;} catch(e2) {try {height=document.documentElement.clientHeight;} catch(e2) {try {height=document.body.clientHeight;} catch(e2) {}}}} return height;} function AppendElement(parent,elementType,properties) {var element=document.createElement(elementType);for(property in properties) if(property=='style') for(nestedProperty in properties[property]) element.style[nestedProperty]=properties['style'][nestedProperty];else element[property]=properties[property];parent.appendChild(element);return element;} function ClearElement(element) {while(element.firstChild!=null) {ClearElement(element.firstChild);element.removeChild(element.firstChild);}} function instanceOf(object,clas) {while(object!=null) {if(object==clas.prototype) return true;object=object.__proto__;} return false;} function GetComputedStyle(element,style) {var camelStyle=Camelize(style);if(element.currentStyle!=null) return element.currentStyle[camelStyle];if(window.getComputedStyle!=null) return window.getComputedStyle(element,null)[camelStyle];return null;} var camelizeTable=[];camelizeTable['background-attachment']='backgroundAttachment';camelizeTable['background-color']='backgroundColor';camelizeTable['background-image']='backgroundImage';camelizeTable['background-position']='backgroundPosition';camelizeTable['background-repeat']='backgroundRepeat';camelizeTable['border-bottom']='borderBottom';camelizeTable['border-bottom-color']='borderBottomColor';camelizeTable['border-bottom-style']='borderBottomStyle';camelizeTable['border-bottom-width']='borderBottomWidth';camelizeTable['border-color']='borderColor';camelizeTable['border-left']='borderLeft';camelizeTable['border-left-color']='borderLeftColor';camelizeTable['border-left-style']='borderLeftStyle';camelizeTable['border-left-width']='borderLeftWidth';camelizeTable['border-right']='borderRight';camelizeTable['border-right-color']='borderRightColor';camelizeTable['border-right-style']='borderRightStyle';camelizeTable['border-right-width']='borderRightWidth';camelizeTable['border-style']='borderStyle';camelizeTable['border-top']='borderTop';camelizeTable['border-top-color']='borderTopColor';camelizeTable['border-top-style']='borderTopStyle';camelizeTable['border-top-width']='borderTopWidth';camelizeTable['border-width']='borderWidth';camelizeTable['font-family']='fontFamily';camelizeTable['font-size']='fontSize';camelizeTable['font-variant']='fontVariant';camelizeTable['font-weight']='fontWeight';camelizeTable['letter-spacing']='letterSpacing';camelizeTable['line-height']='lineHeight';camelizeTable['list-style']='listStyle';camelizeTable['list-style-image']='listStyleImage';camelizeTable['list-style-position']='listStylePosition';camelizeTable['list-style-type']='listStyleType';camelizeTable['margin-bottom']='marginBottom';camelizeTable['margin-left']='marginLeft';camelizeTable['margin-right']='marginRight';camelizeTable['margin-top']='marginTop';camelizeTable['padding-bottom']='paddingBottom';camelizeTable['padding-left']='paddingLeft';camelizeTable['padding-right']='paddingRight';camelizeTable['padding-top']='paddingTop';camelizeTable['page-break-after']='pageBreakAfter';camelizeTable['page-break-before']='pageBreakBefore';camelizeTable['float']='cssFloat';camelizeTable['text-align']='textAlign';camelizeTable['text-decoration']='textDecoration';camelizeTable['text-indent']='textIndent';camelizeTable['text-transform']='textTransform';camelizeTable['vertical-align']='verticalAlign';camelizeTable['z-index']='zIndex';function Camelize(styleName) {var camelStyleName=camelizeTable[styleName];if(camelStyleName!=null) return camelStyleName;else return styleName;}