var MarkerClusterer=function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var i=0;i=332&&google.maps.event.addDomListener(this.div_,"touchstart",(function(e){e.stopPropagation()})),google.maps.event.addDomListener(this.div_,"click",(function(n){if(e=!1,!t){if(google.maps.event.trigger(s,"click",i.cluster_),google.maps.event.trigger(s,"clusterclick",i.cluster_),s.getZoomOnClick()){var r=s.getMaxZoom(),a=i.cluster_.getBounds();s.getMap().fitBounds(a),setTimeout((function(){s.getMap().fitBounds(a),null!==r&&s.getMap().getZoom()>r&&s.getMap().setZoom(r+1)}),100)}n.cancelBubble=!0,n.stopPropagation&&n.stopPropagation()}})),google.maps.event.addDomListener(this.div_,"mouseover",(function(){google.maps.event.trigger(s,"mouseover",i.cluster_)})),google.maps.event.addDomListener(this.div_,"mouseout",(function(){google.maps.event.trigger(s,"mouseout",i.cluster_)}))}},{key:"onRemove",value:function(){this.div_&&this.div_.parentNode&&(this.hide(),google.maps.event.removeListener(this.boundsChangedListener_),google.maps.event.clearInstanceListeners(this.div_),this.div_.parentNode.removeChild(this.div_),this.div_=null)}},{key:"draw",value:function(){if(this.visible_){var e=this.getPosFromLatLng_(this.center_);this.div_.style.top=e.y+"px",this.div_.style.left=e.x+"px"}}},{key:"hide",value:function(){this.div_&&(this.div_.style.display="none"),this.visible_=!1}},{key:"show",value:function(){if(this.div_){var e=this.cluster_.getMarkerClusterer().ariaLabelFn(this.sums_.text),t=this.backgroundPosition_.split(" "),i=parseInt(t[0].replace(/^\s+|\s+$/g,""),10),s=parseInt(t[1].replace(/^\s+|\s+$/g,""),10);this.div_.style.cssText=this.createCss_(this.getPosFromLatLng_(this.center_));var n="";if(this.cluster_.getMarkerClusterer().getEnableRetinaIcons())n="width: ".concat(this.width_,"px; height: ").concat(this.height_,"px");else{var r=-1*s,a=-1*i+this.width_,o=-1*s+this.height_,l=-1*i;n="clip: rect(".concat(r,"px, ").concat(a,"px, ").concat(o,"px, ").concat(l,"px)")}var u=["position: absolute","top: ".concat(s,"px"),"left: ".concat(i,"px"),n].join(";"),h=["position: absolute","top: ".concat(this.anchorText_[0],"px"),"left: ".concat(this.anchorText_[1],"px"),"color: ".concat(this.textColor_),"font-size: ".concat(this.textSize_,"px"),"font-family: ".concat(this.fontFamily_),"font-weight: ".concat(this.fontWeight_),"font-style: ".concat(this.fontStyle_),"text-decoration: ".concat(this.textDecoration_),"text-align: center","width: ".concat(this.width_,"px"),"line-height: ".concat(this.height_,"px")].join(";");this.div_.innerHTML="\n\n
\n \n
\n"),void 0===this.sums_.title||""===this.sums_.title?this.div_.title=this.cluster_.getMarkerClusterer().getTitle():this.div_.title=this.sums_.title,this.div_.style.display=""}this.visible_=!0}},{key:"useStyle",value:function(e){this.sums_=e;var t=Math.max(0,e.index-1);t=Math.min(this.styles_.length-1,t);var i=this.styles_[t];this.url_=i.url,this.height_=i.height,this.width_=i.width,this.anchorText_=i.anchorText||[0,0],this.anchorIcon_=i.anchorIcon||[Math.floor(this.height_/2),Math.floor(this.width_/2)],this.textColor_=i.textColor||"black",this.textSize_=i.textSize||11,this.textDecoration_=i.textDecoration||"none",this.fontWeight_=i.fontWeight||"bold",this.fontStyle_=i.fontStyle||"normal",this.fontFamily_=i.fontFamily||"Arial,sans-serif",this.backgroundPosition_=i.backgroundPosition||"0 0"}},{key:"setCenter",value:function(e){this.center_=e}},{key:"createCss_",value:function(e){return["z-index: ".concat(this.cluster_.getMarkerClusterer().getZIndex()),"cursor: pointer","position: absolute; top: ".concat(e.y,"px; left: ").concat(e.x,"px"),"width: ".concat(this.width_,"px; height: ").concat(this.height_,"px"),"-webkit-user-select: none","-khtml-user-select: none","-moz-user-select: none","-o-user-select: none","user-select: none"].join(";")}},{key:"getPosFromLatLng_",value:function(e){var t=this.getProjection().fromLatLngToDivPixel(e);return t.x=Math.floor(t.x-this.anchorIcon_[1]),t.y=Math.floor(t.y-this.anchorIcon_[0]),t}}]),r}(l),h=function(){function t(i){e(this,t),this.markerClusterer_=i,this.map_=this.markerClusterer_.getMap(),this.minClusterSize_=this.markerClusterer_.getMinimumClusterSize(),this.averageCenter_=this.markerClusterer_.getAverageCenter(),this.markers_=[],this.center_=null,this.bounds_=null,this.clusterIcon_=new u(this,this.markerClusterer_.getStyles())}return i(t,[{key:"getSize",value:function(){return this.markers_.length}},{key:"getMarkers",value:function(){return this.markers_}},{key:"getCenter",value:function(){return this.center_}},{key:"getMap",value:function(){return this.map_}},{key:"getMarkerClusterer",value:function(){return this.markerClusterer_}},{key:"getBounds",value:function(){for(var e=new google.maps.LatLngBounds(this.center_,this.center_),t=this.getMarkers(),i=0;ir)e.getMap()!==this.map_&&e.setMap(this.map_);else if(nt)this.clusterIcon_.hide();else if(e1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e(this,r),(i=a(this,n(r).call(this))).options=o,i.markers_=[],i.clusters_=[],i.listeners_=[],i.activeMap_=null,i.ready_=!1,i.ariaLabelFn=i.options.ariaLabelFn||function(){return""},i.zIndex_=i.options.zIndex||google.maps.Marker.MAX_ZINDEX+1,i.gridSize_=i.options.gridSize||60,i.minClusterSize_=i.options.minimumClusterSize||2,i.maxZoom_=i.options.maxZoom||null,i.styles_=i.options.styles||[],i.title_=i.options.title||"",i.zoomOnClick_=c(i.options,"zoomOnClick",!0),i.averageCenter_=c(i.options,"averageCenter",!1),i.ignoreHidden_=c(i.options,"ignoreHidden",!1),i.enableRetinaIcons_=c(i.options,"enableRetinaIcons",!1),i.imagePath_=i.options.imagePath||r.IMAGE_PATH,i.imageExtension_=i.options.imageExtension||r.IMAGE_EXTENSION,i.imageSizes_=i.options.imageSizes||r.IMAGE_SIZES,i.calculator_=i.options.calculator||r.CALCULATOR,i.batchSize_=i.options.batchSize||r.BATCH_SIZE,i.batchSizeIE_=i.options.batchSizeIE||r.BATCH_SIZE_IE,i.clusterClass_=i.options.clusterClass||"cluster",-1!==navigator.userAgent.toLowerCase().indexOf("msie")&&(i.batchSize_=i.batchSizeIE_),i.setupStyles_(),i.addMarkers(s,!0),i.setMap(t),i}return s(r,t),i(r,[{key:"onAdd",value:function(){var e=this;this.activeMap_=this.getMap(),this.ready_=!0,this.repaint(),this.prevZoom_=this.getMap().getZoom(),this.listeners_=[google.maps.event.addListener(this.getMap(),"zoom_changed",(function(){var t=e.getMap(),i=t.minZoom||0,s=Math.min(t.maxZoom||100,t.mapTypes[t.getMapTypeId()].maxZoom),n=Math.min(Math.max(e.getMap().getZoom(),i),s);e.prevZoom_!=n&&(e.prevZoom_=n,e.resetViewport_(!1))})),google.maps.event.addListener(this.getMap(),"idle",(function(){e.redraw_()}))]}},{key:"onRemove",value:function(){for(var e=0;e0))for(var e=0;e3?new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),this.getMap().getBounds().getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625));for(var s=this.getExtendedBounds(i),n=Math.min(e+this.batchSize_,this.markers_.length),r=e;r