react-leaflet-deflate 3.0.0-beta.1 → 3.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react-leaflet-deflate.js +29 -40
- package/dist/react-leaflet-deflate.min.js +1 -2
- package/lib/Deflate.js +1 -1
- package/package.json +1 -1
- package/.github/workflows/npm-publish-github-packages.yml +0 -36
- package/.github/workflows/npm-publish.yml +0 -33
- package/.github/workflows/webpack.yml +0 -47
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
*/
|
|
9
9
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
10
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
11
|
-
module.exports = factory(require("react"));
|
|
11
|
+
module.exports = factory(require("react"), require("react-dom"), require("react-leaflet"));
|
|
12
12
|
else if(typeof define === 'function' && define.amd)
|
|
13
|
-
define([], factory);
|
|
13
|
+
define([, , "react-leaflet"], factory);
|
|
14
14
|
else if(typeof exports === 'object')
|
|
15
|
-
exports["react-leaflet-deflate"] = factory(require("react"));
|
|
15
|
+
exports["react-leaflet-deflate"] = factory(require("react"), require("react-dom"), require("react-leaflet"));
|
|
16
16
|
else
|
|
17
|
-
root["ReactLeafletDeflate"] = factory(root["React"]);
|
|
18
|
-
})(this, (__WEBPACK_EXTERNAL_MODULE_react__) => {
|
|
17
|
+
root["ReactLeafletDeflate"] = factory(root["React"], root["ReactDOM"], root["ReactLeaflet"]);
|
|
18
|
+
})(this, (__WEBPACK_EXTERNAL_MODULE_react__, __WEBPACK_EXTERNAL_MODULE_react_dom__, __WEBPACK_EXTERNAL_MODULE_react_leaflet__) => {
|
|
19
19
|
return /******/ (() => { // webpackBootstrap
|
|
20
20
|
/******/ var __webpack_modules__ = ({
|
|
21
21
|
|
|
@@ -37,7 +37,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
37
37
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
38
38
|
|
|
39
39
|
"use strict";
|
|
40
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createContainerComponent: () => (/* binding */ createContainerComponent),\n/* harmony export */ createDivOverlayComponent: () => (/* binding */ createDivOverlayComponent),\n/* harmony export */ createLeafComponent: () => (/* binding */ createLeafComponent)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"
|
|
40
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createContainerComponent: () => (/* binding */ createContainerComponent),\n/* harmony export */ createDivOverlayComponent: () => (/* binding */ createDivOverlayComponent),\n/* harmony export */ createLeafComponent: () => (/* binding */ createLeafComponent)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var _context_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./context.js */ \"./node_modules/@react-leaflet/core/lib/context.js\");\n\n\n\nfunction createContainerComponent(useElement) {\n function ContainerComponent(props, forwardedRef) {\n const { instance, context } = useElement(props).current;\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(forwardedRef, ()=>instance);\n const { children } = props;\n return children == null ? null : /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0__.createElement(_context_js__WEBPACK_IMPORTED_MODULE_2__.LeafletContext, {\n value: context\n }, children);\n }\n return /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(ContainerComponent);\n}\nfunction createDivOverlayComponent(useElement) {\n function OverlayComponent(props, forwardedRef) {\n const [isOpen, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);\n const { instance } = useElement(props, setOpen).current;\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(forwardedRef, ()=>instance);\n // biome-ignore lint/correctness/useExhaustiveDependencies: update overlay when children change\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function updateOverlay() {\n if (isOpen) {\n instance.update();\n }\n }, [\n instance,\n isOpen,\n props.children\n ]);\n // @ts-ignore _contentNode missing in type definition\n const contentNode = instance._contentNode;\n return contentNode ? /*#__PURE__*/ (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal)(props.children, contentNode) : null;\n }\n return /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(OverlayComponent);\n}\nfunction createLeafComponent(useElement) {\n function LeafComponent(props, forwardedRef) {\n const { instance } = useElement(props).current;\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(forwardedRef, ()=>instance);\n return null;\n }\n return /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(LeafComponent);\n}\n\n\n//# sourceURL=webpack://ReactLeafletDeflate/./node_modules/@react-leaflet/core/lib/component.js?\n}");
|
|
41
41
|
|
|
42
42
|
/***/ }),
|
|
43
43
|
|
|
@@ -172,39 +172,6 @@ eval("{/*\n * Leaflet.markercluster 1.5.3+master.e5124b2,\n * Provides Beautiful
|
|
|
172
172
|
|
|
173
173
|
/***/ }),
|
|
174
174
|
|
|
175
|
-
/***/ "./node_modules/react-dom/cjs/react-dom.development.js":
|
|
176
|
-
/*!*************************************************************!*\
|
|
177
|
-
!*** ./node_modules/react-dom/cjs/react-dom.development.js ***!
|
|
178
|
-
\*************************************************************/
|
|
179
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
180
|
-
|
|
181
|
-
"use strict";
|
|
182
|
-
eval("{/**\n * @license React\n * react-dom.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n true &&\n (function () {\n function noop() {}\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function createPortal$1(children, containerInfo, implementation) {\n var key =\n 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;\n try {\n testStringCoercion(key);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n JSCompiler_inline_result &&\n (console.error(\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n key[Symbol.toStringTag]) ||\n key.constructor.name ||\n \"Object\"\n ),\n testStringCoercion(key));\n return {\n $$typeof: REACT_PORTAL_TYPE,\n key: null == key ? null : \"\" + key,\n children: children,\n containerInfo: containerInfo,\n implementation: implementation\n };\n }\n function getCrossOriginStringAs(as, input) {\n if (\"font\" === as) return \"\";\n if (\"string\" === typeof input)\n return \"use-credentials\" === input ? input : \"\";\n }\n function getValueDescriptorExpectingObjectForWarning(thing) {\n return null === thing\n ? \"`null`\"\n : void 0 === thing\n ? \"`undefined`\"\n : \"\" === thing\n ? \"an empty string\"\n : 'something with type \"' + typeof thing + '\"';\n }\n function getValueDescriptorExpectingEnumForWarning(thing) {\n return null === thing\n ? \"`null`\"\n : void 0 === thing\n ? \"`undefined`\"\n : \"\" === thing\n ? \"an empty string\"\n : \"string\" === typeof thing\n ? JSON.stringify(thing)\n : \"number\" === typeof thing\n ? \"`\" + thing + \"`\"\n : 'something with type \"' + typeof thing + '\"';\n }\n function resolveDispatcher() {\n var dispatcher = ReactSharedInternals.H;\n null === dispatcher &&\n console.error(\n \"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\\n1. You might have mismatching versions of React and the renderer (such as React DOM)\\n2. You might be breaking the Rules of Hooks\\n3. You might have more than one copy of React in the same app\\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.\"\n );\n return dispatcher;\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = __webpack_require__(/*! react */ \"react\"),\n Internals = {\n d: {\n f: noop,\n r: function () {\n throw Error(\n \"Invalid form element. requestFormReset must be passed a form that was rendered by React.\"\n );\n },\n D: noop,\n C: noop,\n L: noop,\n m: noop,\n X: noop,\n S: noop,\n M: noop\n },\n p: 0,\n findDOMNode: null\n },\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\n (\"function\" === typeof Map &&\n null != Map.prototype &&\n \"function\" === typeof Map.prototype.forEach &&\n \"function\" === typeof Set &&\n null != Set.prototype &&\n \"function\" === typeof Set.prototype.clear &&\n \"function\" === typeof Set.prototype.forEach) ||\n console.error(\n \"React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills\"\n );\n exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n Internals;\n exports.createPortal = function (children, container) {\n var key =\n 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;\n if (\n !container ||\n (1 !== container.nodeType &&\n 9 !== container.nodeType &&\n 11 !== container.nodeType)\n )\n throw Error(\"Target container is not a DOM element.\");\n return createPortal$1(children, container, null, key);\n };\n exports.flushSync = function (fn) {\n var previousTransition = ReactSharedInternals.T,\n previousUpdatePriority = Internals.p;\n try {\n if (((ReactSharedInternals.T = null), (Internals.p = 2), fn))\n return fn();\n } finally {\n (ReactSharedInternals.T = previousTransition),\n (Internals.p = previousUpdatePriority),\n Internals.d.f() &&\n console.error(\n \"flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.\"\n );\n }\n };\n exports.preconnect = function (href, options) {\n \"string\" === typeof href && href\n ? null != options && \"object\" !== typeof options\n ? console.error(\n \"ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.\",\n getValueDescriptorExpectingEnumForWarning(options)\n )\n : null != options &&\n \"string\" !== typeof options.crossOrigin &&\n console.error(\n \"ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.\",\n getValueDescriptorExpectingObjectForWarning(options.crossOrigin)\n )\n : console.error(\n \"ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.\",\n getValueDescriptorExpectingObjectForWarning(href)\n );\n \"string\" === typeof href &&\n (options\n ? ((options = options.crossOrigin),\n (options =\n \"string\" === typeof options\n ? \"use-credentials\" === options\n ? options\n : \"\"\n : void 0))\n : (options = null),\n Internals.d.C(href, options));\n };\n exports.prefetchDNS = function (href) {\n if (\"string\" !== typeof href || !href)\n console.error(\n \"ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.\",\n getValueDescriptorExpectingObjectForWarning(href)\n );\n else if (1 < arguments.length) {\n var options = arguments[1];\n \"object\" === typeof options && options.hasOwnProperty(\"crossOrigin\")\n ? console.error(\n \"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.\",\n getValueDescriptorExpectingEnumForWarning(options)\n )\n : console.error(\n \"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.\",\n getValueDescriptorExpectingEnumForWarning(options)\n );\n }\n \"string\" === typeof href && Internals.d.D(href);\n };\n exports.preinit = function (href, options) {\n \"string\" === typeof href && href\n ? null == options || \"object\" !== typeof options\n ? console.error(\n \"ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.\",\n getValueDescriptorExpectingEnumForWarning(options)\n )\n : \"style\" !== options.as &&\n \"script\" !== options.as &&\n console.error(\n 'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are \"style\" and \"script\".',\n getValueDescriptorExpectingEnumForWarning(options.as)\n )\n : console.error(\n \"ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.\",\n getValueDescriptorExpectingObjectForWarning(href)\n );\n if (\n \"string\" === typeof href &&\n options &&\n \"string\" === typeof options.as\n ) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),\n integrity =\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n fetchPriority =\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0;\n \"style\" === as\n ? Internals.d.S(\n href,\n \"string\" === typeof options.precedence\n ? options.precedence\n : void 0,\n {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority\n }\n )\n : \"script\" === as &&\n Internals.d.X(href, {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n };\n exports.preinitModule = function (href, options) {\n var encountered = \"\";\n (\"string\" === typeof href && href) ||\n (encountered +=\n \" The `href` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(href) +\n \".\");\n void 0 !== options && \"object\" !== typeof options\n ? (encountered +=\n \" The `options` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(options) +\n \".\")\n : options &&\n \"as\" in options &&\n \"script\" !== options.as &&\n (encountered +=\n \" The `as` option encountered was \" +\n getValueDescriptorExpectingEnumForWarning(options.as) +\n \".\");\n if (encountered)\n console.error(\n \"ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s\",\n encountered\n );\n else\n switch (\n ((encountered =\n options && \"string\" === typeof options.as ? options.as : \"script\"),\n encountered)\n ) {\n case \"script\":\n break;\n default:\n (encountered =\n getValueDescriptorExpectingEnumForWarning(encountered)),\n console.error(\n 'ReactDOM.preinitModule(): Currently the only supported \"as\" type for this function is \"script\" but received \"%s\" instead. This warning was generated for `href` \"%s\". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',\n encountered,\n href\n );\n }\n if (\"string\" === typeof href)\n if (\"object\" === typeof options && null !== options) {\n if (null == options.as || \"script\" === options.as)\n (encountered = getCrossOriginStringAs(\n options.as,\n options.crossOrigin\n )),\n Internals.d.M(href, {\n crossOrigin: encountered,\n integrity:\n \"string\" === typeof options.integrity\n ? options.integrity\n : void 0,\n nonce:\n \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n } else null == options && Internals.d.M(href);\n };\n exports.preload = function (href, options) {\n var encountered = \"\";\n (\"string\" === typeof href && href) ||\n (encountered +=\n \" The `href` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(href) +\n \".\");\n null == options || \"object\" !== typeof options\n ? (encountered +=\n \" The `options` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(options) +\n \".\")\n : (\"string\" === typeof options.as && options.as) ||\n (encountered +=\n \" The `as` option encountered was \" +\n getValueDescriptorExpectingObjectForWarning(options.as) +\n \".\");\n encountered &&\n console.error(\n 'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel=\"preload\" as=\"...\" />` tag.%s',\n encountered\n );\n if (\n \"string\" === typeof href &&\n \"object\" === typeof options &&\n null !== options &&\n \"string\" === typeof options.as\n ) {\n encountered = options.as;\n var crossOrigin = getCrossOriginStringAs(\n encountered,\n options.crossOrigin\n );\n Internals.d.L(href, encountered, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n type: \"string\" === typeof options.type ? options.type : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0,\n referrerPolicy:\n \"string\" === typeof options.referrerPolicy\n ? options.referrerPolicy\n : void 0,\n imageSrcSet:\n \"string\" === typeof options.imageSrcSet\n ? options.imageSrcSet\n : void 0,\n imageSizes:\n \"string\" === typeof options.imageSizes\n ? options.imageSizes\n : void 0,\n media: \"string\" === typeof options.media ? options.media : void 0\n });\n }\n };\n exports.preloadModule = function (href, options) {\n var encountered = \"\";\n (\"string\" === typeof href && href) ||\n (encountered +=\n \" The `href` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(href) +\n \".\");\n void 0 !== options && \"object\" !== typeof options\n ? (encountered +=\n \" The `options` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(options) +\n \".\")\n : options &&\n \"as\" in options &&\n \"string\" !== typeof options.as &&\n (encountered +=\n \" The `as` option encountered was \" +\n getValueDescriptorExpectingObjectForWarning(options.as) +\n \".\");\n encountered &&\n console.error(\n 'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel=\"modulepreload\" as=\"...\" />` tag.%s',\n encountered\n );\n \"string\" === typeof href &&\n (options\n ? ((encountered = getCrossOriginStringAs(\n options.as,\n options.crossOrigin\n )),\n Internals.d.m(href, {\n as:\n \"string\" === typeof options.as && \"script\" !== options.as\n ? options.as\n : void 0,\n crossOrigin: encountered,\n integrity:\n \"string\" === typeof options.integrity\n ? options.integrity\n : void 0\n }))\n : Internals.d.m(href));\n };\n exports.requestFormReset = function (form) {\n Internals.d.r(form);\n };\n exports.unstable_batchedUpdates = function (fn, a) {\n return fn(a);\n };\n exports.useFormState = function (action, initialState, permalink) {\n return resolveDispatcher().useFormState(action, initialState, permalink);\n };\n exports.useFormStatus = function () {\n return resolveDispatcher().useHostTransitionStatus();\n };\n exports.version = \"19.2.0\";\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n\n\n//# sourceURL=webpack://ReactLeafletDeflate/./node_modules/react-dom/cjs/react-dom.development.js?\n}");
|
|
183
|
-
|
|
184
|
-
/***/ }),
|
|
185
|
-
|
|
186
|
-
/***/ "./node_modules/react-dom/index.js":
|
|
187
|
-
/*!*****************************************!*\
|
|
188
|
-
!*** ./node_modules/react-dom/index.js ***!
|
|
189
|
-
\*****************************************/
|
|
190
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
191
|
-
|
|
192
|
-
"use strict";
|
|
193
|
-
eval("{\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (true) {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n // removed by dead control flow\n\n}\n\nif (false) // removed by dead control flow\n{} else {\n module.exports = __webpack_require__(/*! ./cjs/react-dom.development.js */ \"./node_modules/react-dom/cjs/react-dom.development.js\");\n}\n\n\n//# sourceURL=webpack://ReactLeafletDeflate/./node_modules/react-dom/index.js?\n}");
|
|
194
|
-
|
|
195
|
-
/***/ }),
|
|
196
|
-
|
|
197
|
-
/***/ "./node_modules/react-leaflet/lib/hooks.js":
|
|
198
|
-
/*!*************************************************!*\
|
|
199
|
-
!*** ./node_modules/react-leaflet/lib/hooks.js ***!
|
|
200
|
-
\*************************************************/
|
|
201
|
-
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
202
|
-
|
|
203
|
-
"use strict";
|
|
204
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ useMap: () => (/* binding */ useMap),\n/* harmony export */ useMapEvent: () => (/* binding */ useMapEvent),\n/* harmony export */ useMapEvents: () => (/* binding */ useMapEvents)\n/* harmony export */ });\n/* harmony import */ var _react_leaflet_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-leaflet/core */ \"./node_modules/@react-leaflet/core/lib/context.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n\n\nfunction useMap() {\n return (0,_react_leaflet_core__WEBPACK_IMPORTED_MODULE_0__.useLeafletContext)().map;\n}\nfunction useMapEvent(type, handler) {\n const map = useMap();\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function addMapEventHandler() {\n // @ts-ignore event type\n map.on(type, handler);\n return function removeMapEventHandler() {\n // @ts-ignore event type\n map.off(type, handler);\n };\n }, [\n map,\n type,\n handler\n ]);\n return map;\n}\nfunction useMapEvents(handlers) {\n const map = useMap();\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function addMapEventHandlers() {\n map.on(handlers);\n return function removeMapEventHandlers() {\n map.off(handlers);\n };\n }, [\n map,\n handlers\n ]);\n return map;\n}\n\n\n//# sourceURL=webpack://ReactLeafletDeflate/./node_modules/react-leaflet/lib/hooks.js?\n}");
|
|
205
|
-
|
|
206
|
-
/***/ }),
|
|
207
|
-
|
|
208
175
|
/***/ "./src/Deflate.jsx":
|
|
209
176
|
/*!*************************!*\
|
|
210
177
|
!*** ./src/Deflate.jsx ***!
|
|
@@ -212,7 +179,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
212
179
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
213
180
|
|
|
214
181
|
"use strict";
|
|
215
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var
|
|
182
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _react_leaflet_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-leaflet/core */ \"./node_modules/@react-leaflet/core/lib/element.js\");\n/* harmony import */ var _react_leaflet_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @react-leaflet/core */ \"./node_modules/@react-leaflet/core/lib/generic.js\");\n/* harmony import */ var _react_leaflet_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @react-leaflet/core */ \"./node_modules/@react-leaflet/core/lib/grid-layer.js\");\n/* harmony import */ var react_leaflet__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-leaflet */ \"react-leaflet\");\n/* harmony import */ var react_leaflet__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_leaflet__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var leaflet_markercluster__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! leaflet.markercluster */ \"./node_modules/leaflet.markercluster/dist/leaflet.markercluster-src.js\");\n/* harmony import */ var leaflet_markercluster__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(leaflet_markercluster__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var Leaflet_Deflate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! Leaflet.Deflate */ \"./node_modules/Leaflet.Deflate/dist/L.Deflate.js\");\n/* harmony import */ var Leaflet_Deflate__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(Leaflet_Deflate__WEBPACK_IMPORTED_MODULE_5__);\nfunction _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); }\nfunction 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; }\nfunction _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; }\nfunction _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; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _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); }\n\n\n\n\nvar initMapClasses = function initMapClasses() {\n var map = (0,react_leaflet__WEBPACK_IMPORTED_MODULE_3__.useMap)();\n var mapClassName = map.getContainer().className;\n var isAnimClassApplied = mapClassName.indexOf('leaflet-cluster-anim') !== -1;\n var isStyledClassApplied = mapClassName.indexOf('marker-cluster-styled') !== -1;\n var isAnimatedClassApplied = mapClassName.indexOf('marker-cluster-animated') !== -1;\n !isAnimClassApplied && (map.getContainer().className += ' leaflet-cluster-anim');\n !isStyledClassApplied && (map.getContainer().className += ' marker-cluster-styled');\n !isAnimatedClassApplied && (map.getContainer().className += ' marker-cluster-animated');\n};\nvar createDeflateLayer = function createDeflateLayer(props, context) {\n var markerCluster = props.markerCluster,\n data = props.data;\n // This will add our Leaflet.Deflate (this.leafletElement) to the map--something that must happen BEFORE\n // we can add anything to Leaflet.Deflate itself.\n\n var deflateProps = _objectSpread({}, props);\n if (markerCluster) {\n initMapClasses();\n var markerLayer = L.markerClusterGroup();\n deflateProps.markerLayer = markerLayer;\n }\n var layer = new L.Deflate(deflateProps);\n L.geoJSON(data, props).addTo(layer);\n return (0,_react_leaflet_core__WEBPACK_IMPORTED_MODULE_0__.createElementObject)(layer, context);\n};\nvar updateDeflateLayer = function updateDeflateLayer(layer, props, prevProps) {\n (0,_react_leaflet_core__WEBPACK_IMPORTED_MODULE_2__.updateGridLayer)(layer, props, prevProps);\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_react_leaflet_core__WEBPACK_IMPORTED_MODULE_1__.createLayerComponent)(createDeflateLayer, updateDeflateLayer));\n\n//# sourceURL=webpack://ReactLeafletDeflate/./src/Deflate.jsx?\n}");
|
|
216
183
|
|
|
217
184
|
/***/ }),
|
|
218
185
|
|
|
@@ -236,6 +203,28 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
236
203
|
"use strict";
|
|
237
204
|
module.exports = __WEBPACK_EXTERNAL_MODULE_react__;
|
|
238
205
|
|
|
206
|
+
/***/ }),
|
|
207
|
+
|
|
208
|
+
/***/ "react-dom":
|
|
209
|
+
/*!***********************************************************************************!*\
|
|
210
|
+
!*** external {"commonjs":"react-dom","commonjs2":"react-dom","root":"ReactDOM"} ***!
|
|
211
|
+
\***********************************************************************************/
|
|
212
|
+
/***/ ((module) => {
|
|
213
|
+
|
|
214
|
+
"use strict";
|
|
215
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_react_dom__;
|
|
216
|
+
|
|
217
|
+
/***/ }),
|
|
218
|
+
|
|
219
|
+
/***/ "react-leaflet":
|
|
220
|
+
/*!*********************************************************************************************************************!*\
|
|
221
|
+
!*** external {"commonjs":"react-leaflet","commonjs2":"react-leaflet","amd":"react-leaflet","root":"ReactLeaflet"} ***!
|
|
222
|
+
\*********************************************************************************************************************/
|
|
223
|
+
/***/ ((module) => {
|
|
224
|
+
|
|
225
|
+
"use strict";
|
|
226
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_react_leaflet__;
|
|
227
|
+
|
|
239
228
|
/***/ })
|
|
240
229
|
|
|
241
230
|
/******/ });
|
|
@@ -1,2 +1 @@
|
|
|
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})());
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom"),require("react-leaflet")):"function"==typeof define&&define.amd?define([,,"react-leaflet"],t):"object"==typeof exports?exports["react-leaflet-deflate"]=t(require("react"),require("react-dom"),require("react-leaflet")):e.ReactLeafletDeflate=t(e.React,e.ReactDOM,e.ReactLeaflet)}(this,(e,t,i)=>(()=>{var r={91:t=>{"use strict";t.exports=e},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)},511:e=>{"use strict";e.exports=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)}},945:e=>{"use strict";e.exports=i}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return r[e].call(i.exports,i,i.exports,o),i.exports}o.d=(e,t)=>{for(var i in t)o.o(t,i)&&!o.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var s={};return(()=>{"use strict";o.d(s,{default:()=>l});var e=o(91);o(511);const t=(0,e.createContext)(null);var i=o(945);function r(e){return r="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},r(e)}function n(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"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}o(389),o(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,o,s,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?n(Object(i),!0).forEach(function(t){a(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}({},e);if(h){s=-1!==(o=(r=(0,i.useMap)()).getContainer().className).indexOf("leaflet-cluster-anim"),l=-1!==o.indexOf("marker-cluster-styled"),u=-1!==o.indexOf("marker-cluster-animated"),!s&&(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(i){const r=function(){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}(),n=u(function(e,t){const i=e.pane??t.pane;return i?{...e,pane:i}:e}(i,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,i.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,i.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,_})(),s.default})());
|
package/lib/Deflate.js
CHANGED
|
@@ -4,8 +4,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
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
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
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
7
|
import { createElementObject, createLayerComponent, updateGridLayer } from "@react-leaflet/core";
|
|
8
|
+
import { useMap } from "react-leaflet";
|
|
9
9
|
import 'leaflet.markercluster';
|
|
10
10
|
import 'Leaflet.Deflate';
|
|
11
11
|
var initMapClasses = function initMapClasses() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-leaflet-deflate",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.2",
|
|
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
6
|
"module": "lib/index.js",
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
-
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
|
3
|
-
|
|
4
|
-
name: Github Package
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
release:
|
|
8
|
-
types: [created]
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
build:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v4
|
|
15
|
-
- uses: actions/setup-node@v4
|
|
16
|
-
with:
|
|
17
|
-
node-version: 20
|
|
18
|
-
- run: npm ci
|
|
19
|
-
- run: npm test
|
|
20
|
-
|
|
21
|
-
publish-gpr:
|
|
22
|
-
needs: build
|
|
23
|
-
runs-on: ubuntu-latest
|
|
24
|
-
permissions:
|
|
25
|
-
contents: read
|
|
26
|
-
packages: write
|
|
27
|
-
steps:
|
|
28
|
-
- uses: actions/checkout@v4
|
|
29
|
-
- uses: actions/setup-node@v4
|
|
30
|
-
with:
|
|
31
|
-
node-version: 20
|
|
32
|
-
registry-url: https://npm.pkg.github.com/
|
|
33
|
-
- run: npm ci
|
|
34
|
-
- run: npm publish
|
|
35
|
-
env:
|
|
36
|
-
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
-
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
|
3
|
-
|
|
4
|
-
name: Node.js Package
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
release:
|
|
8
|
-
types: [created]
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
build:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v4
|
|
15
|
-
- uses: actions/setup-node@v4
|
|
16
|
-
with:
|
|
17
|
-
node-version: 20
|
|
18
|
-
- run: npm ci
|
|
19
|
-
- run: npm test
|
|
20
|
-
|
|
21
|
-
publish-npm:
|
|
22
|
-
needs: build
|
|
23
|
-
runs-on: ubuntu-latest
|
|
24
|
-
steps:
|
|
25
|
-
- uses: actions/checkout@v4
|
|
26
|
-
- uses: actions/setup-node@v4
|
|
27
|
-
with:
|
|
28
|
-
node-version: 20
|
|
29
|
-
registry-url: https://registry.npmjs.org/
|
|
30
|
-
- run: npm ci
|
|
31
|
-
- run: npm publish
|
|
32
|
-
env:
|
|
33
|
-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
name: NodeJS with Webpack
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [ "master", "feature/**", "bugfix/**" ]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [ "master" ]
|
|
8
|
-
workflow_dispatch:
|
|
9
|
-
inputs:
|
|
10
|
-
logLevel:
|
|
11
|
-
description: 'Log level'
|
|
12
|
-
required: true
|
|
13
|
-
default: 'warning'
|
|
14
|
-
type: choice
|
|
15
|
-
options:
|
|
16
|
-
- info
|
|
17
|
-
- warning
|
|
18
|
-
- debug
|
|
19
|
-
tags:
|
|
20
|
-
description: 'Test scenario tags'
|
|
21
|
-
required: false
|
|
22
|
-
type: boolean
|
|
23
|
-
environment:
|
|
24
|
-
description: 'Environment to run tests against'
|
|
25
|
-
type: environment
|
|
26
|
-
required: true
|
|
27
|
-
|
|
28
|
-
jobs:
|
|
29
|
-
build:
|
|
30
|
-
runs-on: ubuntu-latest
|
|
31
|
-
|
|
32
|
-
strategy:
|
|
33
|
-
matrix:
|
|
34
|
-
node-version: [18.x, 20.x, 22.x]
|
|
35
|
-
|
|
36
|
-
steps:
|
|
37
|
-
- uses: actions/checkout@v4
|
|
38
|
-
|
|
39
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
40
|
-
uses: actions/setup-node@v4
|
|
41
|
-
with:
|
|
42
|
-
node-version: ${{ matrix.node-version }}
|
|
43
|
-
|
|
44
|
-
- name: Build
|
|
45
|
-
run: |
|
|
46
|
-
npm install
|
|
47
|
-
npx webpack
|