@react-google-maps/marker-clusterer 2.11.0 → 2.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs.min.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};function e(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}var i=function(t){function i(e,s){var r=t.call(this)||this;return e.getClusterer().extend(i,google.maps.OverlayView),r.cluster=e,r.clusterClassName=r.cluster.getClusterer().getClusterClass(),r.className=r.clusterClassName,r.styles=s,r.center=void 0,r.div=null,r.sums=null,r.visible=!1,r.boundsChangedListener=null,r.url="",r.height=0,r.width=0,r.anchorText=[0,0],r.anchorIcon=[0,0],r.textColor="black",r.textSize=11,r.textDecoration="none",r.fontWeight="bold",r.fontStyle="normal",r.fontFamily="Arial,sans-serif",r.backgroundPosition="0 0",r.cMouseDownInCluster=null,r.cDraggingMapByCluster=null,r.timeOut=null,r.setMap(e.getMap()),r}return e(i,t),i.prototype.onBoundsChanged=function(){this.cDraggingMapByCluster=this.cMouseDownInCluster},i.prototype.onMouseDown=function(){this.cMouseDownInCluster=!0,this.cDraggingMapByCluster=!1},i.prototype.onClick=function(t){if(this.cMouseDownInCluster=!1,!this.cDraggingMapByCluster){var e=this.cluster.getClusterer();if(google.maps.event.trigger(e,"click",this.cluster),google.maps.event.trigger(e,"clusterclick",this.cluster),e.getZoomOnClick()){var i=e.getMaxZoom(),s=this.cluster.getBounds();e.getMap().fitBounds(s),this.timeOut=window.setTimeout((function(){e.getMap().fitBounds(s),null!==i&&e.getMap().getZoom()>i&&e.getMap().setZoom(i+1)}),100)}t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation()}},i.prototype.onMouseOver=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseover",this.cluster)},i.prototype.onMouseOut=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseout",this.cluster)},i.prototype.onAdd=function(){this.div=document.createElement("div"),this.div.className=this.className,this.visible&&this.show(),this.getPanes().overlayMouseTarget.appendChild(this.div),this.boundsChangedListener=google.maps.event.addListener(this.getMap(),"bounds_changed",this.onBoundsChanged),this.div.addEventListener("mousedown",this.onMouseDown),this.div.addEventListener("click",this.onClick),this.div.addEventListener("mouseover",this.onMouseOver),this.div.addEventListener("mouseout",this.onMouseOut)},i.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.hide(),null!==this.boundsChangedListener&&google.maps.event.removeListener(this.boundsChangedListener),this.div.removeEventListener("mousedown",this.onMouseDown),this.div.removeEventListener("click",this.onClick),this.div.removeEventListener("mouseover",this.onMouseOver),this.div.removeEventListener("mouseout",this.onMouseOut),this.div.parentNode.removeChild(this.div),null!==this.timeOut&&(window.clearTimeout(this.timeOut),this.timeOut=null),this.div=null)},i.prototype.draw=function(){if(this.visible&&null!==this.div&&this.center){var t=this.getPosFromLatLng(this.center);this.div.style.top=null!==t?"".concat(t.y,"px"):"0",this.div.style.left=null!==t?"".concat(t.x,"px"):"0"}},i.prototype.hide=function(){this.div&&(this.div.style.display="none"),this.visible=!1},i.prototype.show=function(){var t;if(this.div&&this.center){var e="",i=this.backgroundPosition.split(" "),s=parseInt(i[0].replace(/^\s+|\s+$/g,""),10),r=parseInt(i[1].replace(/^\s+|\s+$/g,""),10),o=this.getPosFromLatLng(this.center);e=null===this.sums||void 0===this.sums.title||""===this.sums.title?this.cluster.getClusterer().getTitle():this.sums.title,this.div.style.cursor="pointer",this.div.style.position="absolute",this.div.style.top=null!==o?"".concat(o.y,"px"):"0",this.div.style.left=null!==o?"".concat(o.x,"px"):"0",this.div.style.width="".concat(this.width,"px"),this.div.style.height="".concat(this.height,"px");var n=document.createElement("img");n.alt=e,n.src=this.url,n.style.position="absolute",n.style.top="".concat(r,"px"),n.style.left="".concat(s,"px"),this.cluster.getClusterer().enableRetinaIcons||(n.style.clip="rect(-".concat(r,"px, -").concat(s+this.width,"px, -").concat(r+this.height,", -").concat(s,")"));var a=document.createElement("div");a.style.position="absolute",a.style.top="".concat(this.anchorText[0],"px"),a.style.left="".concat(this.anchorText[1],"px"),a.style.color=this.textColor,a.style.fontSize="".concat(this.textSize,"px"),a.style.fontFamily=this.fontFamily,a.style.fontWeight=this.fontWeight,a.style.fontStyle=this.fontStyle,a.style.textDecoration=this.textDecoration,a.style.textAlign="center",a.style.width="".concat(this.width,"px"),a.style.lineHeight="".concat(this.height,"px"),a.innerText="".concat(null===(t=this.sums)||void 0===t?void 0:t.text),this.div.innerHTML="",this.div.appendChild(n),this.div.appendChild(a),this.div.title=e,this.div.style.display=""}this.visible=!0},i.prototype.useStyle=function(t){this.sums=t;var e=this.cluster.getClusterer().getStyles(),i=e[Math.min(e.length-1,Math.max(0,t.index-1))];this.url=i.url,this.height=i.height,this.width=i.width,i.className&&(this.className="".concat(this.clusterClassName," ").concat(i.className)),this.anchorText=i.anchorText||[0,0],this.anchorIcon=i.anchorIcon||[this.height/2,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"},i.prototype.setCenter=function(t){this.center=t},i.prototype.getPosFromLatLng=function(t){var e=this.getProjection().fromLatLngToDivPixel(t);return null!==e&&(e.x-=this.anchorIcon[1],e.y-=this.anchorIcon[0]),e},i}(google.maps.OverlayView),s=function(){function t(t){this.markerClusterer=t,this.map=this.markerClusterer.getMap(),this.gridSize=this.markerClusterer.getGridSize(),this.minClusterSize=this.markerClusterer.getMinimumClusterSize(),this.averageCenter=this.markerClusterer.getAverageCenter(),this.markers=[],this.center=void 0,this.bounds=null,this.clusterIcon=new i(this,this.markerClusterer.getStyles())}return t.prototype.getSize=function(){return this.markers.length},t.prototype.getMarkers=function(){return this.markers},t.prototype.getCenter=function(){return this.center},t.prototype.getMap=function(){return this.map},t.prototype.getClusterer=function(){return this.markerClusterer},t.prototype.getBounds=function(){for(var t=new google.maps.LatLngBounds(this.center,this.center),e=this.getMarkers(),i=0;i<e.length;i++){var s=e[i].getPosition();s&&t.extend(s)}return t},t.prototype.remove=function(){this.clusterIcon.setMap(null),this.markers=[],delete this.markers},t.prototype.addMarker=function(t){if(this.isMarkerAlreadyAdded(t))return!1;var e;if(this.center){if(this.averageCenter&&(e=t.getPosition())){var i=this.markers.length+1;this.center=new google.maps.LatLng((this.center.lat()*(i-1)+e.lat())/i,(this.center.lng()*(i-1)+e.lng())/i),this.calculateBounds()}}else(e=t.getPosition())&&(this.center=e,this.calculateBounds());t.isAdded=!0,this.markers.push(t);var s=this.markers.length,r=this.markerClusterer.getMaxZoom(),o=this.map.getZoom();if(null!==r&&void 0!==o&&o>r)t.getMap()!==this.map&&t.setMap(this.map);else if(s<this.minClusterSize)t.getMap()!==this.map&&t.setMap(this.map);else if(s===this.minClusterSize)for(var n=0;n<s;n++)this.markers[n].setMap(null);else t.setMap(null);return!0},t.prototype.isMarkerInClusterBounds=function(t){if(null!==this.bounds){var e=t.getPosition();if(e)return this.bounds.contains(e)}return!1},t.prototype.calculateBounds=function(){this.bounds=this.markerClusterer.getExtendedBounds(new google.maps.LatLngBounds(this.center,this.center))},t.prototype.updateIcon=function(){var t=this.markers.length,e=this.markerClusterer.getMaxZoom(),i=this.map.getZoom();null!==e&&void 0!==i&&i>e||t<this.minClusterSize?this.clusterIcon.hide():(this.center&&this.clusterIcon.setCenter(this.center),this.clusterIcon.useStyle(this.markerClusterer.getCalculator()(this.markers,this.markerClusterer.getStyles().length)),this.clusterIcon.show())},t.prototype.isMarkerAlreadyAdded=function(t){if(this.markers.includes)return this.markers.includes(t);for(var e=0;e<this.markers.length;e++)if(t===this.markers[e])return!0;return!1},t}(),r=function(t,e){var i=t.length,s=i.toString().length,r=Math.min(s,e);return{text:i.toString(),index:r,title:""}},o=[53,56,66,78,90],n=function(t){function i(e,s,n){void 0===s&&(s=[]),void 0===n&&(n={});var a=t.call(this)||this;return a.extend(i,google.maps.OverlayView),a.markers=[],a.clusters=[],a.listeners=[],a.activeMap=null,a.ready=!1,a.gridSize=n.gridSize||60,a.minClusterSize=n.minimumClusterSize||2,a.maxZoom=n.maxZoom||null,a.styles=n.styles||[],a.title=n.title||"",a.zoomOnClick=!0,void 0!==n.zoomOnClick&&(a.zoomOnClick=n.zoomOnClick),a.averageCenter=!1,void 0!==n.averageCenter&&(a.averageCenter=n.averageCenter),a.ignoreHidden=!1,void 0!==n.ignoreHidden&&(a.ignoreHidden=n.ignoreHidden),a.enableRetinaIcons=!1,void 0!==n.enableRetinaIcons&&(a.enableRetinaIcons=n.enableRetinaIcons),a.imagePath=n.imagePath||"https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m",a.imageExtension=n.imageExtension||"png",a.imageSizes=n.imageSizes||o,a.calculator=n.calculator||r,a.batchSize=n.batchSize||2e3,a.batchSizeIE=n.batchSizeIE||500,a.clusterClass=n.clusterClass||"cluster",-1!==navigator.userAgent.toLowerCase().indexOf("msie")&&(a.batchSize=a.batchSizeIE),a.timerRefStatic=null,a.setupStyles(),a.addMarkers(s,!0),a.setMap(e),a}return e(i,t),i.prototype.onZoomChanged=function(){var t,e;this.resetViewport(!1),(null===(t=this.getMap())||void 0===t?void 0:t.getZoom())!==(this.get("minZoom")||0)&&(null===(e=this.getMap())||void 0===e?void 0:e.getZoom())!==this.get("maxZoom")||google.maps.event.trigger(this,"idle")},i.prototype.onIdle=function(){this.redraw()},i.prototype.onAdd=function(){var t=this.getMap();this.activeMap=t,this.ready=!0,this.repaint(),null!==t&&(this.listeners=[google.maps.event.addListener(t,"zoom_changed",this.onZoomChanged),google.maps.event.addListener(t,"idle",this.onIdle)])},i.prototype.onRemove=function(){for(var t=0;t<this.markers.length;t++)this.markers[t].getMap()!==this.activeMap&&this.markers[t].setMap(this.activeMap);for(t=0;t<this.clusters.length;t++)this.clusters[t].remove();this.clusters=[];for(t=0;t<this.listeners.length;t++)google.maps.event.removeListener(this.listeners[t]);this.listeners=[],this.activeMap=null,this.ready=!1},i.prototype.draw=function(){},i.prototype.setupStyles=function(){if(!(this.styles.length>0))for(var t=0;t<this.imageSizes.length;t++)this.styles.push({url:this.imagePath+(t+1)+"."+this.imageExtension,height:this.imageSizes[t],width:this.imageSizes[t]})},i.prototype.fitMapToMarkers=function(){for(var t=this.getMarkers(),e=new google.maps.LatLngBounds,i=0;i<t.length;i++){var s=t[i].getPosition();s&&e.extend(s)}this.getMap().fitBounds(e)},i.prototype.getGridSize=function(){return this.gridSize},i.prototype.setGridSize=function(t){this.gridSize=t},i.prototype.getMinimumClusterSize=function(){return this.minClusterSize},i.prototype.setMinimumClusterSize=function(t){this.minClusterSize=t},i.prototype.getMaxZoom=function(){return this.maxZoom},i.prototype.setMaxZoom=function(t){this.maxZoom=t},i.prototype.getStyles=function(){return this.styles},i.prototype.setStyles=function(t){this.styles=t},i.prototype.getTitle=function(){return this.title},i.prototype.setTitle=function(t){this.title=t},i.prototype.getZoomOnClick=function(){return this.zoomOnClick},i.prototype.setZoomOnClick=function(t){this.zoomOnClick=t},i.prototype.getAverageCenter=function(){return this.averageCenter},i.prototype.setAverageCenter=function(t){this.averageCenter=t},i.prototype.getIgnoreHidden=function(){return this.ignoreHidden},i.prototype.setIgnoreHidden=function(t){this.ignoreHidden=t},i.prototype.getEnableRetinaIcons=function(){return this.enableRetinaIcons},i.prototype.setEnableRetinaIcons=function(t){this.enableRetinaIcons=t},i.prototype.getImageExtension=function(){return this.imageExtension},i.prototype.setImageExtension=function(t){this.imageExtension=t},i.prototype.getImagePath=function(){return this.imagePath},i.prototype.setImagePath=function(t){this.imagePath=t},i.prototype.getImageSizes=function(){return this.imageSizes},i.prototype.setImageSizes=function(t){this.imageSizes=t},i.prototype.getCalculator=function(){return this.calculator},i.prototype.setCalculator=function(t){this.calculator=t},i.prototype.getBatchSizeIE=function(){return this.batchSizeIE},i.prototype.setBatchSizeIE=function(t){this.batchSizeIE=t},i.prototype.getClusterClass=function(){return this.clusterClass},i.prototype.setClusterClass=function(t){this.clusterClass=t},i.prototype.getMarkers=function(){return this.markers},i.prototype.getTotalMarkers=function(){return this.markers.length},i.prototype.getClusters=function(){return this.clusters},i.prototype.getTotalClusters=function(){return this.clusters.length},i.prototype.addMarker=function(t,e){this.pushMarkerTo(t),e||this.redraw()},i.prototype.addMarkers=function(t,e){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&this.pushMarkerTo(t[i]);e||this.redraw()},i.prototype.pushMarkerTo=function(t){var e=this;t.getDraggable()&&google.maps.event.addListener(t,"dragend",(function(){e.ready&&(t.isAdded=!1,e.repaint())})),t.isAdded=!1,this.markers.push(t)},i.prototype.removeMarker_=function(t){var e=-1;if(this.markers.indexOf)e=this.markers.indexOf(t);else for(var i=0;i<this.markers.length;i++)if(t===this.markers[i]){e=i;break}return-1!==e&&(t.setMap(null),this.markers.splice(e,1),!0)},i.prototype.removeMarker=function(t,e){var i=this.removeMarker_(t);return!e&&i&&this.repaint(),i},i.prototype.removeMarkers=function(t,e){for(var i=!1,s=0;s<t.length;s++)i=i||this.removeMarker_(t[s]);return!e&&i&&this.repaint(),i},i.prototype.clearMarkers=function(){this.resetViewport(!0),this.markers=[]},i.prototype.repaint=function(){var t=this.clusters.slice();this.clusters=[],this.resetViewport(!1),this.redraw(),setTimeout((function(){for(var e=0;e<t.length;e++)t[e].remove()}),0)},i.prototype.getExtendedBounds=function(t){var e=this.getProjection(),i=e.fromLatLngToDivPixel(new google.maps.LatLng(t.getNorthEast().lat(),t.getNorthEast().lng()));null!==i&&(i.x+=this.gridSize,i.y-=this.gridSize);var s=e.fromLatLngToDivPixel(new google.maps.LatLng(t.getSouthWest().lat(),t.getSouthWest().lng()));if(null!==s&&(s.x-=this.gridSize,s.y+=this.gridSize),null!==i){var r=e.fromDivPixelToLatLng(i);null!==r&&t.extend(r)}if(null!==s){var o=e.fromDivPixelToLatLng(s);null!==o&&t.extend(o)}return t},i.prototype.redraw=function(){this.createClusters(0)},i.prototype.resetViewport=function(t){for(var e=0;e<this.clusters.length;e++)this.clusters[e].remove();this.clusters=[];for(e=0;e<this.markers.length;e++){var i=this.markers[e];i.isAdded=!1,t&&i.setMap(null)}},i.prototype.distanceBetweenPoints=function(t,e){var i=(e.lat()-t.lat())*Math.PI/180,s=(e.lng()-t.lng())*Math.PI/180,r=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t.lat()*Math.PI/180)*Math.cos(e.lat()*Math.PI/180)*Math.sin(s/2)*Math.sin(s/2);return 2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r))*6371},i.prototype.isMarkerInBounds=function(t,e){var i=t.getPosition();return!!i&&e.contains(i)},i.prototype.addToClosestCluster=function(t){for(var e,i=4e4,r=null,o=0;o<this.clusters.length;o++){var n=(e=this.clusters[o]).getCenter(),a=t.getPosition();if(n&&a){var l=this.distanceBetweenPoints(n,a);l<i&&(i=l,r=e)}}r&&r.isMarkerInClusterBounds(t)?r.addMarker(t):((e=new s(this)).addMarker(t),this.clusters.push(e))},i.prototype.createClusters=function(t){var e=this;if(this.ready){0===t&&(google.maps.event.trigger(this,"clusteringbegin",this),null!==this.timerRefStatic&&(window.clearTimeout(this.timerRefStatic),delete this.timerRefStatic));for(var i=this.getMap(),s=(null!==i&&"getBounds"in i?i.getBounds():null),r=i.getZoom()>3?new google.maps.LatLngBounds(null==s?void 0:s.getSouthWest(),null==s?void 0:s.getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625)),o=this.getExtendedBounds(r),n=Math.min(t+this.batchSize,this.markers.length),a=t;a<n;a++){var l=this.markers[a];!l.isAdded&&this.isMarkerInBounds(l,o)&&(!this.ignoreHidden||this.ignoreHidden&&l.getVisible())&&this.addToClosestCluster(l)}if(n<this.markers.length)this.timerRefStatic=window.setTimeout((function(){e.createClusters(n)}),0);else{this.timerRefStatic=null,google.maps.event.trigger(this,"clusteringend",this);for(a=0;a<this.clusters.length;a++)this.clusters[a].updateIcon()}}},i.prototype.extend=function(t,e){return function(t){for(var e in t.prototype)this.prototype.set(e,t.prototype.get(e));return this}.apply(t,[e])},i}(google.maps.OverlayView);exports.Cluster=s,exports.ClusterIcon=i,exports.Clusterer=n;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};function e(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}var i=function(t){function i(e,s){var r=t.call(this)||this;return e.getClusterer().extend(i,google.maps.OverlayView),r.cluster=e,r.clusterClassName=r.cluster.getClusterer().getClusterClass(),r.className=r.clusterClassName,r.styles=s,r.center=void 0,r.div=null,r.sums=null,r.visible=!1,r.boundsChangedListener=null,r.url="",r.height=0,r.width=0,r.anchorText=[0,0],r.anchorIcon=[0,0],r.textColor="black",r.textSize=11,r.textDecoration="none",r.fontWeight="bold",r.fontStyle="normal",r.fontFamily="Arial,sans-serif",r.backgroundPosition="0 0",r.cMouseDownInCluster=null,r.cDraggingMapByCluster=null,r.timeOut=null,r.setMap(e.getMap()),r}return e(i,t),i.prototype.onBoundsChanged=function(){this.cDraggingMapByCluster=this.cMouseDownInCluster},i.prototype.onMouseDown=function(){this.cMouseDownInCluster=!0,this.cDraggingMapByCluster=!1},i.prototype.onClick=function(t){if(this.cMouseDownInCluster=!1,!this.cDraggingMapByCluster){var e=this.cluster.getClusterer();if(google.maps.event.trigger(e,"click",this.cluster),google.maps.event.trigger(e,"clusterclick",this.cluster),e.getZoomOnClick()){var i=e.getMaxZoom(),s=this.cluster.getBounds(),r=e.getMap();null!==r&&"fitBounds"in r&&r.fitBounds(s),this.timeOut=window.setTimeout((function(){var t=e.getMap();if(null!==t){"fitBounds"in t&&t.fitBounds(s);var r=t.getZoom()||0;null!==i&&r>i&&t.setZoom(i+1)}}),100)}t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation()}},i.prototype.onMouseOver=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseover",this.cluster)},i.prototype.onMouseOut=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseout",this.cluster)},i.prototype.onAdd=function(){var t;this.div=document.createElement("div"),this.div.className=this.className,this.visible&&this.show(),null===(t=this.getPanes())||void 0===t||t.overlayMouseTarget.appendChild(this.div);var e=this.getMap();null!==e&&(this.boundsChangedListener=google.maps.event.addListener(e,"bounds_changed",this.onBoundsChanged),this.div.addEventListener("mousedown",this.onMouseDown),this.div.addEventListener("click",this.onClick),this.div.addEventListener("mouseover",this.onMouseOver),this.div.addEventListener("mouseout",this.onMouseOut))},i.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.hide(),null!==this.boundsChangedListener&&google.maps.event.removeListener(this.boundsChangedListener),this.div.removeEventListener("mousedown",this.onMouseDown),this.div.removeEventListener("click",this.onClick),this.div.removeEventListener("mouseover",this.onMouseOver),this.div.removeEventListener("mouseout",this.onMouseOut),this.div.parentNode.removeChild(this.div),null!==this.timeOut&&(window.clearTimeout(this.timeOut),this.timeOut=null),this.div=null)},i.prototype.draw=function(){if(this.visible&&null!==this.div&&this.center){var t=this.getPosFromLatLng(this.center);this.div.style.top=null!==t?"".concat(t.y,"px"):"0",this.div.style.left=null!==t?"".concat(t.x,"px"):"0"}},i.prototype.hide=function(){this.div&&(this.div.style.display="none"),this.visible=!1},i.prototype.show=function(){var t;if(this.div&&this.center){var e="",i=this.backgroundPosition.split(" "),s=parseInt(i[0].replace(/^\s+|\s+$/g,""),10),r=parseInt(i[1].replace(/^\s+|\s+$/g,""),10),o=this.getPosFromLatLng(this.center);e=null===this.sums||void 0===this.sums.title||""===this.sums.title?this.cluster.getClusterer().getTitle():this.sums.title,this.div.style.cursor="pointer",this.div.style.position="absolute",this.div.style.top=null!==o?"".concat(o.y,"px"):"0",this.div.style.left=null!==o?"".concat(o.x,"px"):"0",this.div.style.width="".concat(this.width,"px"),this.div.style.height="".concat(this.height,"px");var n=document.createElement("img");n.alt=e,n.src=this.url,n.style.position="absolute",n.style.top="".concat(r,"px"),n.style.left="".concat(s,"px"),this.cluster.getClusterer().enableRetinaIcons||(n.style.clip="rect(-".concat(r,"px, -").concat(s+this.width,"px, -").concat(r+this.height,", -").concat(s,")"));var a=document.createElement("div");a.style.position="absolute",a.style.top="".concat(this.anchorText[0],"px"),a.style.left="".concat(this.anchorText[1],"px"),a.style.color=this.textColor,a.style.fontSize="".concat(this.textSize,"px"),a.style.fontFamily=this.fontFamily,a.style.fontWeight=this.fontWeight,a.style.fontStyle=this.fontStyle,a.style.textDecoration=this.textDecoration,a.style.textAlign="center",a.style.width="".concat(this.width,"px"),a.style.lineHeight="".concat(this.height,"px"),a.innerText="".concat(null===(t=this.sums)||void 0===t?void 0:t.text),this.div.innerHTML="",this.div.appendChild(n),this.div.appendChild(a),this.div.title=e,this.div.style.display=""}this.visible=!0},i.prototype.useStyle=function(t){this.sums=t;var e=this.cluster.getClusterer().getStyles(),i=e[Math.min(e.length-1,Math.max(0,t.index-1))];this.url=i.url,this.height=i.height,this.width=i.width,i.className&&(this.className="".concat(this.clusterClassName," ").concat(i.className)),this.anchorText=i.anchorText||[0,0],this.anchorIcon=i.anchorIcon||[this.height/2,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"},i.prototype.setCenter=function(t){this.center=t},i.prototype.getPosFromLatLng=function(t){var e=this.getProjection().fromLatLngToDivPixel(t);return null!==e&&(e.x-=this.anchorIcon[1],e.y-=this.anchorIcon[0]),e},i}(google.maps.OverlayView),s=function(){function t(t){this.markerClusterer=t,this.map=this.markerClusterer.getMap(),this.gridSize=this.markerClusterer.getGridSize(),this.minClusterSize=this.markerClusterer.getMinimumClusterSize(),this.averageCenter=this.markerClusterer.getAverageCenter(),this.markers=[],this.center=void 0,this.bounds=null,this.clusterIcon=new i(this,this.markerClusterer.getStyles())}return t.prototype.getSize=function(){return this.markers.length},t.prototype.getMarkers=function(){return this.markers},t.prototype.getCenter=function(){return this.center},t.prototype.getMap=function(){return this.map},t.prototype.getClusterer=function(){return this.markerClusterer},t.prototype.getBounds=function(){for(var t=new google.maps.LatLngBounds(this.center,this.center),e=this.getMarkers(),i=0;i<e.length;i++){var s=e[i].getPosition();s&&t.extend(s)}return t},t.prototype.remove=function(){this.clusterIcon.setMap(null),this.markers=[],delete this.markers},t.prototype.addMarker=function(t){var e,i;if(this.isMarkerAlreadyAdded(t))return!1;if(this.center){if(this.averageCenter&&(i=t.getPosition())){var s=this.markers.length+1;this.center=new google.maps.LatLng((this.center.lat()*(s-1)+i.lat())/s,(this.center.lng()*(s-1)+i.lng())/s),this.calculateBounds()}}else(i=t.getPosition())&&(this.center=i,this.calculateBounds());t.isAdded=!0,this.markers.push(t);var r=this.markers.length,o=this.markerClusterer.getMaxZoom(),n=null===(e=this.map)||void 0===e?void 0:e.getZoom();if(null!==o&&void 0!==n&&n>o)t.getMap()!==this.map&&t.setMap(this.map);else if(r<this.minClusterSize)t.getMap()!==this.map&&t.setMap(this.map);else if(r===this.minClusterSize)for(var a=0;a<r;a++)this.markers[a].setMap(null);else t.setMap(null);return!0},t.prototype.isMarkerInClusterBounds=function(t){if(null!==this.bounds){var e=t.getPosition();if(e)return this.bounds.contains(e)}return!1},t.prototype.calculateBounds=function(){this.bounds=this.markerClusterer.getExtendedBounds(new google.maps.LatLngBounds(this.center,this.center))},t.prototype.updateIcon=function(){var t,e=this.markers.length,i=this.markerClusterer.getMaxZoom(),s=null===(t=this.map)||void 0===t?void 0:t.getZoom();null!==i&&void 0!==s&&s>i||e<this.minClusterSize?this.clusterIcon.hide():(this.center&&this.clusterIcon.setCenter(this.center),this.clusterIcon.useStyle(this.markerClusterer.getCalculator()(this.markers,this.markerClusterer.getStyles().length)),this.clusterIcon.show())},t.prototype.isMarkerAlreadyAdded=function(t){if(this.markers.includes)return this.markers.includes(t);for(var e=0;e<this.markers.length;e++)if(t===this.markers[e])return!0;return!1},t}(),r=function(t,e){var i=t.length,s=i.toString().length,r=Math.min(s,e);return{text:i.toString(),index:r,title:""}},o=[53,56,66,78,90],n=function(t){function i(e,s,n){void 0===s&&(s=[]),void 0===n&&(n={});var a=t.call(this)||this;return a.extend(i,google.maps.OverlayView),a.markers=[],a.clusters=[],a.listeners=[],a.activeMap=null,a.ready=!1,a.gridSize=n.gridSize||60,a.minClusterSize=n.minimumClusterSize||2,a.maxZoom=n.maxZoom||null,a.styles=n.styles||[],a.title=n.title||"",a.zoomOnClick=!0,void 0!==n.zoomOnClick&&(a.zoomOnClick=n.zoomOnClick),a.averageCenter=!1,void 0!==n.averageCenter&&(a.averageCenter=n.averageCenter),a.ignoreHidden=!1,void 0!==n.ignoreHidden&&(a.ignoreHidden=n.ignoreHidden),a.enableRetinaIcons=!1,void 0!==n.enableRetinaIcons&&(a.enableRetinaIcons=n.enableRetinaIcons),a.imagePath=n.imagePath||"https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m",a.imageExtension=n.imageExtension||"png",a.imageSizes=n.imageSizes||o,a.calculator=n.calculator||r,a.batchSize=n.batchSize||2e3,a.batchSizeIE=n.batchSizeIE||500,a.clusterClass=n.clusterClass||"cluster",-1!==navigator.userAgent.toLowerCase().indexOf("msie")&&(a.batchSize=a.batchSizeIE),a.timerRefStatic=null,a.setupStyles(),a.addMarkers(s,!0),a.setMap(e),a}return e(i,t),i.prototype.onZoomChanged=function(){var t,e;this.resetViewport(!1),(null===(t=this.getMap())||void 0===t?void 0:t.getZoom())!==(this.get("minZoom")||0)&&(null===(e=this.getMap())||void 0===e?void 0:e.getZoom())!==this.get("maxZoom")||google.maps.event.trigger(this,"idle")},i.prototype.onIdle=function(){this.redraw()},i.prototype.onAdd=function(){var t=this.getMap();this.activeMap=t,this.ready=!0,this.repaint(),null!==t&&(this.listeners=[google.maps.event.addListener(t,"zoom_changed",this.onZoomChanged),google.maps.event.addListener(t,"idle",this.onIdle)])},i.prototype.onRemove=function(){for(var t=0;t<this.markers.length;t++)this.markers[t].getMap()!==this.activeMap&&this.markers[t].setMap(this.activeMap);for(t=0;t<this.clusters.length;t++)this.clusters[t].remove();this.clusters=[];for(t=0;t<this.listeners.length;t++)google.maps.event.removeListener(this.listeners[t]);this.listeners=[],this.activeMap=null,this.ready=!1},i.prototype.draw=function(){},i.prototype.setupStyles=function(){if(!(this.styles.length>0))for(var t=0;t<this.imageSizes.length;t++)this.styles.push({url:this.imagePath+(t+1)+"."+this.imageExtension,height:this.imageSizes[t],width:this.imageSizes[t]})},i.prototype.fitMapToMarkers=function(){for(var t=this.getMarkers(),e=new google.maps.LatLngBounds,i=0;i<t.length;i++){var s=t[i].getPosition();s&&e.extend(s)}var r=this.getMap();null!==r&&"fitBounds"in r&&r.fitBounds(e)},i.prototype.getGridSize=function(){return this.gridSize},i.prototype.setGridSize=function(t){this.gridSize=t},i.prototype.getMinimumClusterSize=function(){return this.minClusterSize},i.prototype.setMinimumClusterSize=function(t){this.minClusterSize=t},i.prototype.getMaxZoom=function(){return this.maxZoom},i.prototype.setMaxZoom=function(t){this.maxZoom=t},i.prototype.getStyles=function(){return this.styles},i.prototype.setStyles=function(t){this.styles=t},i.prototype.getTitle=function(){return this.title},i.prototype.setTitle=function(t){this.title=t},i.prototype.getZoomOnClick=function(){return this.zoomOnClick},i.prototype.setZoomOnClick=function(t){this.zoomOnClick=t},i.prototype.getAverageCenter=function(){return this.averageCenter},i.prototype.setAverageCenter=function(t){this.averageCenter=t},i.prototype.getIgnoreHidden=function(){return this.ignoreHidden},i.prototype.setIgnoreHidden=function(t){this.ignoreHidden=t},i.prototype.getEnableRetinaIcons=function(){return this.enableRetinaIcons},i.prototype.setEnableRetinaIcons=function(t){this.enableRetinaIcons=t},i.prototype.getImageExtension=function(){return this.imageExtension},i.prototype.setImageExtension=function(t){this.imageExtension=t},i.prototype.getImagePath=function(){return this.imagePath},i.prototype.setImagePath=function(t){this.imagePath=t},i.prototype.getImageSizes=function(){return this.imageSizes},i.prototype.setImageSizes=function(t){this.imageSizes=t},i.prototype.getCalculator=function(){return this.calculator},i.prototype.setCalculator=function(t){this.calculator=t},i.prototype.getBatchSizeIE=function(){return this.batchSizeIE},i.prototype.setBatchSizeIE=function(t){this.batchSizeIE=t},i.prototype.getClusterClass=function(){return this.clusterClass},i.prototype.setClusterClass=function(t){this.clusterClass=t},i.prototype.getMarkers=function(){return this.markers},i.prototype.getTotalMarkers=function(){return this.markers.length},i.prototype.getClusters=function(){return this.clusters},i.prototype.getTotalClusters=function(){return this.clusters.length},i.prototype.addMarker=function(t,e){this.pushMarkerTo(t),e||this.redraw()},i.prototype.addMarkers=function(t,e){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&this.pushMarkerTo(t[i]);e||this.redraw()},i.prototype.pushMarkerTo=function(t){var e=this;t.getDraggable()&&google.maps.event.addListener(t,"dragend",(function(){e.ready&&(t.isAdded=!1,e.repaint())})),t.isAdded=!1,this.markers.push(t)},i.prototype.removeMarker_=function(t){var e=-1;if(this.markers.indexOf)e=this.markers.indexOf(t);else for(var i=0;i<this.markers.length;i++)if(t===this.markers[i]){e=i;break}return-1!==e&&(t.setMap(null),this.markers.splice(e,1),!0)},i.prototype.removeMarker=function(t,e){var i=this.removeMarker_(t);return!e&&i&&this.repaint(),i},i.prototype.removeMarkers=function(t,e){for(var i=!1,s=0;s<t.length;s++)i=i||this.removeMarker_(t[s]);return!e&&i&&this.repaint(),i},i.prototype.clearMarkers=function(){this.resetViewport(!0),this.markers=[]},i.prototype.repaint=function(){var t=this.clusters.slice();this.clusters=[],this.resetViewport(!1),this.redraw(),setTimeout((function(){for(var e=0;e<t.length;e++)t[e].remove()}),0)},i.prototype.getExtendedBounds=function(t){var e=this.getProjection(),i=e.fromLatLngToDivPixel(new google.maps.LatLng(t.getNorthEast().lat(),t.getNorthEast().lng()));null!==i&&(i.x+=this.gridSize,i.y-=this.gridSize);var s=e.fromLatLngToDivPixel(new google.maps.LatLng(t.getSouthWest().lat(),t.getSouthWest().lng()));if(null!==s&&(s.x-=this.gridSize,s.y+=this.gridSize),null!==i){var r=e.fromDivPixelToLatLng(i);null!==r&&t.extend(r)}if(null!==s){var o=e.fromDivPixelToLatLng(s);null!==o&&t.extend(o)}return t},i.prototype.redraw=function(){this.createClusters(0)},i.prototype.resetViewport=function(t){for(var e=0;e<this.clusters.length;e++)this.clusters[e].remove();this.clusters=[];for(e=0;e<this.markers.length;e++){var i=this.markers[e];i.isAdded=!1,t&&i.setMap(null)}},i.prototype.distanceBetweenPoints=function(t,e){var i=(e.lat()-t.lat())*Math.PI/180,s=(e.lng()-t.lng())*Math.PI/180,r=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t.lat()*Math.PI/180)*Math.cos(e.lat()*Math.PI/180)*Math.sin(s/2)*Math.sin(s/2);return 2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r))*6371},i.prototype.isMarkerInBounds=function(t,e){var i=t.getPosition();return!!i&&e.contains(i)},i.prototype.addToClosestCluster=function(t){for(var e,i=4e4,r=null,o=0;o<this.clusters.length;o++){var n=(e=this.clusters[o]).getCenter(),a=t.getPosition();if(n&&a){var l=this.distanceBetweenPoints(n,a);l<i&&(i=l,r=e)}}r&&r.isMarkerInClusterBounds(t)?r.addMarker(t):((e=new s(this)).addMarker(t),this.clusters.push(e))},i.prototype.createClusters=function(t){var e=this;if(this.ready){0===t&&(google.maps.event.trigger(this,"clusteringbegin",this),null!==this.timerRefStatic&&(window.clearTimeout(this.timerRefStatic),delete this.timerRefStatic));for(var i=this.getMap(),s=(null!==i&&"getBounds"in i?i.getBounds():null),r=((null==i?void 0:i.getZoom())||0)>3?new google.maps.LatLngBounds(null==s?void 0:s.getSouthWest(),null==s?void 0:s.getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625)),o=this.getExtendedBounds(r),n=Math.min(t+this.batchSize,this.markers.length),a=t;a<n;a++){var l=this.markers[a];!l.isAdded&&this.isMarkerInBounds(l,o)&&(!this.ignoreHidden||this.ignoreHidden&&l.getVisible())&&this.addToClosestCluster(l)}if(n<this.markers.length)this.timerRefStatic=window.setTimeout((function(){e.createClusters(n)}),0);else{this.timerRefStatic=null,google.maps.event.trigger(this,"clusteringend",this);for(a=0;a<this.clusters.length;a++)this.clusters[a].updateIcon()}}},i.prototype.extend=function(t,e){return function(t){for(var e in t.prototype)this.prototype.set(e,t.prototype.get(e));return this}.apply(t,[e])},i}(google.maps.OverlayView);exports.Cluster=s,exports.ClusterIcon=i,exports.Clusterer=n;
2
2
  //# sourceMappingURL=cjs.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cjs.min.js","sources":["../../../node_modules/tslib/tslib.es6.js","../src/ClusterIcon.tsx","../src/Cluster.tsx","../src/Clusterer.tsx"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","/* global google */\n/* eslint-disable filenames/match-regex */\nimport { Cluster } from './Cluster'\n\nimport { ClusterIconStyle, ClusterIconInfo } from './types'\n\nexport class ClusterIcon extends google.maps.OverlayView {\n cluster: Cluster\n className: string\n clusterClassName: string\n styles: ClusterIconStyle[]\n center: google.maps.LatLng | undefined\n div: HTMLDivElement | null\n sums: ClusterIconInfo | null\n visible: boolean\n url: string\n height: number\n width: number\n anchorText: number[]\n anchorIcon: number[]\n textColor: string\n textSize: number\n textDecoration: string\n fontWeight: string\n fontStyle: string\n fontFamily: string\n backgroundPosition: string\n cMouseDownInCluster: boolean | null\n cDraggingMapByCluster: boolean | null\n timeOut: number | null\n\n boundsChangedListener: google.maps.MapsEventListener | null\n\n constructor(cluster: Cluster, styles: ClusterIconStyle[]) {\n super()\n cluster.getClusterer().extend(ClusterIcon, google.maps.OverlayView)\n\n this.cluster = cluster\n\n this.clusterClassName = this.cluster.getClusterer().getClusterClass()\n\n this.className = this.clusterClassName\n\n this.styles = styles\n\n this.center = undefined\n\n this.div = null\n\n this.sums = null\n\n this.visible = false\n\n this.boundsChangedListener = null\n\n this.url = ''\n\n this.height = 0\n this.width = 0\n\n this.anchorText = [0, 0]\n this.anchorIcon = [0, 0]\n\n this.textColor = 'black'\n this.textSize = 11\n this.textDecoration = 'none'\n this.fontWeight = 'bold'\n this.fontStyle = 'normal'\n this.fontFamily = 'Arial,sans-serif'\n\n this.backgroundPosition = '0 0'\n\n this.cMouseDownInCluster = null\n this.cDraggingMapByCluster = null\n this.timeOut = null\n\n\n this.setMap(cluster.getMap()) // Note: this causes onAdd to be called\n }\n\n onBoundsChanged() {\n this.cDraggingMapByCluster = this.cMouseDownInCluster\n }\n\n onMouseDown() {\n this.cMouseDownInCluster = true\n\n this.cDraggingMapByCluster = false\n }\n\n onClick(event: Event) {\n this.cMouseDownInCluster = false\n\n if (!this.cDraggingMapByCluster) {\n const markerClusterer = this.cluster.getClusterer()\n\n /**\n * This event is fired when a cluster marker is clicked.\n * @name MarkerClusterer#click\n * @param {Cluster} c The cluster that was clicked.\n * @event\n */\n google.maps.event.trigger(markerClusterer, 'click', this.cluster)\n google.maps.event.trigger(markerClusterer, 'clusterclick', this.cluster) // deprecated name\n\n // The default click handler follows. Disable it by setting\n // the zoomOnClick property to false.\n if (markerClusterer.getZoomOnClick()) {\n // Zoom into the cluster.\n const maxZoom = markerClusterer.getMaxZoom()\n\n const bounds = this.cluster.getBounds()\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n markerClusterer.getMap().fitBounds(bounds)\n\n // There is a fix for Issue 170 here:\n this.timeOut = window.setTimeout(() => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n markerClusterer.getMap().fitBounds(bounds)\n\n // Don't zoom beyond the max zoom level\n if (\n maxZoom !== null &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n markerClusterer.getMap().getZoom() > maxZoom\n ) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n markerClusterer.getMap().setZoom(maxZoom + 1)\n }\n }, 100)\n }\n\n // Prevent event propagation to the map:\n event.cancelBubble = true\n\n if (event.stopPropagation) {\n event.stopPropagation()\n }\n }\n }\n\n onMouseOver() {\n /**\n * This event is fired when the mouse moves over a cluster marker.\n * @name MarkerClusterer#mouseover\n * @param {Cluster} c The cluster that the mouse moved over.\n * @event\n */\n google.maps.event.trigger(\n this.cluster.getClusterer(),\n 'mouseover',\n this.cluster\n )\n }\n\n onMouseOut() {\n /**\n * This event is fired when the mouse moves out of a cluster marker.\n * @name MarkerClusterer#mouseout\n * @param {Cluster} c The cluster that the mouse moved out of.\n * @event\n */\n google.maps.event.trigger(\n this.cluster.getClusterer(),\n 'mouseout',\n this.cluster\n )\n }\n\n onAdd() {\n this.div = document.createElement('div')\n this.div.className = this.className\n if (this.visible) {\n this.show()\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.getPanes().overlayMouseTarget.appendChild(this.div)\n // Fix for Issue 157\n this.boundsChangedListener = google.maps.event.addListener(\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.getMap(),\n 'bounds_changed',\n this.onBoundsChanged\n )\n\n this.div.addEventListener('mousedown', this.onMouseDown)\n\n this.div.addEventListener('click', this.onClick)\n\n this.div.addEventListener('mouseover', this.onMouseOver)\n\n this.div.addEventListener('mouseout', this.onMouseOut)\n }\n\n onRemove() {\n if (this.div && this.div.parentNode) {\n this.hide()\n\n if (this.boundsChangedListener !== null) {\n google.maps.event.removeListener(this.boundsChangedListener)\n }\n\n this.div.removeEventListener('mousedown', this.onMouseDown)\n\n this.div.removeEventListener('click', this.onClick)\n\n this.div.removeEventListener('mouseover', this.onMouseOver)\n\n this.div.removeEventListener('mouseout', this.onMouseOut)\n\n this.div.parentNode.removeChild(this.div)\n\n if (this.timeOut !== null) {\n window.clearTimeout(this.timeOut)\n\n this.timeOut = null\n }\n\n this.div = null\n }\n }\n\n draw() {\n if (this.visible && this.div !== null && this.center) {\n const pos = this.getPosFromLatLng(this.center)\n\n this.div.style.top = pos !== null ? `${pos.y}px` : '0'\n this.div.style.left = pos !== null ? `${pos.x}px` : '0'\n }\n }\n\n hide() {\n if (this.div) {\n this.div.style.display = 'none'\n }\n\n this.visible = false\n }\n\n show() {\n if (this.div && this.center) {\n let divTitle = ''\n\n // NOTE: values must be specified in px units\n const bp = this.backgroundPosition.split(' ')\n\n const spriteH = parseInt(bp[0].replace(/^\\s+|\\s+$/g, ''), 10)\n const spriteV = parseInt(bp[1].replace(/^\\s+|\\s+$/g, ''), 10)\n\n const pos = this.getPosFromLatLng(this.center)\n\n if (\n this.sums === null ||\n typeof this.sums.title === 'undefined' ||\n this.sums.title === ''\n ) {\n divTitle = this.cluster.getClusterer().getTitle()\n } else {\n divTitle = this.sums.title\n }\n\n this.div.style.cursor = 'pointer'\n this.div.style.position = 'absolute'\n\n this.div.style.top = pos !== null ? `${pos.y}px` : '0'\n this.div.style.left = pos !== null ? `${pos.x}px` : '0'\n\n this.div.style.width = `${this.width}px`\n this.div.style.height = `${this.height}px`\n\n const img = document.createElement('img')\n\n img.alt = divTitle\n img.src = this.url\n img.style.position = 'absolute'\n img.style.top = `${spriteV}px`\n img.style.left = `${spriteH}px`\n\n if (!this.cluster.getClusterer().enableRetinaIcons) {\n img.style.clip = `rect(-${spriteV}px, -${spriteH + this.width}px, -${\n spriteV + this.height\n }, -${spriteH})`\n }\n\n const textElm = document.createElement('div')\n\n textElm.style.position = 'absolute'\n textElm.style.top = `${this.anchorText[0]}px`\n textElm.style.left = `${this.anchorText[1]}px`\n textElm.style.color = this.textColor\n textElm.style.fontSize = `${this.textSize}px`\n textElm.style.fontFamily = this.fontFamily\n textElm.style.fontWeight = this.fontWeight\n textElm.style.fontStyle = this.fontStyle\n textElm.style.textDecoration = this.textDecoration\n textElm.style.textAlign = 'center'\n textElm.style.width = `${this.width}px`\n textElm.style.lineHeight = `${this.height}px`\n textElm.innerText = `${this.sums?.text}`\n\n this.div.innerHTML = ''\n\n this.div.appendChild(img)\n this.div.appendChild(textElm)\n\n this.div.title = divTitle\n\n this.div.style.display = ''\n }\n\n this.visible = true\n }\n\n useStyle(sums: ClusterIconInfo) {\n this.sums = sums\n\n const styles = this.cluster.getClusterer().getStyles()\n\n const style =\n styles[Math.min(styles.length - 1, Math.max(0, sums.index - 1))]\n\n this.url = style.url\n this.height = style.height\n this.width = style.width\n\n if (style.className)\n this.className = `${this.clusterClassName} ${style.className}`\n\n this.anchorText = style.anchorText || [0, 0]\n this.anchorIcon = style.anchorIcon || [this.height / 2, this.width / 2]\n\n this.textColor = style.textColor || 'black'\n\n this.textSize = style.textSize || 11\n\n this.textDecoration = style.textDecoration || 'none'\n\n this.fontWeight = style.fontWeight || 'bold'\n\n this.fontStyle = style.fontStyle || 'normal'\n\n this.fontFamily = style.fontFamily || 'Arial,sans-serif'\n\n this.backgroundPosition = style.backgroundPosition || '0 0'\n }\n\n setCenter(center: google.maps.LatLng) {\n this.center = center\n }\n\n getPosFromLatLng(latlng: google.maps.LatLng): google.maps.Point | null {\n const pos = this.getProjection().fromLatLngToDivPixel(latlng)\n\n if (pos !== null) {\n pos.x -= this.anchorIcon[1]\n\n pos.y -= this.anchorIcon[0]\n }\n\n return pos\n }\n}\n","/* global google */\n/* eslint-disable filenames/match-regex */\nimport { Clusterer } from './Clusterer'\n\nimport { ClusterIcon } from './ClusterIcon'\n\nimport { MarkerExtended } from './types'\n\nexport class Cluster {\n markerClusterer: Clusterer\n map: google.maps.Map | google.maps.StreetViewPanorama\n gridSize: number\n minClusterSize: number\n averageCenter: boolean\n markers: MarkerExtended[]\n center: google.maps.LatLng | undefined\n bounds: google.maps.LatLngBounds | null\n clusterIcon: ClusterIcon\n\n constructor(markerClusterer: Clusterer) {\n this.markerClusterer = markerClusterer\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.map = this.markerClusterer.getMap()\n\n this.gridSize = this.markerClusterer.getGridSize()\n\n this.minClusterSize = this.markerClusterer.getMinimumClusterSize()\n\n this.averageCenter = this.markerClusterer.getAverageCenter()\n\n this.markers = []\n\n this.center = undefined\n\n this.bounds = null\n\n this.clusterIcon = new ClusterIcon(this, this.markerClusterer.getStyles())\n }\n\n getSize(): number {\n return this.markers.length\n }\n\n getMarkers(): MarkerExtended[] {\n return this.markers\n }\n\n getCenter(): google.maps.LatLng | undefined {\n return this.center\n }\n\n getMap(): google.maps.Map | google.maps.StreetViewPanorama {\n return this.map\n }\n\n getClusterer(): Clusterer {\n return this.markerClusterer\n }\n\n getBounds(): google.maps.LatLngBounds {\n const bounds = new google.maps.LatLngBounds(this.center, this.center)\n\n const markers = this.getMarkers()\n\n for (let i = 0; i < markers.length; i++) {\n const position = markers[i].getPosition()\n\n if (position) {\n bounds.extend(position)\n }\n }\n\n return bounds\n }\n\n remove() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.clusterIcon.setMap(null)\n\n this.markers = []\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n delete this.markers\n }\n\n addMarker(marker: MarkerExtended): boolean {\n if (this.isMarkerAlreadyAdded(marker)) {\n return false\n }\n\n if (!this.center) {\n const position = marker.getPosition()\n\n if (position) {\n this.center = position\n\n this.calculateBounds()\n }\n } else {\n if (this.averageCenter) {\n const position = marker.getPosition()\n\n if (position) {\n const length = this.markers.length + 1\n\n this.center = new google.maps.LatLng(\n (this.center.lat() * (length - 1) + position.lat()) / length,\n (this.center.lng() * (length - 1) + position.lng()) / length\n )\n\n this.calculateBounds()\n }\n }\n }\n\n marker.isAdded = true\n\n this.markers.push(marker)\n\n const mCount = this.markers.length\n\n const maxZoom = this.markerClusterer.getMaxZoom()\n\n const zoom = this.map.getZoom()\n\n if (maxZoom !== null && typeof zoom !== 'undefined' && zoom > maxZoom) {\n // Zoomed in past max zoom, so show the marker.\n if (marker.getMap() !== this.map) {\n marker.setMap(this.map)\n }\n } else if (mCount < this.minClusterSize) {\n // Min cluster size not reached so show the marker.\n if (marker.getMap() !== this.map) {\n marker.setMap(this.map)\n }\n } else if (mCount === this.minClusterSize) {\n // Hide the markers that were showing.\n for (let i = 0; i < mCount; i++) {\n this.markers[i].setMap(null)\n }\n } else {\n marker.setMap(null)\n }\n\n return true\n }\n\n isMarkerInClusterBounds(marker: MarkerExtended): boolean {\n if (this.bounds !== null) {\n const position = marker.getPosition()\n\n if (position) {\n return this.bounds.contains(position)\n }\n }\n\n return false\n }\n\n calculateBounds() {\n this.bounds = this.markerClusterer.getExtendedBounds(\n new google.maps.LatLngBounds(this.center, this.center)\n )\n }\n\n updateIcon() {\n const mCount = this.markers.length\n\n const maxZoom = this.markerClusterer.getMaxZoom()\n\n const zoom = this.map.getZoom()\n\n if (maxZoom !== null && typeof zoom !== 'undefined' && zoom > maxZoom) {\n this.clusterIcon.hide()\n\n return\n }\n\n if (mCount < this.minClusterSize) {\n // Min cluster size not yet reached.\n this.clusterIcon.hide()\n\n return\n }\n\n if (this.center) {\n this.clusterIcon.setCenter(this.center)\n }\n\n this.clusterIcon.useStyle(\n this.markerClusterer.getCalculator()(this.markers, this.markerClusterer.getStyles().length)\n )\n\n this.clusterIcon.show()\n }\n\n isMarkerAlreadyAdded(marker: MarkerExtended): boolean {\n if (this.markers.includes) {\n return this.markers.includes(marker)\n }\n\n for (let i = 0; i < this.markers.length; i++) {\n if (marker === this.markers[i]) {\n return true\n }\n }\n\n return false\n }\n}\n","/* global google */\n/* eslint-disable filenames/match-regex */\nimport { Cluster } from './Cluster'\nimport { ClusterIcon } from './ClusterIcon'\n\nimport {\n MarkerExtended,\n ClustererOptions,\n ClusterIconStyle,\n TCalculator,\n ClusterIconInfo,\n} from './types'\n\n/**\n * Supports up to 9007199254740991 (Number.MAX_SAFE_INTEGER) markers\n * which is not a problem as max array length is 4294967296 (2**32)\n */\nconst CALCULATOR = function CALCULATOR(\n markers: MarkerExtended[],\n numStyles: number\n): ClusterIconInfo {\n const count = markers.length\n\n const numberOfDigits = count.toString().length\n\n const index = Math.min(numberOfDigits, numStyles)\n\n return {\n text: count.toString(),\n index,\n title: '',\n }\n}\n\nconst BATCH_SIZE = 2000\n\nconst BATCH_SIZE_IE = 500\n\nconst IMAGE_PATH =\n 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'\n\nconst IMAGE_EXTENSION = 'png'\n\nconst IMAGE_SIZES = [53, 56, 66, 78, 90]\n\nconst CLUSTERER_CLASS = 'cluster'\n\nexport class Clusterer extends google.maps.OverlayView {\n markers: MarkerExtended[]\n clusters: Cluster[]\n listeners: google.maps.MapsEventListener[]\n activeMap: google.maps.Map | google.maps.StreetViewPanorama | null\n ready: boolean\n gridSize: number\n minClusterSize: number\n maxZoom: number | null\n styles: ClusterIconStyle[]\n title: string\n zoomOnClick: boolean\n averageCenter: boolean\n ignoreHidden: boolean\n enableRetinaIcons: boolean\n imagePath: string\n imageExtension: string\n imageSizes: number[]\n calculator: TCalculator\n batchSize: number\n batchSizeIE: number\n clusterClass: string\n timerRefStatic: number | null\n\n constructor(\n map: google.maps.Map,\n optMarkers: MarkerExtended[] = [],\n optOptions: ClustererOptions = {}\n ) {\n super()\n\n this.extend(Clusterer, google.maps.OverlayView)\n\n this.markers = []\n this.clusters = []\n this.listeners = []\n this.activeMap = null\n this.ready = false\n this.gridSize = optOptions.gridSize || 60\n this.minClusterSize = optOptions.minimumClusterSize || 2\n this.maxZoom = optOptions.maxZoom || null\n this.styles = optOptions.styles || []\n\n this.title = optOptions.title || ''\n\n this.zoomOnClick = true\n\n if (optOptions.zoomOnClick !== undefined) {\n this.zoomOnClick = optOptions.zoomOnClick\n }\n\n this.averageCenter = false\n\n if (optOptions.averageCenter !== undefined) {\n this.averageCenter = optOptions.averageCenter\n }\n\n this.ignoreHidden = false\n\n if (optOptions.ignoreHidden !== undefined) {\n this.ignoreHidden = optOptions.ignoreHidden\n }\n\n this.enableRetinaIcons = false\n\n if (optOptions.enableRetinaIcons !== undefined) {\n this.enableRetinaIcons = optOptions.enableRetinaIcons\n }\n this.imagePath = optOptions.imagePath || IMAGE_PATH\n\n this.imageExtension = optOptions.imageExtension || IMAGE_EXTENSION\n\n this.imageSizes = optOptions.imageSizes || IMAGE_SIZES\n\n this.calculator = optOptions.calculator || CALCULATOR\n\n this.batchSize = optOptions.batchSize || BATCH_SIZE\n\n this.batchSizeIE = optOptions.batchSizeIE || BATCH_SIZE_IE\n\n this.clusterClass = optOptions.clusterClass || CLUSTERER_CLASS\n\n if (navigator.userAgent.toLowerCase().indexOf('msie') !== -1) {\n // Try to avoid IE timeout when processing a huge number of markers:\n this.batchSize = this.batchSizeIE\n }\n\n this.timerRefStatic = null\n\n this.setupStyles()\n\n this.addMarkers(optMarkers, true)\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.setMap(map) // Note: this causes onAdd to be called\n }\n\n onZoomChanged() {\n this.resetViewport(false)\n\n // Workaround for this Google bug: when map is at level 0 and \"-\" of\n // zoom slider is clicked, a \"zoom_changed\" event is fired even though\n // the map doesn't zoom out any further. In this situation, no \"idle\"\n // event is triggered so the cluster markers that have been removed\n // do not get redrawn. Same goes for a zoom in at maxZoom.\n if (\n this.getMap()?.getZoom() === (this.get('minZoom') || 0) ||\n\n this.getMap()?.getZoom() === this.get('maxZoom')\n ) {\n google.maps.event.trigger(this, 'idle')\n }\n }\n\n onIdle() {\n this.redraw()\n }\n\n onAdd() {\n const map = this.getMap()\n\n this.activeMap = map\n\n this.ready = true\n\n this.repaint()\n\n if (map !== null) {\n // Add the map event listeners\n this.listeners = [\n google.maps.event.addListener(\n map,\n 'zoom_changed',\n this.onZoomChanged\n ),\n google.maps.event.addListener(\n map,\n 'idle',\n this.onIdle\n ),\n ]\n }\n }\n\n onRemove() {\n // Put all the managed markers back on the map:\n for (let i = 0; i < this.markers.length; i++) {\n if (this.markers[i].getMap() !== this.activeMap) {\n this.markers[i].setMap(this.activeMap)\n }\n }\n\n // Remove all clusters:\n for (let i = 0; i < this.clusters.length; i++) {\n this.clusters[i].remove()\n }\n\n this.clusters = []\n\n // Remove map event listeners:\n for (let i = 0; i < this.listeners.length; i++) {\n google.maps.event.removeListener(this.listeners[i])\n }\n\n this.listeners = []\n\n this.activeMap = null\n\n this.ready = false\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n draw() {}\n\n setupStyles() {\n if (this.styles.length > 0) {\n return\n }\n\n for (let i = 0; i < this.imageSizes.length; i++) {\n this.styles.push({\n url: this.imagePath + (i + 1) + '.' + this.imageExtension,\n height: this.imageSizes[i],\n width: this.imageSizes[i],\n })\n }\n }\n\n fitMapToMarkers() {\n const markers = this.getMarkers()\n\n const bounds = new google.maps.LatLngBounds()\n\n for (let i = 0; i < markers.length; i++) {\n const position = markers[i].getPosition()\n if (position) {\n bounds.extend(position)\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.getMap().fitBounds(bounds)\n }\n\n getGridSize(): number {\n return this.gridSize\n }\n\n setGridSize(gridSize: number) {\n this.gridSize = gridSize\n }\n\n getMinimumClusterSize(): number {\n return this.minClusterSize\n }\n\n setMinimumClusterSize(minimumClusterSize: number) {\n this.minClusterSize = minimumClusterSize\n }\n\n getMaxZoom(): number | null {\n return this.maxZoom\n }\n\n setMaxZoom(maxZoom: number) {\n this.maxZoom = maxZoom\n }\n\n getStyles(): ClusterIconStyle[] {\n return this.styles\n }\n\n setStyles(styles: ClusterIconStyle[]) {\n this.styles = styles\n }\n\n getTitle(): string {\n return this.title\n }\n\n setTitle(title: string) {\n this.title = title\n }\n\n getZoomOnClick(): boolean {\n return this.zoomOnClick\n }\n\n setZoomOnClick(zoomOnClick: boolean) {\n this.zoomOnClick = zoomOnClick\n }\n\n getAverageCenter(): boolean {\n return this.averageCenter\n }\n\n setAverageCenter(averageCenter: boolean) {\n this.averageCenter = averageCenter\n }\n\n getIgnoreHidden(): boolean {\n return this.ignoreHidden\n }\n\n setIgnoreHidden(ignoreHidden: boolean) {\n this.ignoreHidden = ignoreHidden\n }\n\n getEnableRetinaIcons(): boolean {\n return this.enableRetinaIcons\n }\n\n setEnableRetinaIcons(enableRetinaIcons: boolean) {\n this.enableRetinaIcons = enableRetinaIcons\n }\n\n getImageExtension(): string {\n return this.imageExtension\n }\n\n setImageExtension(imageExtension: string) {\n this.imageExtension = imageExtension\n }\n\n getImagePath(): string {\n return this.imagePath\n }\n\n setImagePath(imagePath: string) {\n this.imagePath = imagePath\n }\n\n getImageSizes(): number[] {\n return this.imageSizes\n }\n\n setImageSizes(imageSizes: number[]) {\n this.imageSizes = imageSizes\n }\n\n getCalculator(): TCalculator {\n return this.calculator\n }\n\n setCalculator(calculator: TCalculator) {\n this.calculator = calculator\n }\n\n getBatchSizeIE(): number {\n return this.batchSizeIE\n }\n\n setBatchSizeIE(batchSizeIE: number) {\n this.batchSizeIE = batchSizeIE\n }\n\n getClusterClass(): string {\n return this.clusterClass\n }\n\n setClusterClass(clusterClass: string) {\n this.clusterClass = clusterClass\n }\n\n getMarkers(): MarkerExtended[] {\n return this.markers\n }\n\n getTotalMarkers(): number {\n return this.markers.length\n }\n\n getClusters(): Cluster[] {\n return this.clusters\n }\n\n getTotalClusters(): number {\n return this.clusters.length\n }\n\n addMarker(marker: MarkerExtended, optNoDraw: boolean) {\n this.pushMarkerTo(marker)\n\n if (!optNoDraw) {\n this.redraw()\n }\n }\n\n addMarkers(markers: MarkerExtended[], optNoDraw: boolean) {\n for (const key in markers) {\n if (Object.prototype.hasOwnProperty.call(markers, key)) {\n this.pushMarkerTo(markers[key])\n }\n }\n\n if (!optNoDraw) {\n this.redraw()\n }\n }\n\n pushMarkerTo(marker: MarkerExtended) {\n // If the marker is draggable add a listener so we can update the clusters on the dragend:\n if (marker.getDraggable()) {\n google.maps.event.addListener(marker, 'dragend', () => {\n if (this.ready) {\n marker.isAdded = false\n\n this.repaint()\n }\n })\n }\n\n marker.isAdded = false\n\n this.markers.push(marker)\n }\n\n removeMarker_(marker: MarkerExtended): boolean {\n let index = -1\n\n if (this.markers.indexOf) {\n index = this.markers.indexOf(marker)\n } else {\n for (let i = 0; i < this.markers.length; i++) {\n if (marker === this.markers[i]) {\n index = i\n\n break\n }\n }\n }\n\n if (index === -1) {\n // Marker is not in our list of markers, so do nothing:\n return false\n }\n\n marker.setMap(null)\n\n this.markers.splice(index, 1) // Remove the marker from the list of managed markers\n\n return true\n }\n\n removeMarker(marker: MarkerExtended, optNoDraw: boolean): boolean {\n const removed = this.removeMarker_(marker)\n\n if (!optNoDraw && removed) {\n this.repaint()\n }\n\n return removed\n }\n\n removeMarkers(markers: MarkerExtended[], optNoDraw: boolean): boolean {\n let removed = false\n\n for (let i = 0; i < markers.length; i++) {\n removed = removed || this.removeMarker_(markers[i])\n }\n\n if (!optNoDraw && removed) {\n this.repaint()\n }\n\n return removed\n }\n\n clearMarkers() {\n this.resetViewport(true)\n\n this.markers = []\n }\n\n repaint() {\n const oldClusters = this.clusters.slice()\n\n this.clusters = []\n\n this.resetViewport(false)\n\n this.redraw()\n\n // Remove the old clusters.\n // Do it in a timeout to prevent blinking effect.\n setTimeout(function timeout() {\n for (let i = 0; i < oldClusters.length; i++) {\n oldClusters[i].remove()\n }\n }, 0)\n }\n\n getExtendedBounds(bounds: google.maps.LatLngBounds): google.maps.LatLngBounds {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const projection = this.getProjection()\n // Convert the points to pixels and the extend out by the grid size.\n const trPix = projection.fromLatLngToDivPixel(\n // Turn the bounds into latlng.\n new google.maps.LatLng(bounds.getNorthEast().lat(), bounds.getNorthEast().lng())\n )\n\n if (trPix !== null) {\n trPix.x += this.gridSize\n trPix.y -= this.gridSize\n }\n\n const blPix = projection.fromLatLngToDivPixel(\n // Turn the bounds into latlng.\n new google.maps.LatLng(bounds.getSouthWest().lat(), bounds.getSouthWest().lng())\n )\n\n if (blPix !== null) {\n blPix.x -= this.gridSize\n blPix.y += this.gridSize\n }\n\n\n // Extend the bounds to contain the new bounds.\n if (trPix !== null) {\n // Convert the pixel points back to LatLng nw\n const point1 = projection.fromDivPixelToLatLng(trPix)\n\n if (point1 !== null) {\n bounds.extend(point1)\n }\n }\n\n if (blPix !== null) {\n // Convert the pixel points back to LatLng sw\n const point2 = projection.fromDivPixelToLatLng(blPix)\n\n if (point2 !== null) {\n bounds.extend(\n point2\n )\n }\n }\n\n\n return bounds\n }\n\n redraw() {\n // Redraws all the clusters.\n this.createClusters(0)\n }\n\n resetViewport(optHide: boolean) {\n // Remove all the clusters\n for (let i = 0; i < this.clusters.length; i++) {\n this.clusters[i].remove()\n }\n\n this.clusters = []\n\n // Reset the markers to not be added and to be removed from the map.\n for (let i = 0; i < this.markers.length; i++) {\n const marker = this.markers[i]\n\n marker.isAdded = false\n\n if (optHide) {\n marker.setMap(null)\n }\n }\n }\n\n distanceBetweenPoints(p1: google.maps.LatLng, p2: google.maps.LatLng): number {\n const R = 6371 // Radius of the Earth in km\n\n const dLat = ((p2.lat() - p1.lat()) * Math.PI) / 180\n const dLon = ((p2.lng() - p1.lng()) * Math.PI) / 180\n\n const a =\n Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos((p1.lat() * Math.PI) / 180) *\n Math.cos((p2.lat() * Math.PI) / 180) *\n Math.sin(dLon / 2) *\n Math.sin(dLon / 2)\n\n return R * (2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)))\n }\n\n isMarkerInBounds(marker: MarkerExtended, bounds: google.maps.LatLngBounds): boolean {\n const position = marker.getPosition()\n\n if (position) {\n return bounds.contains(position)\n }\n\n return false\n }\n\n addToClosestCluster(marker: MarkerExtended) {\n let cluster\n\n let distance = 40000 // Some large number\n\n let clusterToAddTo = null\n\n for (let i = 0; i < this.clusters.length; i++) {\n cluster = this.clusters[i]\n\n const center = cluster.getCenter()\n\n const position = marker.getPosition()\n\n if (center && position) {\n const d = this.distanceBetweenPoints(center, position)\n\n if (d < distance) {\n distance = d\n\n clusterToAddTo = cluster\n }\n }\n }\n\n if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) {\n clusterToAddTo.addMarker(marker)\n } else {\n cluster = new Cluster(this)\n\n cluster.addMarker(marker)\n\n this.clusters.push(cluster)\n }\n }\n\n createClusters(iFirst: number) {\n if (!this.ready) {\n return\n }\n\n // Cancel previous batch processing if we're working on the first batch:\n if (iFirst === 0) {\n /**\n * This event is fired when the <code>Clusterer</code> begins\n * clustering markers.\n * @name Clusterer#clusteringbegin\n * @param {Clusterer} mc The Clusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, 'clusteringbegin', this)\n\n if (this.timerRefStatic !== null) {\n window.clearTimeout(this.timerRefStatic)\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n delete this.timerRefStatic\n }\n }\n\n const map = this.getMap()\n\n const bounds = map !== null && 'getBounds' in map ? map.getBounds() : null\n\n // Get our current map view bounds.\n // Create a new bounds object so we don't affect the map.\n //\n // See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug:\n const mapBounds =\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n map.getZoom() > 3\n ? new google.maps.LatLngBounds(\n bounds?.getSouthWest(),\n bounds?.getNorthEast()\n )\n : new google.maps.LatLngBounds(\n new google.maps.LatLng(85.02070771743472, -178.48388434375),\n new google.maps.LatLng(-85.08136444384544, 178.00048865625)\n )\n\n const extendedMapBounds = this.getExtendedBounds(mapBounds)\n\n const iLast = Math.min(iFirst + this.batchSize, this.markers.length)\n\n for (let i = iFirst; i < iLast; i++) {\n const marker = this.markers[i]\n\n if (!marker.isAdded && this.isMarkerInBounds(marker, extendedMapBounds) && (!this.ignoreHidden || (this.ignoreHidden && marker.getVisible()))) {\n this.addToClosestCluster(marker)\n }\n }\n\n if (iLast < this.markers.length) {\n this.timerRefStatic = window.setTimeout(\n () => {\n this.createClusters(iLast)\n },\n 0\n )\n } else {\n this.timerRefStatic = null\n\n /**\n * This event is fired when the <code>Clusterer</code> stops\n * clustering markers.\n * @name Clusterer#clusteringend\n * @param {Clusterer} mc The Clusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, 'clusteringend', this)\n\n for (let i = 0; i < this.clusters.length; i++) {\n this.clusters[i].updateIcon()\n }\n }\n }\n\n extend<A extends typeof ClusterIcon | typeof Clusterer>(obj1: A, obj2: typeof google.maps.OverlayView) {\n return function applyExtend(this: A, object: typeof google.maps.OverlayView) {\n for (const property in object.prototype) {\n this.prototype.set(property, object.prototype.get(property))\n }\n\n return this\n }.apply<A, [typeof google.maps.OverlayView], any>(obj1, [obj2])\n }\n}\n"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","this","constructor","create","ClusterIcon","_super","cluster","styles","_this","getClusterer","extend","google","maps","OverlayView","clusterClassName","getClusterClass","className","center","undefined","div","sums","visible","boundsChangedListener","url","height","width","anchorText","anchorIcon","textColor","textSize","textDecoration","fontWeight","fontStyle","fontFamily","backgroundPosition","cMouseDownInCluster","cDraggingMapByCluster","timeOut","setMap","getMap","onBoundsChanged","onMouseDown","onClick","event","markerClusterer_1","trigger","getZoomOnClick","maxZoom_1","getMaxZoom","bounds_1","getBounds","fitBounds","window","setTimeout","getZoom","setZoom","cancelBubble","stopPropagation","onMouseOver","onMouseOut","onAdd","document","createElement","show","getPanes","overlayMouseTarget","appendChild","addListener","addEventListener","onRemove","parentNode","hide","removeListener","removeEventListener","removeChild","clearTimeout","draw","pos","getPosFromLatLng","style","top","concat","y","left","x","display","divTitle","bp","split","spriteH","parseInt","replace","spriteV","title","getTitle","cursor","position","img","alt","src","enableRetinaIcons","clip","textElm","color","fontSize","textAlign","lineHeight","innerText","_a","text","innerHTML","useStyle","getStyles","Math","min","length","max","index","setCenter","latlng","getProjection","fromLatLngToDivPixel","Cluster","markerClusterer","map","gridSize","getGridSize","minClusterSize","getMinimumClusterSize","averageCenter","getAverageCenter","markers","bounds","clusterIcon","getSize","getMarkers","getCenter","LatLngBounds","i","getPosition","remove","addMarker","marker","isMarkerAlreadyAdded","length_1","LatLng","lat","lng","calculateBounds","isAdded","push","mCount","maxZoom","zoom","isMarkerInClusterBounds","contains","getExtendedBounds","updateIcon","getCalculator","includes","CALCULATOR","numStyles","count","numberOfDigits","toString","IMAGE_SIZES","Clusterer","optMarkers","optOptions","clusters","listeners","activeMap","ready","minimumClusterSize","zoomOnClick","ignoreHidden","imagePath","imageExtension","imageSizes","calculator","batchSize","batchSizeIE","clusterClass","navigator","userAgent","toLowerCase","indexOf","timerRefStatic","setupStyles","addMarkers","onZoomChanged","resetViewport","get","_b","onIdle","redraw","repaint","fitMapToMarkers","setGridSize","setMinimumClusterSize","setMaxZoom","setStyles","setTitle","setZoomOnClick","setAverageCenter","getIgnoreHidden","setIgnoreHidden","getEnableRetinaIcons","setEnableRetinaIcons","getImageExtension","setImageExtension","getImagePath","setImagePath","getImageSizes","setImageSizes","setCalculator","getBatchSizeIE","setBatchSizeIE","setClusterClass","getTotalMarkers","getClusters","getTotalClusters","optNoDraw","pushMarkerTo","key","getDraggable","removeMarker_","splice","removeMarker","removed","removeMarkers","clearMarkers","oldClusters","slice","projection","trPix","getNorthEast","blPix","getSouthWest","point1","fromDivPixelToLatLng","point2","createClusters","optHide","distanceBetweenPoints","p1","p2","dLat","PI","dLon","a","sin","cos","atan2","sqrt","isMarkerInBounds","addToClosestCluster","distance","clusterToAddTo","iFirst","mapBounds","extendedMapBounds","iLast","getVisible","obj1","obj2","object","property","set","apply"],"mappings":"oEAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EA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cAAiB9K,KAAK8K,cAAgBjC,EAAOyH,eAC7HtQ,KAAK+P,oBAAoBlH,GAI7B,GAAIwH,EAAQrQ,KAAKkI,QAAQhB,OACvBlH,KAAK0L,eAAiBvI,OAAOC,YAC3B,WACE7C,EAAK0O,eAAeoB,KAEtB,OAEG,CACLrQ,KAAK0L,eAAiB,KAStBhL,OAAOC,KAAK+B,MAAME,QAAQ5C,KAAM,gBAAiBA,MAEjD,IAASyI,EAAI,EAAGA,EAAIzI,KAAKwK,SAAStD,OAAQuB,IACxCzI,KAAKwK,SAAS/B,GAAGmB,gBAKvBS,EAAA5K,UAAAgB,OAAA,SAAwD8P,EAASC,GAC/D,OAAO,SAA8BC,GACnC,IAAK,IAAMC,KAAYD,EAAOhR,UAC5BO,KAAKP,UAAUkR,IAAID,EAAUD,EAAOhR,UAAUsM,IAAI2E,IAGpD,OAAO1Q,MACP4Q,MAAgDL,EAAM,CAACC,KAE5DnG,EA3qBD,CAA+B3J,OAAOC,KAAKC"}
