function MarkerClusterer(n,t,i){var r,u;this.extend(MarkerClusterer,google.maps.OverlayView);this.map_=n;this.markers_=[];this.clusters_=[];this.sizes=[53,56,66,78,90];this.styles_=[];this.ready_=!1;r=i||{};this.gridSize_=r.gridSize||60;this.minClusterSize_=r.minimumClusterSize||2;this.maxZoom_=r.maxZoom||null;this.styles_=r.styles||[];this.imagePath_=r.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_;this.imageExtension_=r.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_;this.zoomOnClick_=!0;r.zoomOnClick!=undefined&&(this.zoomOnClick_=r.zoomOnClick);this.averageCenter_=!1;r.averageCenter!=undefined&&(this.averageCenter_=r.averageCenter);this.setupStyles_();this.setMap(n);this.prevZoom_=this.map_.getZoom();u=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var n=u.map_.getZoom(),t=u.map_.minZoom||0,i=Math.min(u.map_.maxZoom||100,u.map_.mapTypes[u.map_.getMapTypeId()].maxZoom);n=Math.min(Math.max(n,t),i);u.prevZoom_!=n&&(u.prevZoom_=n,u.resetViewport())});google.maps.event.addListener(this.map_,"idle",function(){u.redraw()});t&&(t.length||Object.keys(t).length)&&this.addMarkers(t,!1)}function Cluster(n){this.markerClusterer_=n;this.map_=n.getMap();this.gridSize_=n.getGridSize();this.minClusterSize_=n.getMinClusterSize();this.averageCenter_=n.isAverageCenter();this.center_=null;this.markers_=[];this.bounds_=null;this.clusterIcon_=new ClusterIcon(this,n.getStyles(),n.getGridSize())}function ClusterIcon(n,t,i){n.getMarkerClusterer().extend(ClusterIcon,google.maps.OverlayView);this.styles_=t;this.padding_=i||0;this.cluster_=n;this.center_=null;this.map_=n.getMap();this.div_=null;this.sums_=null;this.visible_=!1;this.setMap(this.map_)}MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_="../images/m";MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_="png";MarkerClusterer.prototype.extend=function(n,t){return function(n){for(var t in n.prototype)this.prototype[t]=n.prototype[t];return this}.apply(n,[t])};MarkerClusterer.prototype.onAdd=function(){this.setReady_(!0)};MarkerClusterer.prototype.draw=function(){};MarkerClusterer.prototype.setupStyles_=function(){if(!this.styles_.length)for(var n=0,t;t=this.sizes[n];n++)this.styles_.push({url:this.imagePath_+(n+1)+"."+this.imageExtension_,height:t,width:t})};MarkerClusterer.prototype.fitMapToMarkers=function(){for(var r=this.getMarkers(),n=new google.maps.LatLngBounds,t=0,i;i=r[t];t++)n.extend(i.getPosition());this.map_.fitBounds(n)};MarkerClusterer.prototype.setStyles=function(n){this.styles_=n};MarkerClusterer.prototype.getStyles=function(){return this.styles_};MarkerClusterer.prototype.isZoomOnClick=function(){return this.zoomOnClick_};MarkerClusterer.prototype.isAverageCenter=function(){return this.averageCenter_};MarkerClusterer.prototype.getMarkers=function(){return this.markers_};MarkerClusterer.prototype.getTotalMarkers=function(){return this.markers_.length};MarkerClusterer.prototype.setMaxZoom=function(n){this.maxZoom_=n};MarkerClusterer.prototype.getMaxZoom=function(){return this.maxZoom_};MarkerClusterer.prototype.calculator_=function(n,t){for(var i=0,u=n.length,r=u;r!==0;)r=parseInt(r/10,10),i++;return i=Math.min(i,t),{text:u,index:i}};MarkerClusterer.prototype.setCalculator=function(n){this.calculator_=n};MarkerClusterer.prototype.getCalculator=function(){return this.calculator_};MarkerClusterer.prototype.addMarkers=function(n,t){var r,i;if(n.length)for(r=0;i=n[r];r++)this.pushMarkerTo_(i);else if(Object.keys(n).length)for(i in n)this.pushMarkerTo_(n[i]);t||this.redraw()};MarkerClusterer.prototype.pushMarkerTo_=function(n){if(n.isAdded=!1,n.draggable){var t=this;google.maps.event.addListener(n,"dragend",function(){n.isAdded=!1;t.repaint()})}this.markers_.push(n)};MarkerClusterer.prototype.addMarker=function(n,t){this.pushMarkerTo_(n);t||this.redraw()};MarkerClusterer.prototype.removeMarker_=function(n){var t=-1,i,r;if(this.markers_.indexOf)t=this.markers_.indexOf(n);else for(i=0;r=this.markers_[i];i++)if(r==n){t=i;break}return t==-1?!1:(n.setMap(null),this.markers_.splice(t,1),!0)};MarkerClusterer.prototype.removeMarker=function(n,t){var i=this.removeMarker_(n);return!t&&i?(this.resetViewport(),this.redraw(),!0):!1};MarkerClusterer.prototype.removeMarkers=function(n,t){for(var f,i=!1,r=0,u;u=n[r];r++)f=this.removeMarker_(u),i=i||f;if(!t&&i)return this.resetViewport(),this.redraw(),!0};MarkerClusterer.prototype.setReady_=function(n){this.ready_||(this.ready_=n,this.createClusters_())};MarkerClusterer.prototype.getTotalClusters=function(){return this.clusters_.length};MarkerClusterer.prototype.getMap=function(){return this.map_};MarkerClusterer.prototype.setMap=function(n){this.map_=n};MarkerClusterer.prototype.getGridSize=function(){return this.gridSize_};MarkerClusterer.prototype.setGridSize=function(n){this.gridSize_=n};MarkerClusterer.prototype.getMinClusterSize=function(){return this.minClusterSize_};MarkerClusterer.prototype.setMinClusterSize=function(n){this.minClusterSize_=n};MarkerClusterer.prototype.getExtendedBounds=function(n){var t=this.getProjection(),e=new google.maps.LatLng(n.getNorthEast().lat(),n.getNorthEast().lng()),o=new google.maps.LatLng(n.getSouthWest().lat(),n.getSouthWest().lng()),r=t.fromLatLngToDivPixel(e),i,u,f;return r.x+=this.gridSize_,r.y-=this.gridSize_,i=t.fromLatLngToDivPixel(o),i.x-=this.gridSize_,i.y+=this.gridSize_,u=t.fromDivPixelToLatLng(r),f=t.fromDivPixelToLatLng(i),n.extend(u),n.extend(f),n};MarkerClusterer.prototype.isMarkerInBounds_=function(n,t){return t.contains(n.getPosition())};MarkerClusterer.prototype.clearMarkers=function(){this.resetViewport(!0);this.markers_=[]};MarkerClusterer.prototype.resetViewport=function(n){for(var r,i,t=0;r=this.clusters_[t];t++)r.remove();for(t=0;i=this.markers_[t];t++)i.isAdded=!1,n&&i.setMap(null);this.clusters_=[]};MarkerClusterer.prototype.repaint=function(){var n=this.clusters_.slice();this.clusters_.length=0;this.resetViewport();this.redraw();window.setTimeout(function(){for(var t=0,i;i=n[t];t++)i.remove()},0)};MarkerClusterer.prototype.redraw=function(){this.createClusters_()};MarkerClusterer.prototype.distanceBetweenPoints_=function(n,t){if(!n||!t)return 0;var i=(t.lat()-n.lat())*Math.PI/180,r=(t.lng()-n.lng())*Math.PI/180,u=Math.sin(i/2)*Math.sin(i/2)+Math.cos(n.lat()*Math.PI/180)*Math.cos(t.lat()*Math.PI/180)*Math.sin(r/2)*Math.sin(r/2),f=2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u));return 6371*f};MarkerClusterer.prototype.addToClosestCluster_=function(n){for(var r,u,t,f=4e4,i=null,o=n.getPosition(),e=0;t=this.clusters_[e];e++)r=t.getCenter(),r&&(u=this.distanceBetweenPoints_(r,n.getPosition()),u=this.minClusterSize_&&n.setMap(null),this.updateIcon(),!0};Cluster.prototype.getMarkerClusterer=function(){return this.markerClusterer_};Cluster.prototype.getBounds=function(){for(var n=new google.maps.LatLngBounds(this.center_,this.center_),r=this.getMarkers(),t=0,i;i=r[t];t++)n.extend(i.getPosition());return n};Cluster.prototype.remove=function(){this.clusterIcon_.remove();this.markers_.length=0;delete this.markers_};Cluster.prototype.getSize=function(){return this.markers_.length};Cluster.prototype.getMarkers=function(){return this.markers_};Cluster.prototype.getCenter=function(){return this.center_};Cluster.prototype.calculateBounds_=function(){var n=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(n)};Cluster.prototype.isMarkerInClusterBounds=function(n){return this.bounds_.contains(n.getPosition())};Cluster.prototype.getMap=function(){return this.map_};Cluster.prototype.updateIcon=function(){var f=this.map_.getZoom(),t=this.markerClusterer_.getMaxZoom(),n,i,r,u;if(t&&f>t){for(n=0;i=this.markers_[n];n++)i.setMap(this.map_);return}if(this.markers_.length0&&this.anchor_[0]0&&this.anchor_[1]