@react-google-maps/marker-clusterer 2.20.0 → 3.0.0
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.js +4 -9
- package/dist/cjs.js.map +1 -1
- package/dist/cjs.min.js.map +1 -1
- package/dist/esm.js +4 -9
- package/dist/esm.js.map +1 -1
- package/dist/esm.min.js.map +1 -1
- package/dist/umd.js +4 -9
- package/dist/umd.js.map +1 -1
- package/dist/umd.min.js.map +1 -1
- package/package.json +13 -12
- package/src/Cluster.tsx +0 -1
- package/src/ClusterIcon.tsx +0 -1
- package/src/Clusterer.tsx +4 -8
- package/src/index.ts +0 -1
- package/LICENSE +0 -21
package/dist/umd.min.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"umd.min.js","sources":["../src/ClusterIcon.tsx","../src/Cluster.tsx","../src/Clusterer.tsx"],"sourcesContent":["/* global google */\n/* eslint-disable filenames/match-regex */\nimport type { Cluster } from './Cluster'\n\nimport type { ClusterIconStyle, ClusterIconInfo } from './types'\n\nexport class ClusterIcon {\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, number]\n anchorIcon: [number, 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 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 (this as unknown as google.maps.OverlayView).setMap(cluster.getMap()) // Note: this causes onAdd to be called\n\n this.onBoundsChanged = this.onBoundsChanged.bind(this)\n this.onMouseDown = this.onMouseDown.bind(this)\n this.onClick = this.onClick.bind(this)\n this.onMouseOver = this.onMouseOver.bind(this)\n this.onMouseOut = this.onMouseOut.bind(this)\n this.onAdd = this.onAdd.bind(this)\n this.onRemove = this.onRemove.bind(this)\n this.draw = this.draw.bind(this)\n this.hide = this.hide.bind(this)\n this.show = this.show.bind(this)\n this.useStyle = this.useStyle.bind(this)\n this.setCenter = this.setCenter.bind(this)\n this.getPosFromLatLng = this.getPosFromLatLng.bind(this)\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 as unknown as google.maps.OverlayView).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 as unknown as google.maps.OverlayView).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 as unknown as google.maps.OverlayView).getPanes()?.overlayMouseTarget.appendChild(this.div)\n\n const map = (this as unknown as google.maps.OverlayView).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 const divTitle = this.sums === null ||\n typeof this.sums.title === 'undefined' ||\n this.sums.title === '' ? this.cluster.getClusterer().getTitle() : this.sums.title\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, '') || '0', 10)\n const spriteV = parseInt(bp[1]?.replace(/^\\s+|\\s+$/g, '') || '0', 10)\n\n const pos = this.getPosFromLatLng(this.center)\n\n this.div.className = this.className\n this.div .setAttribute('style', `cursor: pointer; position: absolute; top: ${pos !== null ? `${pos.y}px` : '0'}; left: ${pos !== null ? `${pos.x}px` : '0'}; width: ${this.width}px; height: ${this.height}px; `)\n\n const img = document.createElement('img')\n\n img.alt = divTitle\n img.src = this.url\n img.width = this.width\n img.height = this.height\n img.setAttribute('style', `position: absolute; top: ${spriteV}px; 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 .setAttribute('style', `position: absolute; top: ${this.anchorText[0]}px; left: ${this.anchorText[1]}px; color: ${this.textColor}; font-size: ${this.textSize}px; font-family: ${this.fontFamily}; font-weight: ${this.fontWeight}; fontStyle: ${this.fontStyle}; text-decoration: ${this.textDecoration}; text-align: center; width: ${this.width}px; line-height: ${this.height}px`)\n\n if (this.sums?.text) textElm.innerText = `${this.sums?.text}`\n if (this.sums?.html) textElm.innerHTML = `${this.sums?.html}`\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 if (style) {\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\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\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 as unknown as google.maps.OverlayView).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\nimport type { Clusterer } from './Clusterer'\n\nimport { ClusterIcon } from './ClusterIcon'\n\nimport type { 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 as unknown as google.maps.OverlayView).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 this.getSize = this.getSize.bind(this)\n this.getMarkers = this.getMarkers.bind(this)\n this.getCenter = this.getCenter.bind(this)\n this.getMap = this.getMap.bind(this)\n this.getClusterer = this.getClusterer.bind(this)\n this.getBounds = this.getBounds.bind(this)\n this.remove = this.remove.bind(this)\n this.addMarker = this.addMarker.bind(this)\n this.isMarkerInClusterBounds = this.isMarkerInClusterBounds.bind(this)\n this.calculateBounds = this.calculateBounds.bind(this)\n this.updateIcon = this.updateIcon.bind(this)\n this.isMarkerAlreadyAdded = this.isMarkerAlreadyAdded.bind(this)\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 (const marker of markers) {\n const position = marker.getPosition()\n\n if (position) {\n bounds.extend(position)\n }\n }\n\n return bounds\n }\n\n remove() {\n (this.clusterIcon as unknown as google.maps.OverlayView).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 (const markerElement of this.markers) {\n markerElement.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 type { ClusterIcon } from './ClusterIcon'\n\nimport type {\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 */\nfunction 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 implements 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 this.getMinimumClusterSize = this.getMinimumClusterSize.bind(this)\n this.setMinimumClusterSize = this.setMinimumClusterSize.bind(this)\n this.getEnableRetinaIcons = this.getEnableRetinaIcons.bind(this)\n this.setEnableRetinaIcons = this.setEnableRetinaIcons.bind(this)\n this.addToClosestCluster = this.addToClosestCluster.bind(this)\n this.getImageExtension = this.getImageExtension.bind(this)\n this.setImageExtension = this.setImageExtension.bind(this)\n this.getExtendedBounds = this.getExtendedBounds.bind(this)\n this.getAverageCenter = this.getAverageCenter.bind(this)\n this.setAverageCenter = this.setAverageCenter.bind(this)\n this.getTotalClusters = this.getTotalClusters.bind(this)\n this.fitMapToMarkers = this.fitMapToMarkers.bind(this)\n this.getIgnoreHidden = this.getIgnoreHidden.bind(this)\n this.setIgnoreHidden = this.setIgnoreHidden.bind(this)\n this.getClusterClass = this.getClusterClass.bind(this)\n this.setClusterClass = this.setClusterClass.bind(this)\n this.getTotalMarkers = this.getTotalMarkers.bind(this)\n this.getZoomOnClick = this.getZoomOnClick.bind(this)\n this.setZoomOnClick = this.setZoomOnClick.bind(this)\n this.getBatchSizeIE = this.getBatchSizeIE.bind(this)\n this.setBatchSizeIE = this.setBatchSizeIE.bind(this)\n this.createClusters = this.createClusters.bind(this)\n this.onZoomChanged = this.onZoomChanged.bind(this)\n this.getImageSizes = this.getImageSizes.bind(this)\n this.setImageSizes = this.setImageSizes.bind(this)\n this.getCalculator = this.getCalculator.bind(this)\n this.setCalculator = this.setCalculator.bind(this)\n this.removeMarkers = this.removeMarkers.bind(this)\n this.resetViewport = this.resetViewport.bind(this)\n this.getImagePath = this.getImagePath.bind(this)\n this.setImagePath = this.setImagePath.bind(this)\n this.pushMarkerTo = this.pushMarkerTo.bind(this)\n this.removeMarker = this.removeMarker.bind(this)\n this.clearMarkers = this.clearMarkers.bind(this)\n this.setupStyles = this.setupStyles.bind(this)\n this.getGridSize = this.getGridSize.bind(this)\n this.setGridSize = this.setGridSize.bind(this)\n this.getClusters = this.getClusters.bind(this)\n this.getMaxZoom = this.getMaxZoom.bind(this)\n this.setMaxZoom = this.setMaxZoom.bind(this)\n this.getMarkers = this.getMarkers.bind(this)\n this.addMarkers = this.addMarkers.bind(this)\n this.getStyles = this.getStyles.bind(this)\n this.setStyles = this.setStyles.bind(this)\n this.addMarker = this.addMarker.bind(this)\n this.onRemove = this.onRemove.bind(this)\n this.getTitle = this.getTitle.bind(this)\n this.setTitle = this.setTitle.bind(this)\n this.repaint = this.repaint.bind(this)\n this.onIdle = this.onIdle.bind(this)\n this.redraw = this.redraw.bind(this)\n this.onAdd = this.onAdd.bind(this)\n this.draw = this.draw.bind(this)\n\n this.extend = this.extend.bind(this)\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 as unknown as google.maps.OverlayView).setMap(map) // Note: this causes onAdd to be called\n }\n\n onZoomChanged(): void {\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 as unknown as google.maps.OverlayView).getMap()?.getZoom() === ((this as unknown as google.maps.OverlayView).get('minZoom') || 0) ||\n (this as unknown as google.maps.OverlayView).getMap()?.getZoom() === (this as unknown as google.maps.OverlayView).get('maxZoom')\n ) {\n google.maps.event.trigger(this, 'idle')\n }\n }\n\n onIdle(): void {\n this.redraw()\n }\n\n onAdd(): void {\n const map = (this as unknown as google.maps.OverlayView).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(): void {\n // Put all the managed markers back on the map:\n for (const marker of this.markers) {\n if (marker.getMap() !== this.activeMap) {\n marker.setMap(this.activeMap)\n }\n }\n\n // Remove all clusters:\n for (const cluster of this.clusters) {\n cluster.remove()\n }\n\n this.clusters = []\n\n // Remove map event listeners:\n for (const listener of this.listeners) {\n google.maps.event.removeListener(listener)\n }\n\n this.listeners = []\n\n this.activeMap = null\n\n this.ready = false\n }\n\n draw(): void { return }\n\n getMap(): null { return null }\n\n getPanes(): null { return null }\n\n getProjection() {\n return {\n fromContainerPixelToLatLng(): null { return null },\n fromDivPixelToLatLng(): null { return null},\n fromLatLngToContainerPixel(): null { return null},\n fromLatLngToDivPixel(): null { return null},\n getVisibleRegion(): null { return null },\n getWorldWidth(): number { return 0 }\n }\n }\n\n setMap(): void { return }\n\n addListener() {\n return {\n remove() { return }\n }\n }\n\n bindTo(): void { return }\n\n get(): void { return }\n\n notify(): void { return }\n\n set(): void { return }\n setValues(): void { return }\n unbind(): void { return }\n unbindAll(): void { return }\n\n setupStyles(): void {\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] || 0,\n width: this.imageSizes[i] || 0,\n })\n }\n }\n\n fitMapToMarkers(): void {\n const markers = this.getMarkers()\n\n const bounds = new google.maps.LatLngBounds()\n\n for (const marker of markers) {\n const position = marker.getPosition()\n\n if (position) {\n bounds.extend(position)\n }\n }\n\n const map = (this as unknown as google.maps.OverlayView).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 const marker = markers[key]\n\n if (marker) {\n this.pushMarkerTo(marker)\n }\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 (const marker of markers) {\n removed = removed || this.removeMarker_(marker)\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 (const oldCluster of oldClusters) {\n oldCluster.remove()\n }\n }, 0)\n }\n\n getExtendedBounds(bounds: google.maps.LatLngBounds): google.maps.LatLngBounds {\n const projection = (this as unknown as google.maps.OverlayView).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 (const cluster of this.clusters) {\n cluster.remove()\n }\n\n this.clusters = []\n\n // Reset the markers to not be added and to be removed from the map.\n for (const marker of this.markers) {\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 (const clusterElement of this.clusters) {\n cluster = clusterElement\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 as unknown as google.maps.OverlayView).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 && !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 (const cluster of this.clusters) {\n cluster.updateIcon()\n }\n }\n }\n\n extend<A extends typeof Clusterer | typeof ClusterIcon>(obj1: A, obj2: typeof google.maps.OverlayView): A {\n return function applyExtend(this: A, object: typeof google.maps.OverlayView): A {\n for (const property in object.prototype) {\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n const prop = property as keyof google.maps.OverlayView & (string & {})\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.prototype[prop] = object.prototype[prop]\n }\n\n return this\n }.apply<A, [typeof google.maps.OverlayView], A>(obj1, [obj2])\n }\n}\n"],"names":["ClusterIcon","cluster","styles","getClusterer","extend","google","maps","OverlayView","this","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","bind","onMouseDown","onClick","onMouseOver","onMouseOut","onAdd","onRemove","draw","hide","show","useStyle","setCenter","getPosFromLatLng","prototype","event","markerClusterer_1","trigger","getZoomOnClick","maxZoom_1","getMaxZoom","bounds_1","getBounds","map","fitBounds","window","setTimeout","zoom","getZoom","setZoom","cancelBubble","stopPropagation","document","createElement","_a","getPanes","overlayMouseTarget","appendChild","addListener","addEventListener","parentNode","removeListener","removeEventListener","removeChild","clearTimeout","pos","style","top","concat","y","left","x","display","divTitle","title","getTitle","bp","split","spriteH","parseInt","replace","spriteV","_b","setAttribute","img","alt","src","enableRetinaIcons","clip","textElm","_c","text","innerText","_d","_e","html","innerHTML","_f","getStyles","Math","min","length","max","index","latlng","getProjection","fromLatLngToDivPixel","Cluster","markerClusterer","gridSize","getGridSize","minClusterSize","getMinimumClusterSize","averageCenter","getAverageCenter","markers","bounds","clusterIcon","getSize","getMarkers","getCenter","remove","addMarker","isMarkerInClusterBounds","calculateBounds","updateIcon","isMarkerAlreadyAdded","LatLngBounds","_i","markers_1","position","getPosition","marker","length_1","LatLng","lat","lng","isAdded","push","mCount","maxZoom","contains","getExtendedBounds","getCalculator","includes","i","CALCULATOR","numStyles","count","numberOfDigits","toString","IMAGE_SIZES","Clusterer","optMarkers","optOptions","setMinimumClusterSize","getEnableRetinaIcons","setEnableRetinaIcons","addToClosestCluster","getImageExtension","setImageExtension","setAverageCenter","getTotalClusters","fitMapToMarkers","getIgnoreHidden","setIgnoreHidden","setClusterClass","getTotalMarkers","setZoomOnClick","getBatchSizeIE","setBatchSizeIE","createClusters","onZoomChanged","getImageSizes","setImageSizes","setCalculator","removeMarkers","resetViewport","getImagePath","setImagePath","pushMarkerTo","removeMarker","clearMarkers","setupStyles","setGridSize","getClusters","setMaxZoom","addMarkers","setStyles","setTitle","repaint","onIdle","redraw","clusters","listeners","activeMap","ready","minimumClusterSize","zoomOnClick","ignoreHidden","imagePath","imageExtension","imageSizes","calculator","batchSize","batchSizeIE","clusterClass","navigator","userAgent","toLowerCase","indexOf","timerRefStatic","get","listener","fromContainerPixelToLatLng","fromDivPixelToLatLng","fromLatLngToContainerPixel","getVisibleRegion","getWorldWidth","bindTo","notify","set","setValues","unbind","unbindAll","optNoDraw","key","Object","hasOwnProperty","call","_this","getDraggable","removeMarker_","splice","removed","markers_2","oldClusters","slice","oldClusters_1","projection","trPix","getNorthEast","blPix","getSouthWest","point1","point2","optHide","distanceBetweenPoints","p1","p2","dLat","PI","dLon","a","sin","cos","atan2","sqrt","isMarkerInBounds","distance","clusterToAddTo","d","iFirst","mapBounds","extendedMapBounds","iLast","getVisible","obj1","obj2","object","property","prop","apply"],"mappings":"uPAMA,IAAAA,EAAA,WA2BE,SAAYA,EAAAC,EAAkBC,GAC5BD,EAAQE,eAAeC,OAAOJ,EAAaK,OAAOC,KAAKC,aAEvDC,KAAKP,QAAUA,EAEfO,KAAKC,iBAAmBD,KAAKP,QAAQE,eAAeO,kBAEpDF,KAAKG,UAAYH,KAAKC,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AAb2B,IAAe,CAAnB1E,EAAA0E,GACRH,YACT,CACF,CA3EA,GA8EH2B,EAAAtH,UAAA7C,OAAA,SAAwDsR,EAASC,GAC/D,OAAO,SAA8BC,GACnC,IAAK,IAAMC,KAAYD,EAAO3O,UAAW,CAGvC,IAAM6O,EAAOD,EAIbrR,KAAKyC,UAAU6O,GAAQF,EAAO3O,UAAU6O,EACzC,CAED,OAAOtR,IACR,EAACuR,MAA8CL,EAAM,CAACC,KAE1DpH,CAAD"}
|
|
1
|
+
{"version":3,"file":"umd.min.js","sources":["../src/ClusterIcon.tsx","../src/Cluster.tsx","../src/Clusterer.tsx"],"sourcesContent":["/* global google */\nimport type { Cluster } from './Cluster'\n\nimport type { ClusterIconStyle, ClusterIconInfo } from './types'\n\nexport class ClusterIcon {\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, number]\n anchorIcon: [number, 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 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 (this as unknown as google.maps.OverlayView).setMap(cluster.getMap()) // Note: this causes onAdd to be called\n\n this.onBoundsChanged = this.onBoundsChanged.bind(this)\n this.onMouseDown = this.onMouseDown.bind(this)\n this.onClick = this.onClick.bind(this)\n this.onMouseOver = this.onMouseOver.bind(this)\n this.onMouseOut = this.onMouseOut.bind(this)\n this.onAdd = this.onAdd.bind(this)\n this.onRemove = this.onRemove.bind(this)\n this.draw = this.draw.bind(this)\n this.hide = this.hide.bind(this)\n this.show = this.show.bind(this)\n this.useStyle = this.useStyle.bind(this)\n this.setCenter = this.setCenter.bind(this)\n this.getPosFromLatLng = this.getPosFromLatLng.bind(this)\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 as unknown as google.maps.OverlayView).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 as unknown as google.maps.OverlayView).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 as unknown as google.maps.OverlayView).getPanes()?.overlayMouseTarget.appendChild(this.div)\n\n const map = (this as unknown as google.maps.OverlayView).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 const divTitle = this.sums === null ||\n typeof this.sums.title === 'undefined' ||\n this.sums.title === '' ? this.cluster.getClusterer().getTitle() : this.sums.title\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, '') || '0', 10)\n const spriteV = parseInt(bp[1]?.replace(/^\\s+|\\s+$/g, '') || '0', 10)\n\n const pos = this.getPosFromLatLng(this.center)\n\n this.div.className = this.className\n this.div .setAttribute('style', `cursor: pointer; position: absolute; top: ${pos !== null ? `${pos.y}px` : '0'}; left: ${pos !== null ? `${pos.x}px` : '0'}; width: ${this.width}px; height: ${this.height}px; `)\n\n const img = document.createElement('img')\n\n img.alt = divTitle\n img.src = this.url\n img.width = this.width\n img.height = this.height\n img.setAttribute('style', `position: absolute; top: ${spriteV}px; 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 .setAttribute('style', `position: absolute; top: ${this.anchorText[0]}px; left: ${this.anchorText[1]}px; color: ${this.textColor}; font-size: ${this.textSize}px; font-family: ${this.fontFamily}; font-weight: ${this.fontWeight}; fontStyle: ${this.fontStyle}; text-decoration: ${this.textDecoration}; text-align: center; width: ${this.width}px; line-height: ${this.height}px`)\n\n if (this.sums?.text) textElm.innerText = `${this.sums?.text}`\n if (this.sums?.html) textElm.innerHTML = `${this.sums?.html}`\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 if (style) {\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\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\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 as unknown as google.maps.OverlayView).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\nimport type { Clusterer } from './Clusterer'\n\nimport { ClusterIcon } from './ClusterIcon'\n\nimport type { 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 as unknown as google.maps.OverlayView).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 this.getSize = this.getSize.bind(this)\n this.getMarkers = this.getMarkers.bind(this)\n this.getCenter = this.getCenter.bind(this)\n this.getMap = this.getMap.bind(this)\n this.getClusterer = this.getClusterer.bind(this)\n this.getBounds = this.getBounds.bind(this)\n this.remove = this.remove.bind(this)\n this.addMarker = this.addMarker.bind(this)\n this.isMarkerInClusterBounds = this.isMarkerInClusterBounds.bind(this)\n this.calculateBounds = this.calculateBounds.bind(this)\n this.updateIcon = this.updateIcon.bind(this)\n this.isMarkerAlreadyAdded = this.isMarkerAlreadyAdded.bind(this)\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 (const marker of markers) {\n const position = marker.getPosition()\n\n if (position) {\n bounds.extend(position)\n }\n }\n\n return bounds\n }\n\n remove() {\n (this.clusterIcon as unknown as google.maps.OverlayView).setMap(null)\n\n this.markers = []\n\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 (const markerElement of this.markers) {\n markerElement.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 */\nimport { Cluster } from './Cluster'\nimport type { ClusterIcon } from './ClusterIcon'\n\nimport type {\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 */\nfunction 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 implements 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 this.getMinimumClusterSize = this.getMinimumClusterSize.bind(this)\n this.setMinimumClusterSize = this.setMinimumClusterSize.bind(this)\n this.getEnableRetinaIcons = this.getEnableRetinaIcons.bind(this)\n this.setEnableRetinaIcons = this.setEnableRetinaIcons.bind(this)\n this.addToClosestCluster = this.addToClosestCluster.bind(this)\n this.getImageExtension = this.getImageExtension.bind(this)\n this.setImageExtension = this.setImageExtension.bind(this)\n this.getExtendedBounds = this.getExtendedBounds.bind(this)\n this.getAverageCenter = this.getAverageCenter.bind(this)\n this.setAverageCenter = this.setAverageCenter.bind(this)\n this.getTotalClusters = this.getTotalClusters.bind(this)\n this.fitMapToMarkers = this.fitMapToMarkers.bind(this)\n this.getIgnoreHidden = this.getIgnoreHidden.bind(this)\n this.setIgnoreHidden = this.setIgnoreHidden.bind(this)\n this.getClusterClass = this.getClusterClass.bind(this)\n this.setClusterClass = this.setClusterClass.bind(this)\n this.getTotalMarkers = this.getTotalMarkers.bind(this)\n this.getZoomOnClick = this.getZoomOnClick.bind(this)\n this.setZoomOnClick = this.setZoomOnClick.bind(this)\n this.getBatchSizeIE = this.getBatchSizeIE.bind(this)\n this.setBatchSizeIE = this.setBatchSizeIE.bind(this)\n this.createClusters = this.createClusters.bind(this)\n this.onZoomChanged = this.onZoomChanged.bind(this)\n this.getImageSizes = this.getImageSizes.bind(this)\n this.setImageSizes = this.setImageSizes.bind(this)\n this.getCalculator = this.getCalculator.bind(this)\n this.setCalculator = this.setCalculator.bind(this)\n this.removeMarkers = this.removeMarkers.bind(this)\n this.resetViewport = this.resetViewport.bind(this)\n this.getImagePath = this.getImagePath.bind(this)\n this.setImagePath = this.setImagePath.bind(this)\n this.pushMarkerTo = this.pushMarkerTo.bind(this)\n this.removeMarker = this.removeMarker.bind(this)\n this.clearMarkers = this.clearMarkers.bind(this)\n this.setupStyles = this.setupStyles.bind(this)\n this.getGridSize = this.getGridSize.bind(this)\n this.setGridSize = this.setGridSize.bind(this)\n this.getClusters = this.getClusters.bind(this)\n this.getMaxZoom = this.getMaxZoom.bind(this)\n this.setMaxZoom = this.setMaxZoom.bind(this)\n this.getMarkers = this.getMarkers.bind(this)\n this.addMarkers = this.addMarkers.bind(this)\n this.getStyles = this.getStyles.bind(this)\n this.setStyles = this.setStyles.bind(this)\n this.addMarker = this.addMarker.bind(this)\n this.onRemove = this.onRemove.bind(this)\n this.getTitle = this.getTitle.bind(this)\n this.setTitle = this.setTitle.bind(this)\n this.repaint = this.repaint.bind(this)\n this.onIdle = this.onIdle.bind(this)\n this.redraw = this.redraw.bind(this)\n this.onAdd = this.onAdd.bind(this)\n this.draw = this.draw.bind(this)\n\n this.extend = this.extend.bind(this)\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 (typeof optOptions.zoomOnClick !== 'undefined') {\n this.zoomOnClick = optOptions.zoomOnClick\n }\n\n this.averageCenter = false\n\n if (typeof optOptions.averageCenter !== 'undefined') {\n this.averageCenter = optOptions.averageCenter\n }\n\n this.ignoreHidden = false\n\n if (typeof optOptions.ignoreHidden !== 'undefined') {\n this.ignoreHidden = optOptions.ignoreHidden\n }\n\n this.enableRetinaIcons = false\n\n if (typeof 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 as unknown as google.maps.OverlayView).setMap(map) // Note: this causes onAdd to be called\n }\n\n onZoomChanged(): void {\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 as unknown as google.maps.OverlayView).getMap()?.getZoom() === ((this as unknown as google.maps.OverlayView).get('minZoom') || 0) ||\n (this as unknown as google.maps.OverlayView).getMap()?.getZoom() === (this as unknown as google.maps.OverlayView).get('maxZoom')\n ) {\n google.maps.event.trigger(this, 'idle')\n }\n }\n\n onIdle(): void {\n this.redraw()\n }\n\n onAdd(): void {\n const map = (this as unknown as google.maps.OverlayView).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(): void {\n // Put all the managed markers back on the map:\n for (const marker of this.markers) {\n if (marker.getMap() !== this.activeMap) {\n marker.setMap(this.activeMap)\n }\n }\n\n // Remove all clusters:\n for (const cluster of this.clusters) {\n cluster.remove()\n }\n\n this.clusters = []\n\n // Remove map event listeners:\n for (const listener of this.listeners) {\n google.maps.event.removeListener(listener)\n }\n\n this.listeners = []\n\n this.activeMap = null\n\n this.ready = false\n }\n\n draw(): void { return }\n\n getMap(): null { return null }\n\n getPanes(): null { return null }\n\n getProjection() {\n return {\n fromContainerPixelToLatLng(): null { return null },\n fromDivPixelToLatLng(): null { return null},\n fromLatLngToContainerPixel(): null { return null},\n fromLatLngToDivPixel(): null { return null},\n getVisibleRegion(): null { return null },\n getWorldWidth(): number { return 0 }\n }\n }\n\n setMap(): void { return }\n\n addListener() {\n return {\n remove() { return }\n }\n }\n\n bindTo(): void { return }\n\n get(): void { return }\n\n notify(): void { return }\n\n set(): void { return }\n setValues(): void { return }\n unbind(): void { return }\n unbindAll(): void { return }\n\n setupStyles(): void {\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] || 0,\n width: this.imageSizes[i] || 0,\n })\n }\n }\n\n fitMapToMarkers(): void {\n const markers = this.getMarkers()\n\n const bounds = new google.maps.LatLngBounds()\n\n for (const marker of markers) {\n const position = marker.getPosition()\n\n if (position) {\n bounds.extend(position)\n }\n }\n\n const map = (this as unknown as google.maps.OverlayView).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 const marker = markers[key]\n\n if (marker) {\n this.pushMarkerTo(marker)\n }\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 (const marker of markers) {\n removed = removed || this.removeMarker_(marker)\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 (const oldCluster of oldClusters) {\n oldCluster.remove()\n }\n }, 0)\n }\n\n getExtendedBounds(bounds: google.maps.LatLngBounds): google.maps.LatLngBounds {\n const projection = (this as unknown as google.maps.OverlayView).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 (const cluster of this.clusters) {\n cluster.remove()\n }\n\n this.clusters = []\n\n // Reset the markers to not be added and to be removed from the map.\n for (const marker of this.markers) {\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 (const clusterElement of this.clusters) {\n cluster = clusterElement\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 // @ts-ignore\n delete this.timerRefStatic\n }\n }\n\n const map = (this as unknown as google.maps.OverlayView).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 && !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 (const cluster of this.clusters) {\n cluster.updateIcon()\n }\n }\n }\n\n extend<A extends typeof Clusterer | typeof ClusterIcon>(obj1: A, obj2: typeof google.maps.OverlayView): A {\n return function applyExtend(this: A, object: typeof google.maps.OverlayView): A {\n for (const property in object.prototype) {\n\n const prop = property as keyof google.maps.OverlayView & (string & {})\n\n // @ts-ignore\n this.prototype[prop] = object.prototype[prop]\n }\n\n return this\n }.apply<A, [typeof google.maps.OverlayView], A>(obj1, [obj2])\n }\n}\n"],"names":["ClusterIcon","cluster","styles","getClusterer","extend","google","maps","OverlayView","this","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","bind","onMouseDown","onClick","onMouseOver","onMouseOut","onAdd","onRemove","draw","hide","show","useStyle","setCenter","getPosFromLatLng","prototype","event","markerClusterer_1","trigger","getZoomOnClick","maxZoom_1","getMaxZoom","bounds_1","getBounds","map","fitBounds","window","setTimeout","zoom","getZoom","setZoom","cancelBubble","stopPropagation","document","createElement","_a","getPanes","overlayMouseTarget","appendChild","addListener","addEventListener","parentNode","removeListener","removeEventListener","removeChild","clearTimeout","pos","style","top","concat","y","left","x","display","divTitle","title","getTitle","bp","split","spriteH","parseInt","replace","spriteV","_b","setAttribute","img","alt","src","enableRetinaIcons","clip","textElm","_c","text","innerText","_d","_e","html","innerHTML","_f","getStyles","Math","min","length","max","index","latlng","getProjection","fromLatLngToDivPixel","Cluster","markerClusterer","gridSize","getGridSize","minClusterSize","getMinimumClusterSize","averageCenter","getAverageCenter","markers","bounds","clusterIcon","getSize","getMarkers","getCenter","remove","addMarker","isMarkerInClusterBounds","calculateBounds","updateIcon","isMarkerAlreadyAdded","LatLngBounds","_i","markers_1","position","getPosition","marker","length_1","LatLng","lat","lng","isAdded","push","mCount","maxZoom","contains","getExtendedBounds","getCalculator","includes","i","CALCULATOR","numStyles","count","numberOfDigits","toString","IMAGE_SIZES","Clusterer","optMarkers","optOptions","setMinimumClusterSize","getEnableRetinaIcons","setEnableRetinaIcons","addToClosestCluster","getImageExtension","setImageExtension","setAverageCenter","getTotalClusters","fitMapToMarkers","getIgnoreHidden","setIgnoreHidden","setClusterClass","getTotalMarkers","setZoomOnClick","getBatchSizeIE","setBatchSizeIE","createClusters","onZoomChanged","getImageSizes","setImageSizes","setCalculator","removeMarkers","resetViewport","getImagePath","setImagePath","pushMarkerTo","removeMarker","clearMarkers","setupStyles","setGridSize","getClusters","setMaxZoom","addMarkers","setStyles","setTitle","repaint","onIdle","redraw","clusters","listeners","activeMap","ready","minimumClusterSize","zoomOnClick","ignoreHidden","imagePath","imageExtension","imageSizes","calculator","batchSize","batchSizeIE","clusterClass","navigator","userAgent","toLowerCase","indexOf","timerRefStatic","get","listener","fromContainerPixelToLatLng","fromDivPixelToLatLng","fromLatLngToContainerPixel","getVisibleRegion","getWorldWidth","bindTo","notify","set","setValues","unbind","unbindAll","optNoDraw","key","Object","hasOwnProperty","call","_this","getDraggable","removeMarker_","splice","removed","markers_2","oldClusters","slice","oldClusters_1","projection","trPix","getNorthEast","blPix","getSouthWest","point1","point2","optHide","distanceBetweenPoints","p1","p2","dLat","PI","dLon","a","sin","cos","atan2","sqrt","isMarkerInBounds","distance","clusterToAddTo","d","iFirst","mapBounds","extendedMapBounds","iLast","getVisible","obj1","obj2","object","property","prop","apply"],"mappings":"uPAKA,IAAAA,EAAA,WA2BE,SAAYA,EAAAC,EAAkBC,GAC5BD,EAAQE,eAAeC,OAAOJ,EAAaK,OAAOC,KAAKC,aAEvDC,KAAKP,QAAUA,EAEfO,KAAKC,iBAAmBD,KAAKP,QAAQE,eAAeO,kBAEpDF,KAAKG,UAAYH,KAAKC,iBAEtBD,KAAKN,OAASA,EAEdM,KAAKI,YAASC,EAEdL,KAAKM,IAAM,KAEXN,KAAKO,KAAO,KAEZP,KAAKQ,SAAU,EAEfR,KAAKS,sBAAwB,KAE7BT,KAAKU,IAAM,GAEXV,KAAKW,OAAS,EACdX,KAAKY,MAAQ,EAEbZ,KAAKa,WAAa,CAAC,EAAG,GACtBb,KAAKc,WAAa,CAAC,EAAG,GAEtBd,KAAKe,UAAY,QACjBf,KAAKgB,SAAW,GAChBhB,KAAKiB,eAAiB,OACtBjB,KAAK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7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-google-maps/marker-clusterer",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"description": "Marker Clusterer for React.js Google Maps API",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -41,6 +41,16 @@
|
|
|
41
41
|
"addons/MarkerClusterer",
|
|
42
42
|
"Marker"
|
|
43
43
|
],
|
|
44
|
+
"scripts": {
|
|
45
|
+
"prebuild": "rimraf dist",
|
|
46
|
+
"build": "rollup --config",
|
|
47
|
+
"clean": "rimraf ./package-lock.json ./bun.lockb ./node_modules/ && bun install",
|
|
48
|
+
"lint": "bunx oxlint ./src/**/*.{ts,tsx}",
|
|
49
|
+
"pub": "npm publish .",
|
|
50
|
+
"tc": "tsc -p ./tsconfig.json --noEmit --traceResolution",
|
|
51
|
+
"test": "jest",
|
|
52
|
+
"prepublishOnly": "bun run build"
|
|
53
|
+
},
|
|
44
54
|
"devDependencies": {
|
|
45
55
|
"@rollup/plugin-commonjs": "28.0.0",
|
|
46
56
|
"@rollup/plugin-node-resolve": "15.3.0",
|
|
@@ -55,14 +65,5 @@
|
|
|
55
65
|
"@rollup/plugin-terser": "0.4.4",
|
|
56
66
|
"typescript": "5.6.3"
|
|
57
67
|
},
|
|
58
|
-
"gitHead": "80167ddcc3d8e356dbf0b0c3a6292c6a3a989f83"
|
|
59
|
-
|
|
60
|
-
"prebuild": "rimraf dist",
|
|
61
|
-
"build": "rollup --config",
|
|
62
|
-
"clean": "rimraf ./package-lock.json ./pnpm-lock.yml ./node_modules/ && pnpm install",
|
|
63
|
-
"lint": "pnpx eslint ./src/**/*.{ts,tsx}",
|
|
64
|
-
"pub": "pnpm publish .",
|
|
65
|
-
"tc": "tsc -p ./tsconfig.json --noEmit --traceResolution",
|
|
66
|
-
"test": "jest"
|
|
67
|
-
}
|
|
68
|
-
}
|
|
68
|
+
"gitHead": "80167ddcc3d8e356dbf0b0c3a6292c6a3a989f83"
|
|
69
|
+
}
|
package/src/Cluster.tsx
CHANGED
package/src/ClusterIcon.tsx
CHANGED
package/src/Clusterer.tsx
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/* global google */
|
|
2
|
-
/* eslint-disable filenames/match-regex */
|
|
3
2
|
import { Cluster } from './Cluster'
|
|
4
3
|
import type { ClusterIcon } from './ClusterIcon'
|
|
5
4
|
|
|
@@ -145,25 +144,25 @@ export class Clusterer implements google.maps.OverlayView {
|
|
|
145
144
|
|
|
146
145
|
this.zoomOnClick = true
|
|
147
146
|
|
|
148
|
-
if (optOptions.zoomOnClick !== undefined) {
|
|
147
|
+
if (typeof optOptions.zoomOnClick !== 'undefined') {
|
|
149
148
|
this.zoomOnClick = optOptions.zoomOnClick
|
|
150
149
|
}
|
|
151
150
|
|
|
152
151
|
this.averageCenter = false
|
|
153
152
|
|
|
154
|
-
if (optOptions.averageCenter !== undefined) {
|
|
153
|
+
if (typeof optOptions.averageCenter !== 'undefined') {
|
|
155
154
|
this.averageCenter = optOptions.averageCenter
|
|
156
155
|
}
|
|
157
156
|
|
|
158
157
|
this.ignoreHidden = false
|
|
159
158
|
|
|
160
|
-
if (optOptions.ignoreHidden !== undefined) {
|
|
159
|
+
if (typeof optOptions.ignoreHidden !== 'undefined') {
|
|
161
160
|
this.ignoreHidden = optOptions.ignoreHidden
|
|
162
161
|
}
|
|
163
162
|
|
|
164
163
|
this.enableRetinaIcons = false
|
|
165
164
|
|
|
166
|
-
if (optOptions.enableRetinaIcons !== undefined) {
|
|
165
|
+
if (typeof optOptions.enableRetinaIcons !== 'undefined') {
|
|
167
166
|
this.enableRetinaIcons = optOptions.enableRetinaIcons
|
|
168
167
|
}
|
|
169
168
|
this.imagePath = optOptions.imagePath || IMAGE_PATH
|
|
@@ -744,7 +743,6 @@ export class Clusterer implements google.maps.OverlayView {
|
|
|
744
743
|
if (this.timerRefStatic !== null) {
|
|
745
744
|
window.clearTimeout(this.timerRefStatic)
|
|
746
745
|
|
|
747
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
748
746
|
// @ts-ignore
|
|
749
747
|
delete this.timerRefStatic
|
|
750
748
|
}
|
|
@@ -810,10 +808,8 @@ export class Clusterer implements google.maps.OverlayView {
|
|
|
810
808
|
return function applyExtend(this: A, object: typeof google.maps.OverlayView): A {
|
|
811
809
|
for (const property in object.prototype) {
|
|
812
810
|
|
|
813
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
814
811
|
const prop = property as keyof google.maps.OverlayView & (string & {})
|
|
815
812
|
|
|
816
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
817
813
|
// @ts-ignore
|
|
818
814
|
this.prototype[prop] = object.prototype[prop]
|
|
819
815
|
}
|
package/src/index.ts
CHANGED
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 Alexey Lyakhov
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|