react-leaflet-deflate 2.2.1 → 3.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("leaflet"),require("react-leaflet")):"function"==typeof define&&define.amd?define([,],t):"object"==typeof exports?exports["react-leaflet-d3"]=t(require("leaflet"),require("react-leaflet")):e.ReactLeafletDeflate=t(e.L,e.ReactLeaflet)}(window,function(e,t){return function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,n=i(1),o=(r=n)&&r.__esModule?r:{default:r};t.default=o.default},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,n=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),o=i(2),s=(r=o)&&r.__esModule?r:{default:r},a=(i(3),i(4));i(5);var l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,a.MapLayer),n(t,[{key:"initMapClasses",value:function(){var e=(this.props.leaflet||this.context).map,t=e._container.className,i=-1!==t.indexOf("leaflet-cluster-anim"),r=-1!==t.indexOf("marker-cluster-styled"),n=-1!==t.indexOf("marker-cluster-animated");!i&&(e._container.className+=" leaflet-cluster-anim"),!r&&(e._container.className+=" marker-cluster-styled"),n&&(e._container.className+=" marker-cluster-animated")}},{key:"createLeafletElement",value:function(e){return new s.default.Deflate(e)}},{key:"componentDidMount",value:function(){(this.props.leaflet||this.context).map;var e=this.props.markerCluster;(function e(t,i,r){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,i);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,i,r)}if("value"in n)return n.value;var s=n.get;return void 0!==s?s.call(r):void 0})(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentDidMount",this).call(this),s.default.geoJSON(this.props.data,this.props).addTo(this.leafletElement),e&&this.initMapClasses()}},{key:"updateLeafletElement",value:function(e,t){var i=(this.props.leaflet||this.context).layerContainer;i.removeLayer(this.leafletElement),this.leafletElement=new s.default.Deflate(t),i.addLayer(this.leafletElement),s.default.geoJSON(t.data,t).addTo(this.leafletElement)}}]),t}();t.default=l},function(t,i){t.exports=e},function(e,t,i){"use strict";L.Deflate=L.FeatureGroup.extend({options:{minSize:10,markerCluster:!1,markerOptions:{},markerClusterOptions:{}},initialize:function(e){L.Util.setOptions(this,e),this._layers=[],this._needsPrepping=[],this._featureLayer=e.markerCluster?L.markerClusterGroup(this.options.markerClusterOptions):L.featureGroup(e)},_getBounds:function(e){var t;return e instanceof L.Circle?(e.addTo(this._map),t=e.getBounds(),this._map.removeLayer(e),t):e.getBounds()},_isCollapsed:function(e,t){var i=e.computedBounds,r=this._map.project(i.getNorthEast(),t),n=this._map.project(i.getSouthWest(),t),o=r.x-n.x;return n.y-r.y<this.options.minSize||o<this.options.minSize},_getZoomThreshold:function(e){var t=null,i=this._map.getZoom();if(this._isCollapsed(e,this._map.getZoom()))for(;!t;)i+=1,this._isCollapsed(e,i)||(t=i-1);else for(;!t;)i-=1,this._isCollapsed(e,i)&&(t=i);return t},_bindInfoTools:function(e,t){t._popupHandlersAdded&&e.bindPopup(t._popup._content,t._popup.options),t._tooltipHandlersAdded&&e.bindTooltip(t._tooltip._content,t._tooltip.options)},_bindEvents:function(e,t){var i,r=0,n=0,o=0,s=0,a=t._events,l=a?Object.getOwnPropertyNames(a):[],h=t._eventParents,u=h?Object.getOwnPropertyNames(h):[];for(this._bindInfoTools(e,t),r=0,o=l.length;r<o;r+=1)for(n=0,s=(i=a[l[r]]).length;n<s;n+=1)e.on(l[r],i[n].fn);if(t._eventParents)for(r=0,o=u.length;r<o;r+=1)t._eventParents[u[r]]._map||(this._bindEvents(e,t._eventParents[u[r]]),this._bindInfoTools(t,t._eventParents[u[r]]))},_makeMarker:function(e){var t="function"==typeof this.options.markerOptions?this.options.markerOptions(e):this.options.markerOptions,i=L.marker(e.computedBounds.getCenter(),t),r=e.feature?i.toGeoJSON():void 0;return this._bindEvents(i,e),r&&(r.properties=e.feature.properties,i.feature=r),i},prepLayer:function(e){var t;e.getBounds&&(e.computedBounds=this._getBounds(e),t=this._getZoomThreshold(e),e.zoomThreshold=t,e.marker=this._makeMarker(e),e.zoomState=this._map.getZoom())},_addToMap:function(e){var t=this._map.getZoom()<=e.zoomThreshold?e.marker:e;this._featureLayer.addLayer(t)},addLayer:function(e){var t=e instanceof L.FeatureGroup?Object.getOwnPropertyNames(e._layers):[],i=0,r=t.length;if(t.length)for(i=0,r=t.length;i<r;i+=1)this.addLayer(e._layers[t[i]]);else this._map?(this.prepLayer(e),this._addToMap(e)):this._needsPrepping.push(e),this._layers[this.getLayerId(e)]=e},removeLayer:function(e){var t,i,r=e instanceof L.FeatureGroup?Object.getOwnPropertyNames(e._layers):[],n=0,o=r.length;if(r.length)for(n=0,o=r.length;n<o;n+=1)this.removeLayer(e._layers[r[n]]);else t=e in this._layers?e:this.getLayerId(e),this._featureLayer.removeLayer(this._layers[t]),this._layers[t].marker&&this._featureLayer.removeLayer(this._layers[t].marker),delete this._layers[t],-1!==(i=this._needsPrepping.indexOf(this._layers[t]))&&this._needsPrepping.splice(i,1)},clearLayers:function(){this._featureLayer.clearLayers(),this._layers=[]},_switchDisplay:function(e,t){t?(this._featureLayer.addLayer(e.marker),this._featureLayer.removeLayer(e)):(this._featureLayer.addLayer(e),this._featureLayer.removeLayer(e.marker))},_deflate:function(){var e=this._map.getBounds(),t=this._map.getZoom();this.eachLayer(function(i){i.marker&&i.zoomState!==t&&i.computedBounds.intersects(e)&&(this._switchDisplay(i,t<=i.zoomThreshold),i.zoomState=t)},this)},onAdd:function(e){var t=0,i=this._needsPrepping.length;for(this._featureLayer.addTo(e),this._map.on("zoomend",this._deflate,this),this._map.on("moveend",this._deflate,this);t<i;t+=1)this.addLayer(this._needsPrepping[t]);this._needsPrepping=[],this._deflate()},onRemove:function(e){e.removeLayer(this._featureLayer),this._map.off("zoomend",this._deflate,this),this._map.off("moveend",this._deflate,this)}}),L.deflate=function(e){return new L.Deflate(e)}},function(e,i){e.exports=t},function(e,t,i){!function(e){"use strict";var t=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,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,r=this._featureGroup,n=this._nonPointGroup,o=this.options.chunkedLoading,s=this.options.chunkInterval,a=this.options.chunkProgress,l=e.length,h=0,u=!0;if(this._map){var _=(new Date).getTime(),d=L.bind(function(){for(var p=(new Date).getTime();h<l;h++){if(o&&h%200==0){var c=(new Date).getTime()-p;if(c>s)break}if((i=e[h])instanceof L.LayerGroup)u&&(e=e.slice(),u=!1),this._extractNonGroupLayers(i,e),l=e.length;else if(i.getLatLng){if(!this.hasLayer(i)&&(this._addLayer(i,this._maxZoom),t||this.fire("layeradd",{layer:i}),i.__parent&&2===i.__parent.getChildCount())){var f=i.__parent.getAllChildMarkers(),m=f[0]===i?f[1]:f[0];r.removeLayer(m)}}else n.addLayer(i),t||this.fire("layeradd",{layer:i})}a&&a(h,l,(new Date).getTime()-_),h===l?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(d,this.options.chunkDelay)},this);d()}else for(var p=this._needsClustering;h<l;h++)(i=e[h])instanceof L.LayerGroup?(u&&(e=e.slice(),u=!1),this._extractNonGroupLayers(i,e),l=e.length):i.getLatLng?this.hasLayer(i)||p.push(i):n.addLayer(i);return this},removeLayers:function(e){var t,i,r=e.length,n=this._featureGroup,o=this._nonPointGroup,s=!0;if(!this._map){for(t=0;t<r;t++)(i=e[t])instanceof L.LayerGroup?(s&&(e=e.slice(),s=!1),this._extractNonGroupLayers(i,e),r=e.length):(this._arraySplice(this._needsClustering,i),o.removeLayer(i),this.hasLayer(i)&&this._needsRemoving.push({layer:i,latlng:i._latlng}),this.fire("layerremove",{layer:i}));return this}if(this._unspiderfy){this._unspiderfy();var a=e.slice(),l=r;for(t=0;t<l;t++)(i=a[t])instanceof L.LayerGroup?(this._extractNonGroupLayers(i,a),l=a.length):this._unspiderfyLayer(i)}for(t=0;t<r;t++)(i=e[t])instanceof L.LayerGroup?(s&&(e=e.slice(),s=!1),this._extractNonGroupLayers(i,e),r=e.length):i.__parent?(this._removeLayer(i,!0,!0),this.fire("layerremove",{layer:i}),n.hasLayer(i)&&(n.removeLayer(i),i.clusterShow&&i.clusterShow())):(o.removeLayer(i),this.fire("layerremove",{layer:i}));return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],this._needsRemoving=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(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,r,n,o=this._needsClustering.slice(),s=this._needsRemoving;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(o),r=o.length-1;r>=0;r--){for(i=!0,n=s.length-1;n>=0;n--)if(s[n].layer===o[r]){i=!1;break}i&&e.call(t,o[r])}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){"function"!=typeof t&&(t=function(){});var i=function(){!e._icon&&!e.__parent._icon||this._inZoomAnimation||(this._map.off("moveend",i,this),this.off("animationend",i,this),e._icon?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",i,this),this._map.panTo(e.getLatLng())):(this._map.on("moveend",i,this),this.on("animationend",i,this),e.__parent.zoomToBounds())},onAdd:function(e){var t,i,r;if(this._map=e,!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++)(r=this._needsRemoving[t]).newlatlng=r.layer._latlng,r.layer._latlng=r.latlng;for(t=0,i=this._needsRemoving.length;t<i;t++)r=this._needsRemoving[t],this._removeLayer(r.layer,!0),r.layer._latlng=r.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,r=this._gridUnclustered,n=Math.floor(this._map.getMinZoom());t>=n&&r[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 r=this._gridClusters,n=this._gridUnclustered,o=this._featureGroup,s=this._map,a=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(e,this._maxZoom);var l,h=e.__parent,u=h._markers;for(this._arraySplice(u,e);h&&(h._childCount--,h._boundsNeedUpdate=!0,!(h._zoom<a));)t&&h._childCount<=1?(l=h._markers[0]===e?h._markers[1]:h._markers[0],r[h._zoom].removeObject(h,s.project(h._cLatLng,h._zoom)),n[h._zoom].addObject(l,s.project(l.getLatLng(),h._zoom)),this._arraySplice(h.__parent._childClusters,h),h.__parent._markers.push(l),l.__parent=h.__parent,h._icon&&(o.removeLayer(h),i||o.addLayer(l))):h._iconNeedsUpdate=!0,h=h.__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 i+=t<10?"small":t<100?"medium":"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,r=this.options.zoomToBoundsOnClick;(t||r)&&this.on("clusterclick",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){for(var t=e.layer,i=t;1===i._childClusters.length;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),e.originalEvent&&13===e.originalEvent.keyCode&&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,r=this._map;(e||i)&&this.off("clusterclick",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,r=i;"function"!=typeof i&&(r=function(){return i}),null!==this.options.disableClusteringAtZoom&&(e=this.options.disableClusteringAtZoom-1),this._maxZoom=e,this._gridClusters={},this._gridUnclustered={};for(var n=e;n>=t;n--)this._gridClusters[n]=new L.DistanceGrid(r(n)),this._gridUnclustered[n]=new L.DistanceGrid(r(n));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(e,t){var i,r,n=this._gridClusters,o=this._gridUnclustered,s=Math.floor(this._map.getMinZoom());for(this.options.singleMarkerMode&&this._overrideMarkerIcon(e),e.on(this._childMarkerEventHandlers,this);t>=s;t--){i=this._map.project(e.getLatLng(),t);var a=n[t].getNearObject(i);if(a)return a._addChild(e),void(e.__parent=a);if(a=o[t].getNearObject(i)){var l=a.__parent;l&&this._removeLayer(a,!1);var h=new this._markerCluster(this,t,a,e);n[t].addObject(h,this._map.project(h._cLatLng,t)),a.__parent=h,e.__parent=h;var u=h;for(r=t-1;r>l._zoom;r--)u=new this._markerCluster(this,r,u),n[r].addObject(u,this._map.project(a.getLatLng(),r));return l._addChild(u),void this._removeFromGridUnclustered(a,t)}o[t].addObject(e,i)}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(){return this.options.removeOutsideVisibleBounds?L.Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat:function(e){var t=this._maxLat;return void 0!==t&&(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(2===t._childCount){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,r=e.getLayers(),n=0;for(t=t||[];n<r.length;n++)(i=r[n])instanceof L.LayerGroup?this._extractNonGroupLayers(i,t):t.push(i);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,r=this._getExpandedVisibleBounds(),n=this._featureGroup,o=Math.floor(this._map.getMinZoom());this._ignoreMove=!0,this._topClusterLevel._recursively(r,e,o,function(o){var s,a=o._latlng,l=o._markers;for(r.contains(a)||(a=null),o._isSingleParent()&&e+1===t?(n.removeLayer(o),o._recursivelyAddChildrenToMap(null,t,r)):(o.clusterHide(),o._recursivelyAddChildrenToMap(a,t,r)),i=l.length-1;i>=0;i--)s=l[i],r.contains(s._latlng)||n.removeLayer(s)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(r,t),n.eachLayer(function(e){e instanceof L.MarkerCluster||!e._icon||e.clusterShow()}),this._topClusterLevel._recursively(r,e,t,function(e){e._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(r,e,o,function(e){n.removeLayer(e),e.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,r=this._featureGroup;r.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(){r.removeLayer(e),e.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(e,t,i){var r=this._getExpandedVisibleBounds(),n=Math.floor(this._map.getMinZoom());e._recursivelyAnimateChildrenInAndAddSelfToMap(r,n,t+1,i);var o=this;this._forceLayout(),e._recursivelyBecomeVisible(r,i),this._enqueue(function(){if(1===e._childCount){var s=e._markers[0];this._ignoreMove=!0,s.setLatLng(s.getLatLng()),this._ignoreMove=!1,s.clusterShow&&s.clusterShow()}else e._recursively(r,i,n,function(e){e._recursivelyRemoveChildrenFromMap(r,n,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 i=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(e,t,i,r){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),r&&this._addChild(r)},getAllChildMarkers:function(e,t){e=e||[];for(var i=this._childClusters.length-1;i>=0;i--)this._childClusters[i].getAllChildMarkers(e);for(var r=this._markers.length-1;r>=0;r--)t&&this._markers[r].__dragStart||e.push(this._markers[r]);return e},getChildCount:function(){return this._childCount},zoomToBounds:function(e){for(var t,i=this._childClusters.slice(),r=this._group._map,n=r.getBoundsZoom(this._bounds),o=this._zoom+1,s=r.getZoom();i.length>0&&n>o;){o++;var a=[];for(t=0;t<i.length;t++)a=a.concat(i[t]._childClusters);i=a}n>o?this._group._map.setView(this._latlng,o):n<=s?this._group._map.setView(this._latlng,s+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,t,i,r,n=this._markers,o=this._childClusters,s=0,a=0,l=this._childCount;if(0!==l){for(this._resetBounds(),e=0;e<n.length;e++)i=n[e]._latlng,this._bounds.extend(i),s+=i.lat,a+=i.lng;for(e=0;e<o.length;e++)(t=o[e])._boundsNeedUpdate&&t._recalculateBounds(),this._bounds.extend(t._bounds),i=t._wLatLng,r=t._childCount,s+=i.lat*r,a+=i.lng*r;this._latlng=this._wLatLng=new L.LatLng(s/l,a/l),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(e){var i,r,n=e._markers;for(i=n.length-1;i>=0;i--)(r=n[i])._icon&&(r._setPos(t),r.clusterHide())},function(e){var i,r,n=e._childClusters;for(i=n.length-1;i>=0;i--)(r=n[i])._icon&&(r._setPos(t),r.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(e,t,i,r){this._recursively(e,r,t,function(n){n._recursivelyAnimateChildrenIn(e,n._group._map.latLngToLayerPoint(n.getLatLng()).round(),i),n._isSingleParent()&&i-1===r?(n.clusterShow(),n._recursivelyRemoveChildrenFromMap(e,t,i)):n.clusterHide(),n._addToMap()})},_recursivelyBecomeVisible:function(e,t){this._recursively(e,this._group._map.getMinZoom(),t,null,function(e){e.clusterShow()})},_recursivelyAddChildrenToMap:function(e,t,i){this._recursively(i,this._group._map.getMinZoom()-1,t,function(r){if(t!==r._zoom)for(var n=r._markers.length-1;n>=0;n--){var o=r._markers[n];i.contains(o._latlng)&&(e&&(o._backupLatlng=o.getLatLng(),o.setLatLng(e),o.clusterHide&&o.clusterHide()),r._group._featureGroup.addLayer(o))}},function(t){t._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 r=this._childClusters.length-1;r>=0;r--)this._childClusters[r]._restorePosition();else for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n]._recursivelyRestoreChildPositions(e)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(e,t,i,r){var n,o;this._recursively(e,t-1,i-1,function(e){for(o=e._markers.length-1;o>=0;o--)n=e._markers[o],r&&r.contains(n._latlng)||(e._group._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow())},function(e){for(o=e._childClusters.length-1;o>=0;o--)n=e._childClusters[o],r&&r.contains(n._latlng)||(e._group._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow())})},_recursively:function(e,t,i,r,n){var o,s,a=this._childClusters,l=this._zoom;if(t<=l&&(r&&r(this),n&&l===i&&n(this)),l<t||l<i)for(o=a.length-1;o>=0;o--)(s=a[o])._boundsNeedUpdate&&s._recalculateBounds(),e.intersects(s._bounds)&&s._recursively(e,t,i,r,n)},_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),r=this._getCoord(t.y),n=this._grid,o=n[r]=n[r]||{},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,r,n=this._getCoord(t.x),o=this._getCoord(t.y),s=this._grid,a=s[o]=s[o]||{},l=a[n]=a[n]||[];for(delete this._objectPoint[L.Util.stamp(e)],i=0,r=l.length;i<r;i++)if(l[i]===e)return l.splice(i,1),1===r&&delete a[n],!0},eachObject:function(e,t){var i,r,n,o,s,a,l=this._grid;for(i in l)for(r in s=l[i])for(a=s[r],n=0,o=a.length;n<o;n++)e.call(t,a[n])&&(n--,o--)},getNearObject:function(e){var t,i,r,n,o,s,a,l,h=this._getCoord(e.x),u=this._getCoord(e.y),_=this._objectPoint,d=this._sqCellSize,p=null;for(t=u-1;t<=u+1;t++)if(n=this._grid[t])for(i=h-1;i<=h+1;i++)if(o=n[i])for(r=0,s=o.length;r<s;r++)a=o[r],((l=this._sqDist(_[L.Util.stamp(a)],e))<d||l<=d&&null===p)&&(d=l,p=a);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,r=t.y-e.y;return i*i+r*r}},L.QuickHull={getDistant:function(e,t){var i=t[1].lat-t[0].lat,r=t[0].lng-t[1].lng;return r*(e.lat-t[0].lat)+i*(e.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(e,t){var i,r,n,o=0,s=null,a=[];for(i=t.length-1;i>=0;i--)r=t[i],(n=this.getDistant(r,e))>0&&(a.push(r),n>o&&(o=n,s=r));return{maxPoint:s,newPoints:a}},buildConvexHull:function(e,t){var i=[],r=this.findMostDistantPointFromBaseLine(e,t);return r.maxPoint?i=(i=i.concat(this.buildConvexHull([e[0],r.maxPoint],r.newPoints))).concat(this.buildConvexHull([r.maxPoint,e[1]],r.newPoints)):[e[0]]},getConvexHull:function(e){var t,i=!1,r=!1,n=!1,o=!1,s=null,a=null,l=null,h=null,u=null,_=null;for(t=e.length-1;t>=0;t--){var d=e[t];(!1===i||d.lat>i)&&(s=d,i=d.lat),(!1===r||d.lat<r)&&(a=d,r=d.lat),(!1===n||d.lng>n)&&(l=d,n=d.lng),(!1===o||d.lng<o)&&(h=d,o=d.lng)}r!==i?(_=a,u=s):(_=h,u=l);var p=[].concat(this.buildConvexHull([_,u],e),this.buildConvexHull([u,_],e));return p}},L.MarkerCluster.include({getConvexHull:function(){var e,t,i=this.getAllChildMarkers(),r=[];for(t=i.length-1;t>=0;t--)e=i[t].getLatLng(),r.push(e);return L.QuickHull.getConvexHull(r)}}),L.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied!==this&&!this._group._inZoomAnimation){var e,t=this.getAllChildMarkers(null,!0),i=this._group,r=i._map,n=r.latLngToLayerPoint(this._latlng);this._group._unspiderfy(),this._group._spiderfied=this,t.length>=this._circleSpiralSwitchover?e=this._generatePointsSpiral(t.length,n):(n.y+=10,e=this._generatePointsCircle(t.length,n)),this._animationSpiderfy(t,e)}},unspiderfy:function(e){this._group._inZoomAnimation||(this._animationUnspiderfy(e),this._group._spiderfied=null)},_generatePointsCircle:function(e,t){var i,r,n=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+e),o=n/this._2PI,s=this._2PI/e,a=[];for(o=Math.max(o,35),a.length=e,i=0;i<e;i++)r=this._circleStartAngle+i*s,a[i]=new L.Point(t.x+o*Math.cos(r),t.y+o*Math.sin(r))._round();return a},_generatePointsSpiral:function(e,t){var i,r=this._group.options.spiderfyDistanceMultiplier,n=r*this._spiralLengthStart,o=r*this._spiralFootSeparation,s=r*this._spiralLengthFactor*this._2PI,a=0,l=[];for(l.length=e,i=e;i>=0;i--)i<e&&(l[i]=new L.Point(t.x+n*Math.cos(a),t.y+n*Math.sin(a))._round()),n+=s/(a+=o/n+5e-4*i);return l},_noanimationUnspiderfy:function(){var e,t,i=this._group,r=i._map,n=i._featureGroup,o=this.getAllChildMarkers(null,!0);for(i._ignoreMove=!0,this.setOpacity(1),t=o.length-1;t>=0;t--)e=o[t],n.removeLayer(e),e._preSpiderfyLatlng&&(e.setLatLng(e._preSpiderfyLatlng),delete e._preSpiderfyLatlng),e.setZIndexOffset&&e.setZIndexOffset(0),e._spiderLeg&&(r.removeLayer(e._spiderLeg),delete e._spiderLeg);i.fire("unspiderfied",{cluster:this,markers:o}),i._ignoreMove=!1,i._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(e,t){var i,r,n,o,s=this._group,a=s._map,l=s._featureGroup,h=this._group.options.spiderLegPolylineOptions;for(s._ignoreMove=!0,i=0;i<e.length;i++)o=a.layerPointToLatLng(t[i]),r=e[i],n=new L.Polyline([this._latlng,o],h),a.addLayer(n),r._spiderLeg=n,r._preSpiderfyLatlng=r._latlng,r.setLatLng(o),r.setZIndexOffset&&r.setZIndexOffset(1e6),l.addLayer(r);this.setOpacity(.3),s._ignoreMove=!1,s.fire("spiderfied",{cluster:this,markers:e})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(e,t){var i,r,n,o,s,a,l=this,h=this._group,u=h._map,_=h._featureGroup,d=this._latlng,p=u.latLngToLayerPoint(d),c=L.Path.SVG,f=L.extend({},this._group.options.spiderLegPolylineOptions),m=f.opacity;for(void 0===m&&(m=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),c?(f.opacity=0,f.className=(f.className||"")+" leaflet-cluster-spider-leg"):f.opacity=m,h._ignoreMove=!0,i=0;i<e.length;i++)r=e[i],a=u.layerPointToLatLng(t[i]),n=new L.Polyline([d,a],f),u.addLayer(n),r._spiderLeg=n,c&&(o=n._path,s=o.getTotalLength()+.1,o.style.strokeDasharray=s,o.style.strokeDashoffset=s),r.setZIndexOffset&&r.setZIndexOffset(1e6),r.clusterHide&&r.clusterHide(),_.addLayer(r),r._setPos&&r._setPos(p);for(h._forceLayout(),h._animationStart(),i=e.length-1;i>=0;i--)a=u.layerPointToLatLng(t[i]),(r=e[i])._preSpiderfyLatlng=r._latlng,r.setLatLng(a),r.clusterShow&&r.clusterShow(),c&&(n=r._spiderLeg,(o=n._path).style.strokeDashoffset=0,n.setStyle({opacity:m}));this.setOpacity(.3),h._ignoreMove=!1,setTimeout(function(){h._animationEnd(),h.fire("spiderfied",{cluster:l,markers:e})},200)},_animationUnspiderfy:function(e){var t,i,r,n,o,s,a=this,l=this._group,h=l._map,u=l._featureGroup,_=e?h._latLngToNewLayerPoint(this._latlng,e.zoom,e.center):h.latLngToLayerPoint(this._latlng),d=this.getAllChildMarkers(null,!0),p=L.Path.SVG;for(l._ignoreMove=!0,l._animationStart(),this.setOpacity(1),i=d.length-1;i>=0;i--)(t=d[i])._preSpiderfyLatlng&&(t.closePopup(),t.setLatLng(t._preSpiderfyLatlng),delete t._preSpiderfyLatlng,s=!0,t._setPos&&(t._setPos(_),s=!1),t.clusterHide&&(t.clusterHide(),s=!1),s&&u.removeLayer(t),p&&(r=t._spiderLeg,n=r._path,o=n.getTotalLength()+.1,n.style.strokeDashoffset=o,r.setStyle({opacity:0})));l._ignoreMove=!1,setTimeout(function(){var e=0;for(i=d.length-1;i>=0;i--)(t=d[i])._spiderLeg&&e++;for(i=d.length-1;i>=0;i--)(t=d[i])._spiderLeg&&(t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),e>1&&u.removeLayer(t),h.removeLayer(t._spiderLeg),delete t._spiderLeg);l._animationEnd(),l.fire("unspiderfied",{cluster:a,markers:d})},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}}),e.MarkerClusterGroup=t,e.MarkerCluster=i}(t)}]).default});
1
+ /*! For license information please see react-leaflet-deflate.min.js.LICENSE.txt */
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["react-leaflet-deflate"]=t(require("react")):e.ReactLeafletDeflate=t(e.React)}(this,e=>(()=>{var t={91:t=>{"use strict";t.exports=e},221:(e,t,i)=>{"use strict";var r=i(91);Symbol.for("react.portal"),r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE},389:function(e,t){!function(e){"use strict";var t=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,r=this._featureGroup,n=this._nonPointGroup,o=this.options.chunkedLoading,s=this.options.chunkInterval,a=this.options.chunkProgress,l=e.length,u=0,h=!0;if(this._map){var _=(new Date).getTime(),d=L.bind(function(){var c=(new Date).getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();u<l&&!(o&&u%200==0&&(new Date).getTime()-c>s);u++)if((i=e[u])instanceof L.LayerGroup)h&&(e=e.slice(),h=!1),this._extractNonGroupLayers(i,e),l=e.length;else if(i.getLatLng){if(!this.hasLayer(i)&&(this._addLayer(i,this._maxZoom),t||this.fire("layeradd",{layer:i}),i.__parent&&2===i.__parent.getChildCount())){var p=i.__parent.getAllChildMarkers(),f=p[0]===i?p[1]:p[0];r.removeLayer(f)}}else n.addLayer(i),t||this.fire("layeradd",{layer:i});a&&a(u,l,(new Date).getTime()-_),u===l?(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<l;u++)(i=e[u])instanceof L.LayerGroup?(h&&(e=e.slice(),h=!1),this._extractNonGroupLayers(i,e),l=e.length):i.getLatLng?this.hasLayer(i)||c.push(i):n.addLayer(i);return this},removeLayers:function(e){var t,i,r=e.length,n=this._featureGroup,o=this._nonPointGroup,s=!0;if(!this._map){for(t=0;t<r;t++)(i=e[t])instanceof L.LayerGroup?(s&&(e=e.slice(),s=!1),this._extractNonGroupLayers(i,e),r=e.length):(this._arraySplice(this._needsClustering,i),o.removeLayer(i),this.hasLayer(i)&&this._needsRemoving.push({layer:i,latlng:i._latlng}),this.fire("layerremove",{layer:i}));return this}if(this._unspiderfy){this._unspiderfy();var a=e.slice(),l=r;for(t=0;t<l;t++)(i=a[t])instanceof L.LayerGroup?(this._extractNonGroupLayers(i,a),l=a.length):this._unspiderfyLayer(i)}for(t=0;t<r;t++)(i=e[t])instanceof L.LayerGroup?(s&&(e=e.slice(),s=!1),this._extractNonGroupLayers(i,e),r=e.length):i.__parent?(this._removeLayer(i,!0,!0),this.fire("layerremove",{layer:i}),n.hasLayer(i)&&(n.removeLayer(i),i.clusterShow&&i.clusterShow())):(o.removeLayer(i),this.fire("layerremove",{layer:i}));return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],this._needsRemoving=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(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,r,n,o=this._needsClustering.slice(),s=this._needsRemoving;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(o),r=o.length-1;r>=0;r--){for(i=!0,n=s.length-1;n>=0;n--)if(s[n].layer===o[r]){i=!1;break}i&&e.call(t,o[r])}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(t=(i=this._needsRemoving).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;"function"!=typeof t&&(t=function(){});var r=function(){!i.hasLayer(e)&&!i.hasLayer(e.__parent)||this._inZoomAnimation||(this._map.off("moveend",r,this),this.off("animationend",r,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",r,this),this._map.panTo(e.getLatLng())):(this._map.on("moveend",r,this),this.on("animationend",r,this),e.__parent.zoomToBounds())},onAdd:function(e){var t,i,r;if(this._map=e,!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++)(r=this._needsRemoving[t]).newlatlng=r.layer._latlng,r.layer._latlng=r.latlng;for(t=0,i=this._needsRemoving.length;t<i;t++)r=this._needsRemoving[t],this._removeLayer(r.layer,!0),r.layer._latlng=r.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,r=this._gridUnclustered,n=Math.floor(this._map.getMinZoom());t>=n&&r[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 r=this._gridClusters,n=this._gridUnclustered,o=this._featureGroup,s=this._map,a=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(e,this._maxZoom);var l,u=e.__parent,h=u._markers;for(this._arraySplice(h,e);u&&(u._childCount--,u._boundsNeedUpdate=!0,!(u._zoom<a));)t&&u._childCount<=1?(l=u._markers[0]===e?u._markers[1]:u._markers[0],r[u._zoom].removeObject(u,s.project(u._cLatLng,u._zoom)),n[u._zoom].addObject(l,s.project(l.getLatLng(),u._zoom)),this._arraySplice(u.__parent._childClusters,u),u.__parent._markers.push(l),l.__parent=u.__parent,u._icon&&(o.removeLayer(u),i||o.addLayer(l))):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 i+=t<10?"small":t<100?"medium":"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,r=this.options.zoomToBoundsOnClick,n=this.options.spiderfyOnEveryZoom;(t||r||n)&&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("clusterkeypress"!==e.type||!e.originalEvent||13===e.originalEvent.keyCode){for(;1===i._childClusters.length;)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&&13===e.originalEvent.keyCode&&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,r=this.options.spiderfyOnEveryZoom,n=this._map;(e||i||r)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),n.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,r=i;"function"!=typeof i&&(r=function(){return i}),null!==this.options.disableClusteringAtZoom&&(e=this.options.disableClusteringAtZoom-1),this._maxZoom=e,this._gridClusters={},this._gridUnclustered={};for(var n=e;n>=t;n--)this._gridClusters[n]=new L.DistanceGrid(r(n)),this._gridUnclustered[n]=new L.DistanceGrid(r(n));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(e,t){var i,r,n=this._gridClusters,o=this._gridUnclustered,s=Math.floor(this._map.getMinZoom());for(this.options.singleMarkerMode&&this._overrideMarkerIcon(e),e.on(this._childMarkerEventHandlers,this);t>=s;t--){i=this._map.project(e.getLatLng(),t);var a=n[t].getNearObject(i);if(a)return a._addChild(e),void(e.__parent=a);if(a=o[t].getNearObject(i)){var l=a.__parent;l&&this._removeLayer(a,!1);var u=new this._markerCluster(this,t,a,e);n[t].addObject(u,this._map.project(u._cLatLng,t)),a.__parent=u,e.__parent=u;var h=u;for(r=t-1;r>l._zoom;r--)h=new this._markerCluster(this,r,h),n[r].addObject(h,this._map.project(a.getLatLng(),r));return l._addChild(h),void this._removeFromGridUnclustered(a,t)}o[t].addObject(e,i)}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(){return this.options.removeOutsideVisibleBounds?L.Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat:function(e){var t=this._maxLat;return void 0!==t&&(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(2===t._childCount){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,r=e.getLayers(),n=0;for(t=t||[];n<r.length;n++)(i=r[n])instanceof L.LayerGroup?this._extractNonGroupLayers(i,t):t.push(i);return t},_overrideMarkerIcon:function(e){return e.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[e]}})}});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,r=this._getExpandedVisibleBounds(),n=this._featureGroup,o=Math.floor(this._map.getMinZoom());this._ignoreMove=!0,this._topClusterLevel._recursively(r,e,o,function(o){var s,a=o._latlng,l=o._markers;for(r.contains(a)||(a=null),o._isSingleParent()&&e+1===t?(n.removeLayer(o),o._recursivelyAddChildrenToMap(null,t,r)):(o.clusterHide(),o._recursivelyAddChildrenToMap(a,t,r)),i=l.length-1;i>=0;i--)s=l[i],r.contains(s._latlng)||n.removeLayer(s)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(r,t),n.eachLayer(function(e){e instanceof L.MarkerCluster||!e._icon||e.clusterShow()}),this._topClusterLevel._recursively(r,e,t,function(e){e._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(r,e,o,function(e){n.removeLayer(e),e.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,r=this._featureGroup;r.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(){r.removeLayer(e),e.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(e,t,i){var r=this._getExpandedVisibleBounds(),n=Math.floor(this._map.getMinZoom());e._recursivelyAnimateChildrenInAndAddSelfToMap(r,n,t+1,i);var o=this;this._forceLayout(),e._recursivelyBecomeVisible(r,i),this._enqueue(function(){if(1===e._childCount){var s=e._markers[0];this._ignoreMove=!0,s.setLatLng(s.getLatLng()),this._ignoreMove=!1,s.clusterShow&&s.clusterShow()}else e._recursively(r,i,n,function(e){e._recursivelyRemoveChildrenFromMap(r,n,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 i=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(e,t,i,r){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),r&&this._addChild(r)},getAllChildMarkers:function(e,t){e=e||[];for(var i=this._childClusters.length-1;i>=0;i--)this._childClusters[i].getAllChildMarkers(e,t);for(var r=this._markers.length-1;r>=0;r--)t&&this._markers[r].__dragStart||e.push(this._markers[r]);return e},getChildCount:function(){return this._childCount},zoomToBounds:function(e){for(var t,i=this._childClusters.slice(),r=this._group._map,n=r.getBoundsZoom(this._bounds),o=this._zoom+1,s=r.getZoom();i.length>0&&n>o;){o++;var a=[];for(t=0;t<i.length;t++)a=a.concat(i[t]._childClusters);i=a}n>o?this._group._map.setView(this._latlng,o):n<=s?this._group._map.setView(this._latlng,s+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,t,i,r,n=this._markers,o=this._childClusters,s=0,a=0,l=this._childCount;if(0!==l){for(this._resetBounds(),e=0;e<n.length;e++)i=n[e]._latlng,this._bounds.extend(i),s+=i.lat,a+=i.lng;for(e=0;e<o.length;e++)(t=o[e])._boundsNeedUpdate&&t._recalculateBounds(),this._bounds.extend(t._bounds),i=t._wLatLng,r=t._childCount,s+=i.lat*r,a+=i.lng*r;this._latlng=this._wLatLng=new L.LatLng(s/l,a/l),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(e){var i,r,n=e._markers;for(i=n.length-1;i>=0;i--)(r=n[i])._icon&&(r._setPos(t),r.clusterHide())},function(e){var i,r,n=e._childClusters;for(i=n.length-1;i>=0;i--)(r=n[i])._icon&&(r._setPos(t),r.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(e,t,i,r){this._recursively(e,r,t,function(n){n._recursivelyAnimateChildrenIn(e,n._group._map.latLngToLayerPoint(n.getLatLng()).round(),i),n._isSingleParent()&&i-1===r?(n.clusterShow(),n._recursivelyRemoveChildrenFromMap(e,t,i)):n.clusterHide(),n._addToMap()})},_recursivelyBecomeVisible:function(e,t){this._recursively(e,this._group._map.getMinZoom(),t,null,function(e){e.clusterShow()})},_recursivelyAddChildrenToMap:function(e,t,i){this._recursively(i,this._group._map.getMinZoom()-1,t,function(r){if(t!==r._zoom)for(var n=r._markers.length-1;n>=0;n--){var o=r._markers[n];i.contains(o._latlng)&&(e&&(o._backupLatlng=o.getLatLng(),o.setLatLng(e),o.clusterHide&&o.clusterHide()),r._group._featureGroup.addLayer(o))}},function(t){t._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 r=this._childClusters.length-1;r>=0;r--)this._childClusters[r]._restorePosition();else for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n]._recursivelyRestoreChildPositions(e)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(e,t,i,r){var n,o;this._recursively(e,t-1,i-1,function(e){for(o=e._markers.length-1;o>=0;o--)n=e._markers[o],r&&r.contains(n._latlng)||(e._group._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow())},function(e){for(o=e._childClusters.length-1;o>=0;o--)n=e._childClusters[o],r&&r.contains(n._latlng)||(e._group._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow())})},_recursively:function(e,t,i,r,n){var o,s,a=this._childClusters,l=this._zoom;if(t<=l&&(r&&r(this),n&&l===i&&n(this)),l<t||l<i)for(o=a.length-1;o>=0;o--)(s=a[o])._boundsNeedUpdate&&s._recalculateBounds(),e.intersects(s._bounds)&&s._recursively(e,t,i,r,n)},_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),r=this._getCoord(t.y),n=this._grid,o=n[r]=n[r]||{},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,r,n=this._getCoord(t.x),o=this._getCoord(t.y),s=this._grid,a=s[o]=s[o]||{},l=a[n]=a[n]||[];for(delete this._objectPoint[L.Util.stamp(e)],i=0,r=l.length;i<r;i++)if(l[i]===e)return l.splice(i,1),1===r&&delete a[n],!0},eachObject:function(e,t){var i,r,n,o,s,a,l=this._grid;for(i in l)for(r in s=l[i])for(n=0,o=(a=s[r]).length;n<o;n++)e.call(t,a[n])&&(n--,o--)},getNearObject:function(e){var t,i,r,n,o,s,a,l,u=this._getCoord(e.x),h=this._getCoord(e.y),_=this._objectPoint,d=this._sqCellSize,c=null;for(t=h-1;t<=h+1;t++)if(n=this._grid[t])for(i=u-1;i<=u+1;i++)if(o=n[i])for(r=0,s=o.length;r<s;r++)a=o[r],((l=this._sqDist(_[L.Util.stamp(a)],e))<d||l<=d&&null===c)&&(d=l,c=a);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,r=t.y-e.y;return i*i+r*r}},L.QuickHull={getDistant:function(e,t){var i=t[1].lat-t[0].lat;return(t[0].lng-t[1].lng)*(e.lat-t[0].lat)+i*(e.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(e,t){var i,r,n,o=0,s=null,a=[];for(i=t.length-1;i>=0;i--)r=t[i],(n=this.getDistant(r,e))>0&&(a.push(r),n>o&&(o=n,s=r));return{maxPoint:s,newPoints:a}},buildConvexHull:function(e,t){var i=[],r=this.findMostDistantPointFromBaseLine(e,t);return r.maxPoint?i=(i=i.concat(this.buildConvexHull([e[0],r.maxPoint],r.newPoints))).concat(this.buildConvexHull([r.maxPoint,e[1]],r.newPoints)):[e[0]]},getConvexHull:function(e){var t,i=!1,r=!1,n=!1,o=!1,s=null,a=null,l=null,u=null,h=null,_=null;for(t=e.length-1;t>=0;t--){var d=e[t];(!1===i||d.lat>i)&&(s=d,i=d.lat),(!1===r||d.lat<r)&&(a=d,r=d.lat),(!1===n||d.lng>n)&&(l=d,n=d.lng),(!1===o||d.lng<o)&&(u=d,o=d.lng)}return r!==i?(_=a,h=s):(_=u,h=l),[].concat(this.buildConvexHull([_,h],e),this.buildConvexHull([h,_],e))}},L.MarkerCluster.include({getConvexHull:function(){var e,t,i=this.getAllChildMarkers(),r=[];for(t=i.length-1;t>=0;t--)e=i[t].getLatLng(),r.push(e);return L.QuickHull.getConvexHull(r)}}),L.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied!==this&&!this._group._inZoomAnimation){var e,t=this.getAllChildMarkers(null,!0),i=this._group._map.latLngToLayerPoint(this._latlng);this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?e=this._group.options.spiderfyShapePositions(t.length,i):t.length>=this._circleSpiralSwitchover?e=this._generatePointsSpiral(t.length,i):(i.y+=10,e=this._generatePointsCircle(t.length,i)),this._animationSpiderfy(t,e)}},unspiderfy:function(e){this._group._inZoomAnimation||(this._animationUnspiderfy(e),this._group._spiderfied=null)},_generatePointsCircle:function(e,t){var i,r,n=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+e)/this._2PI,o=this._2PI/e,s=[];for(n=Math.max(n,35),s.length=e,i=0;i<e;i++)r=this._circleStartAngle+i*o,s[i]=new L.Point(t.x+n*Math.cos(r),t.y+n*Math.sin(r))._round();return s},_generatePointsSpiral:function(e,t){var i,r=this._group.options.spiderfyDistanceMultiplier,n=r*this._spiralLengthStart,o=r*this._spiralFootSeparation,s=r*this._spiralLengthFactor*this._2PI,a=0,l=[];for(l.length=e,i=e;i>=0;i--)i<e&&(l[i]=new L.Point(t.x+n*Math.cos(a),t.y+n*Math.sin(a))._round()),n+=s/(a+=o/n+5e-4*i);return l},_noanimationUnspiderfy:function(){var e,t,i=this._group,r=i._map,n=i._featureGroup,o=this.getAllChildMarkers(null,!0);for(i._ignoreMove=!0,this.setOpacity(1),t=o.length-1;t>=0;t--)e=o[t],n.removeLayer(e),e._preSpiderfyLatlng&&(e.setLatLng(e._preSpiderfyLatlng),delete e._preSpiderfyLatlng),e.setZIndexOffset&&e.setZIndexOffset(0),e._spiderLeg&&(r.removeLayer(e._spiderLeg),delete e._spiderLeg);i.fire("unspiderfied",{cluster:this,markers:o}),i._ignoreMove=!1,i._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(e,t){var i,r,n,o,s=this._group,a=s._map,l=s._featureGroup,u=this._group.options.spiderLegPolylineOptions;for(s._ignoreMove=!0,i=0;i<e.length;i++)o=a.layerPointToLatLng(t[i]),r=e[i],n=new L.Polyline([this._latlng,o],u),a.addLayer(n),r._spiderLeg=n,r._preSpiderfyLatlng=r._latlng,r.setLatLng(o),r.setZIndexOffset&&r.setZIndexOffset(1e6),l.addLayer(r);this.setOpacity(.3),s._ignoreMove=!1,s.fire("spiderfied",{cluster:this,markers:e})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(e,t){var i,r,n,o,s,a,l=this,u=this._group,h=u._map,_=u._featureGroup,d=this._latlng,c=h.latLngToLayerPoint(d),p=L.Path.SVG,f=L.extend({},this._group.options.spiderLegPolylineOptions),m=f.opacity;for(void 0===m&&(m=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),p?(f.opacity=0,f.className=(f.className||"")+" leaflet-cluster-spider-leg"):f.opacity=m,u._ignoreMove=!0,i=0;i<e.length;i++)r=e[i],a=h.layerPointToLatLng(t[i]),n=new L.Polyline([d,a],f),h.addLayer(n),r._spiderLeg=n,p&&(s=(o=n._path).getTotalLength()+.1,o.style.strokeDasharray=s,o.style.strokeDashoffset=s),r.setZIndexOffset&&r.setZIndexOffset(1e6),r.clusterHide&&r.clusterHide(),_.addLayer(r),r._setPos&&r._setPos(c);for(u._forceLayout(),u._animationStart(),i=e.length-1;i>=0;i--)a=h.layerPointToLatLng(t[i]),(r=e[i])._preSpiderfyLatlng=r._latlng,r.setLatLng(a),r.clusterShow&&r.clusterShow(),p&&((o=(n=r._spiderLeg)._path).style.strokeDashoffset=0,n.setStyle({opacity:m}));this.setOpacity(.3),u._ignoreMove=!1,setTimeout(function(){u._animationEnd(),u.fire("spiderfied",{cluster:l,markers:e})},200)},_animationUnspiderfy:function(e){var t,i,r,n,o,s,a=this,l=this._group,u=l._map,h=l._featureGroup,_=e?u._latLngToNewLayerPoint(this._latlng,e.zoom,e.center):u.latLngToLayerPoint(this._latlng),d=this.getAllChildMarkers(null,!0),c=L.Path.SVG;for(l._ignoreMove=!0,l._animationStart(),this.setOpacity(1),i=d.length-1;i>=0;i--)(t=d[i])._preSpiderfyLatlng&&(t.closePopup(),t.setLatLng(t._preSpiderfyLatlng),delete t._preSpiderfyLatlng,s=!0,t._setPos&&(t._setPos(_),s=!1),t.clusterHide&&(t.clusterHide(),s=!1),s&&h.removeLayer(t),c&&(o=(n=(r=t._spiderLeg)._path).getTotalLength()+.1,n.style.strokeDashoffset=o,r.setStyle({opacity:0})));l._ignoreMove=!1,setTimeout(function(){var e=0;for(i=d.length-1;i>=0;i--)(t=d[i])._spiderLeg&&e++;for(i=d.length-1;i>=0;i--)(t=d[i])._spiderLeg&&(t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),e>1&&h.removeLayer(t),u.removeLayer(t._spiderLeg),delete t._spiderLeg);l._animationEnd(),l.fire("unspiderfied",{cluster:a,markers:d})},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}}),e.MarkerClusterGroup=t,e.MarkerCluster=i,Object.defineProperty(e,"__esModule",{value:!0})}(t)},797:()=>{"use strict";L.Layer.include({_originalRemove:L.Layer.prototype.remove,remove:function(){return this.marker&&this.marker.remove(),this._originalRemove()}}),L.Map.include({_originalRemoveLayer:L.Map.prototype.removeLayer,removeLayer:function(e){return e.marker&&e.marker.remove(),this._originalRemoveLayer(e)}}),L.Deflate=L.FeatureGroup.extend({options:{minSize:10,markerOptions:{},markerType:L.marker,greedyCollapse:!0},initialize:function(e){L.Util.setOptions(this,e),this._layers=[],this._needsPrepping=[],this._featureLayer=this._getFeatureLayer(e)},_getFeatureLayer:function(){return this.options.markerLayer?this.options.markerLayer:L.featureGroup(this.options)},_getBounds:function(e){if(e instanceof L.Circle){e.addTo(this._map);const t=e.getBounds();return this._map.removeLayer(e),t}return e.getBounds()},_isCollapsed:function(e,t){const i=e.computedBounds,r=this._map.project(i.getNorthEast(),t),n=this._map.project(i.getSouthWest(),t),o=Math.abs(r.x-n.x),s=Math.abs(n.y-r.y);return this.options.greedyCollapse?s<this.options.minSize||o<this.options.minSize:s<this.options.minSize&&o<this.options.minSize},_getZoomThreshold:function(e){let t,i=this._map.getZoom();if(this._isCollapsed(e,this._map.getZoom()))for(;!t;)i+=1,this._isCollapsed(e,i)||(t=i-1);else for(;!t;)i-=1,this._isCollapsed(e,i)&&(t=i);return t},_bindInfoTools:function(e,t){t._popupHandlersAdded&&e.bindPopup(t._popup._content,t._popup.options),t._tooltipHandlersAdded&&e.bindTooltip(t._tooltip._content,t._tooltip.options)},_bindEvents:function(e,t){const i=t._events,r=i?Object.getOwnPropertyNames(i):[],n=t._eventParents,o=n?Object.getOwnPropertyNames(n):[];this._bindInfoTools(e,t);for(let t=0,n=r.length;t<n;t+=1){const n=i[r[t]];for(let i=0,o=n.length;i<o;i+=1)e.on(r[t],n[i].fn)}if(t._eventParents)for(let i=0,r=o.length;i<r;i+=1)t._eventParents[o[i]]._map||(this._bindEvents(e,t._eventParents[o[i]]),this._bindInfoTools(t,t._eventParents[o[i]]))},_makeMarker:function(e){if(-1===[L.marker,L.circleMarker].indexOf(this.options.markerType))throw new Error("Invalid markerType provided. Allowed markerTypes are: L.marker and L.circleMarker");const t="function"==typeof this.options.markerOptions?this.options.markerOptions(e):this.options.markerOptions,i=this.options.markerType(e.computedBounds.getCenter(),t),r=e.feature?i.toGeoJSON():void 0;return this._bindEvents(i,e),r&&(r.properties=e.feature.properties,i.feature=r),i},prepLayer:function(e){e.getBounds&&(e.computedBounds=this._getBounds(e),e.zoomThreshold=this._getZoomThreshold(e),e.marker=this._makeMarker(e),e.zoomState=this._map.getZoom())},_addToMap:function(e){const t=this._map.getZoom()<=e.zoomThreshold?e.marker:e;this._featureLayer.addLayer(t)},addLayer:function(e){const t=e instanceof L.FeatureGroup?Object.getOwnPropertyNames(e._layers):[];if(t.length)for(let i=0,r=t.length;i<r;i+=1)this.addLayer(e._layers[t[i]]);else this._map?(this.prepLayer(e),this._addToMap(e)):this._needsPrepping.push(e),this._layers[this.getLayerId(e)]=e},removeLayer:function(e){const t=e instanceof L.FeatureGroup?Object.getOwnPropertyNames(e._layers):[];if(t.length)for(let i=0,r=t.length;i<r;i+=1)this.removeLayer(e._layers[t[i]]);else{const t=e in this._layers?e:this.getLayerId(e);this._featureLayer.removeLayer(this._layers[t]),this._layers[t].marker&&this._featureLayer.removeLayer(this._layers[t].marker),delete this._layers[t];const i=this._needsPrepping.indexOf(this._layers[t]);-1!==i&&this._needsPrepping.splice(i,1)}},clearLayers:function(){this._featureLayer.clearLayers(),this._layers=[]},_switchDisplay:function(e,t){t?(this._featureLayer.removeLayer(e),this._featureLayer.addLayer(e.marker)):(this._featureLayer.removeLayer(e.marker),this._featureLayer.addLayer(e))},_deflate:function(){const e=this._map.getBounds(),t=this._map.getZoom();this.eachLayer(function(i){i.marker&&i.zoomState!==t&&i.computedBounds.intersects(e)&&(this._switchDisplay(i,t<=i.zoomThreshold),i.zoomState=t)},this)},onAdd:function(e){this._featureLayer.addTo(e),this._map.on("zoomend",this._deflate,this),this._map.on("moveend",this._deflate,this);for(let e=0,t=this._needsPrepping.length;e<t;e+=1)this.addLayer(this._needsPrepping[e]);this._needsPrepping=[],this._deflate()},onRemove:function(e){e.removeLayer(this._featureLayer),this._map.off("zoomend",this._deflate,this),this._map.off("moveend",this._deflate,this)}}),L.deflate=function(e){return new L.Deflate(e)}},961:(e,t,i)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),i(221)}},i={};function r(e){var n=i[e];if(void 0!==n)return n.exports;var o=i[e]={exports:{}};return t[e].call(o.exports,o,o.exports,r),o.exports}r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};return(()=>{"use strict";r.d(n,{default:()=>l});var e=r(91);const t=(0,e.createContext)(null);function i(){const i=(0,e.use)(t);if(null==i)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return i}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,r)}return i}function a(e,t,i){return(t=function(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}r(961),r(389),r(797);const l=function(i){function r(r,n){const{instance:o,context:s}=i(r).current;(0,e.useImperativeHandle)(n,()=>o);const{children:a}=r;return null==a?null:e.createElement(t,{value:s},a)}return(0,e.forwardRef)(r)}((h=function(e,t){var r,n,o,l,u,h=e.markerCluster,_=e.data,d=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?s(Object(i),!0).forEach(function(t){a(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}({},e);if(h){o=-1!==(n=(r=i().map).getContainer().className).indexOf("leaflet-cluster-anim"),l=-1!==n.indexOf("marker-cluster-styled"),u=-1!==n.indexOf("marker-cluster-animated"),!o&&(r.getContainer().className+=" leaflet-cluster-anim"),!l&&(r.getContainer().className+=" marker-cluster-styled"),!u&&(r.getContainer().className+=" marker-cluster-animated");var c=L.markerClusterGroup();d.markerLayer=c}var p=new L.Deflate(d);return L.geoJSON(_,e).addTo(p),function(e,t){return Object.freeze({instance:e,context:t,container:void 0})}(p,t)},u=null==(_=function(e,t,i){!function(e,t,i){const{opacity:r,zIndex:n}=t;null!=r&&r!==i.opacity&&e.setOpacity(r),null!=n&&n!==i.zIndex&&e.setZIndex(n)}(e,t,i)})?function(t,i){const r=(0,e.useRef)(void 0);return r.current||(r.current=h(t,i)),r}:function(t,i){const r=(0,e.useRef)(void 0);r.current||(r.current=h(t,i));const n=(0,e.useRef)(t),{instance:o}=r.current;return(0,e.useEffect)(function(){n.current!==t&&(_(o,t,n.current),n.current=t)},[o,t,_]),r},function(t){const r=i(),n=u(function(e,t){const i=e.pane??t.pane;return i?{...e,pane:i}:e}(t,r),r);return function(t,i){const r=(0,e.useRef)(i);(0,e.useEffect)(function(){i!==r.current&&null!=t.attributionControl&&(null!=r.current&&t.attributionControl.removeAttribution(r.current),null!=i&&t.attributionControl.addAttribution(i)),r.current=i},[t,i])}(r.map,t.attribution),function(t,i){const r=(0,e.useRef)(void 0);(0,e.useEffect)(function(){return null!=i&&t.instance.on(i),r.current=i,function(){null!=r.current&&t.instance.off(r.current),r.current=null}},[t,i])}(n.current,t.eventHandlers),function(t,i){(0,e.useEffect)(function(){return(i.layerContainer??i.map).addLayer(t.instance),function(){i.layerContainer?.removeLayer(t.instance),i.map.removeLayer(t.instance)}},[i,t])}(n.current,r),n}));var u,h,_})(),n.default})());
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license React
3
+ * react-dom.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */
package/lib/Deflate.js ADDED
@@ -0,0 +1,40 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import { useMap } from 'react-leaflet/hooks';
8
+ import { createElementObject, createLayerComponent, updateGridLayer } from "@react-leaflet/core";
9
+ import 'leaflet.markercluster';
10
+ import 'Leaflet.Deflate';
11
+ var initMapClasses = function initMapClasses() {
12
+ var map = useMap();
13
+ var mapClassName = map.getContainer().className;
14
+ var isAnimClassApplied = mapClassName.indexOf('leaflet-cluster-anim') !== -1;
15
+ var isStyledClassApplied = mapClassName.indexOf('marker-cluster-styled') !== -1;
16
+ var isAnimatedClassApplied = mapClassName.indexOf('marker-cluster-animated') !== -1;
17
+ !isAnimClassApplied && (map.getContainer().className += ' leaflet-cluster-anim');
18
+ !isStyledClassApplied && (map.getContainer().className += ' marker-cluster-styled');
19
+ !isAnimatedClassApplied && (map.getContainer().className += ' marker-cluster-animated');
20
+ };
21
+ var createDeflateLayer = function createDeflateLayer(props, context) {
22
+ var markerCluster = props.markerCluster,
23
+ data = props.data;
24
+ // This will add our Leaflet.Deflate (this.leafletElement) to the map--something that must happen BEFORE
25
+ // we can add anything to Leaflet.Deflate itself.
26
+
27
+ var deflateProps = _objectSpread({}, props);
28
+ if (markerCluster) {
29
+ initMapClasses();
30
+ var markerLayer = L.markerClusterGroup();
31
+ deflateProps.markerLayer = markerLayer;
32
+ }
33
+ var layer = new L.Deflate(deflateProps);
34
+ L.geoJSON(data, props).addTo(layer);
35
+ return createElementObject(layer, context);
36
+ };
37
+ var updateDeflateLayer = function updateDeflateLayer(layer, props, prevProps) {
38
+ updateGridLayer(layer, props, prevProps);
39
+ };
40
+ export default createLayerComponent(createDeflateLayer, updateDeflateLayer);
package/lib/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import Deflate from './Deflate';
2
+ export default Deflate;
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "react-leaflet-deflate",
3
- "version": "2.2.1",
3
+ "version": "3.0.0-beta.1",
4
4
  "description": "React wrapper of Leaflet.Deflate. Substitues polygons and lines with markers when screen size falls below a defined threshold.",
5
5
  "main": "dist/react-leaflet-deflate.min.js",
6
+ "module": "lib/index.js",
6
7
  "scripts": {
7
8
  "build": "npm run build:lib && npm run build:dist && npm run build:dev",
8
- "build:dist": "webpack src/index.js --output dist/react-leaflet-deflate.min.js",
9
- "build:dev": "webpack src/index.js --mode development --output dist/react-leaflet-deflate.js",
9
+ "build:dist": "webpack",
10
+ "build:dev": "webpack --mode development --output-path ./dist --output-filename react-leaflet-deflate.js",
10
11
  "build:lib": "npm run compile:lib",
11
12
  "clean:lib": "rm -Rf ./lib",
12
- "compile:lib": "babel src --out-dir lib",
13
+ "compile:lib": "babel ./src --out-dir lib",
13
14
  "prepublishOnly": "npm run build",
14
15
  "test": "jest"
15
16
  },
@@ -23,55 +24,62 @@
23
24
  "react-leaflet",
24
25
  "deflate",
25
26
  "leaflet-deflate",
26
- "react-leaflet-deflate"
27
+ "react-leaflet-deflate",
28
+ "react-leaflet-v4",
29
+ "react-leaflet-v5"
27
30
  ],
28
31
  "author": "M. Hasbie",
29
32
  "license": "MIT",
30
33
  "peerDependencies": {
31
- "leaflet": "^1.3.4",
32
- "react-leaflet": "^1.9.1 || ^2.1.4",
33
- "leaflet.markercluster": "^1.4.1"
34
+ "leaflet": "^1.9.4",
35
+ "leaflet.markercluster": "^1.5.3",
36
+ "react-leaflet": "^4.0.0 || ^5.0.0"
34
37
  },
35
38
  "devDependencies": {
36
- "babel-cli": "^6.26.0",
37
- "babel-core": "^6.26.3",
38
- "babel-eslint": "^10.0.1",
39
- "babel-jest": "^23.6.0",
40
- "babel-loader": "^7.1.5",
41
- "babel-plugin-transform-class-properties": "^6.24.1",
42
- "babel-plugin-transform-object-rest-spread": "^6.26.0",
43
- "babel-preset-env": "^1.7.0",
44
- "babel-preset-react": "^6.24.1",
45
- "babel-preset-stage-0": "^6.24.1",
46
- "babel-register": "^6.26.0",
47
- "css-loader": "^2.0.2",
48
- "enzyme": "^3.8.0",
49
- "enzyme-adapter-react-16": "^1.7.1",
50
- "eslint": "^5.11.0",
51
- "eslint-plugin-react": "^7.11.1",
52
- "jest": "^23.6.0",
53
- "jest-enzyme": "^7.0.1",
54
- "leaflet": "^1.3.4",
55
- "leaflet.markercluster": "^1.4.1",
56
- "prop-types": "^15.5.10",
57
- "react": "^16.5.2",
58
- "react-dom": "^16.5.2",
59
- "react-leaflet": "^2.1.4",
60
- "style-loader": "^0.23.1",
61
- "webpack": "^4.28.2",
62
- "webpack-cli": "^3.1.2",
63
- "webpack-dev-server": "^3.1.14"
39
+ "@babel/cli": "^7.28.3",
40
+ "@babel/core": "^7.28.5",
41
+ "@babel/eslint-parser": "^7.28.5",
42
+ "@babel/plugin-transform-class-properties": "^7.27.1",
43
+ "@babel/plugin-transform-modules-commonjs": "^7.27.1",
44
+ "@babel/plugin-transform-object-rest-spread": "^7.28.4",
45
+ "@babel/preset-env": "^7.28.5",
46
+ "@babel/preset-react": "^7.28.5",
47
+ "@babel/preset-stage-0": "^7.8.3",
48
+ "@babel/register": "^7.28.3",
49
+ "@testing-library/jest-dom": "^6.9.1",
50
+ "@testing-library/react": "^16.3.0",
51
+ "babel-jest": "^29.7.0",
52
+ "babel-loader": "^10.0.0",
53
+ "css-loader": "^7.1.2",
54
+ "eslint": "^9.39.1",
55
+ "eslint-plugin-react": "^7.37.5",
56
+ "jest": "^29.7.0",
57
+ "jest-environment-jsdom": "^30.2.0",
58
+ "leaflet": "^1.9.4",
59
+ "leaflet.markercluster": "^1.5.3",
60
+ "prop-types": "^15.8.1",
61
+ "react": "^19.2.0",
62
+ "react-dom": "^19.2.0",
63
+ "react-leaflet": "^5.0.0",
64
+ "style-loader": "^4.0.0",
65
+ "webpack": "^5.102.1",
66
+ "webpack-cli": "^6.0.1",
67
+ "webpack-dev-server": "^5.2.2"
64
68
  },
65
69
  "dependencies": {
66
- "Leaflet.Deflate": "^1.1.0"
70
+ "Leaflet.Deflate": "^2.1.0"
67
71
  },
68
72
  "jest": {
69
73
  "collectCoverage": true,
74
+ "testEnvironment": "jsdom",
70
75
  "transform": {
71
- ".*": "<rootDir>/node_modules/babel-jest"
76
+ "^.+\\.[jt]sx?$": "babel-jest"
72
77
  },
73
78
  "testMatch": [
74
79
  "**/__tests__/**/?(*.)+(spec|test).[jt]s?(x)"
80
+ ],
81
+ "transformIgnorePatterns": [
82
+ "/node_modules/(?!react-leaflet|@react-leaflet|leaflet|Leaflet.Deflate)/"
75
83
  ]
76
84
  }
77
85
  }