@react-google-maps/marker-clusterer 2.5.0 → 2.6.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 +5 -3
- package/dist/cjs.js.map +1 -1
- package/dist/cjs.min.js +1 -1
- package/dist/cjs.min.js.map +1 -1
- package/dist/esm.js +5 -3
- package/dist/esm.js.map +1 -1
- package/dist/esm.min.js +1 -1
- package/dist/esm.min.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/umd.js +7 -5
- package/dist/umd.js.map +1 -1
- package/dist/umd.min.js +1 -1
- package/dist/umd.min.js.map +1 -1
- package/package.json +18 -19
- package/src/ClusterIcon.tsx +6 -5
package/dist/cjs.min.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cjs.min.js","sources":["../src/ClusterIcon.tsx","../src/Cluster.tsx","../src/Clusterer.tsx"],"sourcesContent":["/* global google */\n/* eslint-disable filenames/match-regex */\nimport { Cluster } from './Cluster'\n\nimport { ClusterIconStyle, ClusterIconInfo } from './types'\n\nexport class ClusterIcon {\n cluster: Cluster\n className: 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\n boundsChangedListener: google.maps.MapsEventListener | null\n\n constructor(cluster: Cluster, styles: ClusterIconStyle[]) {\n cluster.getClusterer().extend(ClusterIcon, google.maps.OverlayView)\n this.cluster = cluster\n this.className = this.cluster.getClusterer().getClusterClass()\n this.styles = styles\n this.center = undefined\n this.div = null\n this.sums = null\n this.visible = false\n this.boundsChangedListener = null\n this.url = ''\n this.height = 0\n this.width = 0\n this.anchorText = [0, 0]\n this.anchorIcon = [0, 0]\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 this.backgroundPosition = '0 0'\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.setMap(cluster.getMap()) // Note: this causes onAdd to be called\n }\n\n onAdd() {\n let cMouseDownInCluster: boolean\n let cDraggingMapByCluster: boolean\n\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-ignore\n // @ts-ignore\n this.getPanes().overlayMouseTarget.appendChild(this.div)\n\n // Fix for Issue 157\n this.boundsChangedListener = google.maps.event.addListener(\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap(),\n 'boundschanged',\n function boundsChanged() {\n cDraggingMapByCluster = cMouseDownInCluster\n }\n )\n\n google.maps.event.addDomListener(this.div, 'mousedown', function onMouseDown() {\n cMouseDownInCluster = true\n cDraggingMapByCluster = false\n })\n\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n google.maps.event.addDomListener(\n this.div,\n 'click',\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n (event: Event) => {\n cMouseDownInCluster = false\n\n if (!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-ignore\n // @ts-ignore\n markerClusterer.getMap().fitBounds(bounds)\n\n // There is a fix for Issue 170 here:\n setTimeout(function timeout() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n markerClusterer.getMap().fitBounds(bounds)\n\n // Don't zoom beyond the max zoom level\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n if (maxZoom !== null && markerClusterer.getMap().getZoom() > maxZoom) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\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\n google.maps.event.addDomListener(\n this.div,\n 'mouseover',\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n () => {\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(this.cluster.getClusterer(), 'mouseover', this.cluster)\n }\n )\n\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n google.maps.event.addDomListener(\n this.div,\n 'mouseout',\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n () => {\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(this.cluster.getClusterer(), 'mouseout', this.cluster)\n }\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 google.maps.event.clearInstanceListeners(this.div)\n\n this.div.parentNode.removeChild(this.div)\n\n this.div = null\n }\n }\n\n draw() {\n if (this.visible && this.div !== null && this.center) {\n const { x, y } = this.getPosFromLatLng(this.center)\n\n this.div.style.top = y + 'px'\n this.div.style.left = x + 'px'\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 img = '',\n 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\n const spriteV = parseInt(bp[1].replace(/^\\s+|\\s+$/g, ''), 10)\n\n const pos = this.getPosFromLatLng(this.center)\n\n if (this.sums === null || typeof this.sums.title === 'undefined' || this.sums.title === '') {\n divTitle = this.cluster.getClusterer().getTitle()\n } else {\n divTitle = this.sums.title\n }\n\n this.div.style.cssText = this.createCss(pos)\n\n img =\n \"<img alt='\" +\n divTitle +\n \"' src='\" +\n this.url +\n \"' style='position: absolute; top: \" +\n spriteV +\n 'px; left: ' +\n spriteH +\n 'px; '\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n //@ts-ignore\n if (!this.cluster.getClusterer().enableRetinaIcons) {\n img +=\n 'clip: rect(' +\n -1 * spriteV +\n 'px, ' +\n (-1 * spriteH + this.width) +\n 'px, ' +\n (-1 * spriteV + this.height) +\n 'px, ' +\n -1 * spriteH +\n 'px);'\n }\n\n img += \"'>\"\n\n this.div.innerHTML =\n img +\n \"<div style='\" +\n 'position: absolute;' +\n 'top: ' +\n this.anchorText[0] +\n 'px;' +\n 'left: ' +\n this.anchorText[1] +\n 'px;' +\n 'color: ' +\n this.textColor +\n ';' +\n 'font-size: ' +\n this.textSize +\n 'px;' +\n 'font-family: ' +\n this.fontFamily +\n ';' +\n 'font-weight: ' +\n this.fontWeight +\n ';' +\n 'font-style: ' +\n this.fontStyle +\n ';' +\n 'text-decoration: ' +\n this.textDecoration +\n ';' +\n 'text-align: center;' +\n 'width: ' +\n this.width +\n 'px;' +\n 'line-height:' +\n this.height +\n 'px;' +\n \"'>\" +\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.sums.text +\n '</div>'\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 style = this.styles[Math.min(this.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.className} ${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 createCss(pos: google.maps.Point): string {\n const style = []\n\n style.push('cursor: pointer;')\n\n style.push('position: absolute; top: ' + pos.y + 'px; left: ' + pos.x + 'px;')\n\n style.push('width: ' + this.width + 'px; height: ' + this.height + 'px;')\n\n return style.join('')\n }\n\n getPosFromLatLng(latlng: google.maps.LatLng): google.maps.Point {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n const pos = this.getProjection().fromLatLngToDivPixel(latlng)\n\n pos.x -= this.anchorIcon[1]\n\n pos.y -= this.anchorIcon[0]\n\n // pos.x = pos.x\n\n // pos.y = pos.y\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 // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\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-ignore\n // @ts-ignore\n this.clusterIcon.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 (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 } else {\n for (let i = 0; i < this.markers.length; i++) {\n if (marker === this.markers[i]) {\n return true\n }\n }\n }\n\n return false\n }\n}\n","/* global google */\n/* eslint-disable filenames/match-regex */\nimport { Cluster } from './Cluster'\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: 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 {\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.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-ignore\n // @ts-ignore\n this.setMap(map) // Note: this causes onAdd to be called\n }\n\n onAdd() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.activeMap = this.getMap()\n\n this.ready = true\n\n this.repaint()\n\n // Add the map event listeners\n this.listeners = [\n google.maps.event.addListener(\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap(),\n 'zoom_changed',\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n () => {\n this.resetViewport(false)\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 // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap().getZoom() === (this.get('minZoom') || 0) ||\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap().getZoom() === this.get('maxZoom')\n ) {\n google.maps.event.trigger(this, 'idle')\n }\n }\n ),\n google.maps.event.addListener(\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap(),\n 'idle',\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n () => {\n this.redraw()\n }\n ),\n ]\n }\n\n // eslint-disable-next-line @getify/proper-arrows/this\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-ignore\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 (markers.hasOwnProperty(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 // eslint-disable-next-line @getify/proper-arrows/name, @getify/proper-arrows/this\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-ignore\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 trPix.x += this.gridSize\n trPix.y -= this.gridSize\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 blPix.x -= this.gridSize\n blPix.y += this.gridSize\n\n // Extend the bounds to contain the new bounds.\n bounds.extend(\n // Convert the pixel points back to LatLng nw\n projection.fromDivPixelToLatLng(trPix)\n )\n\n bounds.extend(\n // Convert the pixel points back to LatLng sw\n projection.fromDivPixelToLatLng(blPix)\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 // @ts-ignore\n delete this.timerRefStatic\n }\n }\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-ignore\n // @ts-ignore\n this.getMap().getZoom() > 3\n ? new google.maps.LatLngBounds(\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap()\n .getBounds()\n .getSouthWest(),\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap()\n .getBounds()\n .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 bounds = 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, bounds)) {\n if (!this.ignoreHidden || (this.ignoreHidden && marker.getVisible())) {\n this.addToClosestCluster(marker)\n }\n }\n }\n\n if (iLast < this.markers.length) {\n this.timerRefStatic = window.setTimeout(\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\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(obj1: any, obj2: any): any {\n return function applyExtend(object: any) {\n // eslint-disable-next-line guard-for-in\n for (const property in object.prototype) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.prototype[property] = object.prototype[property]\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n return this\n }.apply(obj1, [obj2])\n }\n}\n"],"names":["cluster","styles","getClusterer","extend","ClusterIcon","google","maps","OverlayView","this","className","getClusterClass","center","undefined","div","sums","visible","boundsChangedListener","url","height","width","anchorText","anchorIcon","textColor","textSize","textDecoration","fontWeight","fontStyle","fontFamily","backgroundPosition","setMap","getMap","cMouseDownInCluster","cDraggingMapByCluster","document","createElement","show","getPanes","overlayMouseTarget","appendChild","event","addListener","addDomListener","markerClusterer_1","_this","trigger","getZoomOnClick","maxZoom_1","getMaxZoom","bounds_1","getBounds","fitBounds","setTimeout","getZoom","setZoom","cancelBubble","stopPropagation","parentNode","hide","removeListener","clearInstanceListeners","removeChild","_a","getPosFromLatLng","x","y","style","top","left","display","img","divTitle","bp","split","spriteH","parseInt","replace","spriteV","pos","title","getTitle","cssText","createCss","enableRetinaIcons","innerHTML","text","Math","min","length","max","index","push","join","latlng","getProjection","fromLatLngToDivPixel","markerClusterer","map","gridSize","getGridSize","minClusterSize","getMinimumClusterSize","averageCenter","getAverageCenter","markers","bounds","clusterIcon","getStyles","Cluster","LatLngBounds","getMarkers","i","position","getPosition","marker","isMarkerAlreadyAdded","length_1","LatLng","lat","lng","calculateBounds","isAdded","mCount","maxZoom","zoom","contains","getExtendedBounds","setCenter","useStyle","getCalculator","includes","CALCULATOR","numStyles","count","numberOfDigits","toString","IMAGE_SIZES","optMarkers","optOptions","Clusterer","clusters","listeners","activeMap","ready","minimumClusterSize","zoomOnClick","ignoreHidden","imagePath","imageExtension","imageSizes","calculator","batchSize","batchSizeIE","clusterClass","navigator","userAgent","toLowerCase","indexOf","timerRefStatic","setupStyles","addMarkers","repaint","resetViewport","get","redraw","remove","optNoDraw","pushMarkerTo","key","hasOwnProperty","getDraggable","splice","removed","removeMarker_","oldClusters","slice","projection","trPix","getNorthEast","blPix","getSouthWest","fromDivPixelToLatLng","createClusters","optHide","p1","p2","dLat","PI","dLon","a","sin","cos","atan2","sqrt","distance","clusterToAddTo","getCenter","d","distanceBetweenPoints","isMarkerInClusterBounds","addMarker","iFirst","window","clearTimeout","mapBounds","iLast","isMarkerInBounds","getVisible","addToClosestCluster","updateIcon","obj1","obj2","object","property","prototype","apply"],"mappings":"qFA6BE,WAAYA,EAAkBC,GAC5BD,EAAQE,eAAeC,OAAOC,EAAaC,OAAOC,KAAKC,aACvDC,KAAKR,QAAUA,EACfQ,KAAKC,UAAYD,KAAKR,QAAQE,eAAeQ,kBAC7CF,KAAKP,OAASA,EACdO,KAAKG,YAASC,EACdJ,KAAKK,IAAM,KACXL,KAAKM,KAAO,KACZN,KAAKO,SAAU,EACfP,KAAKQ,sBAAwB,KAC7BR,KAAKS,IAAM,GACXT,KAAKU,OAAS,EACdV,KAAKW,MAAQ,EACbX,KAAKY,WAAa,CAAC,EAAG,GACtBZ,KAAKa,WAAa,CAAC,EAAG,GACtBb,KAAKc,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"}
|
|
1
|
+
{"version":3,"file":"cjs.min.js","sources":["../src/ClusterIcon.tsx","../src/Cluster.tsx","../src/Clusterer.tsx"],"sourcesContent":["/* global google */\n/* eslint-disable filenames/match-regex */\nimport { Cluster } from './Cluster'\n\nimport { 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[]\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\n boundsChangedListener: google.maps.MapsEventListener | null\n\n constructor(cluster: Cluster, styles: ClusterIconStyle[]) {\n cluster.getClusterer().extend(ClusterIcon, google.maps.OverlayView)\n this.cluster = cluster\n this.clusterClassName = this.cluster.getClusterer().getClusterClass()\n this.className = this.clusterClassName\n this.styles = styles\n this.center = undefined\n this.div = null\n this.sums = null\n this.visible = false\n this.boundsChangedListener = null\n this.url = ''\n this.height = 0\n this.width = 0\n this.anchorText = [0, 0]\n this.anchorIcon = [0, 0]\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 this.backgroundPosition = '0 0'\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.setMap(cluster.getMap()) // Note: this causes onAdd to be called\n }\n\n onAdd() {\n let cMouseDownInCluster: boolean\n let cDraggingMapByCluster: boolean\n\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-ignore\n // @ts-ignore\n this.getPanes().overlayMouseTarget.appendChild(this.div)\n\n // Fix for Issue 157\n this.boundsChangedListener = google.maps.event.addListener(\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap(),\n 'boundschanged',\n function boundsChanged() {\n cDraggingMapByCluster = cMouseDownInCluster\n }\n )\n\n google.maps.event.addDomListener(this.div, 'mousedown', function onMouseDown() {\n cMouseDownInCluster = true\n cDraggingMapByCluster = false\n })\n\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n google.maps.event.addDomListener(\n this.div,\n 'click',\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n (event: Event) => {\n cMouseDownInCluster = false\n\n if (!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-ignore\n // @ts-ignore\n markerClusterer.getMap().fitBounds(bounds)\n\n // There is a fix for Issue 170 here:\n setTimeout(function timeout() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n markerClusterer.getMap().fitBounds(bounds)\n\n // Don't zoom beyond the max zoom level\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n if (maxZoom !== null && markerClusterer.getMap().getZoom() > maxZoom) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\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\n google.maps.event.addDomListener(\n this.div,\n 'mouseover',\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n () => {\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(this.cluster.getClusterer(), 'mouseover', this.cluster)\n }\n )\n\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n google.maps.event.addDomListener(\n this.div,\n 'mouseout',\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n () => {\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(this.cluster.getClusterer(), 'mouseout', this.cluster)\n }\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 google.maps.event.clearInstanceListeners(this.div)\n\n this.div.parentNode.removeChild(this.div)\n\n this.div = null\n }\n }\n\n draw() {\n if (this.visible && this.div !== null && this.center) {\n const { x, y } = this.getPosFromLatLng(this.center)\n\n this.div.style.top = y + 'px'\n this.div.style.left = x + 'px'\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 img = '',\n 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\n const spriteV = parseInt(bp[1].replace(/^\\s+|\\s+$/g, ''), 10)\n\n const pos = this.getPosFromLatLng(this.center)\n\n if (this.sums === null || typeof this.sums.title === 'undefined' || this.sums.title === '') {\n divTitle = this.cluster.getClusterer().getTitle()\n } else {\n divTitle = this.sums.title\n }\n\n this.div.style.cssText = this.createCss(pos)\n\n img =\n \"<img alt='\" +\n divTitle +\n \"' src='\" +\n this.url +\n \"' style='position: absolute; top: \" +\n spriteV +\n 'px; left: ' +\n spriteH +\n 'px; '\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n //@ts-ignore\n if (!this.cluster.getClusterer().enableRetinaIcons) {\n img +=\n 'clip: rect(' +\n -1 * spriteV +\n 'px, ' +\n (-1 * spriteH + this.width) +\n 'px, ' +\n (-1 * spriteV + this.height) +\n 'px, ' +\n -1 * spriteH +\n 'px);'\n }\n\n img += \"'>\"\n\n this.div.innerHTML =\n img +\n \"<div style='\" +\n 'position: absolute;' +\n 'top: ' +\n this.anchorText[0] +\n 'px;' +\n 'left: ' +\n this.anchorText[1] +\n 'px;' +\n 'color: ' +\n this.textColor +\n ';' +\n 'font-size: ' +\n this.textSize +\n 'px;' +\n 'font-family: ' +\n this.fontFamily +\n ';' +\n 'font-weight: ' +\n this.fontWeight +\n ';' +\n 'font-style: ' +\n this.fontStyle +\n ';' +\n 'text-decoration: ' +\n this.textDecoration +\n ';' +\n 'text-align: center;' +\n 'width: ' +\n this.width +\n 'px;' +\n 'line-height:' +\n this.height +\n 'px;' +\n \"'>\" +\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.sums.text +\n '</div>'\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 const styles = this.cluster.getClusterer().getStyles()\n const style = 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) 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 createCss(pos: google.maps.Point): string {\n const style = []\n\n style.push('cursor: pointer;')\n\n style.push('position: absolute; top: ' + pos.y + 'px; left: ' + pos.x + 'px;')\n\n style.push('width: ' + this.width + 'px; height: ' + this.height + 'px;')\n\n return style.join('')\n }\n\n getPosFromLatLng(latlng: google.maps.LatLng): google.maps.Point {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n const pos = this.getProjection().fromLatLngToDivPixel(latlng)\n\n pos.x -= this.anchorIcon[1]\n\n pos.y -= this.anchorIcon[0]\n\n // pos.x = pos.x\n\n // pos.y = pos.y\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 // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\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-ignore\n // @ts-ignore\n this.clusterIcon.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 (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 } else {\n for (let i = 0; i < this.markers.length; i++) {\n if (marker === this.markers[i]) {\n return true\n }\n }\n }\n\n return false\n }\n}\n","/* global google */\n/* eslint-disable filenames/match-regex */\nimport { Cluster } from './Cluster'\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: 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 {\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.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-ignore\n // @ts-ignore\n this.setMap(map) // Note: this causes onAdd to be called\n }\n\n onAdd() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.activeMap = this.getMap()\n\n this.ready = true\n\n this.repaint()\n\n // Add the map event listeners\n this.listeners = [\n google.maps.event.addListener(\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap(),\n 'zoom_changed',\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n () => {\n this.resetViewport(false)\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 // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap().getZoom() === (this.get('minZoom') || 0) ||\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap().getZoom() === this.get('maxZoom')\n ) {\n google.maps.event.trigger(this, 'idle')\n }\n }\n ),\n google.maps.event.addListener(\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap(),\n 'idle',\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n () => {\n this.redraw()\n }\n ),\n ]\n }\n\n // eslint-disable-next-line @getify/proper-arrows/this\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-ignore\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 (markers.hasOwnProperty(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 // eslint-disable-next-line @getify/proper-arrows/name, @getify/proper-arrows/this\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-ignore\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 trPix.x += this.gridSize\n trPix.y -= this.gridSize\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 blPix.x -= this.gridSize\n blPix.y += this.gridSize\n\n // Extend the bounds to contain the new bounds.\n bounds.extend(\n // Convert the pixel points back to LatLng nw\n projection.fromDivPixelToLatLng(trPix)\n )\n\n bounds.extend(\n // Convert the pixel points back to LatLng sw\n projection.fromDivPixelToLatLng(blPix)\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 // @ts-ignore\n delete this.timerRefStatic\n }\n }\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-ignore\n // @ts-ignore\n this.getMap().getZoom() > 3\n ? new google.maps.LatLngBounds(\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap()\n .getBounds()\n .getSouthWest(),\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap()\n .getBounds()\n .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 bounds = 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, bounds)) {\n if (!this.ignoreHidden || (this.ignoreHidden && marker.getVisible())) {\n this.addToClosestCluster(marker)\n }\n }\n }\n\n if (iLast < this.markers.length) {\n this.timerRefStatic = window.setTimeout(\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\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(obj1: any, obj2: any): any {\n return function applyExtend(object: any) {\n // eslint-disable-next-line guard-for-in\n for (const property in object.prototype) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.prototype[property] = object.prototype[property]\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n return this\n }.apply(obj1, [obj2])\n }\n}\n"],"names":["cluster","styles","getClusterer","extend","ClusterIcon","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","setMap","getMap","cMouseDownInCluster","cDraggingMapByCluster","document","createElement","show","getPanes","overlayMouseTarget","appendChild","event","addListener","addDomListener","markerClusterer_1","_this","trigger","getZoomOnClick","maxZoom_1","getMaxZoom","bounds_1","getBounds","fitBounds","setTimeout","getZoom","setZoom","cancelBubble","stopPropagation","parentNode","hide","removeListener","clearInstanceListeners","removeChild","_a","getPosFromLatLng","x","y","style","top","left","display","img","divTitle","bp","split","spriteH","parseInt","replace","spriteV","pos","title","getTitle","cssText","createCss","enableRetinaIcons","innerHTML","text","getStyles","Math","min","length","max","index","push","join","latlng","getProjection","fromLatLngToDivPixel","markerClusterer","map","gridSize","getGridSize","minClusterSize","getMinimumClusterSize","averageCenter","getAverageCenter","markers","bounds","clusterIcon","Cluster","LatLngBounds","getMarkers","i","position","getPosition","marker","isMarkerAlreadyAdded","length_1","LatLng","lat","lng","calculateBounds","isAdded","mCount","maxZoom","zoom","contains","getExtendedBounds","setCenter","useStyle","getCalculator","includes","CALCULATOR","numStyles","count","numberOfDigits","toString","IMAGE_SIZES","optMarkers","optOptions","Clusterer","clusters","listeners","activeMap","ready","minimumClusterSize","zoomOnClick","ignoreHidden","imagePath","imageExtension","imageSizes","calculator","batchSize","batchSizeIE","clusterClass","navigator","userAgent","toLowerCase","indexOf","timerRefStatic","setupStyles","addMarkers","repaint","resetViewport","get","redraw","remove","optNoDraw","pushMarkerTo","key","hasOwnProperty","getDraggable","splice","removed","removeMarker_","oldClusters","slice","projection","trPix","getNorthEast","blPix","getSouthWest","fromDivPixelToLatLng","createClusters","optHide","p1","p2","dLat","PI","dLon","a","sin","cos","atan2","sqrt","distance","clusterToAddTo","getCenter","d","distanceBetweenPoints","isMarkerInClusterBounds","addMarker","iFirst","window","clearTimeout","mapBounds","iLast","isMarkerInBounds","getVisible","addToClosestCluster","updateIcon","obj1","obj2","object","property","prototype","apply"],"mappings":"qFA8BE,WAAYA,EAAkBC,GAC5BD,EAAQE,eAAeC,OAAOC,EAAaC,OAAOC,KAAKC,aACvDC,KAAKR,QAAUA,EACfQ,KAAKC,iBAAmBD,KAAKR,QAAQE,eAAeQ,kBACpDF,KAAKG,UAAYH,KAAKC,iBACtBD,KAAKP,OAASA,EACdO,KAAKI,YAASC,EACdL,KAAKM,IAAM,KACXN,KAAKO,KAAO,KACZP,KAAKQ,SAAU,EACfR,KAAKS,sBAAwB,KAC7BT,KAAKU,IAAM,GACXV,KAAKW,OAAS,EACdX,KAAKY,MAAQ,EACbZ,KAAKa,WAAa,CAAC,EAAG,GACtBb,KAAKc,WAAa,CAAC,EAAG,GACtBd,KAAKe,UAAY,QACjBf,KAAKgB,SAAW,GAChBhB,KAAKiB,eAAiB,OACtBjB,KAAKkB,WAAa,OAClBlB,KAAKmB,UAAY,SACjBnB,KAAKoB,WAAa,mBAClBpB,KAAKqB,mBAAqB,MAG1BrB,KAAKsB,OAAO9B,EAAQ+B,UA4TxB,OAzTE3B,kBAAA,WAAA,IACM4B,EACAC,SAEJzB,KAAKM,IAAMoB,SAASC,cAAc,OAClC3B,KAAKM,IAAIH,UAAYH,KAAKG,UACtBH,KAAKQ,SACPR,KAAK4B,OAKP5B,KAAK6B,WAAWC,mBAAmBC,YAAY/B,KAAKM,KAGpDN,K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AI7K,OAAOC,KAAKuG,aACd,IAAIxG,OAAOC,KAAK+G,OAAO,mBAAoB,iBAC3C,IAAIhH,OAAOC,KAAK+G,QAAQ,kBAAmB,kBAG7CX,EAASlG,KAAKsH,kBAAkB8E,GAEhCC,EAAQtH,KAAKC,IAAIiH,EAASjM,KAAK+I,UAAW/I,KAAKiG,QAAQhB,QAEpDsB,EAAI0F,EAAQ1F,EAAI8F,EAAO9F,IAAK,CACnC,IAAMG,EAAS1G,KAAKiG,QAAQM,IAEvBG,EAAOO,SAAWjH,KAAKsM,iBAAiB5F,EAAQR,MAC9ClG,KAAK0I,cAAiB1I,KAAK0I,cAAgBhC,EAAO6F,eACrDvM,KAAKwM,oBAAoB9F,GAK/B,GAAI2F,EAAQrM,KAAKiG,QAAQhB,OACvBjF,KAAKsJ,eAAiB4C,OAAOtJ,YAE3B,WACER,EAAK0I,eAAeuB,KAEtB,OAEG,CACLrM,KAAKsJ,eAAiB,KAStBzJ,OAAOC,KAAKkC,MAAMK,QAAQrC,KAAM,gBAAiBA,MAEjD,IAASuG,EAAI,EAAGA,EAAIvG,KAAKoI,SAASnD,OAAQsB,IACxCvG,KAAKoI,SAAS7B,GAAGkG,gBAKvBtE,mBAAA,SAAOuE,EAAWC,GAChB,OAAO,SAAqBC,GAE1B,IAAK,IAAMC,KAAYD,EAAOE,UAG5B9M,KAAK8M,UAAUD,GAAYD,EAAOE,UAAUD,GAK9C,OAAO7M,MACP+M,MAAML,EAAM,CAACC"}
|
package/dist/esm.js
CHANGED
|
@@ -2,7 +2,8 @@ var ClusterIcon = /** @class */ (function () {
|
|
|
2
2
|
function ClusterIcon(cluster, styles) {
|
|
3
3
|
cluster.getClusterer().extend(ClusterIcon, google.maps.OverlayView);
|
|
4
4
|
this.cluster = cluster;
|
|
5
|
-
this.
|
|
5
|
+
this.clusterClassName = this.cluster.getClusterer().getClusterClass();
|
|
6
|
+
this.className = this.clusterClassName;
|
|
6
7
|
this.styles = styles;
|
|
7
8
|
this.center = undefined;
|
|
8
9
|
this.div = null;
|
|
@@ -229,12 +230,13 @@ var ClusterIcon = /** @class */ (function () {
|
|
|
229
230
|
};
|
|
230
231
|
ClusterIcon.prototype.useStyle = function (sums) {
|
|
231
232
|
this.sums = sums;
|
|
232
|
-
var
|
|
233
|
+
var styles = this.cluster.getClusterer().getStyles();
|
|
234
|
+
var style = styles[Math.min(styles.length - 1, Math.max(0, sums.index - 1))];
|
|
233
235
|
this.url = style.url;
|
|
234
236
|
this.height = style.height;
|
|
235
237
|
this.width = style.width;
|
|
236
238
|
if (style.className)
|
|
237
|
-
this.className = this.
|
|
239
|
+
this.className = this.clusterClassName + " " + style.className;
|
|
238
240
|
this.anchorText = style.anchorText || [0, 0];
|
|
239
241
|
this.anchorIcon = style.anchorIcon || [this.height / 2, this.width / 2];
|
|
240
242
|
this.textColor = style.textColor || 'black';
|
package/dist/esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esm.js","sources":["../src/ClusterIcon.tsx","../src/Cluster.tsx","../src/Clusterer.tsx"],"sourcesContent":["/* global google */\n/* eslint-disable filenames/match-regex */\nimport { Cluster } from './Cluster'\n\nimport { ClusterIconStyle, ClusterIconInfo } from './types'\n\nexport class ClusterIcon {\n cluster: Cluster\n className: 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\n boundsChangedListener: google.maps.MapsEventListener | null\n\n constructor(cluster: Cluster, styles: ClusterIconStyle[]) {\n cluster.getClusterer().extend(ClusterIcon, google.maps.OverlayView)\n this.cluster = cluster\n this.className = this.cluster.getClusterer().getClusterClass()\n this.styles = styles\n this.center = undefined\n this.div = null\n this.sums = null\n this.visible = false\n this.boundsChangedListener = null\n this.url = ''\n this.height = 0\n this.width = 0\n this.anchorText = [0, 0]\n this.anchorIcon = [0, 0]\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 this.backgroundPosition = '0 0'\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.setMap(cluster.getMap()) // Note: this causes onAdd to be called\n }\n\n onAdd() {\n let cMouseDownInCluster: boolean\n let cDraggingMapByCluster: boolean\n\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-ignore\n // @ts-ignore\n this.getPanes().overlayMouseTarget.appendChild(this.div)\n\n // Fix for Issue 157\n this.boundsChangedListener = google.maps.event.addListener(\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap(),\n 'boundschanged',\n function boundsChanged() {\n cDraggingMapByCluster = cMouseDownInCluster\n }\n )\n\n google.maps.event.addDomListener(this.div, 'mousedown', function onMouseDown() {\n cMouseDownInCluster = true\n cDraggingMapByCluster = false\n })\n\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n google.maps.event.addDomListener(\n this.div,\n 'click',\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n (event: Event) => {\n cMouseDownInCluster = false\n\n if (!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-ignore\n // @ts-ignore\n markerClusterer.getMap().fitBounds(bounds)\n\n // There is a fix for Issue 170 here:\n setTimeout(function timeout() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n markerClusterer.getMap().fitBounds(bounds)\n\n // Don't zoom beyond the max zoom level\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n if (maxZoom !== null && markerClusterer.getMap().getZoom() > maxZoom) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\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\n google.maps.event.addDomListener(\n this.div,\n 'mouseover',\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n () => {\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(this.cluster.getClusterer(), 'mouseover', this.cluster)\n }\n )\n\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n google.maps.event.addDomListener(\n this.div,\n 'mouseout',\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n () => {\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(this.cluster.getClusterer(), 'mouseout', this.cluster)\n }\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 google.maps.event.clearInstanceListeners(this.div)\n\n this.div.parentNode.removeChild(this.div)\n\n this.div = null\n }\n }\n\n draw() {\n if (this.visible && this.div !== null && this.center) {\n const { x, y } = this.getPosFromLatLng(this.center)\n\n this.div.style.top = y + 'px'\n this.div.style.left = x + 'px'\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 img = '',\n 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\n const spriteV = parseInt(bp[1].replace(/^\\s+|\\s+$/g, ''), 10)\n\n const pos = this.getPosFromLatLng(this.center)\n\n if (this.sums === null || typeof this.sums.title === 'undefined' || this.sums.title === '') {\n divTitle = this.cluster.getClusterer().getTitle()\n } else {\n divTitle = this.sums.title\n }\n\n this.div.style.cssText = this.createCss(pos)\n\n img =\n \"<img alt='\" +\n divTitle +\n \"' src='\" +\n this.url +\n \"' style='position: absolute; top: \" +\n spriteV +\n 'px; left: ' +\n spriteH +\n 'px; '\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n //@ts-ignore\n if (!this.cluster.getClusterer().enableRetinaIcons) {\n img +=\n 'clip: rect(' +\n -1 * spriteV +\n 'px, ' +\n (-1 * spriteH + this.width) +\n 'px, ' +\n (-1 * spriteV + this.height) +\n 'px, ' +\n -1 * spriteH +\n 'px);'\n }\n\n img += \"'>\"\n\n this.div.innerHTML =\n img +\n \"<div style='\" +\n 'position: absolute;' +\n 'top: ' +\n this.anchorText[0] +\n 'px;' +\n 'left: ' +\n this.anchorText[1] +\n 'px;' +\n 'color: ' +\n this.textColor +\n ';' +\n 'font-size: ' +\n this.textSize +\n 'px;' +\n 'font-family: ' +\n this.fontFamily +\n ';' +\n 'font-weight: ' +\n this.fontWeight +\n ';' +\n 'font-style: ' +\n this.fontStyle +\n ';' +\n 'text-decoration: ' +\n this.textDecoration +\n ';' +\n 'text-align: center;' +\n 'width: ' +\n this.width +\n 'px;' +\n 'line-height:' +\n this.height +\n 'px;' +\n \"'>\" +\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.sums.text +\n '</div>'\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 style = this.styles[Math.min(this.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.className} ${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 createCss(pos: google.maps.Point): string {\n const style = []\n\n style.push('cursor: pointer;')\n\n style.push('position: absolute; top: ' + pos.y + 'px; left: ' + pos.x + 'px;')\n\n style.push('width: ' + this.width + 'px; height: ' + this.height + 'px;')\n\n return style.join('')\n }\n\n getPosFromLatLng(latlng: google.maps.LatLng): google.maps.Point {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n const pos = this.getProjection().fromLatLngToDivPixel(latlng)\n\n pos.x -= this.anchorIcon[1]\n\n pos.y -= this.anchorIcon[0]\n\n // pos.x = pos.x\n\n // pos.y = pos.y\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 // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\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-ignore\n // @ts-ignore\n this.clusterIcon.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 (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 } else {\n for (let i = 0; i < this.markers.length; i++) {\n if (marker === this.markers[i]) {\n return true\n }\n }\n }\n\n return false\n }\n}\n","/* global google */\n/* eslint-disable filenames/match-regex */\nimport { Cluster } from './Cluster'\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: 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 {\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.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-ignore\n // @ts-ignore\n this.setMap(map) // Note: this causes onAdd to be called\n }\n\n onAdd() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.activeMap = this.getMap()\n\n this.ready = true\n\n this.repaint()\n\n // Add the map event listeners\n this.listeners = [\n google.maps.event.addListener(\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap(),\n 'zoom_changed',\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n () => {\n this.resetViewport(false)\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 // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap().getZoom() === (this.get('minZoom') || 0) ||\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap().getZoom() === this.get('maxZoom')\n ) {\n google.maps.event.trigger(this, 'idle')\n }\n }\n ),\n google.maps.event.addListener(\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap(),\n 'idle',\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n () => {\n this.redraw()\n }\n ),\n ]\n }\n\n // eslint-disable-next-line @getify/proper-arrows/this\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-ignore\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 (markers.hasOwnProperty(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 // eslint-disable-next-line @getify/proper-arrows/name, @getify/proper-arrows/this\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-ignore\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 trPix.x += this.gridSize\n trPix.y -= this.gridSize\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 blPix.x -= this.gridSize\n blPix.y += this.gridSize\n\n // Extend the bounds to contain the new bounds.\n bounds.extend(\n // Convert the pixel points back to LatLng nw\n projection.fromDivPixelToLatLng(trPix)\n )\n\n bounds.extend(\n // Convert the pixel points back to LatLng sw\n projection.fromDivPixelToLatLng(blPix)\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 // @ts-ignore\n delete this.timerRefStatic\n }\n }\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-ignore\n // @ts-ignore\n this.getMap().getZoom() > 3\n ? new google.maps.LatLngBounds(\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap()\n .getBounds()\n .getSouthWest(),\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap()\n .getBounds()\n .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 bounds = 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, bounds)) {\n if (!this.ignoreHidden || (this.ignoreHidden && marker.getVisible())) {\n this.addToClosestCluster(marker)\n }\n }\n }\n\n if (iLast < this.markers.length) {\n this.timerRefStatic = window.setTimeout(\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\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(obj1: any, obj2: any): any {\n return function applyExtend(object: any) {\n // eslint-disable-next-line guard-for-in\n for (const property in object.prototype) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.prototype[property] = object.prototype[property]\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n return this\n }.apply(obj1, [obj2])\n }\n}\n"],"names":[],"mappings":";IA6BE,qBAAY,OAAgB,EAAE,MAA0B;QACtD,OAAO,CAAC,YAAY,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;QACnE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,eAAe,EAAE,CAAA;QAC9D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAA;QACvB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAA;Q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,IAAI,CAAA;SACZ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;KACtB;IACH,gBAAC;AAAD,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"esm.js","sources":["../src/ClusterIcon.tsx","../src/Cluster.tsx","../src/Clusterer.tsx"],"sourcesContent":["/* global google */\n/* eslint-disable filenames/match-regex */\nimport { Cluster } from './Cluster'\n\nimport { 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[]\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\n boundsChangedListener: google.maps.MapsEventListener | null\n\n constructor(cluster: Cluster, styles: ClusterIconStyle[]) {\n cluster.getClusterer().extend(ClusterIcon, google.maps.OverlayView)\n this.cluster = cluster\n this.clusterClassName = this.cluster.getClusterer().getClusterClass()\n this.className = this.clusterClassName\n this.styles = styles\n this.center = undefined\n this.div = null\n this.sums = null\n this.visible = false\n this.boundsChangedListener = null\n this.url = ''\n this.height = 0\n this.width = 0\n this.anchorText = [0, 0]\n this.anchorIcon = [0, 0]\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 this.backgroundPosition = '0 0'\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.setMap(cluster.getMap()) // Note: this causes onAdd to be called\n }\n\n onAdd() {\n let cMouseDownInCluster: boolean\n let cDraggingMapByCluster: boolean\n\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-ignore\n // @ts-ignore\n this.getPanes().overlayMouseTarget.appendChild(this.div)\n\n // Fix for Issue 157\n this.boundsChangedListener = google.maps.event.addListener(\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap(),\n 'boundschanged',\n function boundsChanged() {\n cDraggingMapByCluster = cMouseDownInCluster\n }\n )\n\n google.maps.event.addDomListener(this.div, 'mousedown', function onMouseDown() {\n cMouseDownInCluster = true\n cDraggingMapByCluster = false\n })\n\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n google.maps.event.addDomListener(\n this.div,\n 'click',\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n (event: Event) => {\n cMouseDownInCluster = false\n\n if (!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-ignore\n // @ts-ignore\n markerClusterer.getMap().fitBounds(bounds)\n\n // There is a fix for Issue 170 here:\n setTimeout(function timeout() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n markerClusterer.getMap().fitBounds(bounds)\n\n // Don't zoom beyond the max zoom level\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n if (maxZoom !== null && markerClusterer.getMap().getZoom() > maxZoom) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\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\n google.maps.event.addDomListener(\n this.div,\n 'mouseover',\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n () => {\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(this.cluster.getClusterer(), 'mouseover', this.cluster)\n }\n )\n\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n google.maps.event.addDomListener(\n this.div,\n 'mouseout',\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n () => {\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(this.cluster.getClusterer(), 'mouseout', this.cluster)\n }\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 google.maps.event.clearInstanceListeners(this.div)\n\n this.div.parentNode.removeChild(this.div)\n\n this.div = null\n }\n }\n\n draw() {\n if (this.visible && this.div !== null && this.center) {\n const { x, y } = this.getPosFromLatLng(this.center)\n\n this.div.style.top = y + 'px'\n this.div.style.left = x + 'px'\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 img = '',\n 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\n const spriteV = parseInt(bp[1].replace(/^\\s+|\\s+$/g, ''), 10)\n\n const pos = this.getPosFromLatLng(this.center)\n\n if (this.sums === null || typeof this.sums.title === 'undefined' || this.sums.title === '') {\n divTitle = this.cluster.getClusterer().getTitle()\n } else {\n divTitle = this.sums.title\n }\n\n this.div.style.cssText = this.createCss(pos)\n\n img =\n \"<img alt='\" +\n divTitle +\n \"' src='\" +\n this.url +\n \"' style='position: absolute; top: \" +\n spriteV +\n 'px; left: ' +\n spriteH +\n 'px; '\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n //@ts-ignore\n if (!this.cluster.getClusterer().enableRetinaIcons) {\n img +=\n 'clip: rect(' +\n -1 * spriteV +\n 'px, ' +\n (-1 * spriteH + this.width) +\n 'px, ' +\n (-1 * spriteV + this.height) +\n 'px, ' +\n -1 * spriteH +\n 'px);'\n }\n\n img += \"'>\"\n\n this.div.innerHTML =\n img +\n \"<div style='\" +\n 'position: absolute;' +\n 'top: ' +\n this.anchorText[0] +\n 'px;' +\n 'left: ' +\n this.anchorText[1] +\n 'px;' +\n 'color: ' +\n this.textColor +\n ';' +\n 'font-size: ' +\n this.textSize +\n 'px;' +\n 'font-family: ' +\n this.fontFamily +\n ';' +\n 'font-weight: ' +\n this.fontWeight +\n ';' +\n 'font-style: ' +\n this.fontStyle +\n ';' +\n 'text-decoration: ' +\n this.textDecoration +\n ';' +\n 'text-align: center;' +\n 'width: ' +\n this.width +\n 'px;' +\n 'line-height:' +\n this.height +\n 'px;' +\n \"'>\" +\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.sums.text +\n '</div>'\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 const styles = this.cluster.getClusterer().getStyles()\n const style = 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) 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 createCss(pos: google.maps.Point): string {\n const style = []\n\n style.push('cursor: pointer;')\n\n style.push('position: absolute; top: ' + pos.y + 'px; left: ' + pos.x + 'px;')\n\n style.push('width: ' + this.width + 'px; height: ' + this.height + 'px;')\n\n return style.join('')\n }\n\n getPosFromLatLng(latlng: google.maps.LatLng): google.maps.Point {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n const pos = this.getProjection().fromLatLngToDivPixel(latlng)\n\n pos.x -= this.anchorIcon[1]\n\n pos.y -= this.anchorIcon[0]\n\n // pos.x = pos.x\n\n // pos.y = pos.y\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 // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\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-ignore\n // @ts-ignore\n this.clusterIcon.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 (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 } else {\n for (let i = 0; i < this.markers.length; i++) {\n if (marker === this.markers[i]) {\n return true\n }\n }\n }\n\n return false\n }\n}\n","/* global google */\n/* eslint-disable filenames/match-regex */\nimport { Cluster } from './Cluster'\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: 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 {\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.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-ignore\n // @ts-ignore\n this.setMap(map) // Note: this causes onAdd to be called\n }\n\n onAdd() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.activeMap = this.getMap()\n\n this.ready = true\n\n this.repaint()\n\n // Add the map event listeners\n this.listeners = [\n google.maps.event.addListener(\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap(),\n 'zoom_changed',\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n () => {\n this.resetViewport(false)\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 // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap().getZoom() === (this.get('minZoom') || 0) ||\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap().getZoom() === this.get('maxZoom')\n ) {\n google.maps.event.trigger(this, 'idle')\n }\n }\n ),\n google.maps.event.addListener(\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap(),\n 'idle',\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n () => {\n this.redraw()\n }\n ),\n ]\n }\n\n // eslint-disable-next-line @getify/proper-arrows/this\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-ignore\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 (markers.hasOwnProperty(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 // eslint-disable-next-line @getify/proper-arrows/name, @getify/proper-arrows/this\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-ignore\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 trPix.x += this.gridSize\n trPix.y -= this.gridSize\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 blPix.x -= this.gridSize\n blPix.y += this.gridSize\n\n // Extend the bounds to contain the new bounds.\n bounds.extend(\n // Convert the pixel points back to LatLng nw\n projection.fromDivPixelToLatLng(trPix)\n )\n\n bounds.extend(\n // Convert the pixel points back to LatLng sw\n projection.fromDivPixelToLatLng(blPix)\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 // @ts-ignore\n delete this.timerRefStatic\n }\n }\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-ignore\n // @ts-ignore\n this.getMap().getZoom() > 3\n ? new google.maps.LatLngBounds(\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap()\n .getBounds()\n .getSouthWest(),\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap()\n .getBounds()\n .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 bounds = 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, bounds)) {\n if (!this.ignoreHidden || (this.ignoreHidden && marker.getVisible())) {\n this.addToClosestCluster(marker)\n }\n }\n }\n\n if (iLast < this.markers.length) {\n this.timerRefStatic = window.setTimeout(\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\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(obj1: any, obj2: any): any {\n return function applyExtend(object: any) {\n // eslint-disable-next-line guard-for-in\n for (const property in object.prototype) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.prototype[property] = object.prototype[property]\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n return this\n }.apply(obj1, [obj2])\n }\n}\n"],"names":[],"mappings":";IA8BE,qBAAY,OAAgB,EAAE,MAA0B;QACtD,OAAO,CAAC,YAAY,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;QACnE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,eAAe,EAAE,CAAA;QACrE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAA;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAA;QACvB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAA;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;QACpB,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAA;QACjC,IAAI,CAAC,GAAG,GAAG,EAAE,CAAA;QACb,IAAI,CAAC,MAAM,GAAG,CAAC,CAAA;QACf,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QACd,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;QACxB,IAAI,CAAC,UAAU,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