1/*! ***************************************************************************** 2 @kristjan.esperanto/leaflet.markercluster 3 Version 3.0.3+main.99a8232 4 5 Provides beautiful animated Marker clustering functionality for Leaflet. 6 Please submit bugs at https://github.com/KristjanESPERANTO/Leaflet.markercluster/issues 7 8 © Dave Leaver and contributors 9 License: MIT 10 11 This file is auto-generated. Do not edit. 12***************************************************************************** */ 13import{Marker,Icon,LatLng,LatLngBounds,Util,LayerGroup,FeatureGroup,Browser,Polygon,DivIcon,Point,Polyline,Path}from"leaflet";const DistanceGrid=function(t){this._cellSize=t,this._sqCellSize=t*t,this._grid=new Map,this._objectPoint=new Map};DistanceGrid.prototype={addObject:function(t,e){const i=this._getCoord(e.x),n=this._getCoord(e.y),s=this._grid;let o=s.get(n);o||(o=new Map,s.set(n,o));let r=o.get(i);r||(r=[],o.set(i,r)),this._objectPoint.set(t,e),r.push(t)},updateObject:function(t,e){this.removeObject(t,e),this.addObject(t,e)},removeObject:function(t,e){const i=this._getCoord(e.x),n=this._getCoord(e.y),s=this._grid.get(n),o=s?.get(i);if(!o)return!1;this._objectPoint.delete(t);const r=o.indexOf(t);if(-1===r)return!1;const a=o.length-1;return r<a&&(o[r]=o[a]),o.pop(),0===o.length&&(s.delete(i),0===s.size&&this._grid.delete(n)),!0},eachObject:function(t,e){for(const i of this._grid.values())for(const n of i.values())for(let i=0,s=n.length;i<s;i++){t.call(e,n[i])&&(i--,s--)}},getNearObject:function(t){const e=this._getCoord(t.x),i=this._getCoord(t.y),n=this._objectPoint;let s=this._sqCellSize,o=null;for(let r=i-1;r<=i+1;r++){const i=this._grid.get(r);if(i)for(let r=e-1;r<=e+1;r++){const e=i.get(r);if(e)for(let i=0,r=e.length;i<r;i++){const r=e[i],a=this._sqDist(n.get(r),t);(a<s||a<=s&&null===o)&&(s=a,o=r)}}}return o},_getCoord:function(t){const e=Math.floor(t/this._cellSize);return isFinite(e)?e:t},_sqDist:function(t,e){const i=e.x-t.x,n=e.y-t.y;return i*i+n*n}};const QuickHull={getDistant:function(t,e){const i=e[1].lat-e[0].lat;return(e[0].lng-e[1].lng)*(t.lat-e[0].lat)+i*(t.lng-e[0].lng)},findMostDistantPointFromBaseLine:function(t,e){let i=0,n=null;const s=[];let o,r,a;for(o=e.length-1;o>=0;o--)r=e[o],a=this.getDistant(r,t),a>0&&(s.push(r),a>i&&(i=a,n=r));return{maxPoint:n,newPoints:s}},buildConvexHull:function(t,e){let i=[];const n=this.findMostDistantPointFromBaseLine(t,e);return n.maxPoint?(i=i.concat(this.buildConvexHull([t[0],n.maxPoint],n.newPoints)),i=i.concat(this.buildConvexHull([n.maxPoint,t[1]],n.newPoints)),i):[t[0]]},getConvexHull:function(t){let e,i,n,s=!1,o=!1,r=!1,a=!1,l=null,h=null,u=null,_=null;for(n=t.length-1;n>=0;n--){const e=t[n];(!1===s||e.lat>s)&&(l=e,s=e.lat),(!1===o||e.lat<o)&&(h=e,o=e.lat),(!1===r||e.lng>r)&&(u=e,r=e.lng),(!1===a||e.lng<a)&&(_=e,a=e.lng)}o!==s?(i=h,e=l):(i=_,e=u);return[].concat(this.buildConvexHull([i,e],t),this.buildConvexHull([e,i],t))}},quickHullMethods={getConvexHull:function(){const t=this.getAllChildMarkers(),e=[];let i,n;for(n=t.length-1;n>=0;n--)i=t[n].getLatLng(),e.push(i);return QuickHull.getConvexHull(e)}},MarkerCluster$1=Marker.extend({...quickHullMethods,options:Icon.prototype.options,initialize:function(t,e,i,n){Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new LatLng(0,0),{icon:this,pane:t.options.clusterPane}),this._group=t,this._zoom=e,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new LatLngBounds,i&&this._addChild(i),n&&this._addChild(n)},getAllChildMarkers:function(t,e){t=t||[];for(let i=this._childClusters.length-1;i>=0;i--)this._childClusters[i].getAllChildMarkers(t,e);for(let i=this._markers.length-1;i>=0;i--)e&&this._markers[i].__dragStart||t.push(this._markers[i]);return t},getChildCount:function(){return this._childCount},onAdd:function(t){Marker.prototype.onAdd.call(this,t),this._bindIconEvents(),this._setClusterTitle()},_bindIconEvents:function(){if(this._icon&&!this._iconEventsBound){const t=this;this._icon.addEventListener("mouseover",this._onMouseOver=function(e){t._group&&t._group.fire("mouseover",{originalEvent:e,sourceTarget:t,layer:t})}),this._icon.addEventListener("mouseout",this._onMouseOut=function(e){t._group&&t._group.fire("mouseout",{originalEvent:e,sourceTarget:t,layer:t})}),this._iconEventsBound=!0}},onRemove:function(t){this._icon&&this._onMouseOver&&(this._icon.removeEventListener("mouseover",this._onMouseOver),this._icon.removeEventListener("mouseout",this._onMouseOut),this._onMouseOver=null,this._onMouseOut=null,this._iconEventsBound=!1),Marker.prototype.onRemove.call(this,t)},zoomToBounds:function(t){let e=this._childClusters.slice();const i=this._group._map,n=i.getBoundsZoom(this._bounds);let s=this._zoom+1;const o=i.getZoom();let r;for(;e.length>0&&n>s;){s++;let t=[];for(r=0;r<e.length;r++)t=t.concat(e[r]._childClusters);e=t}n>
13s?this._group._map.setView(this._latlng,s):n<=o?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,t)},getBounds:function(){const t=new LatLngBounds;return t.extend(this._bounds),t},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&(this.setIcon(this),this._bindIconEvents(),this._setClusterTitle())},_setClusterTitle:function(){if(this._group.options.clusterMarkerTitle&&this._icon){let t;t="function"==typeof this._group.options.clusterMarkerTitle?this._group.options.clusterMarkerTitle(this):this._group.options.clusterMarkerTitle,this._icon.title=t}},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(t,e){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(t),t instanceof MarkerCluster$1?(e||(this._childClusters.push(t),t.__parent=this),this._childCount+=t._childCount):(e||this._markers.push(t),this._childCount++),this.__parent&&this.__parent._addChild(t,!0)},_setClusterCenter:function(t){this._cLatLng||(this._cLatLng=t._cLatLng||t._latlng)},_resetBounds:function(){const t=this._bounds;t._southWest&&(t._southWest.lat=1/0,t._southWest.lng=1/0),t._northEast&&(t._northEast.lat=-1/0,t._northEast.lng=-1/0)},_recalculateBounds:function(){const t=this._markers,e=this._childClusters;let i=0,n=0;const s=this._childCount;let o,r,a,l;if(0!==s){for(this._resetBounds(),o=0;o<t.length;o++)a=t[o]._latlng,this._bounds.extend(a),i+=a.lat,n+=a.lng;for(o=0;o<e.length;o++)r=e[o],r._boundsNeedUpdate&&r._recalculateBounds(),this._bounds.extend(r._bounds),a=r._wLatLng,l=r._childCount,i+=a.lat*l,n+=a.lng*l;this._latlng=this._wLatLng=new LatLng(i/s,n/s),this._boundsNeedUpdate=!1}},_addToMap:function(t){t&&(this._backupLatlng=this._latlng,this.setLatLng(t)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(t,e,i){this._recursively(t,this._group._map.getMinZoom(),i-1,function(t){const i=t._markers;let n,s;for(n=i.length-1;n>=0;n--)s=i[n],s._icon&&(s._setPos(e),s.clusterHide())},function(t){const i=t._childClusters;let n,s;for(n=i.length-1;n>=0;n--)s=i[n],s._icon&&(s._setPos(e),s.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(t,e,i,n,s){this._recursively(t,s,i,function(o){o._recursivelyAnimateChildrenIn(t,o._group._map.latLngToLayerPoint(o.getLatLng()).round(),n),o._isSingleParent()&&n-1===s?(o.clusterShow(),o._recursivelyRemoveChildrenFromMap(e,i,n)):o.clusterHide(),o._addToMap()})},_recursivelyBecomeVisible:function(t,e){this._recursively(t,this._group._map.getMinZoom(),e,null,function(t){t.clusterShow()})},_recursivelyAddChildrenToMap:function(t,e,i){this._recursively(i,this._group._map.getMinZoom()-1,e,function(n){if(e!==n._zoom)for(let e=n._markers.length-1;e>=0;e--){const s=n._markers[e];i.contains(s._latlng)&&(t&&(s._backupLatlng=s.getLatLng(),s.setLatLng(t),s.clusterHide&&s.clusterHide()),n._group._featureGroup.addLayer(s))}},function(e){e._addToMap(t)})},_recursivelyRestoreChildPositions:function(t){for(let t=this._markers.length-1;t>=0;t--){const e=this._markers[t];e._backupLatlng&&(e.setLatLng(e._backupLatlng),delete e._backupLatlng)}if(t-1===this._zoom)for(let t=this._childClusters.length-1;t>=0;t--)this._childClusters[t]._restorePosition();else for(let e=this._childClusters.length-1;e>=0;e--)this._childClusters[e]._recursivelyRestoreChildPositions(t)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(t,e,i,n){let s,o;this._recursively(t,e-1,i-1,function(t){for(o=t._markers.length-1;o>=0;o--)s=t._markers[o],n&&n.contains(s._latlng)||(t._group._featureGroup.removeLayer(s),s.clusterShow&&s.clusterShow())},function(t){for(o=t._childClusters.length-1;o>=0;o--)s=t._childClusters[o],n&&n.contains(s._latlng)||(t._group._featureGroup.removeLayer(s),s.clusterShow&&s.clusterShow())})},_recursively:function(t,e,i,n,s){const o=this._childClusters,r=this._zoom;let a,l;if(e<=r&&(n&&n(this),s&&r===i&&s(this)),r<e||r<i)for(a=o.length-1;a>=0;
13a--)l=o[a],l._boundsNeedUpdate&&l._recalculateBounds(),t.intersects(l._bounds)&&l._recursively(t,e,i,n,s)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});let MarkerClusterGroup$1,MarkerCluster;function setClusterClasses(t,e){MarkerClusterGroup$1=t,MarkerCluster=e}const refreshMethods={refreshClusters:function(t){return t?t instanceof MarkerClusterGroup$1?t=t._topClusterLevel.getAllChildMarkers():t instanceof LayerGroup?t=t._layers:t instanceof MarkerCluster?t=t.getAllChildMarkers():t instanceof Marker&&(t=[t]):t=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(t),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(t),this},_flagParentsIconsNeedUpdate:function(t){let e,i;for(e in t)for(i=t[e].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers:function(t){let e,i;for(e in t)i=t[e],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}};Marker.include({refreshIconOptions:function(t,e){const i=this.options.icon;return Util.setOptions(i,t),this.setIcon(i),e&&this.__parent&&this.__parent._group.refreshClusters(this),this}});const animationMethods={_noAnimation:{_animationStart:function(){},_animationZoomIn:function(t,e){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),t),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(t,e){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),t),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(t,e){this._animationAddLayerNonAnimated(t,e)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(t,e){const i=this._getExpandedVisibleBounds(),n=this._featureGroup,s=Math.floor(this._map.getMinZoom());let o;this._ignoreMove=!0,this._topClusterLevel._recursively(i,t,s,function(s){let r=s._latlng;const a=s._markers;let l;if(i.contains(r)||(r=null),s._isSingleParent()&&t+1===e?(n.removeLayer(s),s._recursivelyAddChildrenToMap(null,e,i)):(s.clusterHide(),s._recursivelyAddChildrenToMap(r,e,i)),s._zoom===t)for(o=a.length-1;o>=0;o--)l=a[o],i.contains(l._latlng)||n.removeLayer(l)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(i,e),n.eachLayer(function(t){t instanceof MarkerCluster$1||!t._icon||t.clusterShow()}),this._topClusterLevel._recursively(i,t,e,function(t){t._recursivelyRestoreChildPositions(e)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(i,t,s,function(t){n.removeLayer(t),t.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(t,e){this._animationZoomOutSingle(this._topClusterLevel,t-1,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),t,this._getExpandedVisibleBounds())},_animationAddLayer:function(t,e){const i=this,n=this._featureGroup;n.addLayer(t),e!==t&&(e._childCount>2?(e._updateIcon(),this._forceLayout(),this._animationStart(),t._setPos(this._map.latLngToLayerPoint(e.getLatLng())),t.clusterHide(),this._enqueue(function(){n.removeLayer(t),t.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(e,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(t,e,i){const n=this._getExpandedVisibleBounds(),s=Math.floor(this._map.getMinZoom());t._recursivelyAnimateChildrenInAndAddSelfToMap(n,this._currentShownBounds,s,e+1,i);const o=this;this._forceLayout(),t._recursivelyBecomeVisible(n,i),this._enqueue(function(){if(1===t._childCount){const e=t._markers[0];this._ignoreMove=!0,e.setLatLng(e.getLatLng()),this._ignoreMove=!1,e.clusterShow&&e.clusterShow()}else t._recursively(n,i,s,function(t){t._recursivelyRemoveChildrenFromMap(n,s,e+1)});o._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:function(){document.body.offsetWidth}},MarkerClusterGroup=FeatureGroup.extend({...refreshMethods,...animationMethods,options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,clusterMarkerTitle:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!0,chunkInterval:80,chunkDelay:20,chunkProgress:null,polygonOptions:{}},initialize:function(t){Util.setOptions(this,t),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=new FeatureGroup,this._featureGroup.addEventParent(this),this._nonPointGroup=new FeatureGroup,this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};const e=this.options.animate;Object.assign(this,e?this._withAnimation:this._noAnimation),this.on("add",this._spiderfierSetup,this),this.on("remove",this._spiderfierCleanup,this)},addLayer:function(t){if(t instanceof LayerGroup)return this.addLayers([t]);if(!t.getLatLng)return this._nonPointGroup.addLayer(t),this.fire("layeradd",{layer:t}),this;if(!this._map)return this._needsClustering.push(t),this.fire("layeradd",{layer:t}),this;if(this.hasLayer(t))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(t,this._maxZoom),this.fire("layeradd",{layer:t}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();let e=t;const i=this._zoom;if(t.__parent)for(;e.__parent._zoom>=i&&void 0!==e.__parent;)e=e.__parent;
13return this._currentShownBounds.contains(e.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(t,e):this._animationAddLayerNonAnimated(t,e)),this},removeLayer:function(t){return t instanceof LayerGroup?this.removeLayers([t]):t.getLatLng?this._map?t.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(t)),this._removeLayer(t,!0),this.fire("layerremove",{layer:t}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),t.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(t)&&(this._featureGroup.removeLayer(t),t.clusterShow&&t.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,t)&&this.hasLayer(t)&&this._needsRemoving.push({layer:t,latlng:t._latlng}),this.fire("layerremove",{layer:t}),this):(this._nonPointGroup.removeLayer(t),this.fire("layerremove",{layer:t}),this)},addLayers:function(t,e){if(!Array.isArray(t))return this.addLayer(t);const i=this._featureGroup,n=this._nonPointGroup,s=this.options.chunkedLoading,o=this.options.chunkInterval,r=this.options.chunkProgress;let a,l=t.length,h=0,u=!0;if(this._map){const _=(new Date).getTime(),d=[],c=function(){const p=(new Date).getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();h<l;h++){if(s&&h%200==0){if((new Date).getTime()-p>o)break}if(a=t[h],a instanceof LayerGroup)u&&(t=t.slice(),u=!1),this._extractNonGroupLayers(a,t),l=t.length;else if(a.getLatLng){if(!this.hasLayer(a)&&(this._addLayer(a,this._maxZoom),e||d.push(a),a.__parent&&2===a.__parent.getChildCount())){const t=a.__parent.getAllChildMarkers(),e=t[0]===a?t[1]:t[0];i.removeLayer(e)}}else n.addLayer(a),e||d.push(a)}r&&r(h,l,(new Date).getTime()-_),h===l?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),d.length>0&&this.fire("layersadd",{layers:d})):setTimeout(c,this.options.chunkDelay)}.bind(this);c()}else{let e=new Array(l-h),i=0;for(;h<l;h++)a=t[h],a instanceof LayerGroup?(u&&(t=t.slice(),u=!1),this._extractNonGroupLayers(a,t),l=t.length):a.getLatLng?this.hasLayer(a)||(e[i++]=a):n.addLayer(a);e=e.slice(0,i),this._needsClustering=this._needsClustering.concat(e)}return this},removeLayers:function(t){let e,i,n=t.length;const s=this._featureGroup,o=this._nonPointGroup;let r=!0;if(!this._map){for(e=0;e<n;e++)i=t[e],i instanceof LayerGroup?(r&&(t=t.slice(),r=!1),this._extractNonGroupLayers(i,t),n=t.length):(this._arraySplice(this._needsClustering,i),o.removeLayer(i),this.hasLayer(i)&&this._needsRemoving.push({layer:i,latlng:i._latlng}),this.fire("layerremove",{layer:i}));return this}if(this._unspiderfy){this._unspiderfy();const s=t.slice();let o=n;for(e=0;e<o;e++)i=s[e],i instanceof LayerGroup?(this._extractNonGroupLayers(i,s),o=s.length):this._unspiderfyLayer(i)}for(e=0;e<n;e++)i=t[e],i instanceof LayerGroup?(r&&(t=t.slice(),r=!1),this._extractNonGroupLayers(i,t),n=t.length):i.__parent?(this._removeLayer(i,!0,!0),this.fire("layerremove",{layer:i}),s.hasLayer(i)&&(s.removeLayer(i),i.clusterShow&&i.clusterShow())):(o.removeLayer(i),this.fire("layerremove",{layer:i}));return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],this._needsRemoving=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(t){t.off(this._childMarkerEventHandlers,this),delete t.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){const t=new LatLngBounds;this._topClusterLevel&&t.extend(this._topClusterLevel._bounds);for(let e=this._needsClustering.length-1;e>=0;e--)t.extend(this._needsClustering[e].getLatLng());return t.extend(this._nonPointGroup.getBounds()),t},eachLayer:function(t,e){const i=this._needsClustering.slice(),n=this._needsRemoving;let s,o,r;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(i),o=i.length-1;o>=0;o--){for(s=!0,r=n.length-1;r>=0;r--)if(n[r].layer===i[o]){s=!1;break}s&&t.call(e,i[o])}this._nonPointGroup.eachLayer(t,e)},getLayers:function(){const t=[];return this.eachLayer(function(e){t.push(e)}),t},getLayer:function(t){let e=null;return t=parseInt(t,10),this.eachLayer(function(i){Util.stamp(i)===t&&(e=i)}),e},hasLayer:function(t){if(!t)return!1;let e,i=this._needsClustering;for(e=i.length-1;e>=0;e--)if(i[e]===t)return!0;for(i=this._needsRemoving,e=i.length-1;e>=0;e--)if(i[e].layer===t)return!1;return!(!t.__parent||t.__parent._group!==this)||this._nonPointGroup.hasLayer(t)},zoomToShowLayer:function(t,e){const i=this._map;"function"!=typeof e&&(e=function(){});const n=function(){!i.hasLayer(t)&&!i.hasLayer(t.__parent)||this._inZoomAnimation||(this._map.off("moveend",n,this),this.off("animationend",n,this),i.hasLayer(t)?e():t.__parent._icon&&(this.once("spiderfied",e,this),t.__parent.spiderfy()))};t._icon&&this._map.getBounds().contains(t.getLatLng())?e():t.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",n,this),this._map.panTo(t.getLatLng())):(this._map.on("moveend",n,this),this.on("animationend",n,this),t.__parent.zoomToBounds())},onAdd:function(t){let e,i,n;if(this._map=t,!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";
13for(this._featureGroup.addTo(t),this._nonPointGroup.addTo(t),this._gridClusters||this._generateInitialClusters(),this._maxLat=t.options.crs.projection.MAX_LATITUDE,e=0,i=this._needsRemoving.length;e<i;e++)n=this._needsRemoving[e],n.newlatlng=n.layer._latlng,n.layer._latlng=n.latlng;for(e=0,i=this._needsRemoving.length;e<i;e++)n=this._needsRemoving[e],this._removeLayer(n.layer,!0),n.layer._latlng=n.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._bindEvents(),this.fire("add",{target:this}),i=this._needsClustering,this._needsClustering=[],this.addLayers(i,!0)},onRemove:function(t){t.off("zoomend",this._zoomEnd,this),t.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this.fire("remove",{target:this}),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(t){let e=t;for(;e&&!e._icon;)e=e.__parent;return e||null},_arraySplice:function(t,e){for(let i=t.length-1;i>=0;i--)if(t[i]===e)return t.splice(i,1),!0},_removeFromGridUnclustered:function(t,e){const i=this._map,n=this._gridUnclustered,s=Math.floor(this._map.getMinZoom());for(;e>=s&&n[e].removeObject(t,i.project(t.getLatLng(),e));e--);},_childMarkerDragStart:function(t){t.target.__dragStart=t.target._latlng},_childMarkerMoved:function(t){if(!this._ignoreMove&&!t.target.__dragStart){const e=t.target._popup&&t.target._popup.isOpen();this._moveChild(t.target,t.oldLatLng,t.latlng),e&&t.target.openPopup()}},_moveChild:function(t,e,i){t._latlng=e,this.removeLayer(t),t._latlng=i,this.addLayer(t)},_childMarkerDragEnd:function(t){const e=t.target.__dragStart;delete t.target.__dragStart,e&&this._moveChild(t.target,e,t.target._latlng)},_removeLayer:function(t,e,i){const n=this._gridClusters,s=this._gridUnclustered,o=this._featureGroup,r=this._map,a=Math.floor(this._map.getMinZoom());e&&this._removeFromGridUnclustered(t,this._maxZoom);let l=t.__parent;const h=l._markers;let u;for(this._arraySplice(h,t);l&&(l._childCount--,l._boundsNeedUpdate=!0,!(l._zoom<a));)e&&l._childCount<=1?(u=l._markers[0]===t?l._markers[1]:l._markers[0],n[l._zoom].removeObject(l,r.project(l._cLatLng,l._zoom)),s[l._zoom].addObject(u,r.project(u.getLatLng(),l._zoom)),this._arraySplice(l.__parent._childClusters,l),l.__parent._markers.push(u),u.__parent=l.__parent,l._icon&&(o.removeLayer(l),i||o.addLayer(u))):l._iconNeedsUpdate=!0,l=l.__parent;delete t.__parent},_isOrIsParent:function(t,e){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},fire:function(t,e,i){const n=e&&(e.sourceTarget||e.layer)||null;if(n instanceof MarkerCluster$1){if(e&&e.originalEvent&&this._isOrIsParent(n._icon,e.originalEvent.relatedTarget))return;t="cluster"+t}FeatureGroup.prototype.fire.call(this,t,e,i)},listens:function(t,e){return FeatureGroup.prototype.listens.call(this,t,e)||FeatureGroup.prototype.listens.call(this,"cluster"+t,e)},_defaultIconCreateFunction:function(t){const e=t.getChildCount();let i=" marker-cluster-";return i+=e<10?"small":e<100?"medium":"large",new DivIcon({html:'<div><span aria-label="Cluster, '+e+' markers">'+e+"</span></div>",className:"marker-cluster"+i,iconSize:new Point(40,40)})},_bindEvents:function(){const t=this._map,e=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick,s=this.options.spiderfyOnEveryZoom;(e||n||s)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),t.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(t){const e=t.sourceTarget;let i=e;if(!("clusterkeypress"===t.type&&t.originalEvent&&13!==t.originalEvent.keyCode||t.originalEvent&&t.originalEvent.defaultPrevented)){for(;1===i._childClusters.length;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===e._childCount&&this.options.spiderfyOnMaxZoom?e.spiderfy():this.options.zoomToBoundsOnClick&&e.zoomToBounds(),this.options.spiderfyOnEveryZoom&&e.spiderfy(),t.originalEvent&&13===t.originalEvent.keyCode&&this._map._container.focus()}},_showCoverage:function(t){const e=this._map;this._inZoomAnimation||(this._shownPolygon&&e.removeLayer(this._shownPolygon),t.sourceTarget.getChildCount()>2&&t.sourceTarget!==this._spiderfied&&(this._shownPolygon=new Polygon(t.sourceTarget.getConvexHull(),this.options.polygonOptions),e.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){const t=this.options.spiderfyOnMaxZoom,e=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,n=this.options.spiderfyOnEveryZoom,s=this._map;(t||i||n)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),e&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),s.off("zoomend",this._hideCoverage,this))}
13,_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(this._inZoomAnimation)return;const t=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),t),this._currentShownBounds=t},_generateInitialClusters:function(){let t=Math.ceil(this._map.getMaxZoom());const e=Math.floor(this._map.getMinZoom()),i=this.options.maxClusterRadius;let n=i;if("function"!=typeof i&&(n=function(){return i}),null!==this.options.disableClusteringAtZoom&&(t=this.options.disableClusteringAtZoom-1),this._maxZoom=t,this._gridClusters={},this._gridUnclustered={},!isFinite(t))throw"Map has no maxZoom specified";if(!isFinite(e))throw"Map has no minZoom specified";for(let i=t;i>=e;i--)this._gridClusters[i]=new DistanceGrid(n(i)),this._gridUnclustered[i]=new DistanceGrid(n(i));const s=this.options.animate?MarkerCluster$1:MarkerCluster$1.NonAnimated;this._topClusterLevel=new s(this,e-1)},_addLayer:function(t,e){const i=this._gridClusters,n=this._gridUnclustered,s=Math.floor(this._map.getMinZoom());let o,r;for(this.options.singleMarkerMode&&this._overrideMarkerIcon(t),t.on(this._childMarkerEventHandlers,this);e>=s;e--){o=this._map.project(t.getLatLng(),e);let s=i[e].getNearObject(o);if(s)return s._addChild(t),void(t.__parent=s);if(s=n[e].getNearObject(o),s){const n=s.__parent;n&&this._removeLayer(s,!1);const o=new(this.options.animate?MarkerCluster$1:MarkerCluster$1.NonAnimated)(this,e,s,t);i[e].addObject(o,this._map.project(o._cLatLng,e)),s.__parent=o,t.__parent=o;let a=o;for(r=e-1;r>n._zoom;r--){a=new(this.options.animate?MarkerCluster$1:MarkerCluster$1.NonAnimated)(this,r,a),i[r].addObject(a,this._map.project(s.getLatLng(),r))}return n._addChild(a),void this._removeFromGridUnclustered(s,e)}n[e].addObject(t,o)}this._topClusterLevel._addChild(t),t.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(t){t instanceof MarkerCluster$1&&t._iconNeedsUpdate&&t._updateIcon()})},_enqueue:function(t){this._queue.push(t),this._queueTimeout||(this._queueTimeout=setTimeout(this._processQueue.bind(this),300))},_processQueue:function(){for(let t=0;t<this._queue.length;t++)this._queue[t].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){const t=Math.round(this._map._zoom);this._processQueue(),this._zoom<t&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,t)):this._zoom>t?(this._animationStart(),this._animationZoomOut(this._zoom,t)):this._moveEnd()},_getExpandedVisibleBounds:function(){return this.options.removeOutsideVisibleBounds?Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat:function(t){const e=this._maxLat;return void 0!==e&&(t.getNorth()>=e&&(t._northEast.lat=1/0),t.getSouth()<=-e&&(t._southWest.lat=-1/0)),t},_animationAddLayerNonAnimated:function(t,e){if(e===t)this._featureGroup.addLayer(t);else if(2===e._childCount){e._addToMap();const t=e.getAllChildMarkers();this._featureGroup.removeLayer(t[0]),this._featureGroup.removeLayer(t[1])}else e._updateIcon()},_extractNonGroupLayers:function(t,e){const i=t.getLayers();let n,s=0;for(e=e||[];s<i.length;s++)n=i[s],n instanceof LayerGroup?this._extractNonGroupLayers(n,e):e.push(n);return e},_overrideMarkerIcon:function(t){return t.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[t]}})},_mapBoundsInfinite:new LatLngBounds(new LatLng(-1/0,-1/0),new LatLng(1/0,1/0))});setClusterClasses(MarkerClusterGroup,MarkerCluster$1);const MarkerClusterSpiderfierMethods={_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied===this||this._group._inZoomAnimation)return;const t=this.getAllChildMarkers(null,!0),e=this._group._map.latLngToLayerPoint(this._latlng);let i;this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?i=this._group.options.spiderfyShapePositions(t.length,e):t.length>=this._circleSpiralSwitchover?i=this._generatePointsSpiral(t.length,e):(e.y+=10,i=this._generatePointsCircle(t.length,e)),this._animationSpiderfy(t,i)},unspiderfy:function(t){this._group._inZoomAnimation||(this._animationUnspiderfy(t),this._group._spiderfied=null)},_generatePointsCircle:function(t,e){let i=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+t)/this._2PI;const n=this._2PI/t,s=[];let o,r;for(i=Math.max(i,35),s.length=t,o=0;o<t;o++)r=this._circleStartAngle+o*n,s[o]=new Point(e.x+i*Math.cos(r),e.y+i*Math.sin(r))._round();return s},_generatePointsSpiral:function(t,e){const i=this._group.options.spiderfyDistanceMultiplier;let n=i*this._spiralLengthStart;const s=i*this._spiralFootSeparation,o=i*this._spiralLengthFactor*this._2PI;let r=0;const a=[];let l;for(a.length=t,l=t;l>=0;l--)l<t&&(a[l]=new Point(e.x+n*Math.cos(r),e.y+n*Math.sin(r))._round()),r+=s/n+5e-4*l,n+=o/r;return a},_noanimationUnspiderfy:function(){const t=this._group,e=t._map,i=t._featureGroup,n=this.getAllChildMarkers(null,!0);let s,o;for(t._ignoreMove=!0,this.setOpacity(1),o=n.length-1;o>=0;o--)s=n[o],i.removeLayer(s),s._preSpiderfyLatlng&&(s.setLatLng(s._preSpiderfyLatlng),delete s._preSpiderfyLatlng),s.setZIndexOffset&&s.setZIndexOffset(0),s._spiderLeg&&(e.removeLayer(s._spiderLeg),delete s._spiderLeg);t.fire("unspiderfied",{cluster:this,markers:n}),t._ignoreMove=!1,t._spiderfied=null}},MarkerClusterNonAnimated=MarkerCluster$1.extend({_animationSpiderfy:function(t,e){const i=this._group,n=i._map,s=i._featureGroup,o=this._group.options.spiderLegPolylineOptions;let r,a,l,h;for(i._ignoreMove=!0,r=0;r<t.length;r++)h=n.layerPointToLatLng(e[r]),a=t[r],l=new Polyline([this._latlng,h],o),n.addLayer(l),a._spiderLeg=l,a._preSpiderfyLatlng=a._latlng,a.setLatLng(h),a.setZIndexOffset&&a.setZIndexOffset(1e6),s.addLayer(a);this.setOpacity(.3),i._ignoreMove=!1,i.fire("spiderfied",{cluster:this,markers:t})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),MarkerClusterAnimatedSpiderfierMethods={_animationSpiderfy:function(t,e){const i=this,n=this._group,s=n._map,o=n._featureGroup,r=this._latlng,a=s.latLngToLayerPoint(r),l=Path.SVG,h=Object.assign({},this._group.options.spiderLegPolylineOptions);let u,_,d,c,p,f,g=h.opacity;for(void 0===g&&(g=.5),l?(h.opacity=0,h.className=(h.className||"")+" leaflet-cluster-spider-leg"):h.opacity=g,n._ignoreMove=!0,u=0;u<t.length;u++)_=t[u],f=s.layerPointToLatLng(e[u]),d=new Polyline([r,f],h),s.addLayer(d),_._spiderLeg=d,l&&(c=d._path,p=c.getTotalLength()+.1,c.style.strokeDasharray=p,c.style.strokeDashoffset=p),_.setZIndexOffset&&_.setZIndexOffset(1e6),_.clusterHide&&_.clusterHide(),o.addLayer(_),_._setPos&&_._setPos(a);for(n._forceLayout(),n._animationStart(),u=t.length-1;u>=0;u--)f=s.layerPointToLatLng(e[u]),_=t[u],_._preSpiderfyLatlng=_._latlng,_.setLatLng(f),_.clusterShow&&_.clusterShow(),l&&(d=_._spiderLeg,c=d._path,c.style.strokeDashoffset=0,d.setStyle({opacity:g}));this.setOpacity(.3),n._ignoreMove=!1,setTimeout(function(){n._animationEnd(),n.fire("spiderfied",{cluster:i,markers:t})},200)},_animationUnspiderfy:function(t){const e=this,i=this._group,n=i._map,s=i._featureGroup,o=t?n._latLngToNewLayerPoint(this._latlng,t.zoom,t.center):n.latLngToLayerPoint(this._latlng),r=this.getAllChildMarkers(null,!0),a=Path.SVG;let l,h,u,_,d,c;for(i._ignoreMove=!0,i._animationStart(),this.setOpacity(1),h=r.length-1;h>=0;h--)l=r[h],l._preSpiderfyLatlng&&(l.closePopup(),l.setLatLng(l._preSpiderfyLatlng),delete l._preSpiderfyLatlng,c=!0,l._setPos&&(l._setPos(o),c=!1),l.clusterHide&&(l.clusterHide(),c=!1),c&&s.removeLayer(l),a&&(u=l._spiderLeg,_=u._path,d=_.getTotalLength()+.1,_.style.strokeDashoffset=d,u.setStyle({opacity:0}
13)));i._ignoreMove=!1,setTimeout(function(){let t=0;for(h=r.length-1;h>=0;h--)l=r[h],l._spiderLeg&&t++;for(h=r.length-1;h>=0;h--)l=r[h],l._spiderLeg&&(l.clusterShow&&l.clusterShow(),l.setZIndexOffset&&l.setZIndexOffset(0),t>1&&s.removeLayer(l),n.removeLayer(l._spiderLeg),delete l._spiderLeg);i._animationEnd(),i.fire("unspiderfied",{cluster:e,markers:r})},200)}},MarkerClusterGroupSpiderfierMethods={_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierSetup:function(){this._map&&(this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),Browser.touch||this._map.getRenderer(this))},_spiderfierCleanup:function(){this._map&&(this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy())},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(t){this._map._mapPane.classList&&this._map._mapPane.classList.contains("leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(t))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(t){this._spiderfied&&this._spiderfied.unspiderfy(t)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(t){t._spiderLeg&&(this._featureGroup.removeLayer(t),t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),this._map.removeLayer(t._spiderLeg),delete t._spiderLeg)}};MarkerCluster$1.include(MarkerClusterSpiderfierMethods),MarkerCluster$1.include(MarkerClusterAnimatedSpiderfierMethods),MarkerClusterGroup.include(MarkerClusterGroupSpiderfierMethods),MarkerCluster$1.NonAnimated=MarkerClusterNonAnimated,Marker.include({clusterHide:function(){const t=this.options.opacity;return this.setOpacity(0),this.options.opacity=t,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}});export{DistanceGrid,MarkerCluster$1 as MarkerCluster,MarkerClusterGroup,MarkerClusterNonAnimated,QuickHull}; 14//# sourceMappingURL=leaflet.markercluster.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.