vue-leaflet-markercluster
Advanced tools
Comparing version
import type { MarkerClusterGroup } from 'leaflet'; | ||
declare const _sfc_main: { | ||
props: { | ||
readonly maxClusterRadius: { | ||
readonly type: NumberConstructor; | ||
readonly default: 80; | ||
maxClusterRadius: { | ||
type: (NumberConstructor | FunctionConstructor)[]; | ||
default: number; | ||
}; | ||
readonly clusterPane: { | ||
readonly type: StringConstructor; | ||
readonly default: "markerPane"; | ||
clusterPane: { | ||
type: StringConstructor; | ||
default: string; | ||
}; | ||
readonly spiderfyOnEveryZoom: { | ||
readonly type: BooleanConstructor; | ||
readonly default: false; | ||
spiderfyOnEveryZoom: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
readonly spiderfyOnMaxZoom: { | ||
readonly type: BooleanConstructor; | ||
readonly default: true; | ||
spiderfyOnMaxZoom: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
readonly showCoverageOnHover: { | ||
readonly type: BooleanConstructor; | ||
readonly default: true; | ||
showCoverageOnHover: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
readonly zoomToBoundsOnClick: { | ||
readonly type: BooleanConstructor; | ||
readonly default: true; | ||
zoomToBoundsOnClick: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
readonly singleMarkerMode: { | ||
readonly type: BooleanConstructor; | ||
readonly default: false; | ||
singleMarkerMode: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
readonly disableClusteringAtZoom: { | ||
readonly type: NumberConstructor; | ||
readonly default: any; | ||
disableClusteringAtZoom: { | ||
type: NumberConstructor; | ||
default: any; | ||
}; | ||
readonly removeOutsideVisibleBounds: { | ||
readonly type: BooleanConstructor; | ||
readonly default: true; | ||
removeOutsideVisibleBounds: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
readonly animate: { | ||
readonly type: BooleanConstructor; | ||
readonly default: true; | ||
animate: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
readonly animateAddingMarkers: { | ||
readonly type: BooleanConstructor; | ||
readonly default: false; | ||
animateAddingMarkers: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
readonly spiderfyShapePositions: { | ||
readonly type: FunctionConstructor; | ||
readonly default: any; | ||
spiderfyShapePositions: { | ||
type: FunctionConstructor; | ||
default: any; | ||
}; | ||
readonly spiderfyDistanceMultiplier: { | ||
readonly type: NumberConstructor; | ||
readonly default: 1; | ||
spiderfyDistanceMultiplier: { | ||
type: NumberConstructor; | ||
default: number; | ||
}; | ||
readonly spiderLegPolylineOptions: { | ||
readonly type: ObjectConstructor; | ||
readonly default: () => { | ||
spiderLegPolylineOptions: { | ||
type: ObjectConstructor; | ||
default: () => { | ||
weight: number; | ||
@@ -64,41 +64,41 @@ color: string; | ||
}; | ||
readonly chunkedLoading: { | ||
readonly type: BooleanConstructor; | ||
readonly default: false; | ||
chunkedLoading: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
readonly chunkInterval: { | ||
readonly type: NumberConstructor; | ||
readonly default: 200; | ||
chunkInterval: { | ||
type: NumberConstructor; | ||
default: number; | ||
}; | ||
readonly chunkDelay: { | ||
readonly type: NumberConstructor; | ||
readonly default: 50; | ||
chunkDelay: { | ||
type: NumberConstructor; | ||
default: number; | ||
}; | ||
readonly chunkProgress: { | ||
readonly type: FunctionConstructor; | ||
readonly default: any; | ||
chunkProgress: { | ||
type: FunctionConstructor; | ||
default: any; | ||
}; | ||
readonly polygonOptions: { | ||
readonly type: ObjectConstructor; | ||
readonly default: () => {}; | ||
polygonOptions: { | ||
type: ObjectConstructor; | ||
default: () => {}; | ||
}; | ||
readonly iconCreateFunction: { | ||
readonly type: FunctionConstructor; | ||
readonly default: any; | ||
iconCreateFunction: { | ||
type: FunctionConstructor; | ||
default: any; | ||
}; | ||
readonly pane: { | ||
pane: { | ||
readonly type: StringConstructor; | ||
}; | ||
readonly attribution: { | ||
attribution: { | ||
readonly type: StringConstructor; | ||
}; | ||
readonly name: { | ||
name: { | ||
readonly type: StringConstructor; | ||
readonly custom: true; | ||
}; | ||
readonly layerType: { | ||
layerType: { | ||
readonly type: import("vue").PropType<import("@vue-leaflet/vue-leaflet/dist/src/types/enums/LayerType").LayerType>; | ||
readonly custom: true; | ||
}; | ||
readonly visible: { | ||
visible: { | ||
readonly type: BooleanConstructor; | ||
@@ -108,3 +108,3 @@ readonly custom: true; | ||
}; | ||
readonly options: { | ||
options: { | ||
readonly type: ObjectConstructor; | ||
@@ -111,0 +111,0 @@ readonly default: () => {}; |
@@ -13,5 +13,5 @@ import type { Ref, SetupContext, ExtractPropTypes } from 'vue'; | ||
**/ | ||
readonly maxClusterRadius: { | ||
readonly type: NumberConstructor; | ||
readonly default: 80; | ||
maxClusterRadius: { | ||
type: (NumberConstructor | FunctionConstructor)[]; | ||
default: number; | ||
}; | ||
@@ -22,5 +22,5 @@ /** | ||
*/ | ||
readonly clusterPane: { | ||
readonly type: StringConstructor; | ||
readonly default: "markerPane"; | ||
clusterPane: { | ||
type: StringConstructor; | ||
default: string; | ||
}; | ||
@@ -31,5 +31,5 @@ /** | ||
*/ | ||
readonly spiderfyOnEveryZoom: { | ||
readonly type: BooleanConstructor; | ||
readonly default: false; | ||
spiderfyOnEveryZoom: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
@@ -43,5 +43,5 @@ /** | ||
*/ | ||
readonly spiderfyOnMaxZoom: { | ||
readonly type: BooleanConstructor; | ||
readonly default: true; | ||
spiderfyOnMaxZoom: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
@@ -51,5 +51,5 @@ /** | ||
*/ | ||
readonly showCoverageOnHover: { | ||
readonly type: BooleanConstructor; | ||
readonly default: true; | ||
showCoverageOnHover: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
@@ -59,5 +59,5 @@ /** | ||
*/ | ||
readonly zoomToBoundsOnClick: { | ||
readonly type: BooleanConstructor; | ||
readonly default: true; | ||
zoomToBoundsOnClick: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
@@ -71,5 +71,5 @@ /** | ||
*/ | ||
readonly singleMarkerMode: { | ||
readonly type: BooleanConstructor; | ||
readonly default: false; | ||
singleMarkerMode: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
@@ -81,5 +81,5 @@ /** | ||
*/ | ||
readonly disableClusteringAtZoom: { | ||
readonly type: NumberConstructor; | ||
readonly default: any; | ||
disableClusteringAtZoom: { | ||
type: NumberConstructor; | ||
default: any; | ||
}; | ||
@@ -91,5 +91,5 @@ /** | ||
*/ | ||
readonly removeOutsideVisibleBounds: { | ||
readonly type: BooleanConstructor; | ||
readonly default: true; | ||
removeOutsideVisibleBounds: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
@@ -101,5 +101,5 @@ /** | ||
*/ | ||
readonly animate: { | ||
readonly type: BooleanConstructor; | ||
readonly default: true; | ||
animate: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
@@ -113,5 +113,5 @@ /** | ||
*/ | ||
readonly animateAddingMarkers: { | ||
readonly type: BooleanConstructor; | ||
readonly default: false; | ||
animateAddingMarkers: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
@@ -122,5 +122,5 @@ /** | ||
*/ | ||
readonly spiderfyShapePositions: { | ||
readonly type: FunctionConstructor; | ||
readonly default: any; | ||
spiderfyShapePositions: { | ||
type: FunctionConstructor; | ||
default: any; | ||
}; | ||
@@ -131,5 +131,5 @@ /** | ||
*/ | ||
readonly spiderfyDistanceMultiplier: { | ||
readonly type: NumberConstructor; | ||
readonly default: 1; | ||
spiderfyDistanceMultiplier: { | ||
type: NumberConstructor; | ||
default: number; | ||
}; | ||
@@ -140,5 +140,5 @@ /** | ||
*/ | ||
readonly spiderLegPolylineOptions: { | ||
readonly type: ObjectConstructor; | ||
readonly default: () => { | ||
spiderLegPolylineOptions: { | ||
type: ObjectConstructor; | ||
default: () => { | ||
weight: number; | ||
@@ -153,5 +153,5 @@ color: string; | ||
*/ | ||
readonly chunkedLoading: { | ||
readonly type: BooleanConstructor; | ||
readonly default: false; | ||
chunkedLoading: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
@@ -163,5 +163,5 @@ /** | ||
*/ | ||
readonly chunkInterval: { | ||
readonly type: NumberConstructor; | ||
readonly default: 200; | ||
chunkInterval: { | ||
type: NumberConstructor; | ||
default: number; | ||
}; | ||
@@ -172,5 +172,5 @@ /** | ||
*/ | ||
readonly chunkDelay: { | ||
readonly type: NumberConstructor; | ||
readonly default: 50; | ||
chunkDelay: { | ||
type: NumberConstructor; | ||
default: number; | ||
}; | ||
@@ -181,5 +181,5 @@ /** | ||
*/ | ||
readonly chunkProgress: { | ||
readonly type: FunctionConstructor; | ||
readonly default: any; | ||
chunkProgress: { | ||
type: FunctionConstructor; | ||
default: any; | ||
}; | ||
@@ -190,25 +190,25 @@ /** | ||
*/ | ||
readonly polygonOptions: { | ||
readonly type: ObjectConstructor; | ||
readonly default: () => {}; | ||
polygonOptions: { | ||
type: ObjectConstructor; | ||
default: () => {}; | ||
}; | ||
readonly iconCreateFunction: { | ||
readonly type: FunctionConstructor; | ||
readonly default: any; | ||
iconCreateFunction: { | ||
type: FunctionConstructor; | ||
default: any; | ||
}; | ||
readonly pane: { | ||
pane: { | ||
readonly type: StringConstructor; | ||
}; | ||
readonly attribution: { | ||
attribution: { | ||
readonly type: StringConstructor; | ||
}; | ||
readonly name: { | ||
name: { | ||
readonly type: StringConstructor; | ||
readonly custom: true; | ||
}; | ||
readonly layerType: { | ||
layerType: { | ||
readonly type: import("vue").PropType<import("@vue-leaflet/vue-leaflet/dist/src/types/enums/LayerType").LayerType>; | ||
readonly custom: true; | ||
}; | ||
readonly visible: { | ||
visible: { | ||
readonly type: BooleanConstructor; | ||
@@ -218,3 +218,3 @@ readonly custom: true; | ||
}; | ||
readonly options: { | ||
options: { | ||
readonly type: ObjectConstructor; | ||
@@ -221,0 +221,0 @@ readonly default: () => {}; |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("vue"),k=require("@vue-leaflet/vue-leaflet");var G=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},O={exports:{}};(function(m,h){(function(p,v){v(h)})(G,function(p){var v=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.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};var t=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,t?this._withAnimation:this._noAnimation),this._markerCluster=t?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(e){if(e instanceof L.LayerGroup)return this.addLayers([e]);if(!e.getLatLng)return this._nonPointGroup.addLayer(e),this.fire("layeradd",{layer:e}),this;if(!this._map)return this._needsClustering.push(e),this.fire("layeradd",{layer:e}),this;if(this.hasLayer(e))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(e,this._maxZoom),this.fire("layeradd",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var t=e,i=this._zoom;if(e.__parent)for(;t.__parent._zoom>=i;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(e,t):this._animationAddLayerNonAnimated(e,t)),this},removeLayer:function(e){return e instanceof L.LayerGroup?this.removeLayers([e]):e.getLatLng?this._map?e.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(e)),this._removeLayer(e,!0),this.fire("layerremove",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),e.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(e)&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,e)&&this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e}),this):(this._nonPointGroup.removeLayer(e),this.fire("layerremove",{layer:e}),this)},addLayers:function(e,t){if(!L.Util.isArray(e))return this.addLayer(e);var i=this._featureGroup,n=this._nonPointGroup,r=this.options.chunkedLoading,o=this.options.chunkInterval,s=this.options.chunkProgress,a=e.length,u=0,l=!0,_;if(this._map){var f=new Date().getTime(),d=L.bind(function(){var g=new Date().getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();u<a;u++){if(r&&u%200===0){var S=new Date().getTime()-g;if(S>o)break}if(_=e[u],_ instanceof L.LayerGroup){l&&(e=e.slice(),l=!1),this._extractNonGroupLayers(_,e),a=e.length;continue}if(!_.getLatLng){n.addLayer(_),t||this.fire("layeradd",{layer:_});continue}if(!this.hasLayer(_)&&(this._addLayer(_,this._maxZoom),t||this.fire("layeradd",{layer:_}),_.__parent&&_.__parent.getChildCount()===2)){var y=_.__parent.getAllChildMarkers(),x=y[0]===_?y[1]:y[0];i.removeLayer(x)}}s&&s(u,a,new Date().getTime()-f),u===a?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(d,this.options.chunkDelay)},this);d()}else for(var c=this._needsClustering;u<a;u++){if(_=e[u],_ instanceof L.LayerGroup){l&&(e=e.slice(),l=!1),this._extractNonGroupLayers(_,e),a=e.length;continue}if(!_.getLatLng){n.addLayer(_);continue}this.hasLayer(_)||c.push(_)}return this},removeLayers:function(e){var t,i,n=e.length,r=this._featureGroup,o=this._nonPointGroup,s=!0;if(!this._map){for(t=0;t<n;t++){if(i=e[t],i instanceof L.LayerGroup){s&&(e=e.slice(),s=!1),this._extractNonGroupLayers(i,e),n=e.length;continue}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();var a=e.slice(),u=n;for(t=0;t<u;t++){if(i=a[t],i instanceof L.LayerGroup){this._extractNonGroupLayers(i,a),u=a.length;continue}this._unspiderfyLayer(i)}}for(t=0;t<n;t++){if(i=e[t],i instanceof L.LayerGroup){s&&(e=e.slice(),s=!1),this._extractNonGroupLayers(i,e),n=e.length;continue}if(!i.__parent){o.removeLayer(i),this.fire("layerremove",{layer:i});continue}this._removeLayer(i,!0,!0),this.fire("layerremove",{layer:i}),r.hasLayer(i)&&(r.removeLayer(i),i.clusterShow&&i.clusterShow())}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(e){e.off(this._childMarkerEventHandlers,this),delete e.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var e=new L.LatLngBounds;this._topClusterLevel&&e.extend(this._topClusterLevel._bounds);for(var t=this._needsClustering.length-1;t>=0;t--)e.extend(this._needsClustering[t].getLatLng());return e.extend(this._nonPointGroup.getBounds()),e},eachLayer:function(e,t){var i=this._needsClustering.slice(),n=this._needsRemoving,r,o,s;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(i),o=i.length-1;o>=0;o--){for(r=!0,s=n.length-1;s>=0;s--)if(n[s].layer===i[o]){r=!1;break}r&&e.call(t,i[o])}this._nonPointGroup.eachLayer(e,t)},getLayers:function(){var e=[];return this.eachLayer(function(t){e.push(t)}),e},getLayer:function(e){var t=null;return e=parseInt(e,10),this.eachLayer(function(i){L.stamp(i)===e&&(t=i)}),t},hasLayer:function(e){if(!e)return!1;var t,i=this._needsClustering;for(t=i.length-1;t>=0;t--)if(i[t]===e)return!0;for(i=this._needsRemoving,t=i.length-1;t>=0;t--)if(i[t].layer===e)return!1;return!!(e.__parent&&e.__parent._group===this)||this._nonPointGroup.hasLayer(e)},zoomToShowLayer:function(e,t){var i=this._map;typeof t!="function"&&(t=function(){});var n=function(){(i.hasLayer(e)||i.hasLayer(e.__parent))&&!this._inZoomAnimation&&(this._map.off("moveend",n,this),this.off("animationend",n,this),i.hasLayer(e)?t():e.__parent._icon&&(this.once("spiderfied",t,this),e.__parent.spiderfy()))};e._icon&&this._map.getBounds().contains(e.getLatLng())?t():e.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",n,this),this._map.panTo(e.getLatLng())):(this._map.on("moveend",n,this),this.on("animationend",n,this),e.__parent.zoomToBounds())},onAdd:function(e){this._map=e;var t,i,n;if(!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(e),this._nonPointGroup.addTo(e),this._gridClusters||this._generateInitialClusters(),this._maxLat=e.options.crs.projection.MAX_LATITUDE,t=0,i=this._needsRemoving.length;t<i;t++)n=this._needsRemoving[t],n.newlatlng=n.layer._latlng,n.layer._latlng=n.latlng;for(t=0,i=this._needsRemoving.length;t<i;t++)n=this._needsRemoving[t],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._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),i=this._needsClustering,this._needsClustering=[],this.addLayers(i,!0)},onRemove:function(e){e.off("zoomend",this._zoomEnd,this),e.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(e){for(var t=e;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:function(e,t){for(var i=e.length-1;i>=0;i--)if(e[i]===t)return e.splice(i,1),!0},_removeFromGridUnclustered:function(e,t){for(var i=this._map,n=this._gridUnclustered,r=Math.floor(this._map.getMinZoom());t>=r&&n[t].removeObject(e,i.project(e.getLatLng(),t));t--);},_childMarkerDragStart:function(e){e.target.__dragStart=e.target._latlng},_childMarkerMoved:function(e){if(!this._ignoreMove&&!e.target.__dragStart){var t=e.target._popup&&e.target._popup.isOpen();this._moveChild(e.target,e.oldLatLng,e.latlng),t&&e.target.openPopup()}},_moveChild:function(e,t,i){e._latlng=t,this.removeLayer(e),e._latlng=i,this.addLayer(e)},_childMarkerDragEnd:function(e){var t=e.target.__dragStart;delete e.target.__dragStart,t&&this._moveChild(e.target,t,e.target._latlng)},_removeLayer:function(e,t,i){var n=this._gridClusters,r=this._gridUnclustered,o=this._featureGroup,s=this._map,a=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(e,this._maxZoom);var u=e.__parent,l=u._markers,_;for(this._arraySplice(l,e);u&&(u._childCount--,u._boundsNeedUpdate=!0,!(u._zoom<a));)t&&u._childCount<=1?(_=u._markers[0]===e?u._markers[1]:u._markers[0],n[u._zoom].removeObject(u,s.project(u._cLatLng,u._zoom)),r[u._zoom].addObject(_,s.project(_.getLatLng(),u._zoom)),this._arraySplice(u.__parent._childClusters,u),u.__parent._markers.push(_),_.__parent=u.__parent,u._icon&&(o.removeLayer(u),i||o.addLayer(_))):u._iconNeedsUpdate=!0,u=u.__parent;delete e.__parent},_isOrIsParent:function(e,t){for(;t;){if(e===t)return!0;t=t.parentNode}return!1},fire:function(e,t,i){if(t&&t.layer instanceof L.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.layer._icon,t.originalEvent.relatedTarget))return;e="cluster"+e}L.FeatureGroup.prototype.fire.call(this,e,t,i)},listens:function(e,t){return L.FeatureGroup.prototype.listens.call(this,e,t)||L.FeatureGroup.prototype.listens.call(this,"cluster"+e,t)},_defaultIconCreateFunction:function(e){var t=e.getChildCount(),i=" marker-cluster-";return t<10?i+="small":t<100?i+="medium":i+="large",new L.DivIcon({html:"<div><span>"+t+"</span></div>",className:"marker-cluster"+i,iconSize:new L.Point(40,40)})},_bindEvents:function(){var e=this._map,t=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick,r=this.options.spiderfyOnEveryZoom;(t||n||r)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),e.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(e){var t=e.layer,i=t;if(!(e.type==="clusterkeypress"&&e.originalEvent&&e.originalEvent.keyCode!==13)){for(;i._childClusters.length===1;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),this.options.spiderfyOnEveryZoom&&t.spiderfy(),e.originalEvent&&e.originalEvent.keyCode===13&&this._map._container.focus()}},_showCoverage:function(e){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),e.layer.getChildCount()>2&&e.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(e.layer.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var e=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,n=this.options.spiderfyOnEveryZoom,r=this._map;(e||i||n)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),r.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var e=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),e),this._currentShownBounds=e}},_generateInitialClusters:function(){var e=Math.ceil(this._map.getMaxZoom()),t=Math.floor(this._map.getMinZoom()),i=this.options.maxClusterRadius,n=i;typeof i!="function"&&(n=function(){return i}),this.options.disableClusteringAtZoom!==null&&(e=this.options.disableClusteringAtZoom-1),this._maxZoom=e,this._gridClusters={},this._gridUnclustered={};for(var r=e;r>=t;r--)this._gridClusters[r]=new L.DistanceGrid(n(r)),this._gridUnclustered[r]=new L.DistanceGrid(n(r));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(e,t){var i=this._gridClusters,n=this._gridUnclustered,r=Math.floor(this._map.getMinZoom()),o,s;for(this.options.singleMarkerMode&&this._overrideMarkerIcon(e),e.on(this._childMarkerEventHandlers,this);t>=r;t--){o=this._map.project(e.getLatLng(),t);var a=i[t].getNearObject(o);if(a){a._addChild(e),e.__parent=a;return}if(a=n[t].getNearObject(o),a){var u=a.__parent;u&&this._removeLayer(a,!1);var l=new this._markerCluster(this,t,a,e);i[t].addObject(l,this._map.project(l._cLatLng,t)),a.__parent=l,e.__parent=l;var _=l;for(s=t-1;s>u._zoom;s--)_=new this._markerCluster(this,s,_),i[s].addObject(_,this._map.project(a.getLatLng(),s));u._addChild(_),this._removeFromGridUnclustered(a,t);return}n[t].addObject(e,o)}this._topClusterLevel._addChild(e),e.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(e){e instanceof L.MarkerCluster&&e._iconNeedsUpdate&&e._updateIcon()})},_enqueue:function(e){this._queue.push(e),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var e=0;e<this._queue.length;e++)this._queue[e].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var e=Math.round(this._map._zoom);this._processQueue(),this._zoom<e&&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,e)):this._zoom>e?(this._animationStart(),this._animationZoomOut(this._zoom,e)):this._moveEnd()},_getExpandedVisibleBounds:function(){if(this.options.removeOutsideVisibleBounds){if(L.Browser.mobile)return this._checkBoundsMaxLat(this._map.getBounds())}else return this._mapBoundsInfinite;return this._checkBoundsMaxLat(this._map.getBounds().pad(1))},_checkBoundsMaxLat:function(e){var t=this._maxLat;return t!==void 0&&(e.getNorth()>=t&&(e._northEast.lat=1/0),e.getSouth()<=-t&&(e._southWest.lat=-1/0)),e},_animationAddLayerNonAnimated:function(e,t){if(t===e)this._featureGroup.addLayer(e);else if(t._childCount===2){t._addToMap();var i=t.getAllChildMarkers();this._featureGroup.removeLayer(i[0]),this._featureGroup.removeLayer(i[1])}else t._updateIcon()},_extractNonGroupLayers:function(e,t){var i=e.getLayers(),n=0,r;for(t=t||[];n<i.length;n++){if(r=i[n],r instanceof L.LayerGroup){this._extractNonGroupLayers(r,t);continue}t.push(r)}return t},_overrideMarkerIcon:function(e){var t=e.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[e]}});return t}});L.MarkerClusterGroup.include({_mapBoundsInfinite:new L.LatLngBounds(new L.LatLng(-1/0,-1/0),new L.LatLng(1/0,1/0))}),L.MarkerClusterGroup.include({_noAnimation:{_animationStart:function(){},_animationZoomIn:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(e,t){this._animationAddLayerNonAnimated(e,t)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(e,t){var i=this._getExpandedVisibleBounds(),n=this._featureGroup,r=Math.floor(this._map.getMinZoom()),o;this._ignoreMove=!0,this._topClusterLevel._recursively(i,e,r,function(s){var a=s._latlng,u=s._markers,l;for(i.contains(a)||(a=null),s._isSingleParent()&&e+1===t?(n.removeLayer(s),s._recursivelyAddChildrenToMap(null,t,i)):(s.clusterHide(),s._recursivelyAddChildrenToMap(a,t,i)),o=u.length-1;o>=0;o--)l=u[o],i.contains(l._latlng)||n.removeLayer(l)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(i,t),n.eachLayer(function(s){!(s instanceof L.MarkerCluster)&&s._icon&&s.clusterShow()}),this._topClusterLevel._recursively(i,e,t,function(s){s._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(i,e,r,function(s){n.removeLayer(s),s.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(e,t){this._animationZoomOutSingle(this._topClusterLevel,e-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e,this._getExpandedVisibleBounds())},_animationAddLayer:function(e,t){var i=this,n=this._featureGroup;n.addLayer(e),t!==e&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),e._setPos(this._map.latLngToLayerPoint(t.getLatLng())),e.clusterHide(),this._enqueue(function(){n.removeLayer(e),e.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(e,t,i){var n=this._getExpandedVisibleBounds(),r=Math.floor(this._map.getMinZoom());e._recursivelyAnimateChildrenInAndAddSelfToMap(n,r,t+1,i);var o=this;this._forceLayout(),e._recursivelyBecomeVisible(n,i),this._enqueue(function(){if(e._childCount===1){var s=e._markers[0];this._ignoreMove=!0,s.setLatLng(s.getLatLng()),this._ignoreMove=!1,s.clusterShow&&s.clusterShow()}else e._recursively(n,i,r,function(a){a._recursivelyRemoveChildrenFromMap(n,r,t+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(){L.Util.falseFn(document.body.offsetWidth)}}),L.markerClusterGroup=function(e){return new L.MarkerClusterGroup(e)};var C=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(e,t,i,n){L.Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new L.LatLng(0,0),{icon:this,pane:e.options.clusterPane}),this._group=e,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,i&&this._addChild(i),n&&this._addChild(n)},getAllChildMarkers:function(e,t){e=e||[];for(var i=this._childClusters.length-1;i>=0;i--)this._childClusters[i].getAllChildMarkers(e,t);for(var n=this._markers.length-1;n>=0;n--)t&&this._markers[n].__dragStart||e.push(this._markers[n]);return e},getChildCount:function(){return this._childCount},zoomToBounds:function(e){for(var t=this._childClusters.slice(),i=this._group._map,n=i.getBoundsZoom(this._bounds),r=this._zoom+1,o=i.getZoom(),s;t.length>0&&n>r;){r++;var a=[];for(s=0;s<t.length;s++)a=a.concat(t[s]._childClusters);t=a}n>r?this._group._map.setView(this._latlng,r):n<=o?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,e)},getBounds:function(){var e=new L.LatLngBounds;return e.extend(this._bounds),e},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},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(e,t){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(e),e instanceof L.MarkerCluster?(t||(this._childClusters.push(e),e.__parent=this),this._childCount+=e._childCount):(t||this._markers.push(e),this._childCount++),this.__parent&&this.__parent._addChild(e,!0)},_setClusterCenter:function(e){this._cLatLng||(this._cLatLng=e._cLatLng||e._latlng)},_resetBounds:function(){var e=this._bounds;e._southWest&&(e._southWest.lat=1/0,e._southWest.lng=1/0),e._northEast&&(e._northEast.lat=-1/0,e._northEast.lng=-1/0)},_recalculateBounds:function(){var e=this._markers,t=this._childClusters,i=0,n=0,r=this._childCount,o,s,a,u;if(r!==0){for(this._resetBounds(),o=0;o<e.length;o++)a=e[o]._latlng,this._bounds.extend(a),i+=a.lat,n+=a.lng;for(o=0;o<t.length;o++)s=t[o],s._boundsNeedUpdate&&s._recalculateBounds(),this._bounds.extend(s._bounds),a=s._wLatLng,u=s._childCount,i+=a.lat*u,n+=a.lng*u;this._latlng=this._wLatLng=new L.LatLng(i/r,n/r),this._boundsNeedUpdate=!1}},_addToMap:function(e){e&&(this._backupLatlng=this._latlng,this.setLatLng(e)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(e,t,i){this._recursively(e,this._group._map.getMinZoom(),i-1,function(n){var r=n._markers,o,s;for(o=r.length-1;o>=0;o--)s=r[o],s._icon&&(s._setPos(t),s.clusterHide())},function(n){var r=n._childClusters,o,s;for(o=r.length-1;o>=0;o--)s=r[o],s._icon&&(s._setPos(t),s.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(e,t,i,n){this._recursively(e,n,t,function(r){r._recursivelyAnimateChildrenIn(e,r._group._map.latLngToLayerPoint(r.getLatLng()).round(),i),r._isSingleParent()&&i-1===n?(r.clusterShow(),r._recursivelyRemoveChildrenFromMap(e,t,i)):r.clusterHide(),r._addToMap()})},_recursivelyBecomeVisible:function(e,t){this._recursively(e,this._group._map.getMinZoom(),t,null,function(i){i.clusterShow()})},_recursivelyAddChildrenToMap:function(e,t,i){this._recursively(i,this._group._map.getMinZoom()-1,t,function(n){if(t!==n._zoom)for(var r=n._markers.length-1;r>=0;r--){var o=n._markers[r];i.contains(o._latlng)&&(e&&(o._backupLatlng=o.getLatLng(),o.setLatLng(e),o.clusterHide&&o.clusterHide()),n._group._featureGroup.addLayer(o))}},function(n){n._addToMap(e)})},_recursivelyRestoreChildPositions:function(e){for(var t=this._markers.length-1;t>=0;t--){var i=this._markers[t];i._backupLatlng&&(i.setLatLng(i._backupLatlng),delete i._backupLatlng)}if(e-1===this._zoom)for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n]._restorePosition();else for(var r=this._childClusters.length-1;r>=0;r--)this._childClusters[r]._recursivelyRestoreChildPositions(e)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(e,t,i,n){var r,o;this._recursively(e,t-1,i-1,function(s){for(o=s._markers.length-1;o>=0;o--)r=s._markers[o],(!n||!n.contains(r._latlng))&&(s._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())},function(s){for(o=s._childClusters.length-1;o>=0;o--)r=s._childClusters[o],(!n||!n.contains(r._latlng))&&(s._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())})},_recursively:function(e,t,i,n,r){var o=this._childClusters,s=this._zoom,a,u;if(t<=s&&(n&&n(this),r&&s===i&&r(this)),s<t||s<i)for(a=o.length-1;a>=0;a--)u=o[a],u._boundsNeedUpdate&&u._recalculateBounds(),e.intersects(u._bounds)&&u._recursively(e,t,i,n,r)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){var e=this.options.opacity;return this.setOpacity(0),this.options.opacity=e,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}}),L.DistanceGrid=function(e){this._cellSize=e,this._sqCellSize=e*e,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(e,t){var i=this._getCoord(t.x),n=this._getCoord(t.y),r=this._grid,o=r[n]=r[n]||{},s=o[i]=o[i]||[],a=L.Util.stamp(e);this._objectPoint[a]=t,s.push(e)},updateObject:function(e,t){this.removeObject(e),this.addObject(e,t)},removeObject:function(e,t){var i=this._getCoord(t.x),n=this._getCoord(t.y),r=this._grid,o=r[n]=r[n]||{},s=o[i]=o[i]||[],a,u;for(delete this._objectPoint[L.Util.stamp(e)],a=0,u=s.length;a<u;a++)if(s[a]===e)return s.splice(a,1),u===1&&delete o[i],!0},eachObject:function(e,t){var i,n,r,o,s,a,u,l=this._grid;for(i in l){s=l[i];for(n in s)for(a=s[n],r=0,o=a.length;r<o;r++)u=e.call(t,a[r]),u&&(r--,o--)}},getNearObject:function(e){var t=this._getCoord(e.x),i=this._getCoord(e.y),n,r,o,s,a,u,l,_,f=this._objectPoint,d=this._sqCellSize,c=null;for(n=i-1;n<=i+1;n++)if(s=this._grid[n],s){for(r=t-1;r<=t+1;r++)if(a=s[r],a)for(o=0,u=a.length;o<u;o++)l=a[o],_=this._sqDist(f[L.Util.stamp(l)],e),(_<d||_<=d&&c===null)&&(d=_,c=l)}return c},_getCoord:function(e){var t=Math.floor(e/this._cellSize);return isFinite(t)?t:e},_sqDist:function(e,t){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n}},function(){L.QuickHull={getDistant:function(e,t){var i=t[1].lat-t[0].lat,n=t[0].lng-t[1].lng;return n*(e.lat-t[0].lat)+i*(e.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(e,t){var i=0,n=null,r=[],o,s,a;for(o=t.length-1;o>=0;o--){if(s=t[o],a=this.getDistant(s,e),a>0)r.push(s);else continue;a>i&&(i=a,n=s)}return{maxPoint:n,newPoints:r}},buildConvexHull:function(e,t){var i=[],n=this.findMostDistantPointFromBaseLine(e,t);return n.maxPoint?(i=i.concat(this.buildConvexHull([e[0],n.maxPoint],n.newPoints)),i=i.concat(this.buildConvexHull([n.maxPoint,e[1]],n.newPoints)),i):[e[0]]},getConvexHull:function(e){var t=!1,i=!1,n=!1,r=!1,o=null,s=null,a=null,u=null,l=null,_=null,f;for(f=e.length-1;f>=0;f--){var d=e[f];(t===!1||d.lat>t)&&(o=d,t=d.lat),(i===!1||d.lat<i)&&(s=d,i=d.lat),(n===!1||d.lng>n)&&(a=d,n=d.lng),(r===!1||d.lng<r)&&(u=d,r=d.lng)}i!==t?(_=s,l=o):(_=u,l=a);var c=[].concat(this.buildConvexHull([_,l],e),this.buildConvexHull([l,_],e));return c}}}(),L.MarkerCluster.include({getConvexHull:function(){var e=this.getAllChildMarkers(),t=[],i,n;for(n=e.length-1;n>=0;n--)i=e[n].getLatLng(),t.push(i);return L.QuickHull.getConvexHull(t)}}),L.MarkerCluster.include({_2PI:Math.PI*2,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(!(this._group._spiderfied===this||this._group._inZoomAnimation)){var e=this.getAllChildMarkers(null,!0),t=this._group,i=t._map,n=i.latLngToLayerPoint(this._latlng),r;this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?r=this._group.options.spiderfyShapePositions(e.length,n):e.length>=this._circleSpiralSwitchover?r=this._generatePointsSpiral(e.length,n):(n.y+=10,r=this._generatePointsCircle(e.length,n)),this._animationSpiderfy(e,r)}},unspiderfy:function(e){this._group._inZoomAnimation||(this._animationUnspiderfy(e),this._group._spiderfied=null)},_generatePointsCircle:function(e,t){var i=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+e),n=i/this._2PI,r=this._2PI/e,o=[],s,a;for(n=Math.max(n,35),o.length=e,s=0;s<e;s++)a=this._circleStartAngle+s*r,o[s]=new L.Point(t.x+n*Math.cos(a),t.y+n*Math.sin(a))._round();return o},_generatePointsSpiral:function(e,t){var i=this._group.options.spiderfyDistanceMultiplier,n=i*this._spiralLengthStart,r=i*this._spiralFootSeparation,o=i*this._spiralLengthFactor*this._2PI,s=0,a=[],u;for(a.length=e,u=e;u>=0;u--)u<e&&(a[u]=new L.Point(t.x+n*Math.cos(s),t.y+n*Math.sin(s))._round()),s+=r/n+u*5e-4,n+=o/s;return a},_noanimationUnspiderfy:function(){var e=this._group,t=e._map,i=e._featureGroup,n=this.getAllChildMarkers(null,!0),r,o;for(e._ignoreMove=!0,this.setOpacity(1),o=n.length-1;o>=0;o--)r=n[o],i.removeLayer(r),r._preSpiderfyLatlng&&(r.setLatLng(r._preSpiderfyLatlng),delete r._preSpiderfyLatlng),r.setZIndexOffset&&r.setZIndexOffset(0),r._spiderLeg&&(t.removeLayer(r._spiderLeg),delete r._spiderLeg);e.fire("unspiderfied",{cluster:this,markers:n}),e._ignoreMove=!1,e._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(e,t){var i=this._group,n=i._map,r=i._featureGroup,o=this._group.options.spiderLegPolylineOptions,s,a,u,l;for(i._ignoreMove=!0,s=0;s<e.length;s++)l=n.layerPointToLatLng(t[s]),a=e[s],u=new L.Polyline([this._latlng,l],o),n.addLayer(u),a._spiderLeg=u,a._preSpiderfyLatlng=a._latlng,a.setLatLng(l),a.setZIndexOffset&&a.setZIndexOffset(1e6),r.addLayer(a);this.setOpacity(.3),i._ignoreMove=!1,i.fire("spiderfied",{cluster:this,markers:e})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(e,t){var i=this,n=this._group,r=n._map,o=n._featureGroup,s=this._latlng,a=r.latLngToLayerPoint(s),u=L.Path.SVG,l=L.extend({},this._group.options.spiderLegPolylineOptions),_=l.opacity,f,d,c,g,S,y;for(_===void 0&&(_=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),u?(l.opacity=0,l.className=(l.className||"")+" leaflet-cluster-spider-leg"):l.opacity=_,n._ignoreMove=!0,f=0;f<e.length;f++)d=e[f],y=r.layerPointToLatLng(t[f]),c=new L.Polyline([s,y],l),r.addLayer(c),d._spiderLeg=c,u&&(g=c._path,S=g.getTotalLength()+.1,g.style.strokeDasharray=S,g.style.strokeDashoffset=S),d.setZIndexOffset&&d.setZIndexOffset(1e6),d.clusterHide&&d.clusterHide(),o.addLayer(d),d._setPos&&d._setPos(a);for(n._forceLayout(),n._animationStart(),f=e.length-1;f>=0;f--)y=r.layerPointToLatLng(t[f]),d=e[f],d._preSpiderfyLatlng=d._latlng,d.setLatLng(y),d.clusterShow&&d.clusterShow(),u&&(c=d._spiderLeg,g=c._path,g.style.strokeDashoffset=0,c.setStyle({opacity:_}));this.setOpacity(.3),n._ignoreMove=!1,setTimeout(function(){n._animationEnd(),n.fire("spiderfied",{cluster:i,markers:e})},200)},_animationUnspiderfy:function(e){var t=this,i=this._group,n=i._map,r=i._featureGroup,o=e?n._latLngToNewLayerPoint(this._latlng,e.zoom,e.center):n.latLngToLayerPoint(this._latlng),s=this.getAllChildMarkers(null,!0),a=L.Path.SVG,u,l,_,f,d,c;for(i._ignoreMove=!0,i._animationStart(),this.setOpacity(1),l=s.length-1;l>=0;l--)u=s[l],u._preSpiderfyLatlng&&(u.closePopup(),u.setLatLng(u._preSpiderfyLatlng),delete u._preSpiderfyLatlng,c=!0,u._setPos&&(u._setPos(o),c=!1),u.clusterHide&&(u.clusterHide(),c=!1),c&&r.removeLayer(u),a&&(_=u._spiderLeg,f=_._path,d=f.getTotalLength()+.1,f.style.strokeDashoffset=d,_.setStyle({opacity:0})));i._ignoreMove=!1,setTimeout(function(){var g=0;for(l=s.length-1;l>=0;l--)u=s[l],u._spiderLeg&&g++;for(l=s.length-1;l>=0;l--)u=s[l],u._spiderLeg&&(u.clusterShow&&u.clusterShow(),u.setZIndexOffset&&u.setZIndexOffset(0),g>1&&r.removeLayer(u),n.removeLayer(u._spiderLeg),delete u._spiderLeg);i._animationEnd(),i.fire("unspiderfied",{cluster:t,markers:s})},200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd:function(){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),L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){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(e){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(e))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(e){this._spiderfied&&this._spiderfied.unspiderfy(e)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(e){e._spiderLeg&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow(),e.setZIndexOffset&&e.setZIndexOffset(0),this._map.removeLayer(e._spiderLeg),delete e._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(e){return e?e instanceof L.MarkerClusterGroup?e=e._topClusterLevel.getAllChildMarkers():e instanceof L.LayerGroup?e=e._layers:e instanceof L.MarkerCluster?e=e.getAllChildMarkers():e instanceof L.Marker&&(e=[e]):e=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(e),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(e),this},_flagParentsIconsNeedUpdate:function(e){var t,i;for(t in e)for(i=e[t].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers:function(e){var t,i;for(t in e)i=e[t],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),L.Marker.include({refreshIconOptions:function(e,t){var i=this.options.icon;return L.setOptions(i,e),this.setIcon(i),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),p.MarkerClusterGroup=v,p.MarkerCluster=C,Object.defineProperty(p,"__esModule",{value:!0})})})(O,O.exports);const P=(m,h)=>{let p;return(...v)=>{const C=()=>(p=void 0,m.apply(void 0,v));clearTimeout(p),p=setTimeout(C,h)}},{featureGroupProps:B,setupFeatureGroup:I}=k.Functions.FeatureGroup,{AddLayerInjection:Z,RemoveLayerInjection:E}=k.InjectionKeys,{propsToLeafletOptions:T}=k.Utilities,A=["layeradd","layerremove","click","dblclick","mousedown","mouseup","mouseover","mouseout","contextmenu"],b=[...A,"clusterclick","clustermouseover","clustermouseout","animationend","spiderfied","unspiderfied"],w={...B,maxClusterRadius:{type:Number,default:80},clusterPane:{type:String,default:"markerPane"},spiderfyOnEveryZoom:{type:Boolean,default:!1},spiderfyOnMaxZoom:{type:Boolean,default:!0},showCoverageOnHover:{type:Boolean,default:!0},zoomToBoundsOnClick:{type:Boolean,default:!0},singleMarkerMode:{type:Boolean,default:!1},disableClusteringAtZoom:{type:Number,default:null},removeOutsideVisibleBounds:{type:Boolean,default:!0},animate:{type:Boolean,default:!0},animateAddingMarkers:{type:Boolean,default:!1},spiderfyShapePositions:{type:Function,default:null},spiderfyDistanceMultiplier:{type:Number,default:1},spiderLegPolylineOptions:{type:Object,default:()=>({weight:1.5,color:"#222",opacity:.5})},chunkedLoading:{type:Boolean,default:!1},chunkInterval:{type:Number,default:200},chunkDelay:{type:Number,default:50},chunkProgress:{type:Function,default:null},polygonOptions:{type:Object,default:()=>({})},iconCreateFunction:{type:Function,default:null}},U=(m,h,p)=>{const{options:v,methods:C}=I(m,h,p),e=T(m,w,v);let t=[];const i=P(()=>{var s,a;t.length===1?(s=h.value)==null||s.addLayer(t[0]):(a=h.value)==null||a.addLayers(t),t=[]},0);let n=[];const r=P(()=>{var s,a;n.length===1?(s=h.value)==null||s.removeLayer(n[0]):(a=h.value)==null||a.removeLayers(n),n=[]},0),o={...C,addLayer(s){var a;if(m.animateAddingMarkers)return(a=h.value)==null?void 0:a.addLayer(s.leafletObject);t.push(s.leafletObject),i()},removeLayer(s){var a;if(m.animateAddingMarkers)return(a=h.value)==null?void 0:a.removeLayer(s.leafletObject);n.push(s.leafletObject),r()},setMaxClusterRadius(){throw new Error("Max cluster radius can't be set dynamically")},setClusterPane(){throw new Error("Cluster pane can't be set dynamically")},setSpiderfyOnEveryZoom(s){h.value&&(h.value._unbindEvents(),h.value.options.spiderfyOnEveryZoom=s,h.value._bindEvents())},setSpiderfyOnMaxZoom(s){h.value&&(h.value._unbindEvents(),h.value.options.spiderfyOnMaxZoom=s,h.value._bindEvents())},setShowCoverageOnHover(s){h.value&&(h.value._unbindEvents(),h.value.options.showCoverageOnHover=s,h.value._bindEvents())},setZoomToBoundsOnClick(s){h.value&&(h.value._unbindEvents(),h.value.options.zoomToBoundsOnClick=s,h.value._bindEvents())},setSingleMarkerMode(){throw new Error("Single marker mode can't be set dynamically")},setDisableClusteringAtZoom(){throw new Error("Disable Clustering at zoom can't be set dynamically")},setRemoveOutsideVisibleBounds(s){h.value&&(h.value.options.removeOutsideVisibleBounds=s)},setAnimate(){throw new Error("Animate can't be set dynamically")},setAnimateAddingMarkers(s){h.value&&(h.value.options.animateAddingMarkers=s)},setSpiderfyShapePositions(s){h.value&&(h.value.options.spiderfyShapePositions=s)},setSpiderfyDistanceMultiplier(s){h.value&&(h.value.options.spiderfyDistanceMultiplier=s)},setSpiderLegPolylineOptions(s){h.value&&(h.value.options.spiderLegPolylineOptions=s)},setChunkedLoading(s){h.value&&(h.value.options.chunkedLoading=s)},setChunkInterval(s){h.value&&(h.value.options.chunkInterval=s)},setChunkDelay(s){h.value&&(h.value.options.chunkDelay=s)},setChunkProgress(s){h.value&&(h.value.options.chunkProgress=s)},setPolygonOptions(s){h.value&&(h.value.options.polygonOptions=s)},setIconCreateFunction(s){h.value&&(h.value._unbindEvents(),h.value.options.iconCreateFunction=s,h.value._bindEvents())}};return M.provide(Z,o.addLayer),M.provide(E,o.removeLayer),{options:e,methods:o}},{propsBinder:N,assertInject:z,WINDOW_OR_GLOBAL:j}=k.Utilities,{AddLayerInjection:F}=k.InjectionKeys,{render:D}=k.Functions.Layer,H={props:w,emits:["ready",...b],setup(m,h){const p=M.ref(),v=M.ref(!1),C=z(F),{methods:e,options:t}=U(m,p,h);return M.onMounted(async()=>{var o;const{markerClusterGroup:i}=j.L;p.value=M.markRaw(i(t));const n=s=>a=>h.emit(s,a),r=()=>{const s={};for(const a of b)s[a]=n(a);return s};(o=p.value)==null||o.on(r()),N(e,p.value,m),C({...m,...e,leafletObject:p.value}),v.value=!0,M.nextTick(()=>h.emit("ready",p.value))}),{ready:v,leafletObject:p}},render(){return D(this.ready,this.$slots)}};exports.LMarkerClusterGroup=H; | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("vue"),k=require("@vue-leaflet/vue-leaflet");var G=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},O={exports:{}};(function(m,h){(function(p,v){v(h)})(G,function(p){var v=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.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};var t=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,t?this._withAnimation:this._noAnimation),this._markerCluster=t?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(e){if(e instanceof L.LayerGroup)return this.addLayers([e]);if(!e.getLatLng)return this._nonPointGroup.addLayer(e),this.fire("layeradd",{layer:e}),this;if(!this._map)return this._needsClustering.push(e),this.fire("layeradd",{layer:e}),this;if(this.hasLayer(e))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(e,this._maxZoom),this.fire("layeradd",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var t=e,i=this._zoom;if(e.__parent)for(;t.__parent._zoom>=i;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(e,t):this._animationAddLayerNonAnimated(e,t)),this},removeLayer:function(e){return e instanceof L.LayerGroup?this.removeLayers([e]):e.getLatLng?this._map?e.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(e)),this._removeLayer(e,!0),this.fire("layerremove",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),e.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(e)&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,e)&&this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e}),this):(this._nonPointGroup.removeLayer(e),this.fire("layerremove",{layer:e}),this)},addLayers:function(e,t){if(!L.Util.isArray(e))return this.addLayer(e);var i=this._featureGroup,n=this._nonPointGroup,r=this.options.chunkedLoading,o=this.options.chunkInterval,s=this.options.chunkProgress,a=e.length,u=0,l=!0,_;if(this._map){var f=new Date().getTime(),d=L.bind(function(){var g=new Date().getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();u<a;u++){if(r&&u%200===0){var S=new Date().getTime()-g;if(S>o)break}if(_=e[u],_ instanceof L.LayerGroup){l&&(e=e.slice(),l=!1),this._extractNonGroupLayers(_,e),a=e.length;continue}if(!_.getLatLng){n.addLayer(_),t||this.fire("layeradd",{layer:_});continue}if(!this.hasLayer(_)&&(this._addLayer(_,this._maxZoom),t||this.fire("layeradd",{layer:_}),_.__parent&&_.__parent.getChildCount()===2)){var y=_.__parent.getAllChildMarkers(),x=y[0]===_?y[1]:y[0];i.removeLayer(x)}}s&&s(u,a,new Date().getTime()-f),u===a?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(d,this.options.chunkDelay)},this);d()}else for(var c=this._needsClustering;u<a;u++){if(_=e[u],_ instanceof L.LayerGroup){l&&(e=e.slice(),l=!1),this._extractNonGroupLayers(_,e),a=e.length;continue}if(!_.getLatLng){n.addLayer(_);continue}this.hasLayer(_)||c.push(_)}return this},removeLayers:function(e){var t,i,n=e.length,r=this._featureGroup,o=this._nonPointGroup,s=!0;if(!this._map){for(t=0;t<n;t++){if(i=e[t],i instanceof L.LayerGroup){s&&(e=e.slice(),s=!1),this._extractNonGroupLayers(i,e),n=e.length;continue}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();var a=e.slice(),u=n;for(t=0;t<u;t++){if(i=a[t],i instanceof L.LayerGroup){this._extractNonGroupLayers(i,a),u=a.length;continue}this._unspiderfyLayer(i)}}for(t=0;t<n;t++){if(i=e[t],i instanceof L.LayerGroup){s&&(e=e.slice(),s=!1),this._extractNonGroupLayers(i,e),n=e.length;continue}if(!i.__parent){o.removeLayer(i),this.fire("layerremove",{layer:i});continue}this._removeLayer(i,!0,!0),this.fire("layerremove",{layer:i}),r.hasLayer(i)&&(r.removeLayer(i),i.clusterShow&&i.clusterShow())}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(e){e.off(this._childMarkerEventHandlers,this),delete e.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var e=new L.LatLngBounds;this._topClusterLevel&&e.extend(this._topClusterLevel._bounds);for(var t=this._needsClustering.length-1;t>=0;t--)e.extend(this._needsClustering[t].getLatLng());return e.extend(this._nonPointGroup.getBounds()),e},eachLayer:function(e,t){var i=this._needsClustering.slice(),n=this._needsRemoving,r,o,s;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(i),o=i.length-1;o>=0;o--){for(r=!0,s=n.length-1;s>=0;s--)if(n[s].layer===i[o]){r=!1;break}r&&e.call(t,i[o])}this._nonPointGroup.eachLayer(e,t)},getLayers:function(){var e=[];return this.eachLayer(function(t){e.push(t)}),e},getLayer:function(e){var t=null;return e=parseInt(e,10),this.eachLayer(function(i){L.stamp(i)===e&&(t=i)}),t},hasLayer:function(e){if(!e)return!1;var t,i=this._needsClustering;for(t=i.length-1;t>=0;t--)if(i[t]===e)return!0;for(i=this._needsRemoving,t=i.length-1;t>=0;t--)if(i[t].layer===e)return!1;return!!(e.__parent&&e.__parent._group===this)||this._nonPointGroup.hasLayer(e)},zoomToShowLayer:function(e,t){var i=this._map;typeof t!="function"&&(t=function(){});var n=function(){(i.hasLayer(e)||i.hasLayer(e.__parent))&&!this._inZoomAnimation&&(this._map.off("moveend",n,this),this.off("animationend",n,this),i.hasLayer(e)?t():e.__parent._icon&&(this.once("spiderfied",t,this),e.__parent.spiderfy()))};e._icon&&this._map.getBounds().contains(e.getLatLng())?t():e.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",n,this),this._map.panTo(e.getLatLng())):(this._map.on("moveend",n,this),this.on("animationend",n,this),e.__parent.zoomToBounds())},onAdd:function(e){this._map=e;var t,i,n;if(!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(e),this._nonPointGroup.addTo(e),this._gridClusters||this._generateInitialClusters(),this._maxLat=e.options.crs.projection.MAX_LATITUDE,t=0,i=this._needsRemoving.length;t<i;t++)n=this._needsRemoving[t],n.newlatlng=n.layer._latlng,n.layer._latlng=n.latlng;for(t=0,i=this._needsRemoving.length;t<i;t++)n=this._needsRemoving[t],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._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),i=this._needsClustering,this._needsClustering=[],this.addLayers(i,!0)},onRemove:function(e){e.off("zoomend",this._zoomEnd,this),e.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(e){for(var t=e;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:function(e,t){for(var i=e.length-1;i>=0;i--)if(e[i]===t)return e.splice(i,1),!0},_removeFromGridUnclustered:function(e,t){for(var i=this._map,n=this._gridUnclustered,r=Math.floor(this._map.getMinZoom());t>=r&&n[t].removeObject(e,i.project(e.getLatLng(),t));t--);},_childMarkerDragStart:function(e){e.target.__dragStart=e.target._latlng},_childMarkerMoved:function(e){if(!this._ignoreMove&&!e.target.__dragStart){var t=e.target._popup&&e.target._popup.isOpen();this._moveChild(e.target,e.oldLatLng,e.latlng),t&&e.target.openPopup()}},_moveChild:function(e,t,i){e._latlng=t,this.removeLayer(e),e._latlng=i,this.addLayer(e)},_childMarkerDragEnd:function(e){var t=e.target.__dragStart;delete e.target.__dragStart,t&&this._moveChild(e.target,t,e.target._latlng)},_removeLayer:function(e,t,i){var n=this._gridClusters,r=this._gridUnclustered,o=this._featureGroup,s=this._map,a=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(e,this._maxZoom);var u=e.__parent,l=u._markers,_;for(this._arraySplice(l,e);u&&(u._childCount--,u._boundsNeedUpdate=!0,!(u._zoom<a));)t&&u._childCount<=1?(_=u._markers[0]===e?u._markers[1]:u._markers[0],n[u._zoom].removeObject(u,s.project(u._cLatLng,u._zoom)),r[u._zoom].addObject(_,s.project(_.getLatLng(),u._zoom)),this._arraySplice(u.__parent._childClusters,u),u.__parent._markers.push(_),_.__parent=u.__parent,u._icon&&(o.removeLayer(u),i||o.addLayer(_))):u._iconNeedsUpdate=!0,u=u.__parent;delete e.__parent},_isOrIsParent:function(e,t){for(;t;){if(e===t)return!0;t=t.parentNode}return!1},fire:function(e,t,i){if(t&&t.layer instanceof L.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.layer._icon,t.originalEvent.relatedTarget))return;e="cluster"+e}L.FeatureGroup.prototype.fire.call(this,e,t,i)},listens:function(e,t){return L.FeatureGroup.prototype.listens.call(this,e,t)||L.FeatureGroup.prototype.listens.call(this,"cluster"+e,t)},_defaultIconCreateFunction:function(e){var t=e.getChildCount(),i=" marker-cluster-";return t<10?i+="small":t<100?i+="medium":i+="large",new L.DivIcon({html:"<div><span>"+t+"</span></div>",className:"marker-cluster"+i,iconSize:new L.Point(40,40)})},_bindEvents:function(){var e=this._map,t=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick,r=this.options.spiderfyOnEveryZoom;(t||n||r)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),e.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(e){var t=e.layer,i=t;if(!(e.type==="clusterkeypress"&&e.originalEvent&&e.originalEvent.keyCode!==13)){for(;i._childClusters.length===1;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),this.options.spiderfyOnEveryZoom&&t.spiderfy(),e.originalEvent&&e.originalEvent.keyCode===13&&this._map._container.focus()}},_showCoverage:function(e){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),e.layer.getChildCount()>2&&e.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(e.layer.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var e=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,n=this.options.spiderfyOnEveryZoom,r=this._map;(e||i||n)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),r.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var e=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),e),this._currentShownBounds=e}},_generateInitialClusters:function(){var e=Math.ceil(this._map.getMaxZoom()),t=Math.floor(this._map.getMinZoom()),i=this.options.maxClusterRadius,n=i;typeof i!="function"&&(n=function(){return i}),this.options.disableClusteringAtZoom!==null&&(e=this.options.disableClusteringAtZoom-1),this._maxZoom=e,this._gridClusters={},this._gridUnclustered={};for(var r=e;r>=t;r--)this._gridClusters[r]=new L.DistanceGrid(n(r)),this._gridUnclustered[r]=new L.DistanceGrid(n(r));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(e,t){var i=this._gridClusters,n=this._gridUnclustered,r=Math.floor(this._map.getMinZoom()),o,s;for(this.options.singleMarkerMode&&this._overrideMarkerIcon(e),e.on(this._childMarkerEventHandlers,this);t>=r;t--){o=this._map.project(e.getLatLng(),t);var a=i[t].getNearObject(o);if(a){a._addChild(e),e.__parent=a;return}if(a=n[t].getNearObject(o),a){var u=a.__parent;u&&this._removeLayer(a,!1);var l=new this._markerCluster(this,t,a,e);i[t].addObject(l,this._map.project(l._cLatLng,t)),a.__parent=l,e.__parent=l;var _=l;for(s=t-1;s>u._zoom;s--)_=new this._markerCluster(this,s,_),i[s].addObject(_,this._map.project(a.getLatLng(),s));u._addChild(_),this._removeFromGridUnclustered(a,t);return}n[t].addObject(e,o)}this._topClusterLevel._addChild(e),e.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(e){e instanceof L.MarkerCluster&&e._iconNeedsUpdate&&e._updateIcon()})},_enqueue:function(e){this._queue.push(e),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var e=0;e<this._queue.length;e++)this._queue[e].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var e=Math.round(this._map._zoom);this._processQueue(),this._zoom<e&&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,e)):this._zoom>e?(this._animationStart(),this._animationZoomOut(this._zoom,e)):this._moveEnd()},_getExpandedVisibleBounds:function(){if(this.options.removeOutsideVisibleBounds){if(L.Browser.mobile)return this._checkBoundsMaxLat(this._map.getBounds())}else return this._mapBoundsInfinite;return this._checkBoundsMaxLat(this._map.getBounds().pad(1))},_checkBoundsMaxLat:function(e){var t=this._maxLat;return t!==void 0&&(e.getNorth()>=t&&(e._northEast.lat=1/0),e.getSouth()<=-t&&(e._southWest.lat=-1/0)),e},_animationAddLayerNonAnimated:function(e,t){if(t===e)this._featureGroup.addLayer(e);else if(t._childCount===2){t._addToMap();var i=t.getAllChildMarkers();this._featureGroup.removeLayer(i[0]),this._featureGroup.removeLayer(i[1])}else t._updateIcon()},_extractNonGroupLayers:function(e,t){var i=e.getLayers(),n=0,r;for(t=t||[];n<i.length;n++){if(r=i[n],r instanceof L.LayerGroup){this._extractNonGroupLayers(r,t);continue}t.push(r)}return t},_overrideMarkerIcon:function(e){var t=e.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[e]}});return t}});L.MarkerClusterGroup.include({_mapBoundsInfinite:new L.LatLngBounds(new L.LatLng(-1/0,-1/0),new L.LatLng(1/0,1/0))}),L.MarkerClusterGroup.include({_noAnimation:{_animationStart:function(){},_animationZoomIn:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(e,t){this._animationAddLayerNonAnimated(e,t)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(e,t){var i=this._getExpandedVisibleBounds(),n=this._featureGroup,r=Math.floor(this._map.getMinZoom()),o;this._ignoreMove=!0,this._topClusterLevel._recursively(i,e,r,function(s){var a=s._latlng,u=s._markers,l;for(i.contains(a)||(a=null),s._isSingleParent()&&e+1===t?(n.removeLayer(s),s._recursivelyAddChildrenToMap(null,t,i)):(s.clusterHide(),s._recursivelyAddChildrenToMap(a,t,i)),o=u.length-1;o>=0;o--)l=u[o],i.contains(l._latlng)||n.removeLayer(l)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(i,t),n.eachLayer(function(s){!(s instanceof L.MarkerCluster)&&s._icon&&s.clusterShow()}),this._topClusterLevel._recursively(i,e,t,function(s){s._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(i,e,r,function(s){n.removeLayer(s),s.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(e,t){this._animationZoomOutSingle(this._topClusterLevel,e-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e,this._getExpandedVisibleBounds())},_animationAddLayer:function(e,t){var i=this,n=this._featureGroup;n.addLayer(e),t!==e&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),e._setPos(this._map.latLngToLayerPoint(t.getLatLng())),e.clusterHide(),this._enqueue(function(){n.removeLayer(e),e.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(e,t,i){var n=this._getExpandedVisibleBounds(),r=Math.floor(this._map.getMinZoom());e._recursivelyAnimateChildrenInAndAddSelfToMap(n,r,t+1,i);var o=this;this._forceLayout(),e._recursivelyBecomeVisible(n,i),this._enqueue(function(){if(e._childCount===1){var s=e._markers[0];this._ignoreMove=!0,s.setLatLng(s.getLatLng()),this._ignoreMove=!1,s.clusterShow&&s.clusterShow()}else e._recursively(n,i,r,function(a){a._recursivelyRemoveChildrenFromMap(n,r,t+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(){L.Util.falseFn(document.body.offsetWidth)}}),L.markerClusterGroup=function(e){return new L.MarkerClusterGroup(e)};var C=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(e,t,i,n){L.Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new L.LatLng(0,0),{icon:this,pane:e.options.clusterPane}),this._group=e,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,i&&this._addChild(i),n&&this._addChild(n)},getAllChildMarkers:function(e,t){e=e||[];for(var i=this._childClusters.length-1;i>=0;i--)this._childClusters[i].getAllChildMarkers(e,t);for(var n=this._markers.length-1;n>=0;n--)t&&this._markers[n].__dragStart||e.push(this._markers[n]);return e},getChildCount:function(){return this._childCount},zoomToBounds:function(e){for(var t=this._childClusters.slice(),i=this._group._map,n=i.getBoundsZoom(this._bounds),r=this._zoom+1,o=i.getZoom(),s;t.length>0&&n>r;){r++;var a=[];for(s=0;s<t.length;s++)a=a.concat(t[s]._childClusters);t=a}n>r?this._group._map.setView(this._latlng,r):n<=o?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,e)},getBounds:function(){var e=new L.LatLngBounds;return e.extend(this._bounds),e},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},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(e,t){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(e),e instanceof L.MarkerCluster?(t||(this._childClusters.push(e),e.__parent=this),this._childCount+=e._childCount):(t||this._markers.push(e),this._childCount++),this.__parent&&this.__parent._addChild(e,!0)},_setClusterCenter:function(e){this._cLatLng||(this._cLatLng=e._cLatLng||e._latlng)},_resetBounds:function(){var e=this._bounds;e._southWest&&(e._southWest.lat=1/0,e._southWest.lng=1/0),e._northEast&&(e._northEast.lat=-1/0,e._northEast.lng=-1/0)},_recalculateBounds:function(){var e=this._markers,t=this._childClusters,i=0,n=0,r=this._childCount,o,s,a,u;if(r!==0){for(this._resetBounds(),o=0;o<e.length;o++)a=e[o]._latlng,this._bounds.extend(a),i+=a.lat,n+=a.lng;for(o=0;o<t.length;o++)s=t[o],s._boundsNeedUpdate&&s._recalculateBounds(),this._bounds.extend(s._bounds),a=s._wLatLng,u=s._childCount,i+=a.lat*u,n+=a.lng*u;this._latlng=this._wLatLng=new L.LatLng(i/r,n/r),this._boundsNeedUpdate=!1}},_addToMap:function(e){e&&(this._backupLatlng=this._latlng,this.setLatLng(e)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(e,t,i){this._recursively(e,this._group._map.getMinZoom(),i-1,function(n){var r=n._markers,o,s;for(o=r.length-1;o>=0;o--)s=r[o],s._icon&&(s._setPos(t),s.clusterHide())},function(n){var r=n._childClusters,o,s;for(o=r.length-1;o>=0;o--)s=r[o],s._icon&&(s._setPos(t),s.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(e,t,i,n){this._recursively(e,n,t,function(r){r._recursivelyAnimateChildrenIn(e,r._group._map.latLngToLayerPoint(r.getLatLng()).round(),i),r._isSingleParent()&&i-1===n?(r.clusterShow(),r._recursivelyRemoveChildrenFromMap(e,t,i)):r.clusterHide(),r._addToMap()})},_recursivelyBecomeVisible:function(e,t){this._recursively(e,this._group._map.getMinZoom(),t,null,function(i){i.clusterShow()})},_recursivelyAddChildrenToMap:function(e,t,i){this._recursively(i,this._group._map.getMinZoom()-1,t,function(n){if(t!==n._zoom)for(var r=n._markers.length-1;r>=0;r--){var o=n._markers[r];i.contains(o._latlng)&&(e&&(o._backupLatlng=o.getLatLng(),o.setLatLng(e),o.clusterHide&&o.clusterHide()),n._group._featureGroup.addLayer(o))}},function(n){n._addToMap(e)})},_recursivelyRestoreChildPositions:function(e){for(var t=this._markers.length-1;t>=0;t--){var i=this._markers[t];i._backupLatlng&&(i.setLatLng(i._backupLatlng),delete i._backupLatlng)}if(e-1===this._zoom)for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n]._restorePosition();else for(var r=this._childClusters.length-1;r>=0;r--)this._childClusters[r]._recursivelyRestoreChildPositions(e)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(e,t,i,n){var r,o;this._recursively(e,t-1,i-1,function(s){for(o=s._markers.length-1;o>=0;o--)r=s._markers[o],(!n||!n.contains(r._latlng))&&(s._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())},function(s){for(o=s._childClusters.length-1;o>=0;o--)r=s._childClusters[o],(!n||!n.contains(r._latlng))&&(s._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())})},_recursively:function(e,t,i,n,r){var o=this._childClusters,s=this._zoom,a,u;if(t<=s&&(n&&n(this),r&&s===i&&r(this)),s<t||s<i)for(a=o.length-1;a>=0;a--)u=o[a],u._boundsNeedUpdate&&u._recalculateBounds(),e.intersects(u._bounds)&&u._recursively(e,t,i,n,r)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){var e=this.options.opacity;return this.setOpacity(0),this.options.opacity=e,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}}),L.DistanceGrid=function(e){this._cellSize=e,this._sqCellSize=e*e,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(e,t){var i=this._getCoord(t.x),n=this._getCoord(t.y),r=this._grid,o=r[n]=r[n]||{},s=o[i]=o[i]||[],a=L.Util.stamp(e);this._objectPoint[a]=t,s.push(e)},updateObject:function(e,t){this.removeObject(e),this.addObject(e,t)},removeObject:function(e,t){var i=this._getCoord(t.x),n=this._getCoord(t.y),r=this._grid,o=r[n]=r[n]||{},s=o[i]=o[i]||[],a,u;for(delete this._objectPoint[L.Util.stamp(e)],a=0,u=s.length;a<u;a++)if(s[a]===e)return s.splice(a,1),u===1&&delete o[i],!0},eachObject:function(e,t){var i,n,r,o,s,a,u,l=this._grid;for(i in l){s=l[i];for(n in s)for(a=s[n],r=0,o=a.length;r<o;r++)u=e.call(t,a[r]),u&&(r--,o--)}},getNearObject:function(e){var t=this._getCoord(e.x),i=this._getCoord(e.y),n,r,o,s,a,u,l,_,f=this._objectPoint,d=this._sqCellSize,c=null;for(n=i-1;n<=i+1;n++)if(s=this._grid[n],s){for(r=t-1;r<=t+1;r++)if(a=s[r],a)for(o=0,u=a.length;o<u;o++)l=a[o],_=this._sqDist(f[L.Util.stamp(l)],e),(_<d||_<=d&&c===null)&&(d=_,c=l)}return c},_getCoord:function(e){var t=Math.floor(e/this._cellSize);return isFinite(t)?t:e},_sqDist:function(e,t){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n}},function(){L.QuickHull={getDistant:function(e,t){var i=t[1].lat-t[0].lat,n=t[0].lng-t[1].lng;return n*(e.lat-t[0].lat)+i*(e.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(e,t){var i=0,n=null,r=[],o,s,a;for(o=t.length-1;o>=0;o--){if(s=t[o],a=this.getDistant(s,e),a>0)r.push(s);else continue;a>i&&(i=a,n=s)}return{maxPoint:n,newPoints:r}},buildConvexHull:function(e,t){var i=[],n=this.findMostDistantPointFromBaseLine(e,t);return n.maxPoint?(i=i.concat(this.buildConvexHull([e[0],n.maxPoint],n.newPoints)),i=i.concat(this.buildConvexHull([n.maxPoint,e[1]],n.newPoints)),i):[e[0]]},getConvexHull:function(e){var t=!1,i=!1,n=!1,r=!1,o=null,s=null,a=null,u=null,l=null,_=null,f;for(f=e.length-1;f>=0;f--){var d=e[f];(t===!1||d.lat>t)&&(o=d,t=d.lat),(i===!1||d.lat<i)&&(s=d,i=d.lat),(n===!1||d.lng>n)&&(a=d,n=d.lng),(r===!1||d.lng<r)&&(u=d,r=d.lng)}i!==t?(_=s,l=o):(_=u,l=a);var c=[].concat(this.buildConvexHull([_,l],e),this.buildConvexHull([l,_],e));return c}}}(),L.MarkerCluster.include({getConvexHull:function(){var e=this.getAllChildMarkers(),t=[],i,n;for(n=e.length-1;n>=0;n--)i=e[n].getLatLng(),t.push(i);return L.QuickHull.getConvexHull(t)}}),L.MarkerCluster.include({_2PI:Math.PI*2,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(!(this._group._spiderfied===this||this._group._inZoomAnimation)){var e=this.getAllChildMarkers(null,!0),t=this._group,i=t._map,n=i.latLngToLayerPoint(this._latlng),r;this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?r=this._group.options.spiderfyShapePositions(e.length,n):e.length>=this._circleSpiralSwitchover?r=this._generatePointsSpiral(e.length,n):(n.y+=10,r=this._generatePointsCircle(e.length,n)),this._animationSpiderfy(e,r)}},unspiderfy:function(e){this._group._inZoomAnimation||(this._animationUnspiderfy(e),this._group._spiderfied=null)},_generatePointsCircle:function(e,t){var i=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+e),n=i/this._2PI,r=this._2PI/e,o=[],s,a;for(n=Math.max(n,35),o.length=e,s=0;s<e;s++)a=this._circleStartAngle+s*r,o[s]=new L.Point(t.x+n*Math.cos(a),t.y+n*Math.sin(a))._round();return o},_generatePointsSpiral:function(e,t){var i=this._group.options.spiderfyDistanceMultiplier,n=i*this._spiralLengthStart,r=i*this._spiralFootSeparation,o=i*this._spiralLengthFactor*this._2PI,s=0,a=[],u;for(a.length=e,u=e;u>=0;u--)u<e&&(a[u]=new L.Point(t.x+n*Math.cos(s),t.y+n*Math.sin(s))._round()),s+=r/n+u*5e-4,n+=o/s;return a},_noanimationUnspiderfy:function(){var e=this._group,t=e._map,i=e._featureGroup,n=this.getAllChildMarkers(null,!0),r,o;for(e._ignoreMove=!0,this.setOpacity(1),o=n.length-1;o>=0;o--)r=n[o],i.removeLayer(r),r._preSpiderfyLatlng&&(r.setLatLng(r._preSpiderfyLatlng),delete r._preSpiderfyLatlng),r.setZIndexOffset&&r.setZIndexOffset(0),r._spiderLeg&&(t.removeLayer(r._spiderLeg),delete r._spiderLeg);e.fire("unspiderfied",{cluster:this,markers:n}),e._ignoreMove=!1,e._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(e,t){var i=this._group,n=i._map,r=i._featureGroup,o=this._group.options.spiderLegPolylineOptions,s,a,u,l;for(i._ignoreMove=!0,s=0;s<e.length;s++)l=n.layerPointToLatLng(t[s]),a=e[s],u=new L.Polyline([this._latlng,l],o),n.addLayer(u),a._spiderLeg=u,a._preSpiderfyLatlng=a._latlng,a.setLatLng(l),a.setZIndexOffset&&a.setZIndexOffset(1e6),r.addLayer(a);this.setOpacity(.3),i._ignoreMove=!1,i.fire("spiderfied",{cluster:this,markers:e})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(e,t){var i=this,n=this._group,r=n._map,o=n._featureGroup,s=this._latlng,a=r.latLngToLayerPoint(s),u=L.Path.SVG,l=L.extend({},this._group.options.spiderLegPolylineOptions),_=l.opacity,f,d,c,g,S,y;for(_===void 0&&(_=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),u?(l.opacity=0,l.className=(l.className||"")+" leaflet-cluster-spider-leg"):l.opacity=_,n._ignoreMove=!0,f=0;f<e.length;f++)d=e[f],y=r.layerPointToLatLng(t[f]),c=new L.Polyline([s,y],l),r.addLayer(c),d._spiderLeg=c,u&&(g=c._path,S=g.getTotalLength()+.1,g.style.strokeDasharray=S,g.style.strokeDashoffset=S),d.setZIndexOffset&&d.setZIndexOffset(1e6),d.clusterHide&&d.clusterHide(),o.addLayer(d),d._setPos&&d._setPos(a);for(n._forceLayout(),n._animationStart(),f=e.length-1;f>=0;f--)y=r.layerPointToLatLng(t[f]),d=e[f],d._preSpiderfyLatlng=d._latlng,d.setLatLng(y),d.clusterShow&&d.clusterShow(),u&&(c=d._spiderLeg,g=c._path,g.style.strokeDashoffset=0,c.setStyle({opacity:_}));this.setOpacity(.3),n._ignoreMove=!1,setTimeout(function(){n._animationEnd(),n.fire("spiderfied",{cluster:i,markers:e})},200)},_animationUnspiderfy:function(e){var t=this,i=this._group,n=i._map,r=i._featureGroup,o=e?n._latLngToNewLayerPoint(this._latlng,e.zoom,e.center):n.latLngToLayerPoint(this._latlng),s=this.getAllChildMarkers(null,!0),a=L.Path.SVG,u,l,_,f,d,c;for(i._ignoreMove=!0,i._animationStart(),this.setOpacity(1),l=s.length-1;l>=0;l--)u=s[l],u._preSpiderfyLatlng&&(u.closePopup(),u.setLatLng(u._preSpiderfyLatlng),delete u._preSpiderfyLatlng,c=!0,u._setPos&&(u._setPos(o),c=!1),u.clusterHide&&(u.clusterHide(),c=!1),c&&r.removeLayer(u),a&&(_=u._spiderLeg,f=_._path,d=f.getTotalLength()+.1,f.style.strokeDashoffset=d,_.setStyle({opacity:0})));i._ignoreMove=!1,setTimeout(function(){var g=0;for(l=s.length-1;l>=0;l--)u=s[l],u._spiderLeg&&g++;for(l=s.length-1;l>=0;l--)u=s[l],u._spiderLeg&&(u.clusterShow&&u.clusterShow(),u.setZIndexOffset&&u.setZIndexOffset(0),g>1&&r.removeLayer(u),n.removeLayer(u._spiderLeg),delete u._spiderLeg);i._animationEnd(),i.fire("unspiderfied",{cluster:t,markers:s})},200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd:function(){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),L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){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(e){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(e))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(e){this._spiderfied&&this._spiderfied.unspiderfy(e)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(e){e._spiderLeg&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow(),e.setZIndexOffset&&e.setZIndexOffset(0),this._map.removeLayer(e._spiderLeg),delete e._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(e){return e?e instanceof L.MarkerClusterGroup?e=e._topClusterLevel.getAllChildMarkers():e instanceof L.LayerGroup?e=e._layers:e instanceof L.MarkerCluster?e=e.getAllChildMarkers():e instanceof L.Marker&&(e=[e]):e=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(e),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(e),this},_flagParentsIconsNeedUpdate:function(e){var t,i;for(t in e)for(i=e[t].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers:function(e){var t,i;for(t in e)i=e[t],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),L.Marker.include({refreshIconOptions:function(e,t){var i=this.options.icon;return L.setOptions(i,e),this.setIcon(i),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),p.MarkerClusterGroup=v,p.MarkerCluster=C,Object.defineProperty(p,"__esModule",{value:!0})})})(O,O.exports);const P=(m,h)=>{let p;return(...v)=>{const C=()=>(p=void 0,m.apply(void 0,v));clearTimeout(p),p=setTimeout(C,h)}},{featureGroupProps:B,setupFeatureGroup:I}=k.Functions.FeatureGroup,{AddLayerInjection:Z,RemoveLayerInjection:E}=k.InjectionKeys,{propsToLeafletOptions:T}=k.Utilities,A=["layeradd","layerremove","click","dblclick","mousedown","mouseup","mouseover","mouseout","contextmenu"],b=[...A,"clusterclick","clustermouseover","clustermouseout","animationend","spiderfied","unspiderfied"],w={...B,maxClusterRadius:{type:[Number,Function],default:80},clusterPane:{type:String,default:"markerPane"},spiderfyOnEveryZoom:{type:Boolean,default:!1},spiderfyOnMaxZoom:{type:Boolean,default:!0},showCoverageOnHover:{type:Boolean,default:!0},zoomToBoundsOnClick:{type:Boolean,default:!0},singleMarkerMode:{type:Boolean,default:!1},disableClusteringAtZoom:{type:Number,default:null},removeOutsideVisibleBounds:{type:Boolean,default:!0},animate:{type:Boolean,default:!0},animateAddingMarkers:{type:Boolean,default:!1},spiderfyShapePositions:{type:Function,default:null},spiderfyDistanceMultiplier:{type:Number,default:1},spiderLegPolylineOptions:{type:Object,default:()=>({weight:1.5,color:"#222",opacity:.5})},chunkedLoading:{type:Boolean,default:!1},chunkInterval:{type:Number,default:200},chunkDelay:{type:Number,default:50},chunkProgress:{type:Function,default:null},polygonOptions:{type:Object,default:()=>({})},iconCreateFunction:{type:Function,default:null}},U=(m,h,p)=>{const{options:v,methods:C}=I(m,h,p),e=T(m,w,v);let t=[];const i=P(()=>{var s,a;t.length===1?(s=h.value)==null||s.addLayer(t[0]):(a=h.value)==null||a.addLayers(t),t=[]},0);let n=[];const r=P(()=>{var s,a;n.length===1?(s=h.value)==null||s.removeLayer(n[0]):(a=h.value)==null||a.removeLayers(n),n=[]},0),o={...C,addLayer(s){var a;if(m.animateAddingMarkers)return(a=h.value)==null?void 0:a.addLayer(s.leafletObject);t.push(s.leafletObject),i()},removeLayer(s){var a;if(m.animateAddingMarkers)return(a=h.value)==null?void 0:a.removeLayer(s.leafletObject);n.push(s.leafletObject),r()},setMaxClusterRadius(){throw new Error("Max cluster radius can't be set dynamically")},setClusterPane(){throw new Error("Cluster pane can't be set dynamically")},setSpiderfyOnEveryZoom(s){h.value&&(h.value._unbindEvents(),h.value.options.spiderfyOnEveryZoom=s,h.value._bindEvents())},setSpiderfyOnMaxZoom(s){h.value&&(h.value._unbindEvents(),h.value.options.spiderfyOnMaxZoom=s,h.value._bindEvents())},setShowCoverageOnHover(s){h.value&&(h.value._unbindEvents(),h.value.options.showCoverageOnHover=s,h.value._bindEvents())},setZoomToBoundsOnClick(s){h.value&&(h.value._unbindEvents(),h.value.options.zoomToBoundsOnClick=s,h.value._bindEvents())},setSingleMarkerMode(){throw new Error("Single marker mode can't be set dynamically")},setDisableClusteringAtZoom(){throw new Error("Disable Clustering at zoom can't be set dynamically")},setRemoveOutsideVisibleBounds(s){h.value&&(h.value.options.removeOutsideVisibleBounds=s)},setAnimate(){throw new Error("Animate can't be set dynamically")},setAnimateAddingMarkers(s){h.value&&(h.value.options.animateAddingMarkers=s)},setSpiderfyShapePositions(s){h.value&&(h.value.options.spiderfyShapePositions=s)},setSpiderfyDistanceMultiplier(s){h.value&&(h.value.options.spiderfyDistanceMultiplier=s)},setSpiderLegPolylineOptions(s){h.value&&(h.value.options.spiderLegPolylineOptions=s)},setChunkedLoading(s){h.value&&(h.value.options.chunkedLoading=s)},setChunkInterval(s){h.value&&(h.value.options.chunkInterval=s)},setChunkDelay(s){h.value&&(h.value.options.chunkDelay=s)},setChunkProgress(s){h.value&&(h.value.options.chunkProgress=s)},setPolygonOptions(s){h.value&&(h.value.options.polygonOptions=s)},setIconCreateFunction(s){h.value&&(h.value._unbindEvents(),h.value.options.iconCreateFunction=s,h.value._bindEvents())}};return M.provide(Z,o.addLayer),M.provide(E,o.removeLayer),{options:e,methods:o}},{propsBinder:N,assertInject:z,WINDOW_OR_GLOBAL:j}=k.Utilities,{AddLayerInjection:F}=k.InjectionKeys,{render:D}=k.Functions.Layer,H={props:w,emits:["ready",...b],setup(m,h){const p=M.ref(),v=M.ref(!1),C=z(F),{methods:e,options:t}=U(m,p,h);return M.onMounted(async()=>{var o;const{markerClusterGroup:i}=j.L;p.value=M.markRaw(i(t));const n=s=>a=>h.emit(s,a),r=()=>{const s={};for(const a of b)s[a]=n(a);return s};(o=p.value)==null||o.on(r()),N(e,p.value,m),C({...m,...e,leafletObject:p.value}),v.value=!0,M.nextTick(()=>h.emit("ready",p.value))}),{ready:v,leafletObject:p}},render(){return D(this.ready,this.$slots)}};exports.LMarkerClusterGroup=H; |
@@ -1,1 +0,1 @@ | ||
(function(C,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("vue"),require("@vue-leaflet/vue-leaflet")):typeof define=="function"&&define.amd?define(["exports","vue","@vue-leaflet/vue-leaflet"],m):(C=typeof globalThis<"u"?globalThis:C||self,m(C["vue-leaflet-markercluster"]={},C.Vue,C["@vue-leaflet/vue-leaflet"]))})(this,function(C,m,S){"use strict";var G=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},P={exports:{}};(function(g,h){(function(c,y){y(h)})(G,function(c){var y=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.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};var t=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,t?this._withAnimation:this._noAnimation),this._markerCluster=t?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(e){if(e instanceof L.LayerGroup)return this.addLayers([e]);if(!e.getLatLng)return this._nonPointGroup.addLayer(e),this.fire("layeradd",{layer:e}),this;if(!this._map)return this._needsClustering.push(e),this.fire("layeradd",{layer:e}),this;if(this.hasLayer(e))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(e,this._maxZoom),this.fire("layeradd",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var t=e,i=this._zoom;if(e.__parent)for(;t.__parent._zoom>=i;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(e,t):this._animationAddLayerNonAnimated(e,t)),this},removeLayer:function(e){return e instanceof L.LayerGroup?this.removeLayers([e]):e.getLatLng?this._map?e.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(e)),this._removeLayer(e,!0),this.fire("layerremove",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),e.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(e)&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,e)&&this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e}),this):(this._nonPointGroup.removeLayer(e),this.fire("layerremove",{layer:e}),this)},addLayers:function(e,t){if(!L.Util.isArray(e))return this.addLayer(e);var i=this._featureGroup,n=this._nonPointGroup,r=this.options.chunkedLoading,o=this.options.chunkInterval,s=this.options.chunkProgress,a=e.length,u=0,l=!0,d;if(this._map){var f=new Date().getTime(),_=L.bind(function(){var v=new Date().getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();u<a;u++){if(r&&u%200===0){var O=new Date().getTime()-v;if(O>o)break}if(d=e[u],d instanceof L.LayerGroup){l&&(e=e.slice(),l=!1),this._extractNonGroupLayers(d,e),a=e.length;continue}if(!d.getLatLng){n.addLayer(d),t||this.fire("layeradd",{layer:d});continue}if(!this.hasLayer(d)&&(this._addLayer(d,this._maxZoom),t||this.fire("layeradd",{layer:d}),d.__parent&&d.__parent.getChildCount()===2)){var M=d.__parent.getAllChildMarkers(),H=M[0]===d?M[1]:M[0];i.removeLayer(H)}}s&&s(u,a,new Date().getTime()-f),u===a?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(_,this.options.chunkDelay)},this);_()}else for(var p=this._needsClustering;u<a;u++){if(d=e[u],d instanceof L.LayerGroup){l&&(e=e.slice(),l=!1),this._extractNonGroupLayers(d,e),a=e.length;continue}if(!d.getLatLng){n.addLayer(d);continue}this.hasLayer(d)||p.push(d)}return this},removeLayers:function(e){var t,i,n=e.length,r=this._featureGroup,o=this._nonPointGroup,s=!0;if(!this._map){for(t=0;t<n;t++){if(i=e[t],i instanceof L.LayerGroup){s&&(e=e.slice(),s=!1),this._extractNonGroupLayers(i,e),n=e.length;continue}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();var a=e.slice(),u=n;for(t=0;t<u;t++){if(i=a[t],i instanceof L.LayerGroup){this._extractNonGroupLayers(i,a),u=a.length;continue}this._unspiderfyLayer(i)}}for(t=0;t<n;t++){if(i=e[t],i instanceof L.LayerGroup){s&&(e=e.slice(),s=!1),this._extractNonGroupLayers(i,e),n=e.length;continue}if(!i.__parent){o.removeLayer(i),this.fire("layerremove",{layer:i});continue}this._removeLayer(i,!0,!0),this.fire("layerremove",{layer:i}),r.hasLayer(i)&&(r.removeLayer(i),i.clusterShow&&i.clusterShow())}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(e){e.off(this._childMarkerEventHandlers,this),delete e.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var e=new L.LatLngBounds;this._topClusterLevel&&e.extend(this._topClusterLevel._bounds);for(var t=this._needsClustering.length-1;t>=0;t--)e.extend(this._needsClustering[t].getLatLng());return e.extend(this._nonPointGroup.getBounds()),e},eachLayer:function(e,t){var i=this._needsClustering.slice(),n=this._needsRemoving,r,o,s;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(i),o=i.length-1;o>=0;o--){for(r=!0,s=n.length-1;s>=0;s--)if(n[s].layer===i[o]){r=!1;break}r&&e.call(t,i[o])}this._nonPointGroup.eachLayer(e,t)},getLayers:function(){var e=[];return this.eachLayer(function(t){e.push(t)}),e},getLayer:function(e){var t=null;return e=parseInt(e,10),this.eachLayer(function(i){L.stamp(i)===e&&(t=i)}),t},hasLayer:function(e){if(!e)return!1;var t,i=this._needsClustering;for(t=i.length-1;t>=0;t--)if(i[t]===e)return!0;for(i=this._needsRemoving,t=i.length-1;t>=0;t--)if(i[t].layer===e)return!1;return!!(e.__parent&&e.__parent._group===this)||this._nonPointGroup.hasLayer(e)},zoomToShowLayer:function(e,t){var i=this._map;typeof t!="function"&&(t=function(){});var n=function(){(i.hasLayer(e)||i.hasLayer(e.__parent))&&!this._inZoomAnimation&&(this._map.off("moveend",n,this),this.off("animationend",n,this),i.hasLayer(e)?t():e.__parent._icon&&(this.once("spiderfied",t,this),e.__parent.spiderfy()))};e._icon&&this._map.getBounds().contains(e.getLatLng())?t():e.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",n,this),this._map.panTo(e.getLatLng())):(this._map.on("moveend",n,this),this.on("animationend",n,this),e.__parent.zoomToBounds())},onAdd:function(e){this._map=e;var t,i,n;if(!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(e),this._nonPointGroup.addTo(e),this._gridClusters||this._generateInitialClusters(),this._maxLat=e.options.crs.projection.MAX_LATITUDE,t=0,i=this._needsRemoving.length;t<i;t++)n=this._needsRemoving[t],n.newlatlng=n.layer._latlng,n.layer._latlng=n.latlng;for(t=0,i=this._needsRemoving.length;t<i;t++)n=this._needsRemoving[t],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._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),i=this._needsClustering,this._needsClustering=[],this.addLayers(i,!0)},onRemove:function(e){e.off("zoomend",this._zoomEnd,this),e.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(e){for(var t=e;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:function(e,t){for(var i=e.length-1;i>=0;i--)if(e[i]===t)return e.splice(i,1),!0},_removeFromGridUnclustered:function(e,t){for(var i=this._map,n=this._gridUnclustered,r=Math.floor(this._map.getMinZoom());t>=r&&n[t].removeObject(e,i.project(e.getLatLng(),t));t--);},_childMarkerDragStart:function(e){e.target.__dragStart=e.target._latlng},_childMarkerMoved:function(e){if(!this._ignoreMove&&!e.target.__dragStart){var t=e.target._popup&&e.target._popup.isOpen();this._moveChild(e.target,e.oldLatLng,e.latlng),t&&e.target.openPopup()}},_moveChild:function(e,t,i){e._latlng=t,this.removeLayer(e),e._latlng=i,this.addLayer(e)},_childMarkerDragEnd:function(e){var t=e.target.__dragStart;delete e.target.__dragStart,t&&this._moveChild(e.target,t,e.target._latlng)},_removeLayer:function(e,t,i){var n=this._gridClusters,r=this._gridUnclustered,o=this._featureGroup,s=this._map,a=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(e,this._maxZoom);var u=e.__parent,l=u._markers,d;for(this._arraySplice(l,e);u&&(u._childCount--,u._boundsNeedUpdate=!0,!(u._zoom<a));)t&&u._childCount<=1?(d=u._markers[0]===e?u._markers[1]:u._markers[0],n[u._zoom].removeObject(u,s.project(u._cLatLng,u._zoom)),r[u._zoom].addObject(d,s.project(d.getLatLng(),u._zoom)),this._arraySplice(u.__parent._childClusters,u),u.__parent._markers.push(d),d.__parent=u.__parent,u._icon&&(o.removeLayer(u),i||o.addLayer(d))):u._iconNeedsUpdate=!0,u=u.__parent;delete e.__parent},_isOrIsParent:function(e,t){for(;t;){if(e===t)return!0;t=t.parentNode}return!1},fire:function(e,t,i){if(t&&t.layer instanceof L.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.layer._icon,t.originalEvent.relatedTarget))return;e="cluster"+e}L.FeatureGroup.prototype.fire.call(this,e,t,i)},listens:function(e,t){return L.FeatureGroup.prototype.listens.call(this,e,t)||L.FeatureGroup.prototype.listens.call(this,"cluster"+e,t)},_defaultIconCreateFunction:function(e){var t=e.getChildCount(),i=" marker-cluster-";return t<10?i+="small":t<100?i+="medium":i+="large",new L.DivIcon({html:"<div><span>"+t+"</span></div>",className:"marker-cluster"+i,iconSize:new L.Point(40,40)})},_bindEvents:function(){var e=this._map,t=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick,r=this.options.spiderfyOnEveryZoom;(t||n||r)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),e.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(e){var t=e.layer,i=t;if(!(e.type==="clusterkeypress"&&e.originalEvent&&e.originalEvent.keyCode!==13)){for(;i._childClusters.length===1;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),this.options.spiderfyOnEveryZoom&&t.spiderfy(),e.originalEvent&&e.originalEvent.keyCode===13&&this._map._container.focus()}},_showCoverage:function(e){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),e.layer.getChildCount()>2&&e.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(e.layer.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var e=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,n=this.options.spiderfyOnEveryZoom,r=this._map;(e||i||n)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),r.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var e=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),e),this._currentShownBounds=e}},_generateInitialClusters:function(){var e=Math.ceil(this._map.getMaxZoom()),t=Math.floor(this._map.getMinZoom()),i=this.options.maxClusterRadius,n=i;typeof i!="function"&&(n=function(){return i}),this.options.disableClusteringAtZoom!==null&&(e=this.options.disableClusteringAtZoom-1),this._maxZoom=e,this._gridClusters={},this._gridUnclustered={};for(var r=e;r>=t;r--)this._gridClusters[r]=new L.DistanceGrid(n(r)),this._gridUnclustered[r]=new L.DistanceGrid(n(r));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(e,t){var i=this._gridClusters,n=this._gridUnclustered,r=Math.floor(this._map.getMinZoom()),o,s;for(this.options.singleMarkerMode&&this._overrideMarkerIcon(e),e.on(this._childMarkerEventHandlers,this);t>=r;t--){o=this._map.project(e.getLatLng(),t);var a=i[t].getNearObject(o);if(a){a._addChild(e),e.__parent=a;return}if(a=n[t].getNearObject(o),a){var u=a.__parent;u&&this._removeLayer(a,!1);var l=new this._markerCluster(this,t,a,e);i[t].addObject(l,this._map.project(l._cLatLng,t)),a.__parent=l,e.__parent=l;var d=l;for(s=t-1;s>u._zoom;s--)d=new this._markerCluster(this,s,d),i[s].addObject(d,this._map.project(a.getLatLng(),s));u._addChild(d),this._removeFromGridUnclustered(a,t);return}n[t].addObject(e,o)}this._topClusterLevel._addChild(e),e.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(e){e instanceof L.MarkerCluster&&e._iconNeedsUpdate&&e._updateIcon()})},_enqueue:function(e){this._queue.push(e),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var e=0;e<this._queue.length;e++)this._queue[e].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var e=Math.round(this._map._zoom);this._processQueue(),this._zoom<e&&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,e)):this._zoom>e?(this._animationStart(),this._animationZoomOut(this._zoom,e)):this._moveEnd()},_getExpandedVisibleBounds:function(){if(this.options.removeOutsideVisibleBounds){if(L.Browser.mobile)return this._checkBoundsMaxLat(this._map.getBounds())}else return this._mapBoundsInfinite;return this._checkBoundsMaxLat(this._map.getBounds().pad(1))},_checkBoundsMaxLat:function(e){var t=this._maxLat;return t!==void 0&&(e.getNorth()>=t&&(e._northEast.lat=1/0),e.getSouth()<=-t&&(e._southWest.lat=-1/0)),e},_animationAddLayerNonAnimated:function(e,t){if(t===e)this._featureGroup.addLayer(e);else if(t._childCount===2){t._addToMap();var i=t.getAllChildMarkers();this._featureGroup.removeLayer(i[0]),this._featureGroup.removeLayer(i[1])}else t._updateIcon()},_extractNonGroupLayers:function(e,t){var i=e.getLayers(),n=0,r;for(t=t||[];n<i.length;n++){if(r=i[n],r instanceof L.LayerGroup){this._extractNonGroupLayers(r,t);continue}t.push(r)}return t},_overrideMarkerIcon:function(e){var t=e.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[e]}});return t}});L.MarkerClusterGroup.include({_mapBoundsInfinite:new L.LatLngBounds(new L.LatLng(-1/0,-1/0),new L.LatLng(1/0,1/0))}),L.MarkerClusterGroup.include({_noAnimation:{_animationStart:function(){},_animationZoomIn:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(e,t){this._animationAddLayerNonAnimated(e,t)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(e,t){var i=this._getExpandedVisibleBounds(),n=this._featureGroup,r=Math.floor(this._map.getMinZoom()),o;this._ignoreMove=!0,this._topClusterLevel._recursively(i,e,r,function(s){var a=s._latlng,u=s._markers,l;for(i.contains(a)||(a=null),s._isSingleParent()&&e+1===t?(n.removeLayer(s),s._recursivelyAddChildrenToMap(null,t,i)):(s.clusterHide(),s._recursivelyAddChildrenToMap(a,t,i)),o=u.length-1;o>=0;o--)l=u[o],i.contains(l._latlng)||n.removeLayer(l)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(i,t),n.eachLayer(function(s){!(s instanceof L.MarkerCluster)&&s._icon&&s.clusterShow()}),this._topClusterLevel._recursively(i,e,t,function(s){s._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(i,e,r,function(s){n.removeLayer(s),s.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(e,t){this._animationZoomOutSingle(this._topClusterLevel,e-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e,this._getExpandedVisibleBounds())},_animationAddLayer:function(e,t){var i=this,n=this._featureGroup;n.addLayer(e),t!==e&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),e._setPos(this._map.latLngToLayerPoint(t.getLatLng())),e.clusterHide(),this._enqueue(function(){n.removeLayer(e),e.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(e,t,i){var n=this._getExpandedVisibleBounds(),r=Math.floor(this._map.getMinZoom());e._recursivelyAnimateChildrenInAndAddSelfToMap(n,r,t+1,i);var o=this;this._forceLayout(),e._recursivelyBecomeVisible(n,i),this._enqueue(function(){if(e._childCount===1){var s=e._markers[0];this._ignoreMove=!0,s.setLatLng(s.getLatLng()),this._ignoreMove=!1,s.clusterShow&&s.clusterShow()}else e._recursively(n,i,r,function(a){a._recursivelyRemoveChildrenFromMap(n,r,t+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(){L.Util.falseFn(document.body.offsetWidth)}}),L.markerClusterGroup=function(e){return new L.MarkerClusterGroup(e)};var k=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(e,t,i,n){L.Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new L.LatLng(0,0),{icon:this,pane:e.options.clusterPane}),this._group=e,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,i&&this._addChild(i),n&&this._addChild(n)},getAllChildMarkers:function(e,t){e=e||[];for(var i=this._childClusters.length-1;i>=0;i--)this._childClusters[i].getAllChildMarkers(e,t);for(var n=this._markers.length-1;n>=0;n--)t&&this._markers[n].__dragStart||e.push(this._markers[n]);return e},getChildCount:function(){return this._childCount},zoomToBounds:function(e){for(var t=this._childClusters.slice(),i=this._group._map,n=i.getBoundsZoom(this._bounds),r=this._zoom+1,o=i.getZoom(),s;t.length>0&&n>r;){r++;var a=[];for(s=0;s<t.length;s++)a=a.concat(t[s]._childClusters);t=a}n>r?this._group._map.setView(this._latlng,r):n<=o?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,e)},getBounds:function(){var e=new L.LatLngBounds;return e.extend(this._bounds),e},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},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(e,t){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(e),e instanceof L.MarkerCluster?(t||(this._childClusters.push(e),e.__parent=this),this._childCount+=e._childCount):(t||this._markers.push(e),this._childCount++),this.__parent&&this.__parent._addChild(e,!0)},_setClusterCenter:function(e){this._cLatLng||(this._cLatLng=e._cLatLng||e._latlng)},_resetBounds:function(){var e=this._bounds;e._southWest&&(e._southWest.lat=1/0,e._southWest.lng=1/0),e._northEast&&(e._northEast.lat=-1/0,e._northEast.lng=-1/0)},_recalculateBounds:function(){var e=this._markers,t=this._childClusters,i=0,n=0,r=this._childCount,o,s,a,u;if(r!==0){for(this._resetBounds(),o=0;o<e.length;o++)a=e[o]._latlng,this._bounds.extend(a),i+=a.lat,n+=a.lng;for(o=0;o<t.length;o++)s=t[o],s._boundsNeedUpdate&&s._recalculateBounds(),this._bounds.extend(s._bounds),a=s._wLatLng,u=s._childCount,i+=a.lat*u,n+=a.lng*u;this._latlng=this._wLatLng=new L.LatLng(i/r,n/r),this._boundsNeedUpdate=!1}},_addToMap:function(e){e&&(this._backupLatlng=this._latlng,this.setLatLng(e)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(e,t,i){this._recursively(e,this._group._map.getMinZoom(),i-1,function(n){var r=n._markers,o,s;for(o=r.length-1;o>=0;o--)s=r[o],s._icon&&(s._setPos(t),s.clusterHide())},function(n){var r=n._childClusters,o,s;for(o=r.length-1;o>=0;o--)s=r[o],s._icon&&(s._setPos(t),s.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(e,t,i,n){this._recursively(e,n,t,function(r){r._recursivelyAnimateChildrenIn(e,r._group._map.latLngToLayerPoint(r.getLatLng()).round(),i),r._isSingleParent()&&i-1===n?(r.clusterShow(),r._recursivelyRemoveChildrenFromMap(e,t,i)):r.clusterHide(),r._addToMap()})},_recursivelyBecomeVisible:function(e,t){this._recursively(e,this._group._map.getMinZoom(),t,null,function(i){i.clusterShow()})},_recursivelyAddChildrenToMap:function(e,t,i){this._recursively(i,this._group._map.getMinZoom()-1,t,function(n){if(t!==n._zoom)for(var r=n._markers.length-1;r>=0;r--){var o=n._markers[r];i.contains(o._latlng)&&(e&&(o._backupLatlng=o.getLatLng(),o.setLatLng(e),o.clusterHide&&o.clusterHide()),n._group._featureGroup.addLayer(o))}},function(n){n._addToMap(e)})},_recursivelyRestoreChildPositions:function(e){for(var t=this._markers.length-1;t>=0;t--){var i=this._markers[t];i._backupLatlng&&(i.setLatLng(i._backupLatlng),delete i._backupLatlng)}if(e-1===this._zoom)for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n]._restorePosition();else for(var r=this._childClusters.length-1;r>=0;r--)this._childClusters[r]._recursivelyRestoreChildPositions(e)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(e,t,i,n){var r,o;this._recursively(e,t-1,i-1,function(s){for(o=s._markers.length-1;o>=0;o--)r=s._markers[o],(!n||!n.contains(r._latlng))&&(s._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())},function(s){for(o=s._childClusters.length-1;o>=0;o--)r=s._childClusters[o],(!n||!n.contains(r._latlng))&&(s._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())})},_recursively:function(e,t,i,n,r){var o=this._childClusters,s=this._zoom,a,u;if(t<=s&&(n&&n(this),r&&s===i&&r(this)),s<t||s<i)for(a=o.length-1;a>=0;a--)u=o[a],u._boundsNeedUpdate&&u._recalculateBounds(),e.intersects(u._bounds)&&u._recursively(e,t,i,n,r)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){var e=this.options.opacity;return this.setOpacity(0),this.options.opacity=e,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}}),L.DistanceGrid=function(e){this._cellSize=e,this._sqCellSize=e*e,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(e,t){var i=this._getCoord(t.x),n=this._getCoord(t.y),r=this._grid,o=r[n]=r[n]||{},s=o[i]=o[i]||[],a=L.Util.stamp(e);this._objectPoint[a]=t,s.push(e)},updateObject:function(e,t){this.removeObject(e),this.addObject(e,t)},removeObject:function(e,t){var i=this._getCoord(t.x),n=this._getCoord(t.y),r=this._grid,o=r[n]=r[n]||{},s=o[i]=o[i]||[],a,u;for(delete this._objectPoint[L.Util.stamp(e)],a=0,u=s.length;a<u;a++)if(s[a]===e)return s.splice(a,1),u===1&&delete o[i],!0},eachObject:function(e,t){var i,n,r,o,s,a,u,l=this._grid;for(i in l){s=l[i];for(n in s)for(a=s[n],r=0,o=a.length;r<o;r++)u=e.call(t,a[r]),u&&(r--,o--)}},getNearObject:function(e){var t=this._getCoord(e.x),i=this._getCoord(e.y),n,r,o,s,a,u,l,d,f=this._objectPoint,_=this._sqCellSize,p=null;for(n=i-1;n<=i+1;n++)if(s=this._grid[n],s){for(r=t-1;r<=t+1;r++)if(a=s[r],a)for(o=0,u=a.length;o<u;o++)l=a[o],d=this._sqDist(f[L.Util.stamp(l)],e),(d<_||d<=_&&p===null)&&(_=d,p=l)}return p},_getCoord:function(e){var t=Math.floor(e/this._cellSize);return isFinite(t)?t:e},_sqDist:function(e,t){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n}},function(){L.QuickHull={getDistant:function(e,t){var i=t[1].lat-t[0].lat,n=t[0].lng-t[1].lng;return n*(e.lat-t[0].lat)+i*(e.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(e,t){var i=0,n=null,r=[],o,s,a;for(o=t.length-1;o>=0;o--){if(s=t[o],a=this.getDistant(s,e),a>0)r.push(s);else continue;a>i&&(i=a,n=s)}return{maxPoint:n,newPoints:r}},buildConvexHull:function(e,t){var i=[],n=this.findMostDistantPointFromBaseLine(e,t);return n.maxPoint?(i=i.concat(this.buildConvexHull([e[0],n.maxPoint],n.newPoints)),i=i.concat(this.buildConvexHull([n.maxPoint,e[1]],n.newPoints)),i):[e[0]]},getConvexHull:function(e){var t=!1,i=!1,n=!1,r=!1,o=null,s=null,a=null,u=null,l=null,d=null,f;for(f=e.length-1;f>=0;f--){var _=e[f];(t===!1||_.lat>t)&&(o=_,t=_.lat),(i===!1||_.lat<i)&&(s=_,i=_.lat),(n===!1||_.lng>n)&&(a=_,n=_.lng),(r===!1||_.lng<r)&&(u=_,r=_.lng)}i!==t?(d=s,l=o):(d=u,l=a);var p=[].concat(this.buildConvexHull([d,l],e),this.buildConvexHull([l,d],e));return p}}}(),L.MarkerCluster.include({getConvexHull:function(){var e=this.getAllChildMarkers(),t=[],i,n;for(n=e.length-1;n>=0;n--)i=e[n].getLatLng(),t.push(i);return L.QuickHull.getConvexHull(t)}}),L.MarkerCluster.include({_2PI:Math.PI*2,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(!(this._group._spiderfied===this||this._group._inZoomAnimation)){var e=this.getAllChildMarkers(null,!0),t=this._group,i=t._map,n=i.latLngToLayerPoint(this._latlng),r;this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?r=this._group.options.spiderfyShapePositions(e.length,n):e.length>=this._circleSpiralSwitchover?r=this._generatePointsSpiral(e.length,n):(n.y+=10,r=this._generatePointsCircle(e.length,n)),this._animationSpiderfy(e,r)}},unspiderfy:function(e){this._group._inZoomAnimation||(this._animationUnspiderfy(e),this._group._spiderfied=null)},_generatePointsCircle:function(e,t){var i=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+e),n=i/this._2PI,r=this._2PI/e,o=[],s,a;for(n=Math.max(n,35),o.length=e,s=0;s<e;s++)a=this._circleStartAngle+s*r,o[s]=new L.Point(t.x+n*Math.cos(a),t.y+n*Math.sin(a))._round();return o},_generatePointsSpiral:function(e,t){var i=this._group.options.spiderfyDistanceMultiplier,n=i*this._spiralLengthStart,r=i*this._spiralFootSeparation,o=i*this._spiralLengthFactor*this._2PI,s=0,a=[],u;for(a.length=e,u=e;u>=0;u--)u<e&&(a[u]=new L.Point(t.x+n*Math.cos(s),t.y+n*Math.sin(s))._round()),s+=r/n+u*5e-4,n+=o/s;return a},_noanimationUnspiderfy:function(){var e=this._group,t=e._map,i=e._featureGroup,n=this.getAllChildMarkers(null,!0),r,o;for(e._ignoreMove=!0,this.setOpacity(1),o=n.length-1;o>=0;o--)r=n[o],i.removeLayer(r),r._preSpiderfyLatlng&&(r.setLatLng(r._preSpiderfyLatlng),delete r._preSpiderfyLatlng),r.setZIndexOffset&&r.setZIndexOffset(0),r._spiderLeg&&(t.removeLayer(r._spiderLeg),delete r._spiderLeg);e.fire("unspiderfied",{cluster:this,markers:n}),e._ignoreMove=!1,e._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(e,t){var i=this._group,n=i._map,r=i._featureGroup,o=this._group.options.spiderLegPolylineOptions,s,a,u,l;for(i._ignoreMove=!0,s=0;s<e.length;s++)l=n.layerPointToLatLng(t[s]),a=e[s],u=new L.Polyline([this._latlng,l],o),n.addLayer(u),a._spiderLeg=u,a._preSpiderfyLatlng=a._latlng,a.setLatLng(l),a.setZIndexOffset&&a.setZIndexOffset(1e6),r.addLayer(a);this.setOpacity(.3),i._ignoreMove=!1,i.fire("spiderfied",{cluster:this,markers:e})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(e,t){var i=this,n=this._group,r=n._map,o=n._featureGroup,s=this._latlng,a=r.latLngToLayerPoint(s),u=L.Path.SVG,l=L.extend({},this._group.options.spiderLegPolylineOptions),d=l.opacity,f,_,p,v,O,M;for(d===void 0&&(d=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),u?(l.opacity=0,l.className=(l.className||"")+" leaflet-cluster-spider-leg"):l.opacity=d,n._ignoreMove=!0,f=0;f<e.length;f++)_=e[f],M=r.layerPointToLatLng(t[f]),p=new L.Polyline([s,M],l),r.addLayer(p),_._spiderLeg=p,u&&(v=p._path,O=v.getTotalLength()+.1,v.style.strokeDasharray=O,v.style.strokeDashoffset=O),_.setZIndexOffset&&_.setZIndexOffset(1e6),_.clusterHide&&_.clusterHide(),o.addLayer(_),_._setPos&&_._setPos(a);for(n._forceLayout(),n._animationStart(),f=e.length-1;f>=0;f--)M=r.layerPointToLatLng(t[f]),_=e[f],_._preSpiderfyLatlng=_._latlng,_.setLatLng(M),_.clusterShow&&_.clusterShow(),u&&(p=_._spiderLeg,v=p._path,v.style.strokeDashoffset=0,p.setStyle({opacity:d}));this.setOpacity(.3),n._ignoreMove=!1,setTimeout(function(){n._animationEnd(),n.fire("spiderfied",{cluster:i,markers:e})},200)},_animationUnspiderfy:function(e){var t=this,i=this._group,n=i._map,r=i._featureGroup,o=e?n._latLngToNewLayerPoint(this._latlng,e.zoom,e.center):n.latLngToLayerPoint(this._latlng),s=this.getAllChildMarkers(null,!0),a=L.Path.SVG,u,l,d,f,_,p;for(i._ignoreMove=!0,i._animationStart(),this.setOpacity(1),l=s.length-1;l>=0;l--)u=s[l],u._preSpiderfyLatlng&&(u.closePopup(),u.setLatLng(u._preSpiderfyLatlng),delete u._preSpiderfyLatlng,p=!0,u._setPos&&(u._setPos(o),p=!1),u.clusterHide&&(u.clusterHide(),p=!1),p&&r.removeLayer(u),a&&(d=u._spiderLeg,f=d._path,_=f.getTotalLength()+.1,f.style.strokeDashoffset=_,d.setStyle({opacity:0})));i._ignoreMove=!1,setTimeout(function(){var v=0;for(l=s.length-1;l>=0;l--)u=s[l],u._spiderLeg&&v++;for(l=s.length-1;l>=0;l--)u=s[l],u._spiderLeg&&(u.clusterShow&&u.clusterShow(),u.setZIndexOffset&&u.setZIndexOffset(0),v>1&&r.removeLayer(u),n.removeLayer(u._spiderLeg),delete u._spiderLeg);i._animationEnd(),i.fire("unspiderfied",{cluster:t,markers:s})},200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd:function(){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),L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){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(e){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(e))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(e){this._spiderfied&&this._spiderfied.unspiderfy(e)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(e){e._spiderLeg&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow(),e.setZIndexOffset&&e.setZIndexOffset(0),this._map.removeLayer(e._spiderLeg),delete e._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(e){return e?e instanceof L.MarkerClusterGroup?e=e._topClusterLevel.getAllChildMarkers():e instanceof L.LayerGroup?e=e._layers:e instanceof L.MarkerCluster?e=e.getAllChildMarkers():e instanceof L.Marker&&(e=[e]):e=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(e),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(e),this},_flagParentsIconsNeedUpdate:function(e){var t,i;for(t in e)for(i=e[t].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers:function(e){var t,i;for(t in e)i=e[t],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),L.Marker.include({refreshIconOptions:function(e,t){var i=this.options.icon;return L.setOptions(i,e),this.setIcon(i),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),c.MarkerClusterGroup=y,c.MarkerCluster=k,Object.defineProperty(c,"__esModule",{value:!0})})})(P,P.exports);const V="",q="",b=(g,h)=>{let c;return(...y)=>{const k=()=>(c=void 0,g.apply(void 0,y));clearTimeout(c),c=setTimeout(k,h)}},{featureGroupProps:B,setupFeatureGroup:I}=S.Functions.FeatureGroup,{AddLayerInjection:Z,RemoveLayerInjection:E}=S.InjectionKeys,{propsToLeafletOptions:T}=S.Utilities,w=[...["layeradd","layerremove","click","dblclick","mousedown","mouseup","mouseover","mouseout","contextmenu"],"clusterclick","clustermouseover","clustermouseout","animationend","spiderfied","unspiderfied"],x={...B,maxClusterRadius:{type:Number,default:80},clusterPane:{type:String,default:"markerPane"},spiderfyOnEveryZoom:{type:Boolean,default:!1},spiderfyOnMaxZoom:{type:Boolean,default:!0},showCoverageOnHover:{type:Boolean,default:!0},zoomToBoundsOnClick:{type:Boolean,default:!0},singleMarkerMode:{type:Boolean,default:!1},disableClusteringAtZoom:{type:Number,default:null},removeOutsideVisibleBounds:{type:Boolean,default:!0},animate:{type:Boolean,default:!0},animateAddingMarkers:{type:Boolean,default:!1},spiderfyShapePositions:{type:Function,default:null},spiderfyDistanceMultiplier:{type:Number,default:1},spiderLegPolylineOptions:{type:Object,default:()=>({weight:1.5,color:"#222",opacity:.5})},chunkedLoading:{type:Boolean,default:!1},chunkInterval:{type:Number,default:200},chunkDelay:{type:Number,default:50},chunkProgress:{type:Function,default:null},polygonOptions:{type:Object,default:()=>({})},iconCreateFunction:{type:Function,default:null}},A=(g,h,c)=>{const{options:y,methods:k}=I(g,h,c),e=T(g,x,y);let t=[];const i=b(()=>{var s,a;t.length===1?(s=h.value)==null||s.addLayer(t[0]):(a=h.value)==null||a.addLayers(t),t=[]},0);let n=[];const r=b(()=>{var s,a;n.length===1?(s=h.value)==null||s.removeLayer(n[0]):(a=h.value)==null||a.removeLayers(n),n=[]},0),o={...k,addLayer(s){var a;if(g.animateAddingMarkers)return(a=h.value)==null?void 0:a.addLayer(s.leafletObject);t.push(s.leafletObject),i()},removeLayer(s){var a;if(g.animateAddingMarkers)return(a=h.value)==null?void 0:a.removeLayer(s.leafletObject);n.push(s.leafletObject),r()},setMaxClusterRadius(){throw new Error("Max cluster radius can't be set dynamically")},setClusterPane(){throw new Error("Cluster pane can't be set dynamically")},setSpiderfyOnEveryZoom(s){h.value&&(h.value._unbindEvents(),h.value.options.spiderfyOnEveryZoom=s,h.value._bindEvents())},setSpiderfyOnMaxZoom(s){h.value&&(h.value._unbindEvents(),h.value.options.spiderfyOnMaxZoom=s,h.value._bindEvents())},setShowCoverageOnHover(s){h.value&&(h.value._unbindEvents(),h.value.options.showCoverageOnHover=s,h.value._bindEvents())},setZoomToBoundsOnClick(s){h.value&&(h.value._unbindEvents(),h.value.options.zoomToBoundsOnClick=s,h.value._bindEvents())},setSingleMarkerMode(){throw new Error("Single marker mode can't be set dynamically")},setDisableClusteringAtZoom(){throw new Error("Disable Clustering at zoom can't be set dynamically")},setRemoveOutsideVisibleBounds(s){h.value&&(h.value.options.removeOutsideVisibleBounds=s)},setAnimate(){throw new Error("Animate can't be set dynamically")},setAnimateAddingMarkers(s){h.value&&(h.value.options.animateAddingMarkers=s)},setSpiderfyShapePositions(s){h.value&&(h.value.options.spiderfyShapePositions=s)},setSpiderfyDistanceMultiplier(s){h.value&&(h.value.options.spiderfyDistanceMultiplier=s)},setSpiderLegPolylineOptions(s){h.value&&(h.value.options.spiderLegPolylineOptions=s)},setChunkedLoading(s){h.value&&(h.value.options.chunkedLoading=s)},setChunkInterval(s){h.value&&(h.value.options.chunkInterval=s)},setChunkDelay(s){h.value&&(h.value.options.chunkDelay=s)},setChunkProgress(s){h.value&&(h.value.options.chunkProgress=s)},setPolygonOptions(s){h.value&&(h.value.options.polygonOptions=s)},setIconCreateFunction(s){h.value&&(h.value._unbindEvents(),h.value.options.iconCreateFunction=s,h.value._bindEvents())}};return m.provide(Z,o.addLayer),m.provide(E,o.removeLayer),{options:e,methods:o}},{propsBinder:U,assertInject:N,WINDOW_OR_GLOBAL:j}=S.Utilities,{AddLayerInjection:z}=S.InjectionKeys,{render:F}=S.Functions.Layer,D={props:x,emits:["ready",...w],setup(g,h){const c=m.ref(),y=m.ref(!1),k=N(z),{methods:e,options:t}=A(g,c,h);return m.onMounted(async()=>{var o;const{markerClusterGroup:i}=j.L;c.value=m.markRaw(i(t));const n=s=>a=>h.emit(s,a),r=()=>{const s={};for(const a of w)s[a]=n(a);return s};(o=c.value)==null||o.on(r()),U(e,c.value,g),k({...g,...e,leafletObject:c.value}),y.value=!0,m.nextTick(()=>h.emit("ready",c.value))}),{ready:y,leafletObject:c}},render(){return F(this.ready,this.$slots)}};C.LMarkerClusterGroup=D,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})}); | ||
(function(C,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("vue"),require("@vue-leaflet/vue-leaflet")):typeof define=="function"&&define.amd?define(["exports","vue","@vue-leaflet/vue-leaflet"],m):(C=typeof globalThis<"u"?globalThis:C||self,m(C["vue-leaflet-markercluster"]={},C.Vue,C["@vue-leaflet/vue-leaflet"]))})(this,function(C,m,S){"use strict";var G=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},P={exports:{}};(function(g,h){(function(c,y){y(h)})(G,function(c){var y=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.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};var t=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,t?this._withAnimation:this._noAnimation),this._markerCluster=t?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(e){if(e instanceof L.LayerGroup)return this.addLayers([e]);if(!e.getLatLng)return this._nonPointGroup.addLayer(e),this.fire("layeradd",{layer:e}),this;if(!this._map)return this._needsClustering.push(e),this.fire("layeradd",{layer:e}),this;if(this.hasLayer(e))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(e,this._maxZoom),this.fire("layeradd",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var t=e,i=this._zoom;if(e.__parent)for(;t.__parent._zoom>=i;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(e,t):this._animationAddLayerNonAnimated(e,t)),this},removeLayer:function(e){return e instanceof L.LayerGroup?this.removeLayers([e]):e.getLatLng?this._map?e.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(e)),this._removeLayer(e,!0),this.fire("layerremove",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),e.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(e)&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,e)&&this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e}),this):(this._nonPointGroup.removeLayer(e),this.fire("layerremove",{layer:e}),this)},addLayers:function(e,t){if(!L.Util.isArray(e))return this.addLayer(e);var i=this._featureGroup,n=this._nonPointGroup,r=this.options.chunkedLoading,o=this.options.chunkInterval,s=this.options.chunkProgress,a=e.length,u=0,l=!0,d;if(this._map){var f=new Date().getTime(),_=L.bind(function(){var v=new Date().getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();u<a;u++){if(r&&u%200===0){var O=new Date().getTime()-v;if(O>o)break}if(d=e[u],d instanceof L.LayerGroup){l&&(e=e.slice(),l=!1),this._extractNonGroupLayers(d,e),a=e.length;continue}if(!d.getLatLng){n.addLayer(d),t||this.fire("layeradd",{layer:d});continue}if(!this.hasLayer(d)&&(this._addLayer(d,this._maxZoom),t||this.fire("layeradd",{layer:d}),d.__parent&&d.__parent.getChildCount()===2)){var M=d.__parent.getAllChildMarkers(),H=M[0]===d?M[1]:M[0];i.removeLayer(H)}}s&&s(u,a,new Date().getTime()-f),u===a?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(_,this.options.chunkDelay)},this);_()}else for(var p=this._needsClustering;u<a;u++){if(d=e[u],d instanceof L.LayerGroup){l&&(e=e.slice(),l=!1),this._extractNonGroupLayers(d,e),a=e.length;continue}if(!d.getLatLng){n.addLayer(d);continue}this.hasLayer(d)||p.push(d)}return this},removeLayers:function(e){var t,i,n=e.length,r=this._featureGroup,o=this._nonPointGroup,s=!0;if(!this._map){for(t=0;t<n;t++){if(i=e[t],i instanceof L.LayerGroup){s&&(e=e.slice(),s=!1),this._extractNonGroupLayers(i,e),n=e.length;continue}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();var a=e.slice(),u=n;for(t=0;t<u;t++){if(i=a[t],i instanceof L.LayerGroup){this._extractNonGroupLayers(i,a),u=a.length;continue}this._unspiderfyLayer(i)}}for(t=0;t<n;t++){if(i=e[t],i instanceof L.LayerGroup){s&&(e=e.slice(),s=!1),this._extractNonGroupLayers(i,e),n=e.length;continue}if(!i.__parent){o.removeLayer(i),this.fire("layerremove",{layer:i});continue}this._removeLayer(i,!0,!0),this.fire("layerremove",{layer:i}),r.hasLayer(i)&&(r.removeLayer(i),i.clusterShow&&i.clusterShow())}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(e){e.off(this._childMarkerEventHandlers,this),delete e.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var e=new L.LatLngBounds;this._topClusterLevel&&e.extend(this._topClusterLevel._bounds);for(var t=this._needsClustering.length-1;t>=0;t--)e.extend(this._needsClustering[t].getLatLng());return e.extend(this._nonPointGroup.getBounds()),e},eachLayer:function(e,t){var i=this._needsClustering.slice(),n=this._needsRemoving,r,o,s;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(i),o=i.length-1;o>=0;o--){for(r=!0,s=n.length-1;s>=0;s--)if(n[s].layer===i[o]){r=!1;break}r&&e.call(t,i[o])}this._nonPointGroup.eachLayer(e,t)},getLayers:function(){var e=[];return this.eachLayer(function(t){e.push(t)}),e},getLayer:function(e){var t=null;return e=parseInt(e,10),this.eachLayer(function(i){L.stamp(i)===e&&(t=i)}),t},hasLayer:function(e){if(!e)return!1;var t,i=this._needsClustering;for(t=i.length-1;t>=0;t--)if(i[t]===e)return!0;for(i=this._needsRemoving,t=i.length-1;t>=0;t--)if(i[t].layer===e)return!1;return!!(e.__parent&&e.__parent._group===this)||this._nonPointGroup.hasLayer(e)},zoomToShowLayer:function(e,t){var i=this._map;typeof t!="function"&&(t=function(){});var n=function(){(i.hasLayer(e)||i.hasLayer(e.__parent))&&!this._inZoomAnimation&&(this._map.off("moveend",n,this),this.off("animationend",n,this),i.hasLayer(e)?t():e.__parent._icon&&(this.once("spiderfied",t,this),e.__parent.spiderfy()))};e._icon&&this._map.getBounds().contains(e.getLatLng())?t():e.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",n,this),this._map.panTo(e.getLatLng())):(this._map.on("moveend",n,this),this.on("animationend",n,this),e.__parent.zoomToBounds())},onAdd:function(e){this._map=e;var t,i,n;if(!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(e),this._nonPointGroup.addTo(e),this._gridClusters||this._generateInitialClusters(),this._maxLat=e.options.crs.projection.MAX_LATITUDE,t=0,i=this._needsRemoving.length;t<i;t++)n=this._needsRemoving[t],n.newlatlng=n.layer._latlng,n.layer._latlng=n.latlng;for(t=0,i=this._needsRemoving.length;t<i;t++)n=this._needsRemoving[t],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._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),i=this._needsClustering,this._needsClustering=[],this.addLayers(i,!0)},onRemove:function(e){e.off("zoomend",this._zoomEnd,this),e.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(e){for(var t=e;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:function(e,t){for(var i=e.length-1;i>=0;i--)if(e[i]===t)return e.splice(i,1),!0},_removeFromGridUnclustered:function(e,t){for(var i=this._map,n=this._gridUnclustered,r=Math.floor(this._map.getMinZoom());t>=r&&n[t].removeObject(e,i.project(e.getLatLng(),t));t--);},_childMarkerDragStart:function(e){e.target.__dragStart=e.target._latlng},_childMarkerMoved:function(e){if(!this._ignoreMove&&!e.target.__dragStart){var t=e.target._popup&&e.target._popup.isOpen();this._moveChild(e.target,e.oldLatLng,e.latlng),t&&e.target.openPopup()}},_moveChild:function(e,t,i){e._latlng=t,this.removeLayer(e),e._latlng=i,this.addLayer(e)},_childMarkerDragEnd:function(e){var t=e.target.__dragStart;delete e.target.__dragStart,t&&this._moveChild(e.target,t,e.target._latlng)},_removeLayer:function(e,t,i){var n=this._gridClusters,r=this._gridUnclustered,o=this._featureGroup,s=this._map,a=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(e,this._maxZoom);var u=e.__parent,l=u._markers,d;for(this._arraySplice(l,e);u&&(u._childCount--,u._boundsNeedUpdate=!0,!(u._zoom<a));)t&&u._childCount<=1?(d=u._markers[0]===e?u._markers[1]:u._markers[0],n[u._zoom].removeObject(u,s.project(u._cLatLng,u._zoom)),r[u._zoom].addObject(d,s.project(d.getLatLng(),u._zoom)),this._arraySplice(u.__parent._childClusters,u),u.__parent._markers.push(d),d.__parent=u.__parent,u._icon&&(o.removeLayer(u),i||o.addLayer(d))):u._iconNeedsUpdate=!0,u=u.__parent;delete e.__parent},_isOrIsParent:function(e,t){for(;t;){if(e===t)return!0;t=t.parentNode}return!1},fire:function(e,t,i){if(t&&t.layer instanceof L.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.layer._icon,t.originalEvent.relatedTarget))return;e="cluster"+e}L.FeatureGroup.prototype.fire.call(this,e,t,i)},listens:function(e,t){return L.FeatureGroup.prototype.listens.call(this,e,t)||L.FeatureGroup.prototype.listens.call(this,"cluster"+e,t)},_defaultIconCreateFunction:function(e){var t=e.getChildCount(),i=" marker-cluster-";return t<10?i+="small":t<100?i+="medium":i+="large",new L.DivIcon({html:"<div><span>"+t+"</span></div>",className:"marker-cluster"+i,iconSize:new L.Point(40,40)})},_bindEvents:function(){var e=this._map,t=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick,r=this.options.spiderfyOnEveryZoom;(t||n||r)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),e.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(e){var t=e.layer,i=t;if(!(e.type==="clusterkeypress"&&e.originalEvent&&e.originalEvent.keyCode!==13)){for(;i._childClusters.length===1;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),this.options.spiderfyOnEveryZoom&&t.spiderfy(),e.originalEvent&&e.originalEvent.keyCode===13&&this._map._container.focus()}},_showCoverage:function(e){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),e.layer.getChildCount()>2&&e.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(e.layer.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var e=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,n=this.options.spiderfyOnEveryZoom,r=this._map;(e||i||n)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),r.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var e=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),e),this._currentShownBounds=e}},_generateInitialClusters:function(){var e=Math.ceil(this._map.getMaxZoom()),t=Math.floor(this._map.getMinZoom()),i=this.options.maxClusterRadius,n=i;typeof i!="function"&&(n=function(){return i}),this.options.disableClusteringAtZoom!==null&&(e=this.options.disableClusteringAtZoom-1),this._maxZoom=e,this._gridClusters={},this._gridUnclustered={};for(var r=e;r>=t;r--)this._gridClusters[r]=new L.DistanceGrid(n(r)),this._gridUnclustered[r]=new L.DistanceGrid(n(r));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(e,t){var i=this._gridClusters,n=this._gridUnclustered,r=Math.floor(this._map.getMinZoom()),o,s;for(this.options.singleMarkerMode&&this._overrideMarkerIcon(e),e.on(this._childMarkerEventHandlers,this);t>=r;t--){o=this._map.project(e.getLatLng(),t);var a=i[t].getNearObject(o);if(a){a._addChild(e),e.__parent=a;return}if(a=n[t].getNearObject(o),a){var u=a.__parent;u&&this._removeLayer(a,!1);var l=new this._markerCluster(this,t,a,e);i[t].addObject(l,this._map.project(l._cLatLng,t)),a.__parent=l,e.__parent=l;var d=l;for(s=t-1;s>u._zoom;s--)d=new this._markerCluster(this,s,d),i[s].addObject(d,this._map.project(a.getLatLng(),s));u._addChild(d),this._removeFromGridUnclustered(a,t);return}n[t].addObject(e,o)}this._topClusterLevel._addChild(e),e.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(e){e instanceof L.MarkerCluster&&e._iconNeedsUpdate&&e._updateIcon()})},_enqueue:function(e){this._queue.push(e),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var e=0;e<this._queue.length;e++)this._queue[e].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var e=Math.round(this._map._zoom);this._processQueue(),this._zoom<e&&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,e)):this._zoom>e?(this._animationStart(),this._animationZoomOut(this._zoom,e)):this._moveEnd()},_getExpandedVisibleBounds:function(){if(this.options.removeOutsideVisibleBounds){if(L.Browser.mobile)return this._checkBoundsMaxLat(this._map.getBounds())}else return this._mapBoundsInfinite;return this._checkBoundsMaxLat(this._map.getBounds().pad(1))},_checkBoundsMaxLat:function(e){var t=this._maxLat;return t!==void 0&&(e.getNorth()>=t&&(e._northEast.lat=1/0),e.getSouth()<=-t&&(e._southWest.lat=-1/0)),e},_animationAddLayerNonAnimated:function(e,t){if(t===e)this._featureGroup.addLayer(e);else if(t._childCount===2){t._addToMap();var i=t.getAllChildMarkers();this._featureGroup.removeLayer(i[0]),this._featureGroup.removeLayer(i[1])}else t._updateIcon()},_extractNonGroupLayers:function(e,t){var i=e.getLayers(),n=0,r;for(t=t||[];n<i.length;n++){if(r=i[n],r instanceof L.LayerGroup){this._extractNonGroupLayers(r,t);continue}t.push(r)}return t},_overrideMarkerIcon:function(e){var t=e.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[e]}});return t}});L.MarkerClusterGroup.include({_mapBoundsInfinite:new L.LatLngBounds(new L.LatLng(-1/0,-1/0),new L.LatLng(1/0,1/0))}),L.MarkerClusterGroup.include({_noAnimation:{_animationStart:function(){},_animationZoomIn:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(e,t){this._animationAddLayerNonAnimated(e,t)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(e,t){var i=this._getExpandedVisibleBounds(),n=this._featureGroup,r=Math.floor(this._map.getMinZoom()),o;this._ignoreMove=!0,this._topClusterLevel._recursively(i,e,r,function(s){var a=s._latlng,u=s._markers,l;for(i.contains(a)||(a=null),s._isSingleParent()&&e+1===t?(n.removeLayer(s),s._recursivelyAddChildrenToMap(null,t,i)):(s.clusterHide(),s._recursivelyAddChildrenToMap(a,t,i)),o=u.length-1;o>=0;o--)l=u[o],i.contains(l._latlng)||n.removeLayer(l)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(i,t),n.eachLayer(function(s){!(s instanceof L.MarkerCluster)&&s._icon&&s.clusterShow()}),this._topClusterLevel._recursively(i,e,t,function(s){s._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(i,e,r,function(s){n.removeLayer(s),s.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(e,t){this._animationZoomOutSingle(this._topClusterLevel,e-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e,this._getExpandedVisibleBounds())},_animationAddLayer:function(e,t){var i=this,n=this._featureGroup;n.addLayer(e),t!==e&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),e._setPos(this._map.latLngToLayerPoint(t.getLatLng())),e.clusterHide(),this._enqueue(function(){n.removeLayer(e),e.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(e,t,i){var n=this._getExpandedVisibleBounds(),r=Math.floor(this._map.getMinZoom());e._recursivelyAnimateChildrenInAndAddSelfToMap(n,r,t+1,i);var o=this;this._forceLayout(),e._recursivelyBecomeVisible(n,i),this._enqueue(function(){if(e._childCount===1){var s=e._markers[0];this._ignoreMove=!0,s.setLatLng(s.getLatLng()),this._ignoreMove=!1,s.clusterShow&&s.clusterShow()}else e._recursively(n,i,r,function(a){a._recursivelyRemoveChildrenFromMap(n,r,t+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(){L.Util.falseFn(document.body.offsetWidth)}}),L.markerClusterGroup=function(e){return new L.MarkerClusterGroup(e)};var k=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(e,t,i,n){L.Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new L.LatLng(0,0),{icon:this,pane:e.options.clusterPane}),this._group=e,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,i&&this._addChild(i),n&&this._addChild(n)},getAllChildMarkers:function(e,t){e=e||[];for(var i=this._childClusters.length-1;i>=0;i--)this._childClusters[i].getAllChildMarkers(e,t);for(var n=this._markers.length-1;n>=0;n--)t&&this._markers[n].__dragStart||e.push(this._markers[n]);return e},getChildCount:function(){return this._childCount},zoomToBounds:function(e){for(var t=this._childClusters.slice(),i=this._group._map,n=i.getBoundsZoom(this._bounds),r=this._zoom+1,o=i.getZoom(),s;t.length>0&&n>r;){r++;var a=[];for(s=0;s<t.length;s++)a=a.concat(t[s]._childClusters);t=a}n>r?this._group._map.setView(this._latlng,r):n<=o?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,e)},getBounds:function(){var e=new L.LatLngBounds;return e.extend(this._bounds),e},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},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(e,t){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(e),e instanceof L.MarkerCluster?(t||(this._childClusters.push(e),e.__parent=this),this._childCount+=e._childCount):(t||this._markers.push(e),this._childCount++),this.__parent&&this.__parent._addChild(e,!0)},_setClusterCenter:function(e){this._cLatLng||(this._cLatLng=e._cLatLng||e._latlng)},_resetBounds:function(){var e=this._bounds;e._southWest&&(e._southWest.lat=1/0,e._southWest.lng=1/0),e._northEast&&(e._northEast.lat=-1/0,e._northEast.lng=-1/0)},_recalculateBounds:function(){var e=this._markers,t=this._childClusters,i=0,n=0,r=this._childCount,o,s,a,u;if(r!==0){for(this._resetBounds(),o=0;o<e.length;o++)a=e[o]._latlng,this._bounds.extend(a),i+=a.lat,n+=a.lng;for(o=0;o<t.length;o++)s=t[o],s._boundsNeedUpdate&&s._recalculateBounds(),this._bounds.extend(s._bounds),a=s._wLatLng,u=s._childCount,i+=a.lat*u,n+=a.lng*u;this._latlng=this._wLatLng=new L.LatLng(i/r,n/r),this._boundsNeedUpdate=!1}},_addToMap:function(e){e&&(this._backupLatlng=this._latlng,this.setLatLng(e)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(e,t,i){this._recursively(e,this._group._map.getMinZoom(),i-1,function(n){var r=n._markers,o,s;for(o=r.length-1;o>=0;o--)s=r[o],s._icon&&(s._setPos(t),s.clusterHide())},function(n){var r=n._childClusters,o,s;for(o=r.length-1;o>=0;o--)s=r[o],s._icon&&(s._setPos(t),s.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(e,t,i,n){this._recursively(e,n,t,function(r){r._recursivelyAnimateChildrenIn(e,r._group._map.latLngToLayerPoint(r.getLatLng()).round(),i),r._isSingleParent()&&i-1===n?(r.clusterShow(),r._recursivelyRemoveChildrenFromMap(e,t,i)):r.clusterHide(),r._addToMap()})},_recursivelyBecomeVisible:function(e,t){this._recursively(e,this._group._map.getMinZoom(),t,null,function(i){i.clusterShow()})},_recursivelyAddChildrenToMap:function(e,t,i){this._recursively(i,this._group._map.getMinZoom()-1,t,function(n){if(t!==n._zoom)for(var r=n._markers.length-1;r>=0;r--){var o=n._markers[r];i.contains(o._latlng)&&(e&&(o._backupLatlng=o.getLatLng(),o.setLatLng(e),o.clusterHide&&o.clusterHide()),n._group._featureGroup.addLayer(o))}},function(n){n._addToMap(e)})},_recursivelyRestoreChildPositions:function(e){for(var t=this._markers.length-1;t>=0;t--){var i=this._markers[t];i._backupLatlng&&(i.setLatLng(i._backupLatlng),delete i._backupLatlng)}if(e-1===this._zoom)for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n]._restorePosition();else for(var r=this._childClusters.length-1;r>=0;r--)this._childClusters[r]._recursivelyRestoreChildPositions(e)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(e,t,i,n){var r,o;this._recursively(e,t-1,i-1,function(s){for(o=s._markers.length-1;o>=0;o--)r=s._markers[o],(!n||!n.contains(r._latlng))&&(s._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())},function(s){for(o=s._childClusters.length-1;o>=0;o--)r=s._childClusters[o],(!n||!n.contains(r._latlng))&&(s._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())})},_recursively:function(e,t,i,n,r){var o=this._childClusters,s=this._zoom,a,u;if(t<=s&&(n&&n(this),r&&s===i&&r(this)),s<t||s<i)for(a=o.length-1;a>=0;a--)u=o[a],u._boundsNeedUpdate&&u._recalculateBounds(),e.intersects(u._bounds)&&u._recursively(e,t,i,n,r)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){var e=this.options.opacity;return this.setOpacity(0),this.options.opacity=e,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}}),L.DistanceGrid=function(e){this._cellSize=e,this._sqCellSize=e*e,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(e,t){var i=this._getCoord(t.x),n=this._getCoord(t.y),r=this._grid,o=r[n]=r[n]||{},s=o[i]=o[i]||[],a=L.Util.stamp(e);this._objectPoint[a]=t,s.push(e)},updateObject:function(e,t){this.removeObject(e),this.addObject(e,t)},removeObject:function(e,t){var i=this._getCoord(t.x),n=this._getCoord(t.y),r=this._grid,o=r[n]=r[n]||{},s=o[i]=o[i]||[],a,u;for(delete this._objectPoint[L.Util.stamp(e)],a=0,u=s.length;a<u;a++)if(s[a]===e)return s.splice(a,1),u===1&&delete o[i],!0},eachObject:function(e,t){var i,n,r,o,s,a,u,l=this._grid;for(i in l){s=l[i];for(n in s)for(a=s[n],r=0,o=a.length;r<o;r++)u=e.call(t,a[r]),u&&(r--,o--)}},getNearObject:function(e){var t=this._getCoord(e.x),i=this._getCoord(e.y),n,r,o,s,a,u,l,d,f=this._objectPoint,_=this._sqCellSize,p=null;for(n=i-1;n<=i+1;n++)if(s=this._grid[n],s){for(r=t-1;r<=t+1;r++)if(a=s[r],a)for(o=0,u=a.length;o<u;o++)l=a[o],d=this._sqDist(f[L.Util.stamp(l)],e),(d<_||d<=_&&p===null)&&(_=d,p=l)}return p},_getCoord:function(e){var t=Math.floor(e/this._cellSize);return isFinite(t)?t:e},_sqDist:function(e,t){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n}},function(){L.QuickHull={getDistant:function(e,t){var i=t[1].lat-t[0].lat,n=t[0].lng-t[1].lng;return n*(e.lat-t[0].lat)+i*(e.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(e,t){var i=0,n=null,r=[],o,s,a;for(o=t.length-1;o>=0;o--){if(s=t[o],a=this.getDistant(s,e),a>0)r.push(s);else continue;a>i&&(i=a,n=s)}return{maxPoint:n,newPoints:r}},buildConvexHull:function(e,t){var i=[],n=this.findMostDistantPointFromBaseLine(e,t);return n.maxPoint?(i=i.concat(this.buildConvexHull([e[0],n.maxPoint],n.newPoints)),i=i.concat(this.buildConvexHull([n.maxPoint,e[1]],n.newPoints)),i):[e[0]]},getConvexHull:function(e){var t=!1,i=!1,n=!1,r=!1,o=null,s=null,a=null,u=null,l=null,d=null,f;for(f=e.length-1;f>=0;f--){var _=e[f];(t===!1||_.lat>t)&&(o=_,t=_.lat),(i===!1||_.lat<i)&&(s=_,i=_.lat),(n===!1||_.lng>n)&&(a=_,n=_.lng),(r===!1||_.lng<r)&&(u=_,r=_.lng)}i!==t?(d=s,l=o):(d=u,l=a);var p=[].concat(this.buildConvexHull([d,l],e),this.buildConvexHull([l,d],e));return p}}}(),L.MarkerCluster.include({getConvexHull:function(){var e=this.getAllChildMarkers(),t=[],i,n;for(n=e.length-1;n>=0;n--)i=e[n].getLatLng(),t.push(i);return L.QuickHull.getConvexHull(t)}}),L.MarkerCluster.include({_2PI:Math.PI*2,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(!(this._group._spiderfied===this||this._group._inZoomAnimation)){var e=this.getAllChildMarkers(null,!0),t=this._group,i=t._map,n=i.latLngToLayerPoint(this._latlng),r;this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?r=this._group.options.spiderfyShapePositions(e.length,n):e.length>=this._circleSpiralSwitchover?r=this._generatePointsSpiral(e.length,n):(n.y+=10,r=this._generatePointsCircle(e.length,n)),this._animationSpiderfy(e,r)}},unspiderfy:function(e){this._group._inZoomAnimation||(this._animationUnspiderfy(e),this._group._spiderfied=null)},_generatePointsCircle:function(e,t){var i=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+e),n=i/this._2PI,r=this._2PI/e,o=[],s,a;for(n=Math.max(n,35),o.length=e,s=0;s<e;s++)a=this._circleStartAngle+s*r,o[s]=new L.Point(t.x+n*Math.cos(a),t.y+n*Math.sin(a))._round();return o},_generatePointsSpiral:function(e,t){var i=this._group.options.spiderfyDistanceMultiplier,n=i*this._spiralLengthStart,r=i*this._spiralFootSeparation,o=i*this._spiralLengthFactor*this._2PI,s=0,a=[],u;for(a.length=e,u=e;u>=0;u--)u<e&&(a[u]=new L.Point(t.x+n*Math.cos(s),t.y+n*Math.sin(s))._round()),s+=r/n+u*5e-4,n+=o/s;return a},_noanimationUnspiderfy:function(){var e=this._group,t=e._map,i=e._featureGroup,n=this.getAllChildMarkers(null,!0),r,o;for(e._ignoreMove=!0,this.setOpacity(1),o=n.length-1;o>=0;o--)r=n[o],i.removeLayer(r),r._preSpiderfyLatlng&&(r.setLatLng(r._preSpiderfyLatlng),delete r._preSpiderfyLatlng),r.setZIndexOffset&&r.setZIndexOffset(0),r._spiderLeg&&(t.removeLayer(r._spiderLeg),delete r._spiderLeg);e.fire("unspiderfied",{cluster:this,markers:n}),e._ignoreMove=!1,e._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(e,t){var i=this._group,n=i._map,r=i._featureGroup,o=this._group.options.spiderLegPolylineOptions,s,a,u,l;for(i._ignoreMove=!0,s=0;s<e.length;s++)l=n.layerPointToLatLng(t[s]),a=e[s],u=new L.Polyline([this._latlng,l],o),n.addLayer(u),a._spiderLeg=u,a._preSpiderfyLatlng=a._latlng,a.setLatLng(l),a.setZIndexOffset&&a.setZIndexOffset(1e6),r.addLayer(a);this.setOpacity(.3),i._ignoreMove=!1,i.fire("spiderfied",{cluster:this,markers:e})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(e,t){var i=this,n=this._group,r=n._map,o=n._featureGroup,s=this._latlng,a=r.latLngToLayerPoint(s),u=L.Path.SVG,l=L.extend({},this._group.options.spiderLegPolylineOptions),d=l.opacity,f,_,p,v,O,M;for(d===void 0&&(d=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),u?(l.opacity=0,l.className=(l.className||"")+" leaflet-cluster-spider-leg"):l.opacity=d,n._ignoreMove=!0,f=0;f<e.length;f++)_=e[f],M=r.layerPointToLatLng(t[f]),p=new L.Polyline([s,M],l),r.addLayer(p),_._spiderLeg=p,u&&(v=p._path,O=v.getTotalLength()+.1,v.style.strokeDasharray=O,v.style.strokeDashoffset=O),_.setZIndexOffset&&_.setZIndexOffset(1e6),_.clusterHide&&_.clusterHide(),o.addLayer(_),_._setPos&&_._setPos(a);for(n._forceLayout(),n._animationStart(),f=e.length-1;f>=0;f--)M=r.layerPointToLatLng(t[f]),_=e[f],_._preSpiderfyLatlng=_._latlng,_.setLatLng(M),_.clusterShow&&_.clusterShow(),u&&(p=_._spiderLeg,v=p._path,v.style.strokeDashoffset=0,p.setStyle({opacity:d}));this.setOpacity(.3),n._ignoreMove=!1,setTimeout(function(){n._animationEnd(),n.fire("spiderfied",{cluster:i,markers:e})},200)},_animationUnspiderfy:function(e){var t=this,i=this._group,n=i._map,r=i._featureGroup,o=e?n._latLngToNewLayerPoint(this._latlng,e.zoom,e.center):n.latLngToLayerPoint(this._latlng),s=this.getAllChildMarkers(null,!0),a=L.Path.SVG,u,l,d,f,_,p;for(i._ignoreMove=!0,i._animationStart(),this.setOpacity(1),l=s.length-1;l>=0;l--)u=s[l],u._preSpiderfyLatlng&&(u.closePopup(),u.setLatLng(u._preSpiderfyLatlng),delete u._preSpiderfyLatlng,p=!0,u._setPos&&(u._setPos(o),p=!1),u.clusterHide&&(u.clusterHide(),p=!1),p&&r.removeLayer(u),a&&(d=u._spiderLeg,f=d._path,_=f.getTotalLength()+.1,f.style.strokeDashoffset=_,d.setStyle({opacity:0})));i._ignoreMove=!1,setTimeout(function(){var v=0;for(l=s.length-1;l>=0;l--)u=s[l],u._spiderLeg&&v++;for(l=s.length-1;l>=0;l--)u=s[l],u._spiderLeg&&(u.clusterShow&&u.clusterShow(),u.setZIndexOffset&&u.setZIndexOffset(0),v>1&&r.removeLayer(u),n.removeLayer(u._spiderLeg),delete u._spiderLeg);i._animationEnd(),i.fire("unspiderfied",{cluster:t,markers:s})},200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd:function(){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),L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){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(e){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(e))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(e){this._spiderfied&&this._spiderfied.unspiderfy(e)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(e){e._spiderLeg&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow(),e.setZIndexOffset&&e.setZIndexOffset(0),this._map.removeLayer(e._spiderLeg),delete e._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(e){return e?e instanceof L.MarkerClusterGroup?e=e._topClusterLevel.getAllChildMarkers():e instanceof L.LayerGroup?e=e._layers:e instanceof L.MarkerCluster?e=e.getAllChildMarkers():e instanceof L.Marker&&(e=[e]):e=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(e),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(e),this},_flagParentsIconsNeedUpdate:function(e){var t,i;for(t in e)for(i=e[t].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers:function(e){var t,i;for(t in e)i=e[t],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),L.Marker.include({refreshIconOptions:function(e,t){var i=this.options.icon;return L.setOptions(i,e),this.setIcon(i),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),c.MarkerClusterGroup=y,c.MarkerCluster=k,Object.defineProperty(c,"__esModule",{value:!0})})})(P,P.exports);const V="",q="",b=(g,h)=>{let c;return(...y)=>{const k=()=>(c=void 0,g.apply(void 0,y));clearTimeout(c),c=setTimeout(k,h)}},{featureGroupProps:B,setupFeatureGroup:I}=S.Functions.FeatureGroup,{AddLayerInjection:Z,RemoveLayerInjection:E}=S.InjectionKeys,{propsToLeafletOptions:T}=S.Utilities,w=[...["layeradd","layerremove","click","dblclick","mousedown","mouseup","mouseover","mouseout","contextmenu"],"clusterclick","clustermouseover","clustermouseout","animationend","spiderfied","unspiderfied"],x={...B,maxClusterRadius:{type:[Number,Function],default:80},clusterPane:{type:String,default:"markerPane"},spiderfyOnEveryZoom:{type:Boolean,default:!1},spiderfyOnMaxZoom:{type:Boolean,default:!0},showCoverageOnHover:{type:Boolean,default:!0},zoomToBoundsOnClick:{type:Boolean,default:!0},singleMarkerMode:{type:Boolean,default:!1},disableClusteringAtZoom:{type:Number,default:null},removeOutsideVisibleBounds:{type:Boolean,default:!0},animate:{type:Boolean,default:!0},animateAddingMarkers:{type:Boolean,default:!1},spiderfyShapePositions:{type:Function,default:null},spiderfyDistanceMultiplier:{type:Number,default:1},spiderLegPolylineOptions:{type:Object,default:()=>({weight:1.5,color:"#222",opacity:.5})},chunkedLoading:{type:Boolean,default:!1},chunkInterval:{type:Number,default:200},chunkDelay:{type:Number,default:50},chunkProgress:{type:Function,default:null},polygonOptions:{type:Object,default:()=>({})},iconCreateFunction:{type:Function,default:null}},A=(g,h,c)=>{const{options:y,methods:k}=I(g,h,c),e=T(g,x,y);let t=[];const i=b(()=>{var s,a;t.length===1?(s=h.value)==null||s.addLayer(t[0]):(a=h.value)==null||a.addLayers(t),t=[]},0);let n=[];const r=b(()=>{var s,a;n.length===1?(s=h.value)==null||s.removeLayer(n[0]):(a=h.value)==null||a.removeLayers(n),n=[]},0),o={...k,addLayer(s){var a;if(g.animateAddingMarkers)return(a=h.value)==null?void 0:a.addLayer(s.leafletObject);t.push(s.leafletObject),i()},removeLayer(s){var a;if(g.animateAddingMarkers)return(a=h.value)==null?void 0:a.removeLayer(s.leafletObject);n.push(s.leafletObject),r()},setMaxClusterRadius(){throw new Error("Max cluster radius can't be set dynamically")},setClusterPane(){throw new Error("Cluster pane can't be set dynamically")},setSpiderfyOnEveryZoom(s){h.value&&(h.value._unbindEvents(),h.value.options.spiderfyOnEveryZoom=s,h.value._bindEvents())},setSpiderfyOnMaxZoom(s){h.value&&(h.value._unbindEvents(),h.value.options.spiderfyOnMaxZoom=s,h.value._bindEvents())},setShowCoverageOnHover(s){h.value&&(h.value._unbindEvents(),h.value.options.showCoverageOnHover=s,h.value._bindEvents())},setZoomToBoundsOnClick(s){h.value&&(h.value._unbindEvents(),h.value.options.zoomToBoundsOnClick=s,h.value._bindEvents())},setSingleMarkerMode(){throw new Error("Single marker mode can't be set dynamically")},setDisableClusteringAtZoom(){throw new Error("Disable Clustering at zoom can't be set dynamically")},setRemoveOutsideVisibleBounds(s){h.value&&(h.value.options.removeOutsideVisibleBounds=s)},setAnimate(){throw new Error("Animate can't be set dynamically")},setAnimateAddingMarkers(s){h.value&&(h.value.options.animateAddingMarkers=s)},setSpiderfyShapePositions(s){h.value&&(h.value.options.spiderfyShapePositions=s)},setSpiderfyDistanceMultiplier(s){h.value&&(h.value.options.spiderfyDistanceMultiplier=s)},setSpiderLegPolylineOptions(s){h.value&&(h.value.options.spiderLegPolylineOptions=s)},setChunkedLoading(s){h.value&&(h.value.options.chunkedLoading=s)},setChunkInterval(s){h.value&&(h.value.options.chunkInterval=s)},setChunkDelay(s){h.value&&(h.value.options.chunkDelay=s)},setChunkProgress(s){h.value&&(h.value.options.chunkProgress=s)},setPolygonOptions(s){h.value&&(h.value.options.polygonOptions=s)},setIconCreateFunction(s){h.value&&(h.value._unbindEvents(),h.value.options.iconCreateFunction=s,h.value._bindEvents())}};return m.provide(Z,o.addLayer),m.provide(E,o.removeLayer),{options:e,methods:o}},{propsBinder:U,assertInject:N,WINDOW_OR_GLOBAL:j}=S.Utilities,{AddLayerInjection:z}=S.InjectionKeys,{render:F}=S.Functions.Layer,D={props:x,emits:["ready",...w],setup(g,h){const c=m.ref(),y=m.ref(!1),k=N(z),{methods:e,options:t}=A(g,c,h);return m.onMounted(async()=>{var o;const{markerClusterGroup:i}=j.L;c.value=m.markRaw(i(t));const n=s=>a=>h.emit(s,a),r=()=>{const s={};for(const a of w)s[a]=n(a);return s};(o=c.value)==null||o.on(r()),U(e,c.value,g),k({...g,...e,leafletObject:c.value}),y.value=!0,m.nextTick(()=>h.emit("ready",c.value))}),{ready:y,leafletObject:c}},render(){return F(this.ready,this.$slots)}};C.LMarkerClusterGroup=D,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})}); |
{ | ||
"name": "vue-leaflet-markercluster", | ||
"author": "Veit Bjarsch", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Leaflet markercluster components for Vue.js, based on leaflet.markercluster.", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
163813
-0.63%