{"version":3,"sources":["webpack:///./node_modules/@google/markerclustererplus/dist/markerclustererplus.esm.js"],"names":["OverlayViewSafe","type1","type2","property","prototype","extend","google","maps","OverlayView","toCssText","styles","Object","keys","reduce","acc","key","push","join","coercePixels","pixels","undefined","ClusterIcon","cluster_","styles_","super","this","center_","div_","sums_","visible_","style","setMap","getMap","cMouseDownInCluster","cDraggingMapByCluster","mc","getMarkerClusterer","major","minor","version","split","gmVersion","parseInt","document","createElement","show","getPanes","overlayMouseTarget","appendChild","boundsChangedListener_","event","addListener","addDomListener","e","stopPropagation","trigger","getZoomOnClick","mz","getMaxZoom","theBounds","getBounds","fitBounds","setTimeout","getZoom","setZoom","cancelBubble","parentNode","hide","removeListener","clearInstanceListeners","removeChild","pos","getPosFromLatLng_","top","y","left","x","display","className","className_","cssText","createCss_","innerHTML","url","getImageElementHtml","getLabelDivHtml","title","getTitle","ariaLabelFn","text","position","anchorText_","color","textColor","textSize","fontFamily","fontWeight","fontStyle","textDecoration","width","textLineHeight","bp","backgroundPosition","spriteH","replace","spriteV","dimensions","getEnableRetinaIcons","height","Y1","X1","Y2","X2","clip","assign","sums","index","Math","max","min","length","anchorText","anchorIcon_","anchorIcon","floor","getClusterClass","center","getZIndex","cursor","latlng","getProjection","fromLatLngToDivPixel","Cluster","markerClusterer_","map_","minClusterSize_","getMinimumClusterSize","averageCenter_","getAverageCenter","markers_","bounds_","clusterIcon_","getStyles","bounds","LatLngBounds","markers","getMarkers","i","getPosition","marker","isMarkerAlreadyAdded_","l","lat","lng","LatLng","calculateBounds_","isAdded","mCount","contains","getExtendedBounds","numStyles","getCalculator","setCenter","useStyle","indexOf","getOption","options","prop","def","MarkerClusterer","map","clusters_","listeners_","activeMap_","ready_","zIndex_","zIndex","Marker","MAX_ZINDEX","gridSize_","gridSize","minimumClusterSize","maxZoom_","maxZoom","title_","zoomOnClick_","ignoreHidden_","enableRetinaIcons_","imagePath_","imagePath","IMAGE_PATH","imageExtension_","imageExtension","IMAGE_EXTENSION","imageSizes_","imageSizes","IMAGE_SIZES","calculator_","calculator","CALCULATOR","batchSize_","batchSize","BATCH_SIZE","batchSizeIE_","batchSizeIE","BATCH_SIZE_IE","clusterClass_","clusterClass","navigator","userAgent","toLowerCase","setupStyles_","addMarkers","repaint","prevZoom_","minZoom","mapTypes","getMapTypeId","zoom","resetViewport_","redraw_","remove","size","withDefaultStyle","padding","getVisible","getIgnoreHidden","zoomOnClick","averageCenter","ignoreHidden","enableRetinaIcons","nodraw","pushMarkerTo_","hasOwnProperty","call","getDraggable","removed","removeMarker_","r","splice","oldClusters","slice","projection","tr","getNorthEast","bl","getSouthWest","trPix","blPix","ne","fromDivPixelToLatLng","sw","createClusters_","p1","p2","dLat","PI","dLon","a","sin","cos","atan2","sqrt","distance","clusterToAddTo","cluster","getCenter","d","distanceBetweenPoints_","isMarkerInClusterBounds","addMarker","iFirst","mapBounds","timerRefStatic","clearTimeout","iLast","isMarkerInBounds_","addToClosestCluster_","window","updateIcon","count","dv","toString","overrides"],"mappings":"2FAgCA,MAAMA,EACF,eAVJ,SAAgBC,EAAOC,GAEnB,IAAK,IAAIC,KAAYD,EAAME,UACvBH,EAAMG,UAAUD,GAAYD,EAAME,UAAUD,GAa5CE,CAAOL,EAAiBM,OAAOC,KAAKC,cAuB5C,SAASC,EAAUC,GACf,OAAOC,OAAOC,KAAKF,GACdG,OAAO,CAACC,EAAKC,KACVL,EAAOK,IACPD,EAAIE,KAAKD,EAAM,IAAML,EAAOK,IAEzBD,GACR,IACEG,KAAK,KAMd,SAASC,EAAaC,GAClB,OAAOA,EAASA,EAAS,UAAOC,EAKpC,MAAMC,UAAoBrB,EAMtB,YAAYsB,EAAUC,GAClBC,QACAC,KAAKH,SAAWA,EAChBG,KAAKF,QAAUA,EACfE,KAAKC,QAAU,KACfD,KAAKE,KAAO,KACZF,KAAKG,MAAQ,KACbH,KAAKI,UAAW,EAChBJ,KAAKK,MAAQ,KACbL,KAAKM,OAAOT,EAASU,UAKzB,QACI,IAAIC,EAC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AAQC,KAAKE,IAAIH,EAAO4C,GACjB,CACHvE,KAAM+L,EAAME,WACZtK,MAAOA,EACP9B,MAAO,IASf,wBAAwBqM,GACpB,OAAOhR,OAAOuG,OAAO,CAAErB,UAAW,QAASC,SAAU,GAAII,eAAgB,OAAQE,eAAgBuL,EAAU/K,OAAQZ,WAAY,OAAQC,UAAW,SAAUF,WAAY,mBAAoBO,mBAAoB,OAASqL,IAMjOlH,EAAgBiC,WAAa,IAI7BjC,EAAgBoC,cAAgB,IAIhCpC,EAAgBqB,WAAa,cAI7BrB,EAAgBwB,gBAAkB,MAIlCxB,EAAgB2B,YAAc,CAAC,GAAI,GAAI,GAAI,GAAI,IAkBhC","file":"js/vendors~component-googleMapComponent-js~component-hpVolantiniComponent-js.chunks.js","sourcesContent":["/**\r\n * Copyright 2019 Google LLC. All Rights Reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Extends an object's prototype by another's.\r\n *\r\n * @param type1 The Type to be extended.\r\n * @param type2 The Type to extend with.\r\n * @ignore\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nfunction extend(type1, type2) {\r\n // eslint-disable-next-line prefer-const\r\n for (let property in type2.prototype) {\r\n type1.prototype[property] = type2.prototype[property];\r\n }\r\n}\r\n/**\r\n * @ignore\r\n */\r\nclass OverlayViewSafe {\r\n constructor() {\r\n // MarkerClusterer implements google.maps.OverlayView interface. We use the\r\n // extend function to extend MarkerClusterer with google.maps.OverlayView\r\n // because it might not always be available when the code is defined so we\r\n // look for it at the last possible moment. If it doesn't exist now then\r\n // there is no point going ahead :)\r\n extend(OverlayViewSafe, google.maps.OverlayView);\r\n }\r\n}\n\n/**\r\n * Copyright 2019 Google LLC. All Rights Reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n *\r\n * @hidden\r\n */\r\nfunction toCssText(styles) {\r\n return Object.keys(styles)\r\n .reduce((acc, key) => {\r\n if (styles[key]) {\r\n acc.push(key + \":\" + styles[key]);\r\n }\r\n return acc;\r\n }, [])\r\n .join(\";\");\r\n}\r\n/**\r\n *\r\n * @hidden\r\n */\r\nfunction coercePixels(pixels) {\r\n return pixels ? pixels + \"px\" : undefined;\r\n}\r\n/**\r\n * A cluster icon.\r\n */\r\nclass ClusterIcon extends OverlayViewSafe {\r\n /**\r\n * @param cluster_ The cluster with which the icon is to be associated.\r\n * @param styles_ An array of {@link ClusterIconStyle} defining the cluster icons\r\n * to use for various cluster sizes.\r\n */\r\n constructor(cluster_, styles_) {\r\n super();\r\n this.cluster_ = cluster_;\r\n this.styles_ = styles_;\r\n this.center_ = null;\r\n this.div_ = null;\r\n this.sums_ = null;\r\n this.visible_ = false;\r\n this.style = null;\r\n this.setMap(cluster_.getMap()); // Note: this causes onAdd to be called\r\n }\r\n /**\r\n * Adds the icon to the DOM.\r\n */\r\n onAdd() {\r\n let cMouseDownInCluster;\r\n let cDraggingMapByCluster;\r\n const mc = this.cluster_.getMarkerClusterer();\r\n const [major, minor] = google.maps.version.split(\".\");\r\n const gmVersion = parseInt(major, 10) * 100 + parseInt(minor, 10);\r\n this.div_ = document.createElement(\"div\");\r\n if (this.visible_) {\r\n this.show();\r\n }\r\n this.getPanes().overlayMouseTarget.appendChild(this.div_);\r\n // Fix for Issue 157\r\n this.boundsChangedListener_ = google.maps.event.addListener(this.getMap(), \"bounds_changed\", function () {\r\n cDraggingMapByCluster = cMouseDownInCluster;\r\n });\r\n google.maps.event.addDomListener(this.div_, \"mousedown\", () => {\r\n cMouseDownInCluster = true;\r\n cDraggingMapByCluster = false;\r\n });\r\n // March 1, 2018: Fix for this 3.32 exp bug, https://issuetracker.google.com/issues/73571522\r\n // But it doesn't work with earlier releases so do a version check.\r\n if (gmVersion >= 332) {\r\n // Ugly version-dependent code\r\n google.maps.event.addDomListener(this.div_, \"touchstart\", e => {\r\n e.stopPropagation();\r\n });\r\n }\r\n google.maps.event.addDomListener(this.div_, \"click\", e => {\r\n cMouseDownInCluster = false;\r\n if (!cDraggingMapByCluster) {\r\n /**\r\n * This event is fired when a cluster marker is clicked.\r\n * @name MarkerClusterer#click\r\n * @param {Cluster} c The cluster that was clicked.\r\n * @event\r\n */\r\n google.maps.event.trigger(mc, \"click\", this.cluster_);\r\n google.maps.event.trigger(mc, \"clusterclick\", this.cluster_); // deprecated name\r\n // The default click handler follows. Disable it by setting\r\n // the zoomOnClick property to false.\r\n if (mc.getZoomOnClick()) {\r\n // Zoom into the cluster.\r\n const mz = mc.getMaxZoom();\r\n const theBounds = this.cluster_.getBounds();\r\n mc.getMap().fitBounds(theBounds);\r\n // There is a fix for Issue 170 here:\r\n setTimeout(function () {\r\n mc.getMap().fitBounds(theBounds);\r\n // Don't zoom beyond the max zoom level\r\n if (mz !== null && mc.getMap().getZoom() > mz) {\r\n mc.getMap().setZoom(mz + 1);\r\n }\r\n }, 100);\r\n }\r\n // Prevent event propagation to the map:\r\n e.cancelBubble = true;\r\n if (e.stopPropagation) {\r\n e.stopPropagation();\r\n }\r\n }\r\n });\r\n google.maps.event.addDomListener(this.div_, \"mouseover\", () => {\r\n /**\r\n * This event is fired when the mouse moves over a cluster marker.\r\n * @name MarkerClusterer#mouseover\r\n * @param {Cluster} c The cluster that the mouse moved over.\r\n * @event\r\n */\r\n google.maps.event.trigger(mc, \"mouseover\", this.cluster_);\r\n });\r\n google.maps.event.addDomListener(this.div_, \"mouseout\", () => {\r\n /**\r\n * This event is fired when the mouse moves out of a cluster marker.\r\n * @name MarkerClusterer#mouseout\r\n * @param {Cluster} c The cluster that the mouse moved out of.\r\n * @event\r\n */\r\n google.maps.event.trigger(mc, \"mouseout\", this.cluster_);\r\n });\r\n }\r\n /**\r\n * Removes the icon from the DOM.\r\n */\r\n onRemove() {\r\n if (this.div_ && this.div_.parentNode) {\r\n this.hide();\r\n google.maps.event.removeListener(this.boundsChangedListener_);\r\n google.maps.event.clearInstanceListeners(this.div_);\r\n this.div_.parentNode.removeChild(this.div_);\r\n this.div_ = null;\r\n }\r\n }\r\n /**\r\n * Draws the icon.\r\n */\r\n draw() {\r\n if (this.visible_) {\r\n const pos = this.getPosFromLatLng_(this.center_);\r\n this.div_.style.top = pos.y + \"px\";\r\n this.div_.style.left = pos.x + \"px\";\r\n }\r\n }\r\n /**\r\n * Hides the icon.\r\n */\r\n hide() {\r\n if (this.div_) {\r\n this.div_.style.display = \"none\";\r\n }\r\n this.visible_ = false;\r\n }\r\n /**\r\n * Positions and shows the icon.\r\n */\r\n show() {\r\n if (this.div_) {\r\n this.div_.className = this.className_;\r\n this.div_.style.cssText = this.createCss_(this.getPosFromLatLng_(this.center_));\r\n this.div_.innerHTML =\r\n (this.style.url ? this.getImageElementHtml() : \"\") +\r\n this.getLabelDivHtml();\r\n if (typeof this.sums_.title === \"undefined\" || this.sums_.title === \"\") {\r\n this.div_.title = this.cluster_.getMarkerClusterer().getTitle();\r\n }\r\n else {\r\n this.div_.title = this.sums_.title;\r\n }\r\n this.div_.style.display = \"\";\r\n }\r\n this.visible_ = true;\r\n }\r\n getLabelDivHtml() {\r\n const mc = this.cluster_.getMarkerClusterer();\r\n const ariaLabel = mc.ariaLabelFn(this.sums_.text);\r\n const divStyle = {\r\n position: \"absolute\",\r\n top: coercePixels(this.anchorText_[0]),\r\n left: coercePixels(this.anchorText_[1]),\r\n color: this.style.textColor,\r\n \"font-size\": coercePixels(this.style.textSize),\r\n \"font-family\": this.style.fontFamily,\r\n \"font-weight\": this.style.fontWeight,\r\n \"font-style\": this.style.fontStyle,\r\n \"text-decoration\": this.style.textDecoration,\r\n \"text-align\": \"center\",\r\n width: coercePixels(this.style.width),\r\n \"line-height\": coercePixels(this.style.textLineHeight)\r\n };\r\n return `\n
\n ${this.sums_.text}\n
\n`;\r\n }\r\n getImageElementHtml() {\r\n // NOTE: values must be specified in px units\r\n const bp = (this.style.backgroundPosition || \"0 0\").split(\" \");\r\n const spriteH = parseInt(bp[0].replace(/^\\s+|\\s+$/g, \"\"), 10);\r\n const spriteV = parseInt(bp[1].replace(/^\\s+|\\s+$/g, \"\"), 10);\r\n let dimensions = {};\r\n if (this.cluster_.getMarkerClusterer().getEnableRetinaIcons()) {\r\n dimensions = {\r\n width: coercePixels(this.style.width),\r\n height: coercePixels(this.style.height)\r\n };\r\n }\r\n else {\r\n const [Y1, X1, Y2, X2] = [\r\n -1 * spriteV,\r\n -1 * spriteH + this.style.width,\r\n -1 * spriteV + this.style.height,\r\n -1 * spriteH\r\n ];\r\n dimensions = {\r\n clip: `rect(${Y1}px, ${X1}px, ${Y2}px, ${X2}px)`\r\n };\r\n }\r\n const cssText = toCssText(Object.assign({ position: \"absolute\", top: coercePixels(spriteV), left: coercePixels(spriteH) }, dimensions));\r\n return `\"${this.sums_.text}\"`;\r\n }\r\n /**\r\n * Sets the icon styles to the appropriate element in the styles array.\r\n *\r\n * @ignore\r\n * @param sums The icon label text and styles index.\r\n */\r\n useStyle(sums) {\r\n this.sums_ = sums;\r\n let index = Math.max(0, sums.index - 1);\r\n index = Math.min(this.styles_.length - 1, index);\r\n this.style = this.styles_[index];\r\n this.anchorText_ = this.style.anchorText || [0, 0];\r\n this.anchorIcon_ = this.style.anchorIcon || [\r\n Math.floor(this.style.height / 2),\r\n Math.floor(this.style.width / 2)\r\n ];\r\n this.className_ =\r\n this.cluster_.getMarkerClusterer().getClusterClass() +\r\n \" \" +\r\n (this.style.className || \"cluster-\" + index);\r\n }\r\n /**\r\n * Sets the position at which to center the icon.\r\n *\r\n * @param center The latlng to set as the center.\r\n */\r\n setCenter(center) {\r\n this.center_ = center;\r\n }\r\n /**\r\n * Creates the `cssText` style parameter based on the position of the icon.\r\n *\r\n * @param pos The position of the icon.\r\n * @return The CSS style text.\r\n */\r\n createCss_(pos) {\r\n return toCssText({\r\n \"z-index\": `${this.cluster_.getMarkerClusterer().getZIndex()}`,\r\n top: coercePixels(pos.y),\r\n left: coercePixels(pos.x),\r\n width: coercePixels(this.style.width),\r\n height: coercePixels(this.style.height),\r\n cursor: \"pointer\",\r\n position: \"absolute\",\r\n \"-webkit-user-select\": \"none\",\r\n \"-khtml-user-select\": \"none\",\r\n \"-moz-user-select\": \"none\",\r\n \"-o-user-select\": \"none\",\r\n \"user-select\": \"none\"\r\n });\r\n }\r\n /**\r\n * Returns the position at which to place the DIV depending on the latlng.\r\n *\r\n * @param latlng The position in latlng.\r\n * @return The position in pixels.\r\n */\r\n getPosFromLatLng_(latlng) {\r\n const pos = this.getProjection().fromLatLngToDivPixel(latlng);\r\n pos.x = Math.floor(pos.x - this.anchorIcon_[1]);\r\n pos.y = Math.floor(pos.y - this.anchorIcon_[0]);\r\n return pos;\r\n }\r\n}\n\n/**\r\n * Copyright 2019 Google LLC. All Rights Reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Creates a single cluster that manages a group of proximate markers.\r\n * Used internally, do not call this constructor directly.\r\n */\r\nclass Cluster {\r\n /**\r\n *\r\n * @param markerClusterer_ The `MarkerClusterer` object with which this\r\n * cluster is associated.\r\n */\r\n constructor(markerClusterer_) {\r\n this.markerClusterer_ = markerClusterer_;\r\n this.map_ = this.markerClusterer_.getMap();\r\n this.minClusterSize_ = this.markerClusterer_.getMinimumClusterSize();\r\n this.averageCenter_ = this.markerClusterer_.getAverageCenter();\r\n this.markers_ = []; // TODO: type;\r\n this.center_ = null;\r\n this.bounds_ = null;\r\n this.clusterIcon_ = new ClusterIcon(this, this.markerClusterer_.getStyles());\r\n }\r\n /**\r\n * Returns the number of markers managed by the cluster. You can call this from\r\n * a `click`, `mouseover`, or `mouseout` event handler for the `MarkerClusterer` object.\r\n *\r\n * @return The number of markers in the cluster.\r\n */\r\n getSize() {\r\n return this.markers_.length;\r\n }\r\n /**\r\n * Returns the array of markers managed by the cluster. You can call this from\r\n * a `click`, `mouseover`, or `mouseout` event handler for the `MarkerClusterer` object.\r\n *\r\n * @return The array of markers in the cluster.\r\n */\r\n getMarkers() {\r\n return this.markers_;\r\n }\r\n /**\r\n * Returns the center of the cluster. You can call this from\r\n * a `click`, `mouseover`, or `mouseout` event handler\r\n * for the `MarkerClusterer` object.\r\n *\r\n * @return The center of the cluster.\r\n */\r\n getCenter() {\r\n return this.center_;\r\n }\r\n /**\r\n * Returns the map with which the cluster is associated.\r\n *\r\n * @return The map.\r\n * @ignore\r\n */\r\n getMap() {\r\n return this.map_;\r\n }\r\n /**\r\n * Returns the `MarkerClusterer` object with which the cluster is associated.\r\n *\r\n * @return The associated marker clusterer.\r\n * @ignore\r\n */\r\n getMarkerClusterer() {\r\n return this.markerClusterer_;\r\n }\r\n /**\r\n * Returns the bounds of the cluster.\r\n *\r\n * @return the cluster bounds.\r\n * @ignore\r\n */\r\n getBounds() {\r\n const bounds = new google.maps.LatLngBounds(this.center_, this.center_);\r\n const markers = this.getMarkers();\r\n for (let i = 0; i < markers.length; i++) {\r\n bounds.extend(markers[i].getPosition());\r\n }\r\n return bounds;\r\n }\r\n /**\r\n * Removes the cluster from the map.\r\n *\r\n * @ignore\r\n */\r\n remove() {\r\n this.clusterIcon_.setMap(null);\r\n this.markers_ = [];\r\n delete this.markers_;\r\n }\r\n /**\r\n * Adds a marker to the cluster.\r\n *\r\n * @param marker The marker to be added.\r\n * @return True if the marker was added.\r\n * @ignore\r\n */\r\n addMarker(marker) {\r\n if (this.isMarkerAlreadyAdded_(marker)) {\r\n return false;\r\n }\r\n if (!this.center_) {\r\n this.center_ = marker.getPosition();\r\n this.calculateBounds_();\r\n }\r\n else {\r\n if (this.averageCenter_) {\r\n const l = this.markers_.length + 1;\r\n const lat = (this.center_.lat() * (l - 1) + marker.getPosition().lat()) / l;\r\n const lng = (this.center_.lng() * (l - 1) + marker.getPosition().lng()) / l;\r\n this.center_ = new google.maps.LatLng(lat, lng);\r\n this.calculateBounds_();\r\n }\r\n }\r\n marker.isAdded = true;\r\n this.markers_.push(marker);\r\n const mCount = this.markers_.length;\r\n const mz = this.markerClusterer_.getMaxZoom();\r\n if (mz !== null && this.map_.getZoom() > mz) {\r\n // Zoomed in past max zoom, so show the marker.\r\n if (marker.getMap() !== this.map_) {\r\n marker.setMap(this.map_);\r\n }\r\n }\r\n else if (mCount < this.minClusterSize_) {\r\n // Min cluster size not reached so show the marker.\r\n if (marker.getMap() !== this.map_) {\r\n marker.setMap(this.map_);\r\n }\r\n }\r\n else if (mCount === this.minClusterSize_) {\r\n // Hide the markers that were showing.\r\n for (let i = 0; i < mCount; i++) {\r\n this.markers_[i].setMap(null);\r\n }\r\n }\r\n else {\r\n marker.setMap(null);\r\n }\r\n return true;\r\n }\r\n /**\r\n * Determines if a marker lies within the cluster's bounds.\r\n *\r\n * @param marker The marker to check.\r\n * @return True if the marker lies in the bounds.\r\n * @ignore\r\n */\r\n isMarkerInClusterBounds(marker) {\r\n return this.bounds_.contains(marker.getPosition());\r\n }\r\n /**\r\n * Calculates the extended bounds of the cluster with the grid.\r\n */\r\n calculateBounds_() {\r\n const bounds = new google.maps.LatLngBounds(this.center_, this.center_);\r\n this.bounds_ = this.markerClusterer_.getExtendedBounds(bounds);\r\n }\r\n /**\r\n * Updates the cluster icon.\r\n */\r\n updateIcon() {\r\n const mCount = this.markers_.length;\r\n const mz = this.markerClusterer_.getMaxZoom();\r\n if (mz !== null && this.map_.getZoom() > mz) {\r\n this.clusterIcon_.hide();\r\n return;\r\n }\r\n if (mCount < this.minClusterSize_) {\r\n // Min cluster size not yet reached.\r\n this.clusterIcon_.hide();\r\n return;\r\n }\r\n const numStyles = this.markerClusterer_.getStyles().length;\r\n const sums = this.markerClusterer_.getCalculator()(this.markers_, numStyles);\r\n this.clusterIcon_.setCenter(this.center_);\r\n this.clusterIcon_.useStyle(sums);\r\n this.clusterIcon_.show();\r\n }\r\n /**\r\n * Determines if a marker has already been added to the cluster.\r\n *\r\n * @param marker The marker to check.\r\n * @return True if the marker has already been added.\r\n */\r\n isMarkerAlreadyAdded_(marker) {\r\n if (this.markers_.indexOf) {\r\n return this.markers_.indexOf(marker) !== -1;\r\n }\r\n else {\r\n for (let i = 0; i < this.markers_.length; i++) {\r\n if (marker === this.markers_[i]) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n}\n\n/**\r\n * Copyright 2019 Google LLC. All Rights Reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @ignore\r\n */\r\nconst getOption = (options, prop, def) => {\r\n if (options[prop] !== undefined) {\r\n return options[prop];\r\n }\r\n else {\r\n return def;\r\n }\r\n};\r\nclass MarkerClusterer extends OverlayViewSafe {\r\n /**\r\n * Creates a MarkerClusterer object with the options specified in {@link MarkerClustererOptions}.\r\n * @param map The Google map to attach to.\r\n * @param markers The markers to be added to the cluster.\r\n * @param options The optional parameters.\r\n */\r\n constructor(map, markers = [], options = {}) {\r\n super();\r\n this.options = options;\r\n this.markers_ = [];\r\n this.clusters_ = [];\r\n this.listeners_ = [];\r\n this.activeMap_ = null;\r\n this.ready_ = false;\r\n this.ariaLabelFn = this.options.ariaLabelFn || (() => \"\");\r\n this.zIndex_ = this.options.zIndex || google.maps.Marker.MAX_ZINDEX + 1;\r\n this.gridSize_ = this.options.gridSize || 60;\r\n this.minClusterSize_ = this.options.minimumClusterSize || 2;\r\n this.maxZoom_ = this.options.maxZoom || null;\r\n this.styles_ = this.options.styles || [];\r\n this.title_ = this.options.title || \"\";\r\n this.zoomOnClick_ = getOption(this.options, \"zoomOnClick\", true);\r\n this.averageCenter_ = getOption(this.options, \"averageCenter\", false);\r\n this.ignoreHidden_ = getOption(this.options, \"ignoreHidden\", false);\r\n this.enableRetinaIcons_ = getOption(this.options, \"enableRetinaIcons\", false);\r\n this.imagePath_ = this.options.imagePath || MarkerClusterer.IMAGE_PATH;\r\n this.imageExtension_ = this.options.imageExtension || MarkerClusterer.IMAGE_EXTENSION;\r\n this.imageSizes_ = this.options.imageSizes || MarkerClusterer.IMAGE_SIZES;\r\n this.calculator_ = this.options.calculator || MarkerClusterer.CALCULATOR;\r\n this.batchSize_ = this.options.batchSize || MarkerClusterer.BATCH_SIZE;\r\n this.batchSizeIE_ = this.options.batchSizeIE || MarkerClusterer.BATCH_SIZE_IE;\r\n this.clusterClass_ = this.options.clusterClass || \"cluster\";\r\n if (navigator.userAgent.toLowerCase().indexOf(\"msie\") !== -1) {\r\n // Try to avoid IE timeout when processing a huge number of markers:\r\n this.batchSize_ = this.batchSizeIE_;\r\n }\r\n this.setupStyles_();\r\n this.addMarkers(markers, true);\r\n this.setMap(map); // Note: this causes onAdd to be called\r\n }\r\n /**\r\n * Implementation of the onAdd interface method.\r\n * @ignore\r\n */\r\n onAdd() {\r\n this.activeMap_ = this.getMap();\r\n this.ready_ = true;\r\n this.repaint();\r\n this.prevZoom_ = this.getMap().getZoom();\r\n // Add the map event listeners\r\n this.listeners_ = [\r\n google.maps.event.addListener(this.getMap(), \"zoom_changed\", () => {\r\n const map = this.getMap(); // eslint-disable-line @typescript-eslint/no-explicit-any\r\n // Fix for bug #407\r\n // Determines map type and prevents illegal zoom levels\r\n const minZoom = map.minZoom || 0;\r\n const maxZoom = Math.min(map.maxZoom || 100, map.mapTypes[map.getMapTypeId()].maxZoom);\r\n const zoom = Math.min(Math.max(this.getMap().getZoom(), minZoom), maxZoom);\r\n if (this.prevZoom_ != zoom) {\r\n this.prevZoom_ = zoom;\r\n this.resetViewport_(false);\r\n }\r\n }),\r\n google.maps.event.addListener(this.getMap(), \"idle\", () => {\r\n this.redraw_();\r\n })\r\n ];\r\n }\r\n /**\r\n * Implementation of the onRemove interface method.\r\n * Removes map event listeners and all cluster icons from the DOM.\r\n * All managed markers are also put back on the map.\r\n * @ignore\r\n */\r\n onRemove() {\r\n // Put all the managed markers back on the map:\r\n for (let i = 0; i < this.markers_.length; i++) {\r\n if (this.markers_[i].getMap() !== this.activeMap_) {\r\n this.markers_[i].setMap(this.activeMap_);\r\n }\r\n }\r\n // Remove all clusters:\r\n for (let i = 0; i < this.clusters_.length; i++) {\r\n this.clusters_[i].remove();\r\n }\r\n this.clusters_ = [];\r\n // Remove map event listeners:\r\n for (let i = 0; i < this.listeners_.length; i++) {\r\n google.maps.event.removeListener(this.listeners_[i]);\r\n }\r\n this.listeners_ = [];\r\n this.activeMap_ = null;\r\n this.ready_ = false;\r\n }\r\n /**\r\n * Implementation of the draw interface method.\r\n * @ignore\r\n */\r\n draw() { }\r\n /**\r\n * Sets up the styles object.\r\n */\r\n setupStyles_() {\r\n if (this.styles_.length > 0) {\r\n return;\r\n }\r\n for (let i = 0; i < this.imageSizes_.length; i++) {\r\n const size = this.imageSizes_[i];\r\n this.styles_.push(MarkerClusterer.withDefaultStyle({\r\n url: this.imagePath_ + (i + 1) + \".\" + this.imageExtension_,\r\n height: size,\r\n width: size\r\n }));\r\n }\r\n }\r\n /**\r\n * Fits the map to the bounds of the markers managed by the clusterer.\r\n */\r\n fitMapToMarkers(padding) {\r\n const markers = this.getMarkers();\r\n const bounds = new google.maps.LatLngBounds();\r\n for (let i = 0; i < markers.length; i++) {\r\n // March 3, 2018: Bug fix -- honor the ignoreHidden property\r\n if (markers[i].getVisible() || !this.getIgnoreHidden()) {\r\n bounds.extend(markers[i].getPosition());\r\n }\r\n }\r\n this.getMap().fitBounds(bounds, padding);\r\n }\r\n /**\r\n * Returns the value of the `gridSize` property.\r\n *\r\n * @return The grid size.\r\n */\r\n getGridSize() {\r\n return this.gridSize_;\r\n }\r\n /**\r\n * Sets the value of the `gridSize` property.\r\n *\r\n * @param gridSize The grid size.\r\n */\r\n setGridSize(gridSize) {\r\n this.gridSize_ = gridSize;\r\n }\r\n /**\r\n * Returns the value of the `minimumClusterSize` property.\r\n *\r\n * @return The minimum cluster size.\r\n */\r\n getMinimumClusterSize() {\r\n return this.minClusterSize_;\r\n }\r\n /**\r\n * Sets the value of the `minimumClusterSize` property.\r\n *\r\n * @param minimumClusterSize The minimum cluster size.\r\n */\r\n setMinimumClusterSize(minimumClusterSize) {\r\n this.minClusterSize_ = minimumClusterSize;\r\n }\r\n /**\r\n * Returns the value of the `maxZoom` property.\r\n *\r\n * @return The maximum zoom level.\r\n */\r\n getMaxZoom() {\r\n return this.maxZoom_;\r\n }\r\n /**\r\n * Sets the value of the `maxZoom` property.\r\n *\r\n * @param maxZoom The maximum zoom level.\r\n */\r\n setMaxZoom(maxZoom) {\r\n this.maxZoom_ = maxZoom;\r\n }\r\n getZIndex() {\r\n return this.zIndex_;\r\n }\r\n setZIndex(zIndex) {\r\n this.zIndex_ = zIndex;\r\n }\r\n /**\r\n * Returns the value of the `styles` property.\r\n *\r\n * @return The array of styles defining the cluster markers to be used.\r\n */\r\n getStyles() {\r\n return this.styles_;\r\n }\r\n /**\r\n * Sets the value of the `styles` property.\r\n *\r\n * @param styles The array of styles to use.\r\n */\r\n setStyles(styles) {\r\n this.styles_ = styles;\r\n }\r\n /**\r\n * Returns the value of the `title` property.\r\n *\r\n * @return The content of the title text.\r\n */\r\n getTitle() {\r\n return this.title_;\r\n }\r\n /**\r\n * Sets the value of the `title` property.\r\n *\r\n * @param title The value of the title property.\r\n */\r\n setTitle(title) {\r\n this.title_ = title;\r\n }\r\n /**\r\n * Returns the value of the `zoomOnClick` property.\r\n *\r\n * @return True if zoomOnClick property is set.\r\n */\r\n getZoomOnClick() {\r\n return this.zoomOnClick_;\r\n }\r\n /**\r\n * Sets the value of the `zoomOnClick` property.\r\n *\r\n * @param zoomOnClick The value of the zoomOnClick property.\r\n */\r\n setZoomOnClick(zoomOnClick) {\r\n this.zoomOnClick_ = zoomOnClick;\r\n }\r\n /**\r\n * Returns the value of the `averageCenter` property.\r\n *\r\n * @return True if averageCenter property is set.\r\n */\r\n getAverageCenter() {\r\n return this.averageCenter_;\r\n }\r\n /**\r\n * Sets the value of the `averageCenter` property.\r\n *\r\n * @param averageCenter The value of the averageCenter property.\r\n */\r\n setAverageCenter(averageCenter) {\r\n this.averageCenter_ = averageCenter;\r\n }\r\n /**\r\n * Returns the value of the `ignoreHidden` property.\r\n *\r\n * @return True if ignoreHidden property is set.\r\n */\r\n getIgnoreHidden() {\r\n return this.ignoreHidden_;\r\n }\r\n /**\r\n * Sets the value of the `ignoreHidden` property.\r\n *\r\n * @param ignoreHidden The value of the ignoreHidden property.\r\n */\r\n setIgnoreHidden(ignoreHidden) {\r\n this.ignoreHidden_ = ignoreHidden;\r\n }\r\n /**\r\n * Returns the value of the `enableRetinaIcons` property.\r\n *\r\n * @return True if enableRetinaIcons property is set.\r\n */\r\n getEnableRetinaIcons() {\r\n return this.enableRetinaIcons_;\r\n }\r\n /**\r\n * Sets the value of the `enableRetinaIcons` property.\r\n *\r\n * @param enableRetinaIcons The value of the enableRetinaIcons property.\r\n */\r\n setEnableRetinaIcons(enableRetinaIcons) {\r\n this.enableRetinaIcons_ = enableRetinaIcons;\r\n }\r\n /**\r\n * Returns the value of the `imageExtension` property.\r\n *\r\n * @return The value of the imageExtension property.\r\n */\r\n getImageExtension() {\r\n return this.imageExtension_;\r\n }\r\n /**\r\n * Sets the value of the `imageExtension` property.\r\n *\r\n * @param imageExtension The value of the imageExtension property.\r\n */\r\n setImageExtension(imageExtension) {\r\n this.imageExtension_ = imageExtension;\r\n }\r\n /**\r\n * Returns the value of the `imagePath` property.\r\n *\r\n * @return The value of the imagePath property.\r\n */\r\n getImagePath() {\r\n return this.imagePath_;\r\n }\r\n /**\r\n * Sets the value of the `imagePath` property.\r\n *\r\n * @param imagePath The value of the imagePath property.\r\n */\r\n setImagePath(imagePath) {\r\n this.imagePath_ = imagePath;\r\n }\r\n /**\r\n * Returns the value of the `imageSizes` property.\r\n *\r\n * @return The value of the imageSizes property.\r\n */\r\n getImageSizes() {\r\n return this.imageSizes_;\r\n }\r\n /**\r\n * Sets the value of the `imageSizes` property.\r\n *\r\n * @param imageSizes The value of the imageSizes property.\r\n */\r\n setImageSizes(imageSizes) {\r\n this.imageSizes_ = imageSizes;\r\n }\r\n /**\r\n * Returns the value of the `calculator` property.\r\n *\r\n * @return the value of the calculator property.\r\n */\r\n getCalculator() {\r\n return this.calculator_;\r\n }\r\n /**\r\n * Sets the value of the `calculator` property.\r\n *\r\n * @param calculator The value of the calculator property.\r\n */\r\n setCalculator(calculator) {\r\n this.calculator_ = calculator;\r\n }\r\n /**\r\n * Returns the value of the `batchSizeIE` property.\r\n *\r\n * @return the value of the batchSizeIE property.\r\n */\r\n getBatchSizeIE() {\r\n return this.batchSizeIE_;\r\n }\r\n /**\r\n * Sets the value of the `batchSizeIE` property.\r\n *\r\n * @param batchSizeIE The value of the batchSizeIE property.\r\n */\r\n setBatchSizeIE(batchSizeIE) {\r\n this.batchSizeIE_ = batchSizeIE;\r\n }\r\n /**\r\n * Returns the value of the `clusterClass` property.\r\n *\r\n * @return the value of the clusterClass property.\r\n */\r\n getClusterClass() {\r\n return this.clusterClass_;\r\n }\r\n /**\r\n * Sets the value of the `clusterClass` property.\r\n *\r\n * @param clusterClass The value of the clusterClass property.\r\n */\r\n setClusterClass(clusterClass) {\r\n this.clusterClass_ = clusterClass;\r\n }\r\n /**\r\n * Returns the array of markers managed by the clusterer.\r\n *\r\n * @return The array of markers managed by the clusterer.\r\n */\r\n getMarkers() {\r\n return this.markers_;\r\n }\r\n /**\r\n * Returns the number of markers managed by the clusterer.\r\n *\r\n * @return The number of markers.\r\n */\r\n getTotalMarkers() {\r\n return this.markers_.length;\r\n }\r\n /**\r\n * Returns the current array of clusters formed by the clusterer.\r\n *\r\n * @return The array of clusters formed by the clusterer.\r\n */\r\n getClusters() {\r\n return this.clusters_;\r\n }\r\n /**\r\n * Returns the number of clusters formed by the clusterer.\r\n *\r\n * @return The number of clusters formed by the clusterer.\r\n */\r\n getTotalClusters() {\r\n return this.clusters_.length;\r\n }\r\n /**\r\n * Adds a marker to the clusterer. The clusters are redrawn unless\r\n * `nodraw` is set to `true`.\r\n *\r\n * @param marker The marker to add.\r\n * @param nodraw Set to `true` to prevent redrawing.\r\n */\r\n addMarker(marker, nodraw) {\r\n this.pushMarkerTo_(marker);\r\n if (!nodraw) {\r\n this.redraw_();\r\n }\r\n }\r\n /**\r\n * Adds an array of markers to the clusterer. The clusters are redrawn unless\r\n * `nodraw` is set to `true`.\r\n *\r\n * @param markers The markers to add.\r\n * @param nodraw Set to `true` to prevent redrawing.\r\n */\r\n addMarkers(markers, nodraw) {\r\n for (const key in markers) {\r\n if (Object.prototype.hasOwnProperty.call(markers, key)) {\r\n this.pushMarkerTo_(markers[key]);\r\n }\r\n }\r\n if (!nodraw) {\r\n this.redraw_();\r\n }\r\n }\r\n /**\r\n * Pushes a marker to the clusterer.\r\n *\r\n * @param marker The marker to add.\r\n */\r\n pushMarkerTo_(marker) {\r\n // If the marker is draggable add a listener so we can update the clusters on the dragend:\r\n if (marker.getDraggable()) {\r\n google.maps.event.addListener(marker, \"dragend\", () => {\r\n if (this.ready_) {\r\n marker.isAdded = false;\r\n this.repaint();\r\n }\r\n });\r\n }\r\n marker.isAdded = false;\r\n this.markers_.push(marker);\r\n }\r\n /**\r\n * Removes a marker from the cluster. The clusters are redrawn unless\r\n * `nodraw` is set to `true`. Returns `true` if the\r\n * marker was removed from the clusterer.\r\n *\r\n * @param marker The marker to remove.\r\n * @param nodraw Set to `true` to prevent redrawing.\r\n * @return True if the marker was removed from the clusterer.\r\n */\r\n removeMarker(marker, nodraw) {\r\n const removed = this.removeMarker_(marker);\r\n if (!nodraw && removed) {\r\n this.repaint();\r\n }\r\n return removed;\r\n }\r\n /**\r\n * Removes an array of markers from the cluster. The clusters are redrawn unless\r\n * `nodraw` is set to `true`. Returns `true` if markers were removed from the clusterer.\r\n *\r\n * @param markers The markers to remove.\r\n * @param nodraw Set to `true` to prevent redrawing.\r\n * @return True if markers were removed from the clusterer.\r\n */\r\n removeMarkers(markers, nodraw) {\r\n let removed = false;\r\n for (let i = 0; i < markers.length; i++) {\r\n const r = this.removeMarker_(markers[i]);\r\n removed = removed || r;\r\n }\r\n if (!nodraw && removed) {\r\n this.repaint();\r\n }\r\n return removed;\r\n }\r\n /**\r\n * Removes a marker and returns true if removed, false if not.\r\n *\r\n * @param marker The marker to remove\r\n * @return Whether the marker was removed or not\r\n */\r\n removeMarker_(marker) {\r\n let index = -1;\r\n if (this.markers_.indexOf) {\r\n index = this.markers_.indexOf(marker);\r\n }\r\n else {\r\n for (let i = 0; i < this.markers_.length; i++) {\r\n if (marker === this.markers_[i]) {\r\n index = i;\r\n break;\r\n }\r\n }\r\n }\r\n if (index === -1) {\r\n // Marker is not in our list of markers, so do nothing:\r\n return false;\r\n }\r\n marker.setMap(null);\r\n this.markers_.splice(index, 1); // Remove the marker from the list of managed markers\r\n return true;\r\n }\r\n /**\r\n * Removes all clusters and markers from the map and also removes all markers\r\n * managed by the clusterer.\r\n */\r\n clearMarkers() {\r\n this.resetViewport_(true);\r\n this.markers_ = [];\r\n }\r\n /**\r\n * Recalculates and redraws all the marker clusters from scratch.\r\n * Call this after changing any properties.\r\n */\r\n repaint() {\r\n const oldClusters = this.clusters_.slice();\r\n this.clusters_ = [];\r\n this.resetViewport_(false);\r\n this.redraw_();\r\n // Remove the old clusters.\r\n // Do it in a timeout to prevent blinking effect.\r\n setTimeout(function () {\r\n for (let i = 0; i < oldClusters.length; i++) {\r\n oldClusters[i].remove();\r\n }\r\n }, 0);\r\n }\r\n /**\r\n * Returns the current bounds extended by the grid size.\r\n *\r\n * @param bounds The bounds to extend.\r\n * @return The extended bounds.\r\n * @ignore\r\n */\r\n getExtendedBounds(bounds) {\r\n const projection = this.getProjection();\r\n // Turn the bounds into latlng.\r\n const tr = new google.maps.LatLng(bounds.getNorthEast().lat(), bounds.getNorthEast().lng());\r\n const bl = new google.maps.LatLng(bounds.getSouthWest().lat(), bounds.getSouthWest().lng());\r\n // Convert the points to pixels and the extend out by the grid size.\r\n const trPix = projection.fromLatLngToDivPixel(tr);\r\n trPix.x += this.gridSize_;\r\n trPix.y -= this.gridSize_;\r\n const blPix = projection.fromLatLngToDivPixel(bl);\r\n blPix.x -= this.gridSize_;\r\n blPix.y += this.gridSize_;\r\n // Convert the pixel points back to LatLng\r\n const ne = projection.fromDivPixelToLatLng(trPix);\r\n const sw = projection.fromDivPixelToLatLng(blPix);\r\n // Extend the bounds to contain the new bounds.\r\n bounds.extend(ne);\r\n bounds.extend(sw);\r\n return bounds;\r\n }\r\n /**\r\n * Redraws all the clusters.\r\n */\r\n redraw_() {\r\n this.createClusters_(0);\r\n }\r\n /**\r\n * Removes all clusters from the map. The markers are also removed from the map\r\n * if `hide` is set to `true`.\r\n *\r\n * @param hide Set to `true` to also remove the markers from the map.\r\n */\r\n resetViewport_(hide) {\r\n // Remove all the clusters\r\n for (let i = 0; i < this.clusters_.length; i++) {\r\n this.clusters_[i].remove();\r\n }\r\n this.clusters_ = [];\r\n // Reset the markers to not be added and to be removed from the map.\r\n for (let i = 0; i < this.markers_.length; i++) {\r\n const marker = this.markers_[i];\r\n marker.isAdded = false;\r\n if (hide) {\r\n marker.setMap(null);\r\n }\r\n }\r\n }\r\n /**\r\n * Calculates the distance between two latlng locations in km.\r\n *\r\n * @param p1 The first lat lng point.\r\n * @param p2 The second lat lng point.\r\n * @return The distance between the two points in km.\r\n * @link http://www.movable-type.co.uk/scripts/latlong.html\r\n */\r\n distanceBetweenPoints_(p1, p2) {\r\n const R = 6371; // Radius of the Earth in km\r\n const dLat = ((p2.lat() - p1.lat()) * Math.PI) / 180;\r\n const dLon = ((p2.lng() - p1.lng()) * Math.PI) / 180;\r\n const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +\r\n Math.cos((p1.lat() * Math.PI) / 180) *\r\n Math.cos((p2.lat() * Math.PI) / 180) *\r\n Math.sin(dLon / 2) *\r\n Math.sin(dLon / 2);\r\n const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\r\n return R * c;\r\n }\r\n /**\r\n * Determines if a marker is contained in a bounds.\r\n *\r\n * @param marker The marker to check.\r\n * @param bounds The bounds to check against.\r\n * @return True if the marker is in the bounds.\r\n */\r\n isMarkerInBounds_(marker, bounds) {\r\n return bounds.contains(marker.getPosition());\r\n }\r\n /**\r\n * Adds a marker to a cluster, or creates a new cluster.\r\n *\r\n * @param marker The marker to add.\r\n */\r\n addToClosestCluster_(marker) {\r\n let distance = 40000; // Some large number\r\n let clusterToAddTo = null;\r\n for (let i = 0; i < this.clusters_.length; i++) {\r\n const cluster = this.clusters_[i];\r\n const center = cluster.getCenter();\r\n if (center) {\r\n const d = this.distanceBetweenPoints_(center, marker.getPosition());\r\n if (d < distance) {\r\n distance = d;\r\n clusterToAddTo = cluster;\r\n }\r\n }\r\n }\r\n if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) {\r\n clusterToAddTo.addMarker(marker);\r\n }\r\n else {\r\n const cluster = new Cluster(this);\r\n cluster.addMarker(marker);\r\n this.clusters_.push(cluster);\r\n }\r\n }\r\n /**\r\n * Creates the clusters. This is done in batches to avoid timeout errors\r\n * in some browsers when there is a huge number of markers.\r\n *\r\n * @param iFirst The index of the first marker in the batch of\r\n * markers to be added to clusters.\r\n */\r\n createClusters_(iFirst) {\r\n if (!this.ready_) {\r\n return;\r\n }\r\n // Cancel previous batch processing if we're working on the first batch:\r\n if (iFirst === 0) {\r\n google.maps.event.trigger(this, \"clusteringbegin\", this);\r\n if (typeof this.timerRefStatic !== \"undefined\") {\r\n clearTimeout(this.timerRefStatic);\r\n delete this.timerRefStatic;\r\n }\r\n }\r\n // Get our current map view bounds.\r\n // Create a new bounds object so we don't affect the map.\r\n //\r\n // See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug:\r\n let mapBounds;\r\n if (this.getMap().getZoom() > 3) {\r\n mapBounds = new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(), this.getMap().getBounds().getNorthEast());\r\n }\r\n else {\r\n mapBounds = new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625));\r\n }\r\n const bounds = this.getExtendedBounds(mapBounds);\r\n const iLast = Math.min(iFirst + this.batchSize_, this.markers_.length);\r\n for (let i = iFirst; i < iLast; i++) {\r\n const marker = this.markers_[i];\r\n if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) {\r\n if (!this.ignoreHidden_ ||\r\n (this.ignoreHidden_ && marker.getVisible())) {\r\n this.addToClosestCluster_(marker);\r\n }\r\n }\r\n }\r\n if (iLast < this.markers_.length) {\r\n this.timerRefStatic = window.setTimeout(() => {\r\n this.createClusters_(iLast);\r\n }, 0);\r\n }\r\n else {\r\n delete this.timerRefStatic;\r\n google.maps.event.trigger(this, \"clusteringend\", this);\r\n for (let i = 0; i < this.clusters_.length; i++) {\r\n this.clusters_[i].updateIcon();\r\n }\r\n }\r\n }\r\n /**\r\n * The default function for determining the label text and style\r\n * for a cluster icon.\r\n *\r\n * @param markers The array of markers represented by the cluster.\r\n * @param numStyles The number of marker styles available.\r\n * @return The information resource for the cluster.\r\n */\r\n static CALCULATOR(markers, numStyles) {\r\n let index = 0;\r\n const count = markers.length;\r\n let dv = count;\r\n while (dv !== 0) {\r\n dv = Math.floor(dv / 10);\r\n index++;\r\n }\r\n index = Math.min(index, numStyles);\r\n return {\r\n text: count.toString(),\r\n index: index,\r\n title: \"\"\r\n };\r\n }\r\n /**\r\n * Generates default styles augmented with user passed values.\r\n * Useful when you want to override some default values but keep untouched\r\n *\r\n * @param overrides override default values\r\n */\r\n static withDefaultStyle(overrides) {\r\n return Object.assign({ textColor: \"black\", textSize: 11, textDecoration: \"none\", textLineHeight: overrides.height, fontWeight: \"bold\", fontStyle: \"normal\", fontFamily: \"Arial,sans-serif\", backgroundPosition: \"0 0\" }, overrides);\r\n }\r\n}\r\n/**\r\n * The number of markers to process in one batch.\r\n */\r\nMarkerClusterer.BATCH_SIZE = 2000;\r\n/**\r\n * The number of markers to process in one batch (IE only).\r\n */\r\nMarkerClusterer.BATCH_SIZE_IE = 500;\r\n/**\r\n * The default root name for the marker cluster images.\r\n */\r\nMarkerClusterer.IMAGE_PATH = \"../images/m\";\r\n/**\r\n * The default extension name for the marker cluster images.\r\n */\r\nMarkerClusterer.IMAGE_EXTENSION = \"png\";\r\n/**\r\n * The default array of sizes for the marker cluster images.\r\n */\r\nMarkerClusterer.IMAGE_SIZES = [53, 56, 66, 78, 90];\n\n/**\r\n * Copyright 2019 Google LLC. All Rights Reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\n\nexport default MarkerClusterer;\n//# sourceMappingURL=markerclustererplus.esm.js.map\n"],"sourceRoot":""}