1
+ {"version":3,"file":"cjs.min.js","sources":["../../../node_modules/tslib/tslib.es6.js","../src/ClusterIcon.tsx","../src/Cluster.tsx","../src/Clusterer.tsx"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","/* global google */\n/* eslint-disable filenames/match-regex */\nimport { Cluster } from './Cluster'\n\nimport { ClusterIconStyle, ClusterIconInfo } from './types'\n\nexport class ClusterIcon extends google.maps.OverlayView {\n cluster: Cluster\n className: string\n clusterClassName: string\n styles: ClusterIconStyle[]\n center: google.maps.LatLng | undefined\n div: HTMLDivElement | null\n sums: ClusterIconInfo | null\n visible: boolean\n url: string\n height: number\n width: number\n anchorText: number[]\n anchorIcon: number[]\n textColor: string\n textSize: number\n textDecoration: string\n fontWeight: string\n fontStyle: string\n fontFamily: string\n backgroundPosition: string\n cMouseDownInCluster: boolean | null\n cDraggingMapByCluster: boolean | null\n timeOut: number | null\n\n boundsChangedListener: google.maps.MapsEventListener | null\n\n constructor(cluster: Cluster, styles: ClusterIconStyle[]) {\n super()\n cluster.getClusterer().extend(ClusterIcon, google.maps.OverlayView)\n\n this.cluster = cluster\n\n this.clusterClassName = this.cluster.getClusterer().getClusterClass()\n\n this.className = this.clusterClassName\n\n this.styles = styles\n\n this.center = undefined\n\n this.div = null\n\n this.sums = null\n\n this.visible = false\n\n this.boundsChangedListener = null\n\n this.url = ''\n\n this.height = 0\n this.width = 0\n\n this.anchorText = [0, 0]\n this.anchorIcon = [0, 0]\n\n this.textColor = 'black'\n this.textSize = 11\n this.textDecoration = 'none'\n this.fontWeight = 'bold'\n this.fontStyle = 'normal'\n this.fontFamily = 'Arial,sans-serif'\n\n this.backgroundPosition = '0 0'\n\n this.cMouseDownInCluster = null\n this.cDraggingMapByCluster = null\n this.timeOut = null\n\n\n this.setMap(cluster.getMap()) // Note: this causes onAdd to be called\n }\n\n onBoundsChanged() {\n this.cDraggingMapByCluster = this.cMouseDownInCluster\n }\n\n onMouseDown() {\n this.cMouseDownInCluster = true\n\n this.cDraggingMapByCluster = false\n }\n\n onClick(event: Event) {\n this.cMouseDownInCluster = false\n\n if (!this.cDraggingMapByCluster) {\n const markerClusterer = this.cluster.getClusterer()\n\n /**\n * This event is fired when a cluster marker is clicked.\n * @name MarkerClusterer#click\n * @param {Cluster} c The cluster that was clicked.\n * @event\n */\n google.maps.event.trigger(markerClusterer, 'click', this.cluster)\n google.maps.event.trigger(markerClusterer, 'clusterclick', this.cluster) // deprecated name\n\n // The default click handler follows. Disable it by setting\n // the zoomOnClick property to false.\n if (markerClusterer.getZoomOnClick()) {\n // Zoom into the cluster.\n const maxZoom = markerClusterer.getMaxZoom()\n\n const bounds = this.cluster.getBounds()\n\n const map = markerClusterer.getMap()\n\n if (map !== null && 'fitBounds' in map) {\n map.fitBounds(bounds)\n }\n\n\n // There is a fix for Issue 170 here:\n this.timeOut = window.setTimeout(() => {\n const map = markerClusterer.getMap()\n\n if (map !== null) {\n if ('fitBounds' in map) {\n map.fitBounds(bounds)\n }\n\n const zoom = map.getZoom() || 0\n\n // Don't zoom beyond the max zoom level\n if (\n maxZoom !== null &&\n zoom > maxZoom\n ) {\n map.setZoom(maxZoom + 1)\n }\n }\n }, 100)\n }\n\n // Prevent event propagation to the map:\n event.cancelBubble = true\n\n if (event.stopPropagation) {\n event.stopPropagation()\n }\n }\n }\n\n onMouseOver() {\n /**\n * This event is fired when the mouse moves over a cluster marker.\n * @name MarkerClusterer#mouseover\n * @param {Cluster} c The cluster that the mouse moved over.\n * @event\n */\n google.maps.event.trigger(\n this.cluster.getClusterer(),\n 'mouseover',\n this.cluster\n )\n }\n\n onMouseOut() {\n /**\n * This event is fired when the mouse moves out of a cluster marker.\n * @name MarkerClusterer#mouseout\n * @param {Cluster} c The cluster that the mouse moved out of.\n * @event\n */\n google.maps.event.trigger(\n this.cluster.getClusterer(),\n 'mouseout',\n this.cluster\n )\n }\n\n onAdd() {\n this.div = document.createElement('div')\n\n this.div.className = this.className\n\n if (this.visible) {\n this.show()\n }\n\n this.getPanes()?.overlayMouseTarget.appendChild(this.div)\n\n const map = this.getMap()\n\n if (map !== null) {\n // Fix for Issue 157\n this.boundsChangedListener = google.maps.event.addListener(\n map,\n 'bounds_changed',\n this.onBoundsChanged\n )\n\n this.div.addEventListener('mousedown', this.onMouseDown)\n\n this.div.addEventListener('click', this.onClick)\n\n this.div.addEventListener('mouseover', this.onMouseOver)\n\n this.div.addEventListener('mouseout', this.onMouseOut)\n }\n }\n\n onRemove() {\n if (this.div && this.div.parentNode) {\n this.hide()\n\n if (this.boundsChangedListener !== null) {\n google.maps.event.removeListener(this.boundsChangedListener)\n }\n\n this.div.removeEventListener('mousedown', this.onMouseDown)\n\n this.div.removeEventListener('click', this.onClick)\n\n this.div.removeEventListener('mouseover', this.onMouseOver)\n\n this.div.removeEventListener('mouseout', this.onMouseOut)\n\n this.div.parentNode.removeChild(this.div)\n\n if (this.timeOut !== null) {\n window.clearTimeout(this.timeOut)\n\n this.timeOut = null\n }\n\n this.div = null\n }\n }\n\n draw() {\n if (this.visible && this.div !== null && this.center) {\n const pos = this.getPosFromLatLng(this.center)\n\n this.div.style.top = pos !== null ? `${pos.y}px` : '0'\n this.div.style.left = pos !== null ? `${pos.x}px` : '0'\n }\n }\n\n hide() {\n if (this.div) {\n this.div.style.display = 'none'\n }\n\n this.visible = false\n }\n\n show() {\n if (this.div && this.center) {\n let divTitle = ''\n\n // NOTE: values must be specified in px units\n const bp = this.backgroundPosition.split(' ')\n\n const spriteH = parseInt(bp[0].replace(/^\\s+|\\s+$/g, ''), 10)\n const spriteV = parseInt(bp[1].replace(/^\\s+|\\s+$/g, ''), 10)\n\n const pos = this.getPosFromLatLng(this.center)\n\n if (\n this.sums === null ||\n typeof this.sums.title === 'undefined' ||\n this.sums.title === ''\n ) {\n divTitle = this.cluster.getClusterer().getTitle()\n } else {\n divTitle = this.sums.title\n }\n\n this.div.style.cursor = 'pointer'\n this.div.style.position = 'absolute'\n\n this.div.style.top = pos !== null ? `${pos.y}px` : '0'\n this.div.style.left = pos !== null ? `${pos.x}px` : '0'\n\n this.div.style.width = `${this.width}px`\n this.div.style.height = `${this.height}px`\n\n const img = document.createElement('img')\n\n img.alt = divTitle\n img.src = this.url\n img.style.position = 'absolute'\n img.style.top = `${spriteV}px`\n img.style.left = `${spriteH}px`\n\n if (!this.cluster.getClusterer().enableRetinaIcons) {\n img.style.clip = `rect(-${spriteV}px, -${spriteH + this.width}px, -${\n spriteV + this.height\n }, -${spriteH})`\n }\n\n const textElm = document.createElement('div')\n\n textElm.style.position = 'absolute'\n textElm.style.top = `${this.anchorText[0]}px`\n textElm.style.left = `${this.anchorText[1]}px`\n textElm.style.color = this.textColor\n textElm.style.fontSize = `${this.textSize}px`\n textElm.style.fontFamily = this.fontFamily\n textElm.style.fontWeight = this.fontWeight\n textElm.style.fontStyle = this.fontStyle\n textElm.style.textDecoration = this.textDecoration\n textElm.style.textAlign = 'center'\n textElm.style.width = `${this.width}px`\n textElm.style.lineHeight = `${this.height}px`\n textElm.innerText = `${this.sums?.text}`\n\n this.div.innerHTML = ''\n\n this.div.appendChild(img)\n this.div.appendChild(textElm)\n\n this.div.title = divTitle\n\n this.div.style.display = ''\n }\n\n this.visible = true\n }\n\n useStyle(sums: ClusterIconInfo) {\n this.sums = sums\n\n const styles = this.cluster.getClusterer().getStyles()\n\n const style =\n styles[Math.min(styles.length - 1, Math.max(0, sums.index - 1))]\n\n this.url = style.url\n this.height = style.height\n this.width = style.width\n\n if (style.className)\n this.className = `${this.clusterClassName} ${style.className}`\n\n this.anchorText = style.anchorText || [0, 0]\n this.anchorIcon = style.anchorIcon || [this.height / 2, this.width / 2]\n\n this.textColor = style.textColor || 'black'\n\n this.textSize = style.textSize || 11\n\n this.textDecoration = style.textDecoration || 'none'\n\n this.fontWeight = style.fontWeight || 'bold'\n\n this.fontStyle = style.fontStyle || 'normal'\n\n this.fontFamily = style.fontFamily || 'Arial,sans-serif'\n\n this.backgroundPosition = style.backgroundPosition || '0 0'\n }\n\n setCenter(center: google.maps.LatLng) {\n this.center = center\n }\n\n getPosFromLatLng(latlng: google.maps.LatLng): google.maps.Point | null {\n const pos = this.getProjection().fromLatLngToDivPixel(latlng)\n\n if (pos !== null) {\n pos.x -= this.anchorIcon[1]\n\n pos.y -= this.anchorIcon[0]\n }\n\n return pos\n }\n}\n","/* global google */\n/* eslint-disable filenames/match-regex */\nimport { Clusterer } from './Clusterer'\n\nimport { ClusterIcon } from './ClusterIcon'\n\nimport { MarkerExtended } from './types'\n\nexport class Cluster {\n markerClusterer: Clusterer\n map: google.maps.Map | google.maps.StreetViewPanorama | null\n gridSize: number\n minClusterSize: number\n averageCenter: boolean\n markers: MarkerExtended[]\n center: google.maps.LatLng | undefined\n bounds: google.maps.LatLngBounds | null\n clusterIcon: ClusterIcon\n\n constructor(markerClusterer: Clusterer) {\n this.markerClusterer = markerClusterer\n\n this.map = this.markerClusterer.getMap()\n\n this.gridSize = this.markerClusterer.getGridSize()\n\n this.minClusterSize = this.markerClusterer.getMinimumClusterSize()\n\n this.averageCenter = this.markerClusterer.getAverageCenter()\n\n this.markers = []\n\n this.center = undefined\n\n this.bounds = null\n\n this.clusterIcon = new ClusterIcon(this, this.markerClusterer.getStyles())\n }\n\n getSize(): number {\n return this.markers.length\n }\n\n getMarkers(): MarkerExtended[] {\n return this.markers\n }\n\n getCenter(): google.maps.LatLng | undefined {\n return this.center\n }\n\n getMap(): google.maps.Map | google.maps.StreetViewPanorama | null {\n return this.map\n }\n\n getClusterer(): Clusterer {\n return this.markerClusterer\n }\n\n getBounds(): google.maps.LatLngBounds {\n const bounds = new google.maps.LatLngBounds(this.center, this.center)\n\n const markers = this.getMarkers()\n\n for (let i = 0; i < markers.length; i++) {\n const position = markers[i].getPosition()\n\n if (position) {\n bounds.extend(position)\n }\n }\n\n return bounds\n }\n\n remove() {\n this.clusterIcon.setMap(null)\n\n this.markers = []\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n delete this.markers\n }\n\n addMarker(marker: MarkerExtended): boolean {\n if (this.isMarkerAlreadyAdded(marker)) {\n return false\n }\n\n if (!this.center) {\n const position = marker.getPosition()\n\n if (position) {\n this.center = position\n\n this.calculateBounds()\n }\n } else {\n if (this.averageCenter) {\n const position = marker.getPosition()\n\n if (position) {\n const length = this.markers.length + 1\n\n this.center = new google.maps.LatLng(\n (this.center.lat() * (length - 1) + position.lat()) / length,\n (this.center.lng() * (length - 1) + position.lng()) / length\n )\n\n this.calculateBounds()\n }\n }\n }\n\n marker.isAdded = true\n\n this.markers.push(marker)\n\n const mCount = this.markers.length\n\n const maxZoom = this.markerClusterer.getMaxZoom()\n\n const zoom = this.map?.getZoom()\n\n if (maxZoom !== null && typeof zoom !== 'undefined' && zoom > maxZoom) {\n // Zoomed in past max zoom, so show the marker.\n if (marker.getMap() !== this.map) {\n marker.setMap(this.map)\n }\n } else if (mCount < this.minClusterSize) {\n // Min cluster size not reached so show the marker.\n if (marker.getMap() !== this.map) {\n marker.setMap(this.map)\n }\n } else if (mCount === this.minClusterSize) {\n // Hide the markers that were showing.\n for (let i = 0; i < mCount; i++) {\n this.markers[i].setMap(null)\n }\n } else {\n marker.setMap(null)\n }\n\n return true\n }\n\n isMarkerInClusterBounds(marker: MarkerExtended): boolean {\n if (this.bounds !== null) {\n const position = marker.getPosition()\n\n if (position) {\n return this.bounds.contains(position)\n }\n }\n\n return false\n }\n\n calculateBounds() {\n this.bounds = this.markerClusterer.getExtendedBounds(\n new google.maps.LatLngBounds(this.center, this.center)\n )\n }\n\n updateIcon() {\n const mCount = this.markers.length\n\n const maxZoom = this.markerClusterer.getMaxZoom()\n\n const zoom = this.map?.getZoom()\n\n if (maxZoom !== null && typeof zoom !== 'undefined' && zoom > maxZoom) {\n this.clusterIcon.hide()\n\n return\n }\n\n if (mCount < this.minClusterSize) {\n // Min cluster size not yet reached.\n this.clusterIcon.hide()\n\n return\n }\n\n if (this.center) {\n this.clusterIcon.setCenter(this.center)\n }\n\n this.clusterIcon.useStyle(\n this.markerClusterer.getCalculator()(this.markers, this.markerClusterer.getStyles().length)\n )\n\n this.clusterIcon.show()\n }\n\n isMarkerAlreadyAdded(marker: MarkerExtended): boolean {\n if (this.markers.includes) {\n return this.markers.includes(marker)\n }\n\n for (let i = 0; i < this.markers.length; i++) {\n if (marker === this.markers[i]) {\n return true\n }\n }\n\n return false\n }\n}\n","/* global google */\n/* eslint-disable filenames/match-regex */\nimport { Cluster } from './Cluster'\nimport { ClusterIcon } from './ClusterIcon'\n\nimport {\n MarkerExtended,\n ClustererOptions,\n ClusterIconStyle,\n TCalculator,\n ClusterIconInfo,\n} from './types'\n\n/**\n * Supports up to 9007199254740991 (Number.MAX_SAFE_INTEGER) markers\n * which is not a problem as max array length is 4294967296 (2**32)\n */\nconst CALCULATOR = function CALCULATOR(\n markers: MarkerExtended[],\n numStyles: number\n): ClusterIconInfo {\n const count = markers.length\n\n const numberOfDigits = count.toString().length\n\n const index = Math.min(numberOfDigits, numStyles)\n\n return {\n text: count.toString(),\n index,\n title: '',\n }\n}\n\nconst BATCH_SIZE = 2000\n\nconst BATCH_SIZE_IE = 500\n\nconst IMAGE_PATH =\n 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'\n\nconst IMAGE_EXTENSION = 'png'\n\nconst IMAGE_SIZES = [53, 56, 66, 78, 90]\n\nconst CLUSTERER_CLASS = 'cluster'\n\nexport class Clusterer extends google.maps.OverlayView {\n markers: MarkerExtended[]\n clusters: Cluster[]\n listeners: google.maps.MapsEventListener[]\n activeMap: google.maps.Map | google.maps.StreetViewPanorama | null\n ready: boolean\n gridSize: number\n minClusterSize: number\n maxZoom: number | null\n styles: ClusterIconStyle[]\n title: string\n zoomOnClick: boolean\n averageCenter: boolean\n ignoreHidden: boolean\n enableRetinaIcons: boolean\n imagePath: string\n imageExtension: string\n imageSizes: number[]\n calculator: TCalculator\n batchSize: number\n batchSizeIE: number\n clusterClass: string\n timerRefStatic: number | null\n\n constructor(\n map: google.maps.Map,\n optMarkers: MarkerExtended[] = [],\n optOptions: ClustererOptions = {}\n ) {\n super()\n\n this.extend(Clusterer, google.maps.OverlayView)\n\n this.markers = []\n this.clusters = []\n this.listeners = []\n this.activeMap = null\n this.ready = false\n this.gridSize = optOptions.gridSize || 60\n this.minClusterSize = optOptions.minimumClusterSize || 2\n this.maxZoom = optOptions.maxZoom || null\n this.styles = optOptions.styles || []\n\n this.title = optOptions.title || ''\n\n this.zoomOnClick = true\n\n if (optOptions.zoomOnClick !== undefined) {\n this.zoomOnClick = optOptions.zoomOnClick\n }\n\n this.averageCenter = false\n\n if (optOptions.averageCenter !== undefined) {\n this.averageCenter = optOptions.averageCenter\n }\n\n this.ignoreHidden = false\n\n if (optOptions.ignoreHidden !== undefined) {\n this.ignoreHidden = optOptions.ignoreHidden\n }\n\n this.enableRetinaIcons = false\n\n if (optOptions.enableRetinaIcons !== undefined) {\n this.enableRetinaIcons = optOptions.enableRetinaIcons\n }\n this.imagePath = optOptions.imagePath || IMAGE_PATH\n\n this.imageExtension = optOptions.imageExtension || IMAGE_EXTENSION\n\n this.imageSizes = optOptions.imageSizes || IMAGE_SIZES\n\n this.calculator = optOptions.calculator || CALCULATOR\n\n this.batchSize = optOptions.batchSize || BATCH_SIZE\n\n this.batchSizeIE = optOptions.batchSizeIE || BATCH_SIZE_IE\n\n this.clusterClass = optOptions.clusterClass || CLUSTERER_CLASS\n\n if (navigator.userAgent.toLowerCase().indexOf('msie') !== -1) {\n // Try to avoid IE timeout when processing a huge number of markers:\n this.batchSize = this.batchSizeIE\n }\n\n this.timerRefStatic = null\n\n this.setupStyles()\n\n this.addMarkers(optMarkers, true)\n\n this.setMap(map) // Note: this causes onAdd to be called\n }\n\n onZoomChanged() {\n this.resetViewport(false)\n\n // Workaround for this Google bug: when map is at level 0 and \"-\" of\n // zoom slider is clicked, a \"zoom_changed\" event is fired even though\n // the map doesn't zoom out any further. In this situation, no \"idle\"\n // event is triggered so the cluster markers that have been removed\n // do not get redrawn. Same goes for a zoom in at maxZoom.\n if (\n this.getMap()?.getZoom() === (this.get('minZoom') || 0) ||\n\n this.getMap()?.getZoom() === this.get('maxZoom')\n ) {\n google.maps.event.trigger(this, 'idle')\n }\n }\n\n onIdle() {\n this.redraw()\n }\n\n onAdd() {\n const map = this.getMap()\n\n this.activeMap = map\n\n this.ready = true\n\n this.repaint()\n\n if (map !== null) {\n // Add the map event listeners\n this.listeners = [\n google.maps.event.addListener(\n map,\n 'zoom_changed',\n this.onZoomChanged\n ),\n google.maps.event.addListener(\n map,\n 'idle',\n this.onIdle\n ),\n ]\n }\n }\n\n onRemove() {\n // Put all the managed markers back on the map:\n for (let i = 0; i < this.markers.length; i++) {\n if (this.markers[i].getMap() !== this.activeMap) {\n this.markers[i].setMap(this.activeMap)\n }\n }\n\n // Remove all clusters:\n for (let i = 0; i < this.clusters.length; i++) {\n this.clusters[i].remove()\n }\n\n this.clusters = []\n\n // Remove map event listeners:\n for (let i = 0; i < this.listeners.length; i++) {\n google.maps.event.removeListener(this.listeners[i])\n }\n\n this.listeners = []\n\n this.activeMap = null\n\n this.ready = false\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n draw() {}\n\n setupStyles() {\n if (this.styles.length > 0) {\n return\n }\n\n for (let i = 0; i < this.imageSizes.length; i++) {\n this.styles.push({\n url: this.imagePath + (i + 1) + '.' + this.imageExtension,\n height: this.imageSizes[i],\n width: this.imageSizes[i],\n })\n }\n }\n\n fitMapToMarkers() {\n const markers = this.getMarkers()\n\n const bounds = new google.maps.LatLngBounds()\n\n for (let i = 0; i < markers.length; i++) {\n const position = markers[i].getPosition()\n\n if (position) {\n bounds.extend(position)\n }\n }\n\n const map = this.getMap()\n\n if (map !== null && 'fitBounds' in map) {\n map.fitBounds(bounds)\n }\n\n }\n\n getGridSize(): number {\n return this.gridSize\n }\n\n setGridSize(gridSize: number) {\n this.gridSize = gridSize\n }\n\n getMinimumClusterSize(): number {\n return this.minClusterSize\n }\n\n setMinimumClusterSize(minimumClusterSize: number) {\n this.minClusterSize = minimumClusterSize\n }\n\n getMaxZoom(): number | null {\n return this.maxZoom\n }\n\n setMaxZoom(maxZoom: number) {\n this.maxZoom = maxZoom\n }\n\n getStyles(): ClusterIconStyle[] {\n return this.styles\n }\n\n setStyles(styles: ClusterIconStyle[]) {\n this.styles = styles\n }\n\n getTitle(): string {\n return this.title\n }\n\n setTitle(title: string) {\n this.title = title\n }\n\n getZoomOnClick(): boolean {\n return this.zoomOnClick\n }\n\n setZoomOnClick(zoomOnClick: boolean) {\n this.zoomOnClick = zoomOnClick\n }\n\n getAverageCenter(): boolean {\n return this.averageCenter\n }\n\n setAverageCenter(averageCenter: boolean) {\n this.averageCenter = averageCenter\n }\n\n getIgnoreHidden(): boolean {\n return this.ignoreHidden\n }\n\n setIgnoreHidden(ignoreHidden: boolean) {\n this.ignoreHidden = ignoreHidden\n }\n\n getEnableRetinaIcons(): boolean {\n return this.enableRetinaIcons\n }\n\n setEnableRetinaIcons(enableRetinaIcons: boolean) {\n this.enableRetinaIcons = enableRetinaIcons\n }\n\n getImageExtension(): string {\n return this.imageExtension\n }\n\n setImageExtension(imageExtension: string) {\n this.imageExtension = imageExtension\n }\n\n getImagePath(): string {\n return this.imagePath\n }\n\n setImagePath(imagePath: string) {\n this.imagePath = imagePath\n }\n\n getImageSizes(): number[] {\n return this.imageSizes\n }\n\n setImageSizes(imageSizes: number[]) {\n this.imageSizes = imageSizes\n }\n\n getCalculator(): TCalculator {\n return this.calculator\n }\n\n setCalculator(calculator: TCalculator) {\n this.calculator = calculator\n }\n\n getBatchSizeIE(): number {\n return this.batchSizeIE\n }\n\n setBatchSizeIE(batchSizeIE: number) {\n this.batchSizeIE = batchSizeIE\n }\n\n getClusterClass(): string {\n return this.clusterClass\n }\n\n setClusterClass(clusterClass: string) {\n this.clusterClass = clusterClass\n }\n\n getMarkers(): MarkerExtended[] {\n return this.markers\n }\n\n getTotalMarkers(): number {\n return this.markers.length\n }\n\n getClusters(): Cluster[] {\n return this.clusters\n }\n\n getTotalClusters(): number {\n return this.clusters.length\n }\n\n addMarker(marker: MarkerExtended, optNoDraw: boolean) {\n this.pushMarkerTo(marker)\n\n if (!optNoDraw) {\n this.redraw()\n }\n }\n\n addMarkers(markers: MarkerExtended[], optNoDraw: boolean) {\n for (const key in markers) {\n if (Object.prototype.hasOwnProperty.call(markers, key)) {\n this.pushMarkerTo(markers[key])\n }\n }\n\n if (!optNoDraw) {\n this.redraw()\n }\n }\n\n pushMarkerTo(marker: MarkerExtended) {\n // If the marker is draggable add a listener so we can update the clusters on the dragend:\n if (marker.getDraggable()) {\n google.maps.event.addListener(marker, 'dragend', () => {\n if (this.ready) {\n marker.isAdded = false\n\n this.repaint()\n }\n })\n }\n\n marker.isAdded = false\n\n this.markers.push(marker)\n }\n\n removeMarker_(marker: MarkerExtended): boolean {\n let index = -1\n\n if (this.markers.indexOf) {\n index = this.markers.indexOf(marker)\n } else {\n for (let i = 0; i < this.markers.length; i++) {\n if (marker === this.markers[i]) {\n index = i\n\n break\n }\n }\n }\n\n if (index === -1) {\n // Marker is not in our list of markers, so do nothing:\n return false\n }\n\n marker.setMap(null)\n\n this.markers.splice(index, 1) // Remove the marker from the list of managed markers\n\n return true\n }\n\n removeMarker(marker: MarkerExtended, optNoDraw: boolean): boolean {\n const removed = this.removeMarker_(marker)\n\n if (!optNoDraw && removed) {\n this.repaint()\n }\n\n return removed\n }\n\n removeMarkers(markers: MarkerExtended[], optNoDraw: boolean): boolean {\n let removed = false\n\n for (let i = 0; i < markers.length; i++) {\n removed = removed || this.removeMarker_(markers[i])\n }\n\n if (!optNoDraw && removed) {\n this.repaint()\n }\n\n return removed\n }\n\n clearMarkers() {\n this.resetViewport(true)\n\n this.markers = []\n }\n\n repaint() {\n const oldClusters = this.clusters.slice()\n\n this.clusters = []\n\n this.resetViewport(false)\n\n this.redraw()\n\n // Remove the old clusters.\n // Do it in a timeout to prevent blinking effect.\n setTimeout(function timeout() {\n for (let i = 0; i < oldClusters.length; i++) {\n oldClusters[i].remove()\n }\n }, 0)\n }\n\n getExtendedBounds(bounds: google.maps.LatLngBounds): google.maps.LatLngBounds {\n const projection = this.getProjection()\n\n // Convert the points to pixels and the extend out by the grid size.\n const trPix = projection.fromLatLngToDivPixel(\n // Turn the bounds into latlng.\n new google.maps.LatLng(bounds.getNorthEast().lat(), bounds.getNorthEast().lng())\n )\n\n if (trPix !== null) {\n trPix.x += this.gridSize\n trPix.y -= this.gridSize\n }\n\n const blPix = projection.fromLatLngToDivPixel(\n // Turn the bounds into latlng.\n new google.maps.LatLng(bounds.getSouthWest().lat(), bounds.getSouthWest().lng())\n )\n\n if (blPix !== null) {\n blPix.x -= this.gridSize\n blPix.y += this.gridSize\n }\n\n\n // Extend the bounds to contain the new bounds.\n if (trPix !== null) {\n // Convert the pixel points back to LatLng nw\n const point1 = projection.fromDivPixelToLatLng(trPix)\n\n if (point1 !== null) {\n bounds.extend(point1)\n }\n }\n\n if (blPix !== null) {\n // Convert the pixel points back to LatLng sw\n const point2 = projection.fromDivPixelToLatLng(blPix)\n\n if (point2 !== null) {\n bounds.extend(\n point2\n )\n }\n }\n\n\n return bounds\n }\n\n redraw() {\n // Redraws all the clusters.\n this.createClusters(0)\n }\n\n resetViewport(optHide: boolean) {\n // Remove all the clusters\n for (let i = 0; i < this.clusters.length; i++) {\n this.clusters[i].remove()\n }\n\n this.clusters = []\n\n // Reset the markers to not be added and to be removed from the map.\n for (let i = 0; i < this.markers.length; i++) {\n const marker = this.markers[i]\n\n marker.isAdded = false\n\n if (optHide) {\n marker.setMap(null)\n }\n }\n }\n\n distanceBetweenPoints(p1: google.maps.LatLng, p2: google.maps.LatLng): number {\n const R = 6371 // Radius of the Earth in km\n\n const dLat = ((p2.lat() - p1.lat()) * Math.PI) / 180\n const dLon = ((p2.lng() - p1.lng()) * Math.PI) / 180\n\n const a =\n Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos((p1.lat() * Math.PI) / 180) *\n Math.cos((p2.lat() * Math.PI) / 180) *\n Math.sin(dLon / 2) *\n Math.sin(dLon / 2)\n\n return R * (2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)))\n }\n\n isMarkerInBounds(marker: MarkerExtended, bounds: google.maps.LatLngBounds): boolean {\n const position = marker.getPosition()\n\n if (position) {\n return bounds.contains(position)\n }\n\n return false\n }\n\n addToClosestCluster(marker: MarkerExtended) {\n let cluster\n\n let distance = 40000 // Some large number\n\n let clusterToAddTo = null\n\n for (let i = 0; i < this.clusters.length; i++) {\n cluster = this.clusters[i]\n\n const center = cluster.getCenter()\n\n const position = marker.getPosition()\n\n if (center && position) {\n const d = this.distanceBetweenPoints(center, position)\n\n if (d < distance) {\n distance = d\n\n clusterToAddTo = cluster\n }\n }\n }\n\n if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) {\n clusterToAddTo.addMarker(marker)\n } else {\n cluster = new Cluster(this)\n\n cluster.addMarker(marker)\n\n this.clusters.push(cluster)\n }\n }\n\n createClusters(iFirst: number) {\n if (!this.ready) {\n return\n }\n\n // Cancel previous batch processing if we're working on the first batch:\n if (iFirst === 0) {\n /**\n * This event is fired when the <code>Clusterer</code> begins\n * clustering markers.\n * @name Clusterer#clusteringbegin\n * @param {Clusterer} mc The Clusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, 'clusteringbegin', this)\n\n if (this.timerRefStatic !== null) {\n window.clearTimeout(this.timerRefStatic)\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n delete this.timerRefStatic\n }\n }\n\n const map = this.getMap()\n\n const bounds = map !== null && 'getBounds' in map ? map.getBounds() : null\n\n const zoom = map?.getZoom() || 0\n // Get our current map view bounds.\n // Create a new bounds object so we don't affect the map.\n //\n // See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug:\n const mapBounds = zoom > 3\n ? new google.maps.LatLngBounds(\n bounds?.getSouthWest(),\n bounds?.getNorthEast()\n )\n : new google.maps.LatLngBounds(\n new google.maps.LatLng(85.02070771743472, -178.48388434375),\n new google.maps.LatLng(-85.08136444384544, 178.00048865625)\n )\n\n const extendedMapBounds = this.getExtendedBounds(mapBounds)\n\n const iLast = Math.min(iFirst + this.batchSize, this.markers.length)\n\n for (let i = iFirst; i < iLast; i++) {\n const marker = this.markers[i]\n\n if (!marker.isAdded && this.isMarkerInBounds(marker, extendedMapBounds) && (!this.ignoreHidden || (this.ignoreHidden && marker.getVisible()))) {\n this.addToClosestCluster(marker)\n }\n }\n\n if (iLast < this.markers.length) {\n this.timerRefStatic = window.setTimeout(\n () => {\n this.createClusters(iLast)\n },\n 0\n )\n } else {\n this.timerRefStatic = null\n\n /**\n * This event is fired when the <code>Clusterer</code> stops\n * clustering markers.\n * @name Clusterer#clusteringend\n * @param {Clusterer} mc The Clusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, 'clusteringend', this)\n\n for (let i = 0; i < this.clusters.length; i++) {\n this.clusters[i].updateIcon()\n }\n }\n }\n\n extend<A extends typeof ClusterIcon | typeof Clusterer>(obj1: A, obj2: typeof google.maps.OverlayView) {\n return function applyExtend(this: A, object: typeof google.maps.OverlayView) {\n for (const property in object.prototype) {\n this.prototype.set(property, object.prototype.get(property))\n }\n\n return this\n }.apply<A, [typeof google.maps.OverlayView], any>(obj1, [obj2])\n }\n}\n"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","this","constructor","create","ClusterIcon","_super","cluster","styles","_this","getClusterer","extend","google","maps","OverlayView","clusterClassName","getClusterClass","className","center","undefined","div","sums","visible","boundsChangedListener","url","height","width","anchorText","anchorIcon","textColor","textSize","textDecoration","fontWeight","fontStyle","fontFamily","backgroundPosition","cMouseDownInCluster","cDraggingMapByCluster","timeOut","setMap","getMap","onBoundsChanged","onMouseDown","onClick","event","markerClusterer_1","trigger","getZoomOnClick","maxZoom_1","getMaxZoom","bounds_1","getBounds","map","fitBounds","window","setTimeout","zoom","getZoom","setZoom","cancelBubble","stopPropagation","onMouseOver","onMouseOut","onAdd","document","createElement","show","_a","getPanes","overlayMouseTarget","appendChild","addListener","addEventListener","onRemove","parentNode","hide","removeListener","removeEventListener","removeChild","clearTimeout","draw","pos","getPosFromLatLng","style","top","concat","y","left","x","display","divTitle","bp","split","spriteH","parseInt","replace","spriteV","title","getTitle","cursor","position","img","alt","src","enableRetinaIcons","clip","textElm","color","fontSize","textAlign","lineHeight","innerText","text","innerHTML","useStyle","getStyles","Math","min","length","max","index","setCenter","latlng","getProjection","fromLatLngToDivPixel","Cluster","markerClusterer","gridSize","getGridSize","minClusterSize","getMinimumClusterSize","averageCenter","getAverageCenter","markers","bounds","clusterIcon","getSize","getMarkers","getCenter","LatLngBounds","i","getPosition","remove","addMarker","marker","isMarkerAlreadyAdded","length_1","LatLng","lat","lng","calculateBounds","isAdded","push","mCount","maxZoom","isMarkerInClusterBounds","contains","getExtendedBounds","updateIcon","getCalculator","includes","CALCULATOR","numStyles","count","numberOfDigits","toString","IMAGE_SIZES","Clusterer","optMarkers","optOptions","clusters","listeners","activeMap","ready","minimumClusterSize","zoomOnClick","ignoreHidden","imagePath","imageExtension","imageSizes","calculator","batchSize","batchSizeIE","clusterClass","navigator","userAgent","toLowerCase","indexOf","timerRefStatic","setupStyles","addMarkers","onZoomChanged","resetViewport","get","_b","onIdle","redraw","repaint","fitMapToMarkers","setGridSize","setMinimumClusterSize","setMaxZoom","setStyles","setTitle","setZoomOnClick","setAverageCenter","getIgnoreHidden","setIgnoreHidden","getEnableRetinaIcons","setEnableRetinaIcons","getImageExtension","setImageExtension","getImagePath","setImagePath","getImageSizes","setImageSizes","setCalculator","getBatchSizeIE","setBatchSizeIE","setClusterClass","getTotalMarkers","getClusters","getTotalClusters","optNoDraw","pushMarkerTo","key","getDraggable","removeMarker_","splice","removeMarker","removed","removeMarkers","clearMarkers","oldClusters","slice","projection","trPix","getNorthEast","blPix","getSouthWest","point1","fromDivPixelToLatLng","point2","createClusters","optHide","distanceBetweenPoints","p1","p2","dLat","PI","dLon","a","sin","cos","atan2","sqrt","isMarkerInBounds","addToClosestCluster","distance","clusterToAddTo","iFirst","mapBounds","extendedMapBounds","iLast","getVisible","obj1","obj2","object","property","set","apply"],"mappings":"oEAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOC,OAAOK,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,KACzFP,EAAcC,EAAGC,IAGrB,SAASS,EAAUV,EAAGC,GACzB,GAAiB,mBAANA,GAA0B,OAANA,EAC3B,MAAM,IAAIU,UAAU,uBAAyBC,OAAOX,GAAK,iCAE7D,SAASY,IAAOC,KAAKC,YAAcf,EADnCD,EAAcC,EAAGC,GAEjBD,EAAEO,UAAkB,OAANN,EAAaC,OAAOc,OAAOf,IAAMY,EAAGN,UAAYN,EAAEM,UAAW,IAAIM,GCtBnF,IAAAI,EAAA,SAAAC,GA2BE,SAAYD,EAAAE,EAAkBC,GAA9B,IAAAC,EACEH,cA4CDJ,YA3CCK,EAAQG,eAAeC,OAAON,EAAaO,OAAOC,KAAKC,aAEvDL,EAAKF,QAAUA,EAEfE,EAAKM,iBAAmBN,EAAKF,QAAQG,eAAeM,kBAEpDP,EAAKQ,UAAYR,EAAKM,iBAEtBN,EA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A,EAAI1I,KAAKwK,SAASpD,OAAQsB,IACxC1I,KAAKwK,SAAS9B,GAAGkB,gBAKvBS,EAAA5K,UAAAgB,OAAA,SAAwD8P,EAASC,GAC/D,OAAO,SAA8BC,GACnC,IAAK,IAAMC,KAAYD,EAAOhR,UAC5BO,KAAKP,UAAUkR,IAAID,EAAUD,EAAOhR,UAAUsM,IAAI2E,IAGpD,OAAO1Q,MACP4Q,MAAgDL,EAAM,CAACC,KAE5DnG,EA3qBD,CAA+B3J,OAAOC,KAAKC"}
package/dist/esm.js CHANGED
@@ -86,22 +86,23 @@ var ClusterIcon = /** @class */ (function (_super) {
86
86
  // Zoom into the cluster.
87
87
  var maxZoom_1 = markerClusterer_1.getMaxZoom();
88
88
  var bounds_1 = this.cluster.getBounds();
89
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
90
- // @ts-ignore
91
- markerClusterer_1.getMap().fitBounds(bounds_1);
89
+ var map = markerClusterer_1.getMap();
90
+ if (map !== null && 'fitBounds' in map) {
91
+ map.fitBounds(bounds_1);
92
+ }
92
93
  // There is a fix for Issue 170 here:
93
94
  this.timeOut = window.setTimeout(function () {
94
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
95
- // @ts-ignore
96
- markerClusterer_1.getMap().fitBounds(bounds_1);
97
- // Don't zoom beyond the max zoom level
98
- if (maxZoom_1 !== null &&
99
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
100
- // @ts-ignore
101
- markerClusterer_1.getMap().getZoom() > maxZoom_1) {
102
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
103
- // @ts-ignore
104
- markerClusterer_1.getMap().setZoom(maxZoom_1 + 1);
95
+ var map = markerClusterer_1.getMap();
96
+ if (map !== null) {
97
+ if ('fitBounds' in map) {
98
+ map.fitBounds(bounds_1);
99
+ }
100
+ var zoom = map.getZoom() || 0;
101
+ // Don't zoom beyond the max zoom level
102
+ if (maxZoom_1 !== null &&
103
+ zoom > maxZoom_1) {
104
+ map.setZoom(maxZoom_1 + 1);
105
+ }
105
106
  }
106
107
  }, 100);
107
108
  }
@@ -131,23 +132,22 @@ var ClusterIcon = /** @class */ (function (_super) {
131
132
  google.maps.event.trigger(this.cluster.getClusterer(), 'mouseout', this.cluster);
132
133
  };
133
134
  ClusterIcon.prototype.onAdd = function () {
135
+ var _a;
134
136
  this.div = document.createElement('div');
135
137
  this.div.className = this.className;
136
138
  if (this.visible) {
137
139
  this.show();
138
140
  }
139
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
140
- // @ts-ignore
141
- this.getPanes().overlayMouseTarget.appendChild(this.div);
142
- // Fix for Issue 157
143
- this.boundsChangedListener = google.maps.event.addListener(
144
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
145
- // @ts-ignore
146
- this.getMap(), 'bounds_changed', this.onBoundsChanged);
147
- this.div.addEventListener('mousedown', this.onMouseDown);
148
- this.div.addEventListener('click', this.onClick);
149
- this.div.addEventListener('mouseover', this.onMouseOver);
150
- this.div.addEventListener('mouseout', this.onMouseOut);
141
+ (_a = this.getPanes()) === null || _a === void 0 ? void 0 : _a.overlayMouseTarget.appendChild(this.div);
142
+ var map = this.getMap();
143
+ if (map !== null) {
144
+ // Fix for Issue 157
145
+ this.boundsChangedListener = google.maps.event.addListener(map, 'bounds_changed', this.onBoundsChanged);
146
+ this.div.addEventListener('mousedown', this.onMouseDown);
147
+ this.div.addEventListener('click', this.onClick);
148
+ this.div.addEventListener('mouseover', this.onMouseOver);
149
+ this.div.addEventListener('mouseout', this.onMouseOut);
150
+ }
151
151
  };
152
152
  ClusterIcon.prototype.onRemove = function () {
153
153
  if (this.div && this.div.parentNode) {
@@ -270,8 +270,6 @@ var ClusterIcon = /** @class */ (function (_super) {
270
270
  var Cluster = /** @class */ (function () {
271
271
  function Cluster(markerClusterer) {
272
272
  this.markerClusterer = markerClusterer;
273
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
274
- // @ts-ignore
275
273
  this.map = this.markerClusterer.getMap();
276
274
  this.gridSize = this.markerClusterer.getGridSize();
277
275
  this.minClusterSize = this.markerClusterer.getMinimumClusterSize();
@@ -308,8 +306,6 @@ var Cluster = /** @class */ (function () {
308
306
  return bounds;
309
307
  };
310
308
  Cluster.prototype.remove = function () {
311
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
312
- // @ts-ignore
313
309
  this.clusterIcon.setMap(null);
314
310
  this.markers = [];
315
311
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -317,6 +313,7 @@ var Cluster = /** @class */ (function () {
317
313
  delete this.markers;
318
314
  };
319
315
  Cluster.prototype.addMarker = function (marker) {
316
+ var _a;
320
317
  if (this.isMarkerAlreadyAdded(marker)) {
321
318
  return false;
322
319
  }
@@ -341,7 +338,7 @@ var Cluster = /** @class */ (function () {
341
338
  this.markers.push(marker);
342
339
  var mCount = this.markers.length;
343
340
  var maxZoom = this.markerClusterer.getMaxZoom();
344
- var zoom = this.map.getZoom();
341
+ var zoom = (_a = this.map) === null || _a === void 0 ? void 0 : _a.getZoom();
345
342
  if (maxZoom !== null && typeof zoom !== 'undefined' && zoom > maxZoom) {
346
343
  // Zoomed in past max zoom, so show the marker.
347
344
  if (marker.getMap() !== this.map) {
@@ -378,9 +375,10 @@ var Cluster = /** @class */ (function () {
378
375
  this.bounds = this.markerClusterer.getExtendedBounds(new google.maps.LatLngBounds(this.center, this.center));
379
376
  };
380
377
  Cluster.prototype.updateIcon = function () {
378
+ var _a;
381
379
  var mCount = this.markers.length;
382
380
  var maxZoom = this.markerClusterer.getMaxZoom();
383
- var zoom = this.map.getZoom();
381
+ var zoom = (_a = this.map) === null || _a === void 0 ? void 0 : _a.getZoom();
384
382
  if (maxZoom !== null && typeof zoom !== 'undefined' && zoom > maxZoom) {
385
383
  this.clusterIcon.hide();
386
384
  return;
@@ -477,8 +475,6 @@ var Clusterer = /** @class */ (function (_super) {
477
475
  _this.timerRefStatic = null;
478
476
  _this.setupStyles();
479
477
  _this.addMarkers(optMarkers, true);
480
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
481
- // @ts-ignore
482
478
  _this.setMap(map); // Note: this causes onAdd to be called
483
479
  return _this;
484
480
  }
@@ -554,9 +550,10 @@ var Clusterer = /** @class */ (function (_super) {
554
550
  bounds.extend(position);
555
551
  }
556
552
  }
557
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
558
- // @ts-ignore
559
- this.getMap().fitBounds(bounds);
553
+ var map = this.getMap();
554
+ if (map !== null && 'fitBounds' in map) {
555
+ map.fitBounds(bounds);
556
+ }
560
557
  };
561
558
  Clusterer.prototype.getGridSize = function () {
562
559
  return this.gridSize;
@@ -746,8 +743,6 @@ var Clusterer = /** @class */ (function (_super) {
746
743
  }, 0);
747
744
  };
748
745
  Clusterer.prototype.getExtendedBounds = function (bounds) {
749
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
750
- // @ts-ignore
751
746
  var projection = this.getProjection();
752
747
  // Convert the points to pixels and the extend out by the grid size.
753
748
  var trPix = projection.fromLatLngToDivPixel(
@@ -867,14 +862,12 @@ var Clusterer = /** @class */ (function (_super) {
867
862
  }
868
863
  var map = this.getMap();
869
864
  var bounds = map !== null && 'getBounds' in map ? map.getBounds() : null;
865
+ var zoom = (map === null || map === void 0 ? void 0 : map.getZoom()) || 0;
870
866
  // Get our current map view bounds.
871
867
  // Create a new bounds object so we don't affect the map.
872
868
  //
873
869
  // See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug:
874
- var mapBounds =
875
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
876
- // @ts-ignore
877
- map.getZoom() > 3
870
+ var mapBounds = zoom > 3
878
871
  ? new google.maps.LatLngBounds(bounds === null || bounds === void 0 ? void 0 : bounds.getSouthWest(), bounds === null || bounds === void 0 ? void 0 : bounds.getNorthEast())
879
872
  : new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625));
880
873
  var extendedMapBounds = this.getExtendedBounds(mapBounds);