﻿var styles=[{url:"/images/cluster_small.png",height:37,width:38,opt_textColor:"#FFFFFF"},{url:"/images/cluster_medium.png",height:41,width:41,opt_textColor:"#FFFFFF"},{url:"/images/cluster_large.png",height:46,width:46,opt_textColor:"#FFFFFF"}];var mcOptions={gridSize:40,maxZoom:7,styles:styles};function KClusterMarker(a){var b=1;if(styles.length<b){b=styles.length}this.url_=styles[b-1].url;this.height_=styles[b-1].height;this.width_=styles[b-1].width;this.textColor_=styles[b-1].opt_textColor;this.anchor_=styles[b-1].opt_anchor;this.latlng_=new GLatLng(a.avg_y,a.avg_x);this.index_=b;this.styles_=styles;this.text_=a.cnt;this.clusterInfo=a;this.padding_=0}KClusterMarker.prototype=new GOverlay();KClusterMarker.prototype.initialize=function(e){this.map_=e;var h=document.createElement("div");var g=this.latlng_;var f=e.fromLatLngToDivPixel(g);f.x-=parseInt(this.width_/2,10);f.y-=parseInt(this.height_/2,10);var d="";if(document.all){d='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="'+this.url_+'");'}else{d="background:url("+this.url_+");"}if(typeof this.anchor_==="object"){if(typeof this.anchor_[0]==="number"&&this.anchor_[0]>0&&this.anchor_[0]<this.height_){d+="height:"+(this.height_-this.anchor_[0])+"px;padding-top:"+this.anchor_[0]+"px;"}else{d+="height:"+this.height_+"px;line-height:"+this.height_+"px;"}if(typeof this.anchor_[1]==="number"&&this.anchor_[1]>0&&this.anchor_[1]<this.width_){d+="width:"+(this.width_-this.anchor_[1])+"px;padding-left:"+this.anchor_[1]+"px;"}else{d+="width:"+this.width_+"px;text-align:center;"}}else{d+="height:"+this.height_+"px;line-height:"+this.height_+"px;";d+="width:"+this.width_+"px;text-align:center;"}var a=this.textColor_?this.textColor_:"black";h.style.cssText=d+"cursor:pointer;top:"+f.y+"px;left:"+f.x+"px;color:"+a+";position:absolute;font-size:11px;font-family:Arial,sans-serif;font-weight:bold";h.innerHTML=this.text_;e.getPane(G_MAP_MAP_PANE).appendChild(h);var c=this.padding_;var b=this;GEvent.bindDom(h,"click",b,function(){var j=40;var l=e.getSize().width;var r=e.getSize().height;var k=this.clusterInfo.xmin;var o=this.clusterInfo.xmax;var q=this.clusterInfo.ymin;var m=this.clusterInfo.ymax;var t=o-k;var s=m-q;if(k>o){t=(o+360)-k}var n=t/l;var p=s/r;k-=n*j;if(k<-180){k+=360}o+=n*j;if(o>180){o-=360}q-=p*j;m+=p*j;var i=new GLatLngBounds(new GLatLng(q,k),new GLatLng(m,o));e.closeInfoWindow();e.setCenter(i.getCenter(),e.getBoundsZoomLevel(i))});this.div_=h};KClusterMarker.prototype.remove=function(){this.div_.parentNode.removeChild(this.div_)};KClusterMarker.prototype.copy=function(){return new KClusterMarker(this.clusterInfo)};KClusterMarker.prototype.redraw=function(a){if(!a){return}var b=this.map_.fromLatLngToDivPixel(this.latlng_);b.x-=parseInt(this.width_/2,10);b.y-=parseInt(this.height_/2,10);this.div_.style.top=b.y+"px";this.div_.style.left=b.x+"px"};KClusterMarker.prototype.hide=function(){this.div_.style.display="none"};KClusterMarker.prototype.show=function(){this.div_.style.display=""};KClusterMarker.prototype.isHidden=function(){return this.div_.style.display==="none"};
