var BMapLib=window.BMapLib=BMapLib||{};(function(){var b=function(m,l,j){l=d(l);var n=m.pointToPixel(l.getNorthEast());var i=m.pointToPixel(l.getSouthWest());n.x+=j;n.y-=j;i.x-=j;i.y+=j;var h=m.pixelToPoint(n);var k=m.pixelToPoint(i);return new BMap.Bounds(k,h)};var d=function(i){var k=f(i.getNorthEast().lng,-180,180);var h=f(i.getSouthWest().lng,-180,180);var j=f(i.getNorthEast().lat,-74,74);var l=f(i.getSouthWest().lat,-74,74);return new BMap.Bounds(new BMap.Point(h,l),new BMap.Point(k,j))};var f=function(j,k,h){k&&(j=Math.max(j,k));h&&(j=Math.min(j,h));return j};var a=function(h){return"[object Array]"===Object.prototype.toString.call(h)};var c=function(l,n){var j=-1;if(a(n)){if(n.indexOf){j=n.indexOf(l)}else{for(var k=0,h;h=n[k];k++){if(h===l){j=k;break}}}}return j};var e=BMapLib.MarkerClusterer=function(l,h){if(!l){return}this._map=l;this._markers=[];this._clusters=[];var k=h||{};this._gridSize=k.gridSize||60;this._maxZoom=k.maxZoom||18;this._minClusterSize=k.minClusterSize||2;this._isAverageCenter=false;if(k.isAverageCenter!=undefined){this._isAverageCenter=k.isAverageCenter}this._styles=k.styles||[];var j=this;this._map.addEventListener("zoomend",function(){j._redraw()});this._map.addEventListener("moveend",function(){j._redraw()});var i=k.markers;a(i)&&this.addMarkers(i)};e.prototype.addMarkers=function(k){for(var j=0,h=k.length;jthis._markerClusterer.getMaxZoom()){this._clusterMarker&&this._map.removeOverlay(this._clusterMarker);for(var l=0,j;j=this._markers[l];l++){this._map.addOverlay(j)}return}if(this._markers.length