react-leaflet-deflate 2.2.1 → 3.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/npm-publish-github-packages.yml +36 -0
- package/.github/workflows/npm-publish.yml +33 -0
- package/.github/workflows/webpack.yml +47 -0
- package/CHANGELOG.md +7 -0
- package/README.md +5 -31
- package/dist/react-leaflet-deflate.js +277 -127
- package/dist/react-leaflet-deflate.min.js +2 -1
- package/dist/react-leaflet-deflate.min.js.LICENSE.txt +9 -0
- package/lib/Deflate.js +40 -0
- package/lib/index.js +2 -0
- package/package.json +46 -38
|
@@ -1,110 +1,164 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
3
|
+
* This devtool is neither made for production nor for readable output files.
|
|
4
|
+
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
5
|
+
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
6
|
+
* or disable the default devtool with "devtool: false".
|
|
7
|
+
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
8
|
+
*/
|
|
1
9
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
10
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
-
module.exports = factory(require("
|
|
11
|
+
module.exports = factory(require("react"));
|
|
4
12
|
else if(typeof define === 'function' && define.amd)
|
|
5
|
-
define([
|
|
13
|
+
define([], factory);
|
|
6
14
|
else if(typeof exports === 'object')
|
|
7
|
-
exports["react-leaflet-
|
|
15
|
+
exports["react-leaflet-deflate"] = factory(require("react"));
|
|
8
16
|
else
|
|
9
|
-
root["ReactLeafletDeflate"] = factory(root["
|
|
10
|
-
})(
|
|
11
|
-
return /******/ (
|
|
12
|
-
/******/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
17
|
+
root["ReactLeafletDeflate"] = factory(root["React"]);
|
|
18
|
+
})(this, (__WEBPACK_EXTERNAL_MODULE_react__) => {
|
|
19
|
+
return /******/ (() => { // webpackBootstrap
|
|
20
|
+
/******/ var __webpack_modules__ = ({
|
|
21
|
+
|
|
22
|
+
/***/ "./node_modules/@react-leaflet/core/lib/attribution.js":
|
|
23
|
+
/*!*************************************************************!*\
|
|
24
|
+
!*** ./node_modules/@react-leaflet/core/lib/attribution.js ***!
|
|
25
|
+
\*************************************************************/
|
|
26
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
27
|
+
|
|
28
|
+
"use strict";
|
|
29
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ useAttribution: () => (/* binding */ useAttribution)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n\nfunction useAttribution(map, attribution) {\n const attributionRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(attribution);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function updateAttribution() {\n if (attribution !== attributionRef.current && map.attributionControl != null) {\n if (attributionRef.current != null) {\n map.attributionControl.removeAttribution(attributionRef.current);\n }\n if (attribution != null) {\n map.attributionControl.addAttribution(attribution);\n }\n }\n attributionRef.current = attribution;\n }, [\n map,\n attribution\n ]);\n}\n\n\n//# sourceURL=webpack://ReactLeafletDeflate/./node_modules/@react-leaflet/core/lib/attribution.js?\n}");
|
|
30
|
+
|
|
31
|
+
/***/ }),
|
|
32
|
+
|
|
33
|
+
/***/ "./node_modules/@react-leaflet/core/lib/component.js":
|
|
34
|
+
/*!***********************************************************!*\
|
|
35
|
+
!*** ./node_modules/@react-leaflet/core/lib/component.js ***!
|
|
36
|
+
\***********************************************************/
|
|
37
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
38
|
+
|
|
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 */ \"./node_modules/react-dom/index.js\");\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
|
+
|
|
42
|
+
/***/ }),
|
|
43
|
+
|
|
44
|
+
/***/ "./node_modules/@react-leaflet/core/lib/context.js":
|
|
45
|
+
/*!*********************************************************!*\
|
|
46
|
+
!*** ./node_modules/@react-leaflet/core/lib/context.js ***!
|
|
47
|
+
\*********************************************************/
|
|
48
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
49
|
+
|
|
50
|
+
"use strict";
|
|
51
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CONTEXT_VERSION: () => (/* binding */ CONTEXT_VERSION),\n/* harmony export */ LeafletContext: () => (/* binding */ LeafletContext),\n/* harmony export */ createLeafletContext: () => (/* binding */ createLeafletContext),\n/* harmony export */ extendContext: () => (/* binding */ extendContext),\n/* harmony export */ useLeafletContext: () => (/* binding */ useLeafletContext)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n\nconst CONTEXT_VERSION = 1;\nfunction createLeafletContext(map) {\n return Object.freeze({\n __version: CONTEXT_VERSION,\n map\n });\n}\nfunction extendContext(source, extra) {\n return Object.freeze({\n ...source,\n ...extra\n });\n}\nconst LeafletContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);\nfunction useLeafletContext() {\n const context = (0,react__WEBPACK_IMPORTED_MODULE_0__.use)(LeafletContext);\n if (context == null) {\n throw new Error('No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>');\n }\n return context;\n}\n\n\n//# sourceURL=webpack://ReactLeafletDeflate/./node_modules/@react-leaflet/core/lib/context.js?\n}");
|
|
52
|
+
|
|
53
|
+
/***/ }),
|
|
54
|
+
|
|
55
|
+
/***/ "./node_modules/@react-leaflet/core/lib/control.js":
|
|
56
|
+
/*!*********************************************************!*\
|
|
57
|
+
!*** ./node_modules/@react-leaflet/core/lib/control.js ***!
|
|
58
|
+
\*********************************************************/
|
|
59
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
60
|
+
|
|
61
|
+
"use strict";
|
|
62
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createControlHook: () => (/* binding */ createControlHook)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var _context_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./context.js */ \"./node_modules/@react-leaflet/core/lib/context.js\");\n\n\nfunction createControlHook(useElement) {\n return function useLeafletControl(props) {\n const context = (0,_context_js__WEBPACK_IMPORTED_MODULE_1__.useLeafletContext)();\n const elementRef = useElement(props, context);\n const { instance } = elementRef.current;\n const positionRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(props.position);\n const { position } = props;\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function addControl() {\n instance.addTo(context.map);\n return function removeControl() {\n instance.remove();\n };\n }, [\n context.map,\n instance\n ]);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function updateControl() {\n if (position != null && position !== positionRef.current) {\n instance.setPosition(position);\n positionRef.current = position;\n }\n }, [\n instance,\n position\n ]);\n return elementRef;\n };\n}\n\n\n//# sourceURL=webpack://ReactLeafletDeflate/./node_modules/@react-leaflet/core/lib/control.js?\n}");
|
|
63
|
+
|
|
64
|
+
/***/ }),
|
|
65
|
+
|
|
66
|
+
/***/ "./node_modules/@react-leaflet/core/lib/div-overlay.js":
|
|
67
|
+
/*!*************************************************************!*\
|
|
68
|
+
!*** ./node_modules/@react-leaflet/core/lib/div-overlay.js ***!
|
|
69
|
+
\*************************************************************/
|
|
70
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
71
|
+
|
|
72
|
+
"use strict";
|
|
73
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createDivOverlayHook: () => (/* binding */ createDivOverlayHook)\n/* harmony export */ });\n/* harmony import */ var _attribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./attribution.js */ \"./node_modules/@react-leaflet/core/lib/attribution.js\");\n/* harmony import */ var _context_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./context.js */ \"./node_modules/@react-leaflet/core/lib/context.js\");\n/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./events.js */ \"./node_modules/@react-leaflet/core/lib/events.js\");\n/* harmony import */ var _pane_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pane.js */ \"./node_modules/@react-leaflet/core/lib/pane.js\");\n\n\n\n\nfunction createDivOverlayHook(useElement, useLifecycle) {\n return function useDivOverlay(props, setOpen) {\n const context = (0,_context_js__WEBPACK_IMPORTED_MODULE_1__.useLeafletContext)();\n const elementRef = useElement((0,_pane_js__WEBPACK_IMPORTED_MODULE_3__.withPane)(props, context), context);\n (0,_attribution_js__WEBPACK_IMPORTED_MODULE_0__.useAttribution)(context.map, props.attribution);\n (0,_events_js__WEBPACK_IMPORTED_MODULE_2__.useEventHandlers)(elementRef.current, props.eventHandlers);\n useLifecycle(elementRef.current, context, props, setOpen);\n return elementRef;\n };\n}\n\n\n//# sourceURL=webpack://ReactLeafletDeflate/./node_modules/@react-leaflet/core/lib/div-overlay.js?\n}");
|
|
74
|
+
|
|
75
|
+
/***/ }),
|
|
76
|
+
|
|
77
|
+
/***/ "./node_modules/@react-leaflet/core/lib/element.js":
|
|
78
|
+
/*!*********************************************************!*\
|
|
79
|
+
!*** ./node_modules/@react-leaflet/core/lib/element.js ***!
|
|
80
|
+
\*********************************************************/
|
|
81
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
82
|
+
|
|
83
|
+
"use strict";
|
|
84
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createElementHook: () => (/* binding */ createElementHook),\n/* harmony export */ createElementObject: () => (/* binding */ createElementObject)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n\nfunction createElementObject(instance, context, container) {\n return Object.freeze({\n instance,\n context,\n container\n });\n}\nfunction createElementHook(createElement, updateElement) {\n if (updateElement == null) {\n return function useImmutableLeafletElement(props, context) {\n const elementRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(undefined);\n if (!elementRef.current) elementRef.current = createElement(props, context);\n return elementRef;\n };\n }\n return function useMutableLeafletElement(props, context) {\n const elementRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(undefined);\n if (!elementRef.current) elementRef.current = createElement(props, context);\n const propsRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(props);\n const { instance } = elementRef.current;\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function updateElementProps() {\n if (propsRef.current !== props) {\n updateElement(instance, props, propsRef.current);\n propsRef.current = props;\n }\n }, [\n instance,\n props,\n updateElement\n ]);\n return elementRef;\n };\n}\n\n\n//# sourceURL=webpack://ReactLeafletDeflate/./node_modules/@react-leaflet/core/lib/element.js?\n}");
|
|
85
|
+
|
|
86
|
+
/***/ }),
|
|
87
|
+
|
|
88
|
+
/***/ "./node_modules/@react-leaflet/core/lib/events.js":
|
|
89
|
+
/*!********************************************************!*\
|
|
90
|
+
!*** ./node_modules/@react-leaflet/core/lib/events.js ***!
|
|
91
|
+
\********************************************************/
|
|
92
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
93
|
+
|
|
94
|
+
"use strict";
|
|
95
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ useEventHandlers: () => (/* binding */ useEventHandlers)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n\nfunction useEventHandlers(element, eventHandlers) {\n const eventHandlersRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(undefined);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function addEventHandlers() {\n if (eventHandlers != null) {\n element.instance.on(eventHandlers);\n }\n eventHandlersRef.current = eventHandlers;\n return function removeEventHandlers() {\n if (eventHandlersRef.current != null) {\n element.instance.off(eventHandlersRef.current);\n }\n eventHandlersRef.current = null;\n };\n }, [\n element,\n eventHandlers\n ]);\n}\n\n\n//# sourceURL=webpack://ReactLeafletDeflate/./node_modules/@react-leaflet/core/lib/events.js?\n}");
|
|
96
|
+
|
|
97
|
+
/***/ }),
|
|
98
|
+
|
|
99
|
+
/***/ "./node_modules/@react-leaflet/core/lib/generic.js":
|
|
100
|
+
/*!*********************************************************!*\
|
|
101
|
+
!*** ./node_modules/@react-leaflet/core/lib/generic.js ***!
|
|
102
|
+
\*********************************************************/
|
|
103
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
104
|
+
|
|
105
|
+
"use strict";
|
|
106
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createControlComponent: () => (/* binding */ createControlComponent),\n/* harmony export */ createLayerComponent: () => (/* binding */ createLayerComponent),\n/* harmony export */ createOverlayComponent: () => (/* binding */ createOverlayComponent),\n/* harmony export */ createPathComponent: () => (/* binding */ createPathComponent),\n/* harmony export */ createTileLayerComponent: () => (/* binding */ createTileLayerComponent)\n/* harmony export */ });\n/* harmony import */ var _component_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./component.js */ \"./node_modules/@react-leaflet/core/lib/component.js\");\n/* harmony import */ var _control_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./control.js */ \"./node_modules/@react-leaflet/core/lib/control.js\");\n/* harmony import */ var _div_overlay_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./div-overlay.js */ \"./node_modules/@react-leaflet/core/lib/div-overlay.js\");\n/* harmony import */ var _element_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./element.js */ \"./node_modules/@react-leaflet/core/lib/element.js\");\n/* harmony import */ var _layer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./layer.js */ \"./node_modules/@react-leaflet/core/lib/layer.js\");\n/* harmony import */ var _path_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./path.js */ \"./node_modules/@react-leaflet/core/lib/path.js\");\n\n\n\n\n\n\nfunction createControlComponent(createInstance) {\n function createElement(props, context) {\n return (0,_element_js__WEBPACK_IMPORTED_MODULE_3__.createElementObject)(createInstance(props), context);\n }\n const useElement = (0,_element_js__WEBPACK_IMPORTED_MODULE_3__.createElementHook)(createElement);\n const useControl = (0,_control_js__WEBPACK_IMPORTED_MODULE_1__.createControlHook)(useElement);\n return (0,_component_js__WEBPACK_IMPORTED_MODULE_0__.createLeafComponent)(useControl);\n}\nfunction createLayerComponent(createElement, updateElement) {\n const useElement = (0,_element_js__WEBPACK_IMPORTED_MODULE_3__.createElementHook)(createElement, updateElement);\n const useLayer = (0,_layer_js__WEBPACK_IMPORTED_MODULE_4__.createLayerHook)(useElement);\n return (0,_component_js__WEBPACK_IMPORTED_MODULE_0__.createContainerComponent)(useLayer);\n}\nfunction createOverlayComponent(createElement, useLifecycle) {\n const useElement = (0,_element_js__WEBPACK_IMPORTED_MODULE_3__.createElementHook)(createElement);\n const useOverlay = (0,_div_overlay_js__WEBPACK_IMPORTED_MODULE_2__.createDivOverlayHook)(useElement, useLifecycle);\n return (0,_component_js__WEBPACK_IMPORTED_MODULE_0__.createDivOverlayComponent)(useOverlay);\n}\nfunction createPathComponent(createElement, updateElement) {\n const useElement = (0,_element_js__WEBPACK_IMPORTED_MODULE_3__.createElementHook)(createElement, updateElement);\n const usePath = (0,_path_js__WEBPACK_IMPORTED_MODULE_5__.createPathHook)(useElement);\n return (0,_component_js__WEBPACK_IMPORTED_MODULE_0__.createContainerComponent)(usePath);\n}\nfunction createTileLayerComponent(createElement, updateElement) {\n const useElement = (0,_element_js__WEBPACK_IMPORTED_MODULE_3__.createElementHook)(createElement, updateElement);\n const useLayer = (0,_layer_js__WEBPACK_IMPORTED_MODULE_4__.createLayerHook)(useElement);\n return (0,_component_js__WEBPACK_IMPORTED_MODULE_0__.createLeafComponent)(useLayer);\n}\n\n\n//# sourceURL=webpack://ReactLeafletDeflate/./node_modules/@react-leaflet/core/lib/generic.js?\n}");
|
|
107
|
+
|
|
108
|
+
/***/ }),
|
|
109
|
+
|
|
110
|
+
/***/ "./node_modules/@react-leaflet/core/lib/grid-layer.js":
|
|
111
|
+
/*!************************************************************!*\
|
|
112
|
+
!*** ./node_modules/@react-leaflet/core/lib/grid-layer.js ***!
|
|
113
|
+
\************************************************************/
|
|
114
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
115
|
+
|
|
116
|
+
"use strict";
|
|
117
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ updateGridLayer: () => (/* binding */ updateGridLayer)\n/* harmony export */ });\nfunction updateGridLayer(layer, props, prevProps) {\n const { opacity, zIndex } = props;\n if (opacity != null && opacity !== prevProps.opacity) {\n layer.setOpacity(opacity);\n }\n if (zIndex != null && zIndex !== prevProps.zIndex) {\n layer.setZIndex(zIndex);\n }\n}\n\n\n//# sourceURL=webpack://ReactLeafletDeflate/./node_modules/@react-leaflet/core/lib/grid-layer.js?\n}");
|
|
118
|
+
|
|
119
|
+
/***/ }),
|
|
120
|
+
|
|
121
|
+
/***/ "./node_modules/@react-leaflet/core/lib/layer.js":
|
|
122
|
+
/*!*******************************************************!*\
|
|
123
|
+
!*** ./node_modules/@react-leaflet/core/lib/layer.js ***!
|
|
124
|
+
\*******************************************************/
|
|
125
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
126
|
+
|
|
127
|
+
"use strict";
|
|
128
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createLayerHook: () => (/* binding */ createLayerHook),\n/* harmony export */ useLayerLifecycle: () => (/* binding */ useLayerLifecycle)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var _attribution_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./attribution.js */ \"./node_modules/@react-leaflet/core/lib/attribution.js\");\n/* harmony import */ var _context_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./context.js */ \"./node_modules/@react-leaflet/core/lib/context.js\");\n/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./events.js */ \"./node_modules/@react-leaflet/core/lib/events.js\");\n/* harmony import */ var _pane_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./pane.js */ \"./node_modules/@react-leaflet/core/lib/pane.js\");\n\n\n\n\n\nfunction useLayerLifecycle(element, context) {\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function addLayer() {\n const container = context.layerContainer ?? context.map;\n container.addLayer(element.instance);\n return function removeLayer() {\n context.layerContainer?.removeLayer(element.instance);\n context.map.removeLayer(element.instance);\n };\n }, [\n context,\n element\n ]);\n}\nfunction createLayerHook(useElement) {\n return function useLayer(props) {\n const context = (0,_context_js__WEBPACK_IMPORTED_MODULE_2__.useLeafletContext)();\n const elementRef = useElement((0,_pane_js__WEBPACK_IMPORTED_MODULE_4__.withPane)(props, context), context);\n (0,_attribution_js__WEBPACK_IMPORTED_MODULE_1__.useAttribution)(context.map, props.attribution);\n (0,_events_js__WEBPACK_IMPORTED_MODULE_3__.useEventHandlers)(elementRef.current, props.eventHandlers);\n useLayerLifecycle(elementRef.current, context);\n return elementRef;\n };\n}\n\n\n//# sourceURL=webpack://ReactLeafletDeflate/./node_modules/@react-leaflet/core/lib/layer.js?\n}");
|
|
129
|
+
|
|
130
|
+
/***/ }),
|
|
131
|
+
|
|
132
|
+
/***/ "./node_modules/@react-leaflet/core/lib/pane.js":
|
|
133
|
+
/*!******************************************************!*\
|
|
134
|
+
!*** ./node_modules/@react-leaflet/core/lib/pane.js ***!
|
|
135
|
+
\******************************************************/
|
|
136
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
137
|
+
|
|
138
|
+
"use strict";
|
|
139
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ withPane: () => (/* binding */ withPane)\n/* harmony export */ });\nfunction withPane(props, context) {\n const pane = props.pane ?? context.pane;\n return pane ? {\n ...props,\n pane\n } : props;\n}\n\n\n//# sourceURL=webpack://ReactLeafletDeflate/./node_modules/@react-leaflet/core/lib/pane.js?\n}");
|
|
140
|
+
|
|
141
|
+
/***/ }),
|
|
142
|
+
|
|
143
|
+
/***/ "./node_modules/@react-leaflet/core/lib/path.js":
|
|
144
|
+
/*!******************************************************!*\
|
|
145
|
+
!*** ./node_modules/@react-leaflet/core/lib/path.js ***!
|
|
146
|
+
\******************************************************/
|
|
147
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
148
|
+
|
|
149
|
+
"use strict";
|
|
150
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createPathHook: () => (/* binding */ createPathHook),\n/* harmony export */ usePathOptions: () => (/* binding */ usePathOptions)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var _context_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./context.js */ \"./node_modules/@react-leaflet/core/lib/context.js\");\n/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./events.js */ \"./node_modules/@react-leaflet/core/lib/events.js\");\n/* harmony import */ var _layer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./layer.js */ \"./node_modules/@react-leaflet/core/lib/layer.js\");\n/* harmony import */ var _pane_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./pane.js */ \"./node_modules/@react-leaflet/core/lib/pane.js\");\n\n\n\n\n\nfunction usePathOptions(element, props) {\n const optionsRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(undefined);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function updatePathOptions() {\n if (props.pathOptions !== optionsRef.current) {\n const options = props.pathOptions ?? {};\n element.instance.setStyle(options);\n optionsRef.current = options;\n }\n }, [\n element,\n props\n ]);\n}\nfunction createPathHook(useElement) {\n return function usePath(props) {\n const context = (0,_context_js__WEBPACK_IMPORTED_MODULE_1__.useLeafletContext)();\n const elementRef = useElement((0,_pane_js__WEBPACK_IMPORTED_MODULE_4__.withPane)(props, context), context);\n (0,_events_js__WEBPACK_IMPORTED_MODULE_2__.useEventHandlers)(elementRef.current, props.eventHandlers);\n (0,_layer_js__WEBPACK_IMPORTED_MODULE_3__.useLayerLifecycle)(elementRef.current, context);\n usePathOptions(elementRef.current, props);\n return elementRef;\n };\n}\n\n\n//# sourceURL=webpack://ReactLeafletDeflate/./node_modules/@react-leaflet/core/lib/path.js?\n}");
|
|
151
|
+
|
|
152
|
+
/***/ }),
|
|
98
153
|
|
|
99
154
|
/***/ "./node_modules/Leaflet.Deflate/dist/L.Deflate.js":
|
|
100
155
|
/*!********************************************************!*\
|
|
101
156
|
!*** ./node_modules/Leaflet.Deflate/dist/L.Deflate.js ***!
|
|
102
157
|
\********************************************************/
|
|
103
|
-
|
|
104
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
158
|
+
/***/ (() => {
|
|
105
159
|
|
|
106
160
|
"use strict";
|
|
107
|
-
eval("L.Deflate=L.FeatureGroup.extend({options:{minSize:10,
|
|
161
|
+
eval("{L.Layer.include({_originalRemove:L.Layer.prototype.remove,remove:function(){if(this.marker){this.marker.remove()}return this._originalRemove()}});L.Map.include({_originalRemoveLayer:L.Map.prototype.removeLayer,removeLayer:function(layer){if(layer.marker){layer.marker.remove()}return this._originalRemoveLayer(layer)}});L.Deflate=L.FeatureGroup.extend({options:{minSize:10,markerOptions:{},markerType:L.marker,greedyCollapse:true},initialize:function(options){L.Util.setOptions(this,options);this._layers=[];this._needsPrepping=[];this._featureLayer=this._getFeatureLayer(options)},_getFeatureLayer:function(){if(this.options.markerLayer){return this.options.markerLayer}return L.featureGroup(this.options)},_getBounds:function(path){if(path instanceof L.Circle){path.addTo(this._map);const bounds=path.getBounds();this._map.removeLayer(path);return bounds}return path.getBounds()},_isCollapsed:function(path,zoom){const bounds=path.computedBounds;const northEastPixels=this._map.project(bounds.getNorthEast(),zoom);const southWestPixels=this._map.project(bounds.getSouthWest(),zoom);const width=Math.abs(northEastPixels.x-southWestPixels.x);const height=Math.abs(southWestPixels.y-northEastPixels.y);if(this.options.greedyCollapse){return height<this.options.minSize||width<this.options.minSize}return height<this.options.minSize&&width<this.options.minSize},_getZoomThreshold:function(path){let zoomThreshold;let zoom=this._map.getZoom();if(this._isCollapsed(path,this._map.getZoom())){while(!zoomThreshold){zoom+=1;if(!this._isCollapsed(path,zoom)){zoomThreshold=zoom-1}}}else{while(!zoomThreshold){zoom-=1;if(this._isCollapsed(path,zoom)){zoomThreshold=zoom}}}return zoomThreshold},_bindInfoTools:function(marker,parentLayer){if(parentLayer._popupHandlersAdded){marker.bindPopup(parentLayer._popup._content,parentLayer._popup.options)}if(parentLayer._tooltipHandlersAdded){marker.bindTooltip(parentLayer._tooltip._content,parentLayer._tooltip.options)}},_bindEvents:function _bindEvents(marker,parentLayer){const events=parentLayer._events;const eventKeys=events?Object.getOwnPropertyNames(events):[];const eventParents=parentLayer._eventParents;const eventParentKeys=eventParents?Object.getOwnPropertyNames(eventParents):[];this._bindInfoTools(marker,parentLayer);for(let i=0,lenI=eventKeys.length;i<lenI;i+=1){const listeners=events[eventKeys[i]];for(let j=0,lenJ=listeners.length;j<lenJ;j+=1){marker.on(eventKeys[i],listeners[j].fn)}}if(!parentLayer._eventParents){return}for(let i=0,lenI=eventParentKeys.length;i<lenI;i+=1){if(!parentLayer._eventParents[eventParentKeys[i]]._map){this._bindEvents(marker,parentLayer._eventParents[eventParentKeys[i]]);this._bindInfoTools(parentLayer,parentLayer._eventParents[eventParentKeys[i]])}}},_makeMarker:function(layer){const allowedMarkerTypes=[L.marker,L.circleMarker];if(allowedMarkerTypes.indexOf(this.options.markerType)===-1){throw new Error(\"Invalid markerType provided. Allowed markerTypes are: L.marker and L.circleMarker\")}const markerOptions=typeof this.options.markerOptions===\"function\"?this.options.markerOptions(layer):this.options.markerOptions;const marker=this.options.markerType(layer.computedBounds.getCenter(),markerOptions);const markerFeature=layer.feature?marker.toGeoJSON():undefined;this._bindEvents(marker,layer);if(markerFeature){markerFeature.properties=layer.feature.properties;marker.feature=markerFeature}return marker},prepLayer:function(layer){if(layer.getBounds){layer.computedBounds=this._getBounds(layer);layer.zoomThreshold=this._getZoomThreshold(layer);layer.marker=this._makeMarker(layer);layer.zoomState=this._map.getZoom()}},_addToMap:function(layer){const layerToAdd=this._map.getZoom()<=layer.zoomThreshold?layer.marker:layer;this._featureLayer.addLayer(layerToAdd)},addLayer:function(layer){const layers=layer instanceof L.FeatureGroup?Object.getOwnPropertyNames(layer._layers):[];if(layers.length){for(let i=0,len=layers.length;i<len;i+=1){this.addLayer(layer._layers[layers[i]])}}else{if(this._map){this.prepLayer(layer);this._addToMap(layer)}else{this._needsPrepping.push(layer)}this._layers[this.getLayerId(layer)]=layer}},removeLayer:function(layer){const layers=layer instanceof L.FeatureGroup?Object.getOwnPropertyNames(layer._layers):[];if(layers.length){for(let i=0,len=layers.length;i<len;i+=1){this.removeLayer(layer._layers[layers[i]])}}else{const layerId=layer in this._layers?layer:this.getLayerId(layer);this._featureLayer.removeLayer(this._layers[layerId]);if(this._layers[layerId].marker){this._featureLayer.removeLayer(this._layers[layerId].marker)}delete this._layers[layerId];const layerIndex=this._needsPrepping.indexOf(this._layers[layerId]);if(layerIndex!==-1){this._needsPrepping.splice(layerIndex,1)}}},clearLayers:function(){this._featureLayer.clearLayers();this._layers=[]},_switchDisplay:function(layer,showMarker){if(showMarker){this._featureLayer.removeLayer(layer);this._featureLayer.addLayer(layer.marker)}else{this._featureLayer.removeLayer(layer.marker);this._featureLayer.addLayer(layer)}},_deflate:function(){const bounds=this._map.getBounds();const endZoom=this._map.getZoom();this.eachLayer((function(layer){if(layer.marker&&layer.zoomState!==endZoom&&layer.computedBounds.intersects(bounds)){this._switchDisplay(layer,endZoom<=layer.zoomThreshold);layer.zoomState=endZoom}}),this)},onAdd:function(map){this._featureLayer.addTo(map);this._map.on(\"zoomend\",this._deflate,this);this._map.on(\"moveend\",this._deflate,this);for(let i=0,len=this._needsPrepping.length;i<len;i+=1){this.addLayer(this._needsPrepping[i])}this._needsPrepping=[];this._deflate()},onRemove:function(map){map.removeLayer(this._featureLayer);this._map.off(\"zoomend\",this._deflate,this);this._map.off(\"moveend\",this._deflate,this)}});L.deflate=function(options){return new L.Deflate(options)};\n\n//# sourceURL=webpack://ReactLeafletDeflate/./node_modules/Leaflet.Deflate/dist/L.Deflate.js?\n}");
|
|
108
162
|
|
|
109
163
|
/***/ }),
|
|
110
164
|
|
|
@@ -112,58 +166,154 @@ eval("L.Deflate=L.FeatureGroup.extend({options:{minSize:10,markerCluster:false,m
|
|
|
112
166
|
/*!******************************************************************************!*\
|
|
113
167
|
!*** ./node_modules/leaflet.markercluster/dist/leaflet.markercluster-src.js ***!
|
|
114
168
|
\******************************************************************************/
|
|
115
|
-
|
|
116
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
169
|
+
/***/ (function(__unused_webpack_module, exports) {
|
|
117
170
|
|
|
118
|
-
eval("/*\n * Leaflet.markercluster 1.4.1+master.94f9815,\n * Provides Beautiful Animated Marker Clustering functionality for Leaflet, a JS library for interactive maps.\n * https://github.com/Leaflet/Leaflet.markercluster\n * (c) 2012-2017, Dave Leaver, smartrak\n */\n(function (global, factory) {\n\t true ? factory(exports) :\n\tundefined;\n}(this, (function (exports) { 'use strict';\n\n/*\r\n * L.MarkerClusterGroup extends L.FeatureGroup by clustering the markers contained within\r\n */\r\n\r\nvar MarkerClusterGroup = L.MarkerClusterGroup = L.FeatureGroup.extend({\r\n\r\n\toptions: {\r\n\t\tmaxClusterRadius: 80, //A cluster will cover at most this many pixels from its center\r\n\t\ticonCreateFunction: null,\r\n\t\tclusterPane: L.Marker.prototype.options.pane,\r\n\r\n\t\tspiderfyOnMaxZoom: true,\r\n\t\tshowCoverageOnHover: true,\r\n\t\tzoomToBoundsOnClick: true,\r\n\t\tsingleMarkerMode: false,\r\n\r\n\t\tdisableClusteringAtZoom: null,\r\n\r\n\t\t// Setting this to false prevents the removal of any clusters outside of the viewpoint, which\r\n\t\t// is the default behaviour for performance reasons.\r\n\t\tremoveOutsideVisibleBounds: true,\r\n\r\n\t\t// Set to false to disable all animations (zoom and spiderfy).\r\n\t\t// If false, option animateAddingMarkers below has no effect.\r\n\t\t// If L.DomUtil.TRANSITION is falsy, this option has no effect.\r\n\t\tanimate: true,\r\n\r\n\t\t//Whether to animate adding markers after adding the MarkerClusterGroup to the map\r\n\t\t// If you are adding individual markers set to true, if adding bulk markers leave false for massive performance gains.\r\n\t\tanimateAddingMarkers: false,\r\n\r\n\t\t//Increase to increase the distance away that spiderfied markers appear from the center\r\n\t\tspiderfyDistanceMultiplier: 1,\r\n\r\n\t\t// Make it possible to specify a polyline options on a spider leg\r\n\t\tspiderLegPolylineOptions: { weight: 1.5, color: '#222', opacity: 0.5 },\r\n\r\n\t\t// When bulk adding layers, adds markers in chunks. Means addLayers may not add all the layers in the call, others will be loaded during setTimeouts\r\n\t\tchunkedLoading: false,\r\n\t\tchunkInterval: 200, // process markers for a maximum of ~ n milliseconds (then trigger the chunkProgress callback)\r\n\t\tchunkDelay: 50, // at the end of each interval, give n milliseconds back to system/browser\r\n\t\tchunkProgress: null, // progress callback: function(processed, total, elapsed) (e.g. for a progress indicator)\r\n\r\n\t\t//Options to pass to the L.Polygon constructor\r\n\t\tpolygonOptions: {}\r\n\t},\r\n\r\n\tinitialize: function (options) {\r\n\t\tL.Util.setOptions(this, options);\r\n\t\tif (!this.options.iconCreateFunction) {\r\n\t\t\tthis.options.iconCreateFunction = this._defaultIconCreateFunction;\r\n\t\t}\r\n\r\n\t\tthis._featureGroup = L.featureGroup();\r\n\t\tthis._featureGroup.addEventParent(this);\r\n\r\n\t\tthis._nonPointGroup = L.featureGroup();\r\n\t\tthis._nonPointGroup.addEventParent(this);\r\n\r\n\t\tthis._inZoomAnimation = 0;\r\n\t\tthis._needsClustering = [];\r\n\t\tthis._needsRemoving = []; //Markers removed while we aren't on the map need to be kept track of\r\n\t\t//The bounds of the currently shown area (from _getExpandedVisibleBounds) Updated on zoom/move\r\n\t\tthis._currentShownBounds = null;\r\n\r\n\t\tthis._queue = [];\r\n\r\n\t\tthis._childMarkerEventHandlers = {\r\n\t\t\t'dragstart': this._childMarkerDragStart,\r\n\t\t\t'move': this._childMarkerMoved,\r\n\t\t\t'dragend': this._childMarkerDragEnd,\r\n\t\t};\r\n\r\n\t\t// Hook the appropriate animation methods.\r\n\t\tvar animate = L.DomUtil.TRANSITION && this.options.animate;\r\n\t\tL.extend(this, animate ? this._withAnimation : this._noAnimation);\r\n\t\t// Remember which MarkerCluster class to instantiate (animated or not).\r\n\t\tthis._markerCluster = animate ? L.MarkerCluster : L.MarkerClusterNonAnimated;\r\n\t},\r\n\r\n\taddLayer: function (layer) {\r\n\r\n\t\tif (layer instanceof L.LayerGroup) {\r\n\t\t\treturn this.addLayers([layer]);\r\n\t\t}\r\n\r\n\t\t//Don't cluster non point data\r\n\t\tif (!layer.getLatLng) {\r\n\t\t\tthis._nonPointGroup.addLayer(layer);\r\n\t\t\tthis.fire('layeradd', { layer: layer });\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tif (!this._map) {\r\n\t\t\tthis._needsClustering.push(layer);\r\n\t\t\tthis.fire('layeradd', { layer: layer });\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tif (this.hasLayer(layer)) {\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\r\n\t\t//If we have already clustered we'll need to add this one to a cluster\r\n\r\n\t\tif (this._unspiderfy) {\r\n\t\t\tthis._unspiderfy();\r\n\t\t}\r\n\r\n\t\tthis._addLayer(layer, this._maxZoom);\r\n\t\tthis.fire('layeradd', { layer: layer });\r\n\r\n\t\t// Refresh bounds and weighted positions.\r\n\t\tthis._topClusterLevel._recalculateBounds();\r\n\r\n\t\tthis._refreshClustersIcons();\r\n\r\n\t\t//Work out what is visible\r\n\t\tvar visibleLayer = layer,\r\n\t\t currentZoom = this._zoom;\r\n\t\tif (layer.__parent) {\r\n\t\t\twhile (visibleLayer.__parent._zoom >= currentZoom) {\r\n\t\t\t\tvisibleLayer = visibleLayer.__parent;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this._currentShownBounds.contains(visibleLayer.getLatLng())) {\r\n\t\t\tif (this.options.animateAddingMarkers) {\r\n\t\t\t\tthis._animationAddLayer(layer, visibleLayer);\r\n\t\t\t} else {\r\n\t\t\t\tthis._animationAddLayerNonAnimated(layer, visibleLayer);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\tremoveLayer: function (layer) {\r\n\r\n\t\tif (layer instanceof L.LayerGroup) {\r\n\t\t\treturn this.removeLayers([layer]);\r\n\t\t}\r\n\r\n\t\t//Non point layers\r\n\t\tif (!layer.getLatLng) {\r\n\t\t\tthis._nonPointGroup.removeLayer(layer);\r\n\t\t\tthis.fire('layerremove', { layer: layer });\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tif (!this._map) {\r\n\t\t\tif (!this._arraySplice(this._needsClustering, layer) && this.hasLayer(layer)) {\r\n\t\t\t\tthis._needsRemoving.push({ layer: layer, latlng: layer._latlng });\r\n\t\t\t}\r\n\t\t\tthis.fire('layerremove', { layer: layer });\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tif (!layer.__parent) {\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tif (this._unspiderfy) {\r\n\t\t\tthis._unspiderfy();\r\n\t\t\tthis._unspiderfyLayer(layer);\r\n\t\t}\r\n\r\n\t\t//Remove the marker from clusters\r\n\t\tthis._removeLayer(layer, true);\r\n\t\tthis.fire('layerremove', { layer: layer });\r\n\r\n\t\t// Refresh bounds and weighted positions.\r\n\t\tthis._topClusterLevel._recalculateBounds();\r\n\r\n\t\tthis._refreshClustersIcons();\r\n\r\n\t\tlayer.off(this._childMarkerEventHandlers, this);\r\n\r\n\t\tif (this._featureGroup.hasLayer(layer)) {\r\n\t\t\tthis._featureGroup.removeLayer(layer);\r\n\t\t\tif (layer.clusterShow) {\r\n\t\t\t\tlayer.clusterShow();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t//Takes an array of markers and adds them in bulk\r\n\taddLayers: function (layersArray, skipLayerAddEvent) {\r\n\t\tif (!L.Util.isArray(layersArray)) {\r\n\t\t\treturn this.addLayer(layersArray);\r\n\t\t}\r\n\r\n\t\tvar fg = this._featureGroup,\r\n\t\t npg = this._nonPointGroup,\r\n\t\t chunked = this.options.chunkedLoading,\r\n\t\t chunkInterval = this.options.chunkInterval,\r\n\t\t chunkProgress = this.options.chunkProgress,\r\n\t\t l = layersArray.length,\r\n\t\t offset = 0,\r\n\t\t originalArray = true,\r\n\t\t m;\r\n\r\n\t\tif (this._map) {\r\n\t\t\tvar started = (new Date()).getTime();\r\n\t\t\tvar process = L.bind(function () {\r\n\t\t\t\tvar start = (new Date()).getTime();\r\n\t\t\t\tfor (; offset < l; offset++) {\r\n\t\t\t\t\tif (chunked && offset % 200 === 0) {\r\n\t\t\t\t\t\t// every couple hundred markers, instrument the time elapsed since processing started:\r\n\t\t\t\t\t\tvar elapsed = (new Date()).getTime() - start;\r\n\t\t\t\t\t\tif (elapsed > chunkInterval) {\r\n\t\t\t\t\t\t\tbreak; // been working too hard, time to take a break :-)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tm = layersArray[offset];\r\n\r\n\t\t\t\t\t// Group of layers, append children to layersArray and skip.\r\n\t\t\t\t\t// Side effects:\r\n\t\t\t\t\t// - Total increases, so chunkProgress ratio jumps backward.\r\n\t\t\t\t\t// - Groups are not included in this group, only their non-group child layers (hasLayer).\r\n\t\t\t\t\t// Changing array length while looping does not affect performance in current browsers:\r\n\t\t\t\t\t// http://jsperf.com/for-loop-changing-length/6\r\n\t\t\t\t\tif (m instanceof L.LayerGroup) {\r\n\t\t\t\t\t\tif (originalArray) {\r\n\t\t\t\t\t\t\tlayersArray = layersArray.slice();\r\n\t\t\t\t\t\t\toriginalArray = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis._extractNonGroupLayers(m, layersArray);\r\n\t\t\t\t\t\tl = layersArray.length;\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//Not point data, can't be clustered\r\n\t\t\t\t\tif (!m.getLatLng) {\r\n\t\t\t\t\t\tnpg.addLayer(m);\r\n\t\t\t\t\t\tif (!skipLayerAddEvent) {\r\n\t\t\t\t\t\t\tthis.fire('layeradd', { layer: m });\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (this.hasLayer(m)) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis._addLayer(m, this._maxZoom);\r\n\t\t\t\t\tif (!skipLayerAddEvent) {\r\n\t\t\t\t\t\tthis.fire('layeradd', { layer: m });\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//If we just made a cluster of size 2 then we need to remove the other marker from the map (if it is) or we never will\r\n\t\t\t\t\tif (m.__parent) {\r\n\t\t\t\t\t\tif (m.__parent.getChildCount() === 2) {\r\n\t\t\t\t\t\t\tvar markers = m.__parent.getAllChildMarkers(),\r\n\t\t\t\t\t\t\t otherMarker = markers[0] === m ? markers[1] : markers[0];\r\n\t\t\t\t\t\t\tfg.removeLayer(otherMarker);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (chunkProgress) {\r\n\t\t\t\t\t// report progress and time elapsed:\r\n\t\t\t\t\tchunkProgress(offset, l, (new Date()).getTime() - started);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Completed processing all markers.\r\n\t\t\t\tif (offset === l) {\r\n\r\n\t\t\t\t\t// Refresh bounds and weighted positions.\r\n\t\t\t\t\tthis._topClusterLevel._recalculateBounds();\r\n\r\n\t\t\t\t\tthis._refreshClustersIcons();\r\n\r\n\t\t\t\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsetTimeout(process, this.options.chunkDelay);\r\n\t\t\t\t}\r\n\t\t\t}, this);\r\n\r\n\t\t\tprocess();\r\n\t\t} else {\r\n\t\t\tvar needsClustering = this._needsClustering;\r\n\r\n\t\t\tfor (; offset < l; offset++) {\r\n\t\t\t\tm = layersArray[offset];\r\n\r\n\t\t\t\t// Group of layers, append children to layersArray and skip.\r\n\t\t\t\tif (m instanceof L.LayerGroup) {\r\n\t\t\t\t\tif (originalArray) {\r\n\t\t\t\t\t\tlayersArray = layersArray.slice();\r\n\t\t\t\t\t\toriginalArray = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis._extractNonGroupLayers(m, layersArray);\r\n\t\t\t\t\tl = layersArray.length;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Not point data, can't be clustered\r\n\t\t\t\tif (!m.getLatLng) {\r\n\t\t\t\t\tnpg.addLayer(m);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.hasLayer(m)) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tneedsClustering.push(m);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t//Takes an array of markers and removes them in bulk\r\n\tremoveLayers: function (layersArray) {\r\n\t\tvar i, m,\r\n\t\t l = layersArray.length,\r\n\t\t fg = this._featureGroup,\r\n\t\t npg = this._nonPointGroup,\r\n\t\t originalArray = true;\r\n\r\n\t\tif (!this._map) {\r\n\t\t\tfor (i = 0; i < l; i++) {\r\n\t\t\t\tm = layersArray[i];\r\n\r\n\t\t\t\t// Group of layers, append children to layersArray and skip.\r\n\t\t\t\tif (m instanceof L.LayerGroup) {\r\n\t\t\t\t\tif (originalArray) {\r\n\t\t\t\t\t\tlayersArray = layersArray.slice();\r\n\t\t\t\t\t\toriginalArray = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis._extractNonGroupLayers(m, layersArray);\r\n\t\t\t\t\tl = layersArray.length;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._arraySplice(this._needsClustering, m);\r\n\t\t\t\tnpg.removeLayer(m);\r\n\t\t\t\tif (this.hasLayer(m)) {\r\n\t\t\t\t\tthis._needsRemoving.push({ layer: m, latlng: m._latlng });\r\n\t\t\t\t}\r\n\t\t\t\tthis.fire('layerremove', { layer: m });\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tif (this._unspiderfy) {\r\n\t\t\tthis._unspiderfy();\r\n\r\n\t\t\t// Work on a copy of the array, so that next loop is not affected.\r\n\t\t\tvar layersArray2 = layersArray.slice(),\r\n\t\t\t l2 = l;\r\n\t\t\tfor (i = 0; i < l2; i++) {\r\n\t\t\t\tm = layersArray2[i];\r\n\r\n\t\t\t\t// Group of layers, append children to layersArray and skip.\r\n\t\t\t\tif (m instanceof L.LayerGroup) {\r\n\t\t\t\t\tthis._extractNonGroupLayers(m, layersArray2);\r\n\t\t\t\t\tl2 = layersArray2.length;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._unspiderfyLayer(m);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (i = 0; i < l; i++) {\r\n\t\t\tm = layersArray[i];\r\n\r\n\t\t\t// Group of layers, append children to layersArray and skip.\r\n\t\t\tif (m instanceof L.LayerGroup) {\r\n\t\t\t\tif (originalArray) {\r\n\t\t\t\t\tlayersArray = layersArray.slice();\r\n\t\t\t\t\toriginalArray = false;\r\n\t\t\t\t}\r\n\t\t\t\tthis._extractNonGroupLayers(m, layersArray);\r\n\t\t\t\tl = layersArray.length;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif (!m.__parent) {\r\n\t\t\t\tnpg.removeLayer(m);\r\n\t\t\t\tthis.fire('layerremove', { layer: m });\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tthis._removeLayer(m, true, true);\r\n\t\t\tthis.fire('layerremove', { layer: m });\r\n\r\n\t\t\tif (fg.hasLayer(m)) {\r\n\t\t\t\tfg.removeLayer(m);\r\n\t\t\t\tif (m.clusterShow) {\r\n\t\t\t\t\tm.clusterShow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Refresh bounds and weighted positions.\r\n\t\tthis._topClusterLevel._recalculateBounds();\r\n\r\n\t\tthis._refreshClustersIcons();\r\n\r\n\t\t//Fix up the clusters and markers on the map\r\n\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds);\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t//Removes all layers from the MarkerClusterGroup\r\n\tclearLayers: function () {\r\n\t\t//Need our own special implementation as the LayerGroup one doesn't work for us\r\n\r\n\t\t//If we aren't on the map (yet), blow away the markers we know of\r\n\t\tif (!this._map) {\r\n\t\t\tthis._needsClustering = [];\r\n\t\t\tthis._needsRemoving = [];\r\n\t\t\tdelete this._gridClusters;\r\n\t\t\tdelete this._gridUnclustered;\r\n\t\t}\r\n\r\n\t\tif (this._noanimationUnspiderfy) {\r\n\t\t\tthis._noanimationUnspiderfy();\r\n\t\t}\r\n\r\n\t\t//Remove all the visible layers\r\n\t\tthis._featureGroup.clearLayers();\r\n\t\tthis._nonPointGroup.clearLayers();\r\n\r\n\t\tthis.eachLayer(function (marker) {\r\n\t\t\tmarker.off(this._childMarkerEventHandlers, this);\r\n\t\t\tdelete marker.__parent;\r\n\t\t}, this);\r\n\r\n\t\tif (this._map) {\r\n\t\t\t//Reset _topClusterLevel and the DistanceGrids\r\n\t\t\tthis._generateInitialClusters();\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t//Override FeatureGroup.getBounds as it doesn't work\r\n\tgetBounds: function () {\r\n\t\tvar bounds = new L.LatLngBounds();\r\n\r\n\t\tif (this._topClusterLevel) {\r\n\t\t\tbounds.extend(this._topClusterLevel._bounds);\r\n\t\t}\r\n\r\n\t\tfor (var i = this._needsClustering.length - 1; i >= 0; i--) {\r\n\t\t\tbounds.extend(this._needsClustering[i].getLatLng());\r\n\t\t}\r\n\r\n\t\tbounds.extend(this._nonPointGroup.getBounds());\r\n\r\n\t\treturn bounds;\r\n\t},\r\n\r\n\t//Overrides LayerGroup.eachLayer\r\n\teachLayer: function (method, context) {\r\n\t\tvar markers = this._needsClustering.slice(),\r\n\t\t\tneedsRemoving = this._needsRemoving,\r\n\t\t\tthisNeedsRemoving, i, j;\r\n\r\n\t\tif (this._topClusterLevel) {\r\n\t\t\tthis._topClusterLevel.getAllChildMarkers(markers);\r\n\t\t}\r\n\r\n\t\tfor (i = markers.length - 1; i >= 0; i--) {\r\n\t\t\tthisNeedsRemoving = true;\r\n\r\n\t\t\tfor (j = needsRemoving.length - 1; j >= 0; j--) {\r\n\t\t\t\tif (needsRemoving[j].layer === markers[i]) {\r\n\t\t\t\t\tthisNeedsRemoving = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (thisNeedsRemoving) {\r\n\t\t\t\tmethod.call(context, markers[i]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._nonPointGroup.eachLayer(method, context);\r\n\t},\r\n\r\n\t//Overrides LayerGroup.getLayers\r\n\tgetLayers: function () {\r\n\t\tvar layers = [];\r\n\t\tthis.eachLayer(function (l) {\r\n\t\t\tlayers.push(l);\r\n\t\t});\r\n\t\treturn layers;\r\n\t},\r\n\r\n\t//Overrides LayerGroup.getLayer, WARNING: Really bad performance\r\n\tgetLayer: function (id) {\r\n\t\tvar result = null;\r\n\r\n\t\tid = parseInt(id, 10);\r\n\r\n\t\tthis.eachLayer(function (l) {\r\n\t\t\tif (L.stamp(l) === id) {\r\n\t\t\t\tresult = l;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn result;\r\n\t},\r\n\r\n\t//Returns true if the given layer is in this MarkerClusterGroup\r\n\thasLayer: function (layer) {\r\n\t\tif (!layer) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tvar i, anArray = this._needsClustering;\r\n\r\n\t\tfor (i = anArray.length - 1; i >= 0; i--) {\r\n\t\t\tif (anArray[i] === layer) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tanArray = this._needsRemoving;\r\n\t\tfor (i = anArray.length - 1; i >= 0; i--) {\r\n\t\t\tif (anArray[i].layer === layer) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn !!(layer.__parent && layer.__parent._group === this) || this._nonPointGroup.hasLayer(layer);\r\n\t},\r\n\r\n\t//Zoom down to show the given layer (spiderfying if necessary) then calls the callback\r\n\tzoomToShowLayer: function (layer, callback) {\r\n\r\n\t\tif (typeof callback !== 'function') {\r\n\t\t\tcallback = function () {};\r\n\t\t}\r\n\r\n\t\tvar showMarker = function () {\r\n\t\t\tif ((layer._icon || layer.__parent._icon) && !this._inZoomAnimation) {\r\n\t\t\t\tthis._map.off('moveend', showMarker, this);\r\n\t\t\t\tthis.off('animationend', showMarker, this);\r\n\r\n\t\t\t\tif (layer._icon) {\r\n\t\t\t\t\tcallback();\r\n\t\t\t\t} else if (layer.__parent._icon) {\r\n\t\t\t\t\tthis.once('spiderfied', callback, this);\r\n\t\t\t\t\tlayer.__parent.spiderfy();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tif (layer._icon && this._map.getBounds().contains(layer.getLatLng())) {\r\n\t\t\t//Layer is visible ond on screen, immediate return\r\n\t\t\tcallback();\r\n\t\t} else if (layer.__parent._zoom < Math.round(this._map._zoom)) {\r\n\t\t\t//Layer should be visible at this zoom level. It must not be on screen so just pan over to it\r\n\t\t\tthis._map.on('moveend', showMarker, this);\r\n\t\t\tthis._map.panTo(layer.getLatLng());\r\n\t\t} else {\r\n\t\t\tthis._map.on('moveend', showMarker, this);\r\n\t\t\tthis.on('animationend', showMarker, this);\r\n\t\t\tlayer.__parent.zoomToBounds();\r\n\t\t}\r\n\t},\r\n\r\n\t//Overrides FeatureGroup.onAdd\r\n\tonAdd: function (map) {\r\n\t\tthis._map = map;\r\n\t\tvar i, l, layer;\r\n\r\n\t\tif (!isFinite(this._map.getMaxZoom())) {\r\n\t\t\tthrow \"Map has no maxZoom specified\";\r\n\t\t}\r\n\r\n\t\tthis._featureGroup.addTo(map);\r\n\t\tthis._nonPointGroup.addTo(map);\r\n\r\n\t\tif (!this._gridClusters) {\r\n\t\t\tthis._generateInitialClusters();\r\n\t\t}\r\n\r\n\t\tthis._maxLat = map.options.crs.projection.MAX_LATITUDE;\r\n\r\n\t\t//Restore all the positions as they are in the MCG before removing them\r\n\t\tfor (i = 0, l = this._needsRemoving.length; i < l; i++) {\r\n\t\t\tlayer = this._needsRemoving[i];\r\n\t\t\tlayer.newlatlng = layer.layer._latlng;\r\n\t\t\tlayer.layer._latlng = layer.latlng;\r\n\t\t}\r\n\t\t//Remove them, then restore their new positions\r\n\t\tfor (i = 0, l = this._needsRemoving.length; i < l; i++) {\r\n\t\t\tlayer = this._needsRemoving[i];\r\n\t\t\tthis._removeLayer(layer.layer, true);\r\n\t\t\tlayer.layer._latlng = layer.newlatlng;\r\n\t\t}\r\n\t\tthis._needsRemoving = [];\r\n\r\n\t\t//Remember the current zoom level and bounds\r\n\t\tthis._zoom = Math.round(this._map._zoom);\r\n\t\tthis._currentShownBounds = this._getExpandedVisibleBounds();\r\n\r\n\t\tthis._map.on('zoomend', this._zoomEnd, this);\r\n\t\tthis._map.on('moveend', this._moveEnd, this);\r\n\r\n\t\tif (this._spiderfierOnAdd) { //TODO FIXME: Not sure how to have spiderfier add something on here nicely\r\n\t\t\tthis._spiderfierOnAdd();\r\n\t\t}\r\n\r\n\t\tthis._bindEvents();\r\n\r\n\t\t//Actually add our markers to the map:\r\n\t\tl = this._needsClustering;\r\n\t\tthis._needsClustering = [];\r\n\t\tthis.addLayers(l, true);\r\n\t},\r\n\r\n\t//Overrides FeatureGroup.onRemove\r\n\tonRemove: function (map) {\r\n\t\tmap.off('zoomend', this._zoomEnd, this);\r\n\t\tmap.off('moveend', this._moveEnd, this);\r\n\r\n\t\tthis._unbindEvents();\r\n\r\n\t\t//In case we are in a cluster animation\r\n\t\tthis._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', '');\r\n\r\n\t\tif (this._spiderfierOnRemove) { //TODO FIXME: Not sure how to have spiderfier add something on here nicely\r\n\t\t\tthis._spiderfierOnRemove();\r\n\t\t}\r\n\r\n\t\tdelete this._maxLat;\r\n\r\n\t\t//Clean up all the layers we added to the map\r\n\t\tthis._hideCoverage();\r\n\t\tthis._featureGroup.remove();\r\n\t\tthis._nonPointGroup.remove();\r\n\r\n\t\tthis._featureGroup.clearLayers();\r\n\r\n\t\tthis._map = null;\r\n\t},\r\n\r\n\tgetVisibleParent: function (marker) {\r\n\t\tvar vMarker = marker;\r\n\t\twhile (vMarker && !vMarker._icon) {\r\n\t\t\tvMarker = vMarker.__parent;\r\n\t\t}\r\n\t\treturn vMarker || null;\r\n\t},\r\n\r\n\t//Remove the given object from the given array\r\n\t_arraySplice: function (anArray, obj) {\r\n\t\tfor (var i = anArray.length - 1; i >= 0; i--) {\r\n\t\t\tif (anArray[i] === obj) {\r\n\t\t\t\tanArray.splice(i, 1);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Removes a marker from all _gridUnclustered zoom levels, starting at the supplied zoom.\r\n\t * @param marker to be removed from _gridUnclustered.\r\n\t * @param z integer bottom start zoom level (included)\r\n\t * @private\r\n\t */\r\n\t_removeFromGridUnclustered: function (marker, z) {\r\n\t\tvar map = this._map,\r\n\t\t gridUnclustered = this._gridUnclustered,\r\n\t\t\tminZoom = Math.floor(this._map.getMinZoom());\r\n\r\n\t\tfor (; z >= minZoom; z--) {\r\n\t\t\tif (!gridUnclustered[z].removeObject(marker, map.project(marker.getLatLng(), z))) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_childMarkerDragStart: function (e) {\r\n\t\te.target.__dragStart = e.target._latlng;\r\n\t},\r\n\r\n\t_childMarkerMoved: function (e) {\r\n\t\tif (!this._ignoreMove && !e.target.__dragStart) {\r\n\t\t\tvar isPopupOpen = e.target._popup && e.target._popup.isOpen();\r\n\r\n\t\t\tthis._moveChild(e.target, e.oldLatLng, e.latlng);\r\n\r\n\t\t\tif (isPopupOpen) {\r\n\t\t\t\te.target.openPopup();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_moveChild: function (layer, from, to) {\r\n\t\tlayer._latlng = from;\r\n\t\tthis.removeLayer(layer);\r\n\r\n\t\tlayer._latlng = to;\r\n\t\tthis.addLayer(layer);\r\n\t},\r\n\r\n\t_childMarkerDragEnd: function (e) {\r\n\t\tvar dragStart = e.target.__dragStart;\r\n\t\tdelete e.target.__dragStart;\r\n\t\tif (dragStart) {\r\n\t\t\tthis._moveChild(e.target, dragStart, e.target._latlng);\r\n\t\t}\t\t\r\n\t},\r\n\r\n\r\n\t//Internal function for removing a marker from everything.\r\n\t//dontUpdateMap: set to true if you will handle updating the map manually (for bulk functions)\r\n\t_removeLayer: function (marker, removeFromDistanceGrid, dontUpdateMap) {\r\n\t\tvar gridClusters = this._gridClusters,\r\n\t\t\tgridUnclustered = this._gridUnclustered,\r\n\t\t\tfg = this._featureGroup,\r\n\t\t\tmap = this._map,\r\n\t\t\tminZoom = Math.floor(this._map.getMinZoom());\r\n\r\n\t\t//Remove the marker from distance clusters it might be in\r\n\t\tif (removeFromDistanceGrid) {\r\n\t\t\tthis._removeFromGridUnclustered(marker, this._maxZoom);\r\n\t\t}\r\n\r\n\t\t//Work our way up the clusters removing them as we go if required\r\n\t\tvar cluster = marker.__parent,\r\n\t\t\tmarkers = cluster._markers,\r\n\t\t\totherMarker;\r\n\r\n\t\t//Remove the marker from the immediate parents marker list\r\n\t\tthis._arraySplice(markers, marker);\r\n\r\n\t\twhile (cluster) {\r\n\t\t\tcluster._childCount--;\r\n\t\t\tcluster._boundsNeedUpdate = true;\r\n\r\n\t\t\tif (cluster._zoom < minZoom) {\r\n\t\t\t\t//Top level, do nothing\r\n\t\t\t\tbreak;\r\n\t\t\t} else if (removeFromDistanceGrid && cluster._childCount <= 1) { //Cluster no longer required\r\n\t\t\t\t//We need to push the other marker up to the parent\r\n\t\t\t\totherMarker = cluster._markers[0] === marker ? cluster._markers[1] : cluster._markers[0];\r\n\r\n\t\t\t\t//Update distance grid\r\n\t\t\t\tgridClusters[cluster._zoom].removeObject(cluster, map.project(cluster._cLatLng, cluster._zoom));\r\n\t\t\t\tgridUnclustered[cluster._zoom].addObject(otherMarker, map.project(otherMarker.getLatLng(), cluster._zoom));\r\n\r\n\t\t\t\t//Move otherMarker up to parent\r\n\t\t\t\tthis._arraySplice(cluster.__parent._childClusters, cluster);\r\n\t\t\t\tcluster.__parent._markers.push(otherMarker);\r\n\t\t\t\totherMarker.__parent = cluster.__parent;\r\n\r\n\t\t\t\tif (cluster._icon) {\r\n\t\t\t\t\t//Cluster is currently on the map, need to put the marker on the map instead\r\n\t\t\t\t\tfg.removeLayer(cluster);\r\n\t\t\t\t\tif (!dontUpdateMap) {\r\n\t\t\t\t\t\tfg.addLayer(otherMarker);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tcluster._iconNeedsUpdate = true;\r\n\t\t\t}\r\n\r\n\t\t\tcluster = cluster.__parent;\r\n\t\t}\r\n\r\n\t\tdelete marker.__parent;\r\n\t},\r\n\r\n\t_isOrIsParent: function (el, oel) {\r\n\t\twhile (oel) {\r\n\t\t\tif (el === oel) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\toel = oel.parentNode;\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\t//Override L.Evented.fire\r\n\tfire: function (type, data, propagate) {\r\n\t\tif (data && data.layer instanceof L.MarkerCluster) {\r\n\t\t\t//Prevent multiple clustermouseover/off events if the icon is made up of stacked divs (Doesn't work in ie <= 8, no relatedTarget)\r\n\t\t\tif (data.originalEvent && this._isOrIsParent(data.layer._icon, data.originalEvent.relatedTarget)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\ttype = 'cluster' + type;\r\n\t\t}\r\n\r\n\t\tL.FeatureGroup.prototype.fire.call(this, type, data, propagate);\r\n\t},\r\n\r\n\t//Override L.Evented.listens\r\n\tlistens: function (type, propagate) {\r\n\t\treturn L.FeatureGroup.prototype.listens.call(this, type, propagate) || L.FeatureGroup.prototype.listens.call(this, 'cluster' + type, propagate);\r\n\t},\r\n\r\n\t//Default functionality\r\n\t_defaultIconCreateFunction: function (cluster) {\r\n\t\tvar childCount = cluster.getChildCount();\r\n\r\n\t\tvar c = ' marker-cluster-';\r\n\t\tif (childCount < 10) {\r\n\t\t\tc += 'small';\r\n\t\t} else if (childCount < 100) {\r\n\t\t\tc += 'medium';\r\n\t\t} else {\r\n\t\t\tc += 'large';\r\n\t\t}\r\n\r\n\t\treturn new L.DivIcon({ html: '<div><span>' + childCount + '</span></div>', className: 'marker-cluster' + c, iconSize: new L.Point(40, 40) });\r\n\t},\r\n\r\n\t_bindEvents: function () {\r\n\t\tvar map = this._map,\r\n\t\t spiderfyOnMaxZoom = this.options.spiderfyOnMaxZoom,\r\n\t\t showCoverageOnHover = this.options.showCoverageOnHover,\r\n\t\t zoomToBoundsOnClick = this.options.zoomToBoundsOnClick;\r\n\r\n\t\t//Zoom on cluster click or spiderfy if we are at the lowest level\r\n\t\tif (spiderfyOnMaxZoom || zoomToBoundsOnClick) {\r\n\t\t\tthis.on('clusterclick', this._zoomOrSpiderfy, this);\r\n\t\t}\r\n\r\n\t\t//Show convex hull (boundary) polygon on mouse over\r\n\t\tif (showCoverageOnHover) {\r\n\t\t\tthis.on('clustermouseover', this._showCoverage, this);\r\n\t\t\tthis.on('clustermouseout', this._hideCoverage, this);\r\n\t\t\tmap.on('zoomend', this._hideCoverage, this);\r\n\t\t}\r\n\t},\r\n\r\n\t_zoomOrSpiderfy: function (e) {\r\n\t\tvar cluster = e.layer,\r\n\t\t bottomCluster = cluster;\r\n\r\n\t\twhile (bottomCluster._childClusters.length === 1) {\r\n\t\t\tbottomCluster = bottomCluster._childClusters[0];\r\n\t\t}\r\n\r\n\t\tif (bottomCluster._zoom === this._maxZoom &&\r\n\t\t\tbottomCluster._childCount === cluster._childCount &&\r\n\t\t\tthis.options.spiderfyOnMaxZoom) {\r\n\r\n\t\t\t// All child markers are contained in a single cluster from this._maxZoom to this cluster.\r\n\t\t\tcluster.spiderfy();\r\n\t\t} else if (this.options.zoomToBoundsOnClick) {\r\n\t\t\tcluster.zoomToBounds();\r\n\t\t}\r\n\r\n\t\t// Focus the map again for keyboard users.\r\n\t\tif (e.originalEvent && e.originalEvent.keyCode === 13) {\r\n\t\t\tthis._map._container.focus();\r\n\t\t}\r\n\t},\r\n\r\n\t_showCoverage: function (e) {\r\n\t\tvar map = this._map;\r\n\t\tif (this._inZoomAnimation) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (this._shownPolygon) {\r\n\t\t\tmap.removeLayer(this._shownPolygon);\r\n\t\t}\r\n\t\tif (e.layer.getChildCount() > 2 && e.layer !== this._spiderfied) {\r\n\t\t\tthis._shownPolygon = new L.Polygon(e.layer.getConvexHull(), this.options.polygonOptions);\r\n\t\t\tmap.addLayer(this._shownPolygon);\r\n\t\t}\r\n\t},\r\n\r\n\t_hideCoverage: function () {\r\n\t\tif (this._shownPolygon) {\r\n\t\t\tthis._map.removeLayer(this._shownPolygon);\r\n\t\t\tthis._shownPolygon = null;\r\n\t\t}\r\n\t},\r\n\r\n\t_unbindEvents: function () {\r\n\t\tvar spiderfyOnMaxZoom = this.options.spiderfyOnMaxZoom,\r\n\t\t\tshowCoverageOnHover = this.options.showCoverageOnHover,\r\n\t\t\tzoomToBoundsOnClick = this.options.zoomToBoundsOnClick,\r\n\t\t\tmap = this._map;\r\n\r\n\t\tif (spiderfyOnMaxZoom || zoomToBoundsOnClick) {\r\n\t\t\tthis.off('clusterclick', this._zoomOrSpiderfy, this);\r\n\t\t}\r\n\t\tif (showCoverageOnHover) {\r\n\t\t\tthis.off('clustermouseover', this._showCoverage, this);\r\n\t\t\tthis.off('clustermouseout', this._hideCoverage, this);\r\n\t\t\tmap.off('zoomend', this._hideCoverage, this);\r\n\t\t}\r\n\t},\r\n\r\n\t_zoomEnd: function () {\r\n\t\tif (!this._map) { //May have been removed from the map by a zoomEnd handler\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._mergeSplitClusters();\r\n\r\n\t\tthis._zoom = Math.round(this._map._zoom);\r\n\t\tthis._currentShownBounds = this._getExpandedVisibleBounds();\r\n\t},\r\n\r\n\t_moveEnd: function () {\r\n\t\tif (this._inZoomAnimation) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar newBounds = this._getExpandedVisibleBounds();\r\n\r\n\t\tthis._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), this._zoom, newBounds);\r\n\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, Math.round(this._map._zoom), newBounds);\r\n\r\n\t\tthis._currentShownBounds = newBounds;\r\n\t\treturn;\r\n\t},\r\n\r\n\t_generateInitialClusters: function () {\r\n\t\tvar maxZoom = Math.ceil(this._map.getMaxZoom()),\r\n\t\t\tminZoom = Math.floor(this._map.getMinZoom()),\r\n\t\t\tradius = this.options.maxClusterRadius,\r\n\t\t\tradiusFn = radius;\r\n\r\n\t\t//If we just set maxClusterRadius to a single number, we need to create\r\n\t\t//a simple function to return that number. Otherwise, we just have to\r\n\t\t//use the function we've passed in.\r\n\t\tif (typeof radius !== \"function\") {\r\n\t\t\tradiusFn = function () { return radius; };\r\n\t\t}\r\n\r\n\t\tif (this.options.disableClusteringAtZoom !== null) {\r\n\t\t\tmaxZoom = this.options.disableClusteringAtZoom - 1;\r\n\t\t}\r\n\t\tthis._maxZoom = maxZoom;\r\n\t\tthis._gridClusters = {};\r\n\t\tthis._gridUnclustered = {};\r\n\r\n\t\t//Set up DistanceGrids for each zoom\r\n\t\tfor (var zoom = maxZoom; zoom >= minZoom; zoom--) {\r\n\t\t\tthis._gridClusters[zoom] = new L.DistanceGrid(radiusFn(zoom));\r\n\t\t\tthis._gridUnclustered[zoom] = new L.DistanceGrid(radiusFn(zoom));\r\n\t\t}\r\n\r\n\t\t// Instantiate the appropriate L.MarkerCluster class (animated or not).\r\n\t\tthis._topClusterLevel = new this._markerCluster(this, minZoom - 1);\r\n\t},\r\n\r\n\t//Zoom: Zoom to start adding at (Pass this._maxZoom to start at the bottom)\r\n\t_addLayer: function (layer, zoom) {\r\n\t\tvar gridClusters = this._gridClusters,\r\n\t\t gridUnclustered = this._gridUnclustered,\r\n\t\t\tminZoom = Math.floor(this._map.getMinZoom()),\r\n\t\t markerPoint, z;\r\n\r\n\t\tif (this.options.singleMarkerMode) {\r\n\t\t\tthis._overrideMarkerIcon(layer);\r\n\t\t}\r\n\r\n\t\tlayer.on(this._childMarkerEventHandlers, this);\r\n\r\n\t\t//Find the lowest zoom level to slot this one in\r\n\t\tfor (; zoom >= minZoom; zoom--) {\r\n\t\t\tmarkerPoint = this._map.project(layer.getLatLng(), zoom); // calculate pixel position\r\n\r\n\t\t\t//Try find a cluster close by\r\n\t\t\tvar closest = gridClusters[zoom].getNearObject(markerPoint);\r\n\t\t\tif (closest) {\r\n\t\t\t\tclosest._addChild(layer);\r\n\t\t\t\tlayer.__parent = closest;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Try find a marker close by to form a new cluster with\r\n\t\t\tclosest = gridUnclustered[zoom].getNearObject(markerPoint);\r\n\t\t\tif (closest) {\r\n\t\t\t\tvar parent = closest.__parent;\r\n\t\t\t\tif (parent) {\r\n\t\t\t\t\tthis._removeLayer(closest, false);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Create new cluster with these 2 in it\r\n\r\n\t\t\t\tvar newCluster = new this._markerCluster(this, zoom, closest, layer);\r\n\t\t\t\tgridClusters[zoom].addObject(newCluster, this._map.project(newCluster._cLatLng, zoom));\r\n\t\t\t\tclosest.__parent = newCluster;\r\n\t\t\t\tlayer.__parent = newCluster;\r\n\r\n\t\t\t\t//First create any new intermediate parent clusters that don't exist\r\n\t\t\t\tvar lastParent = newCluster;\r\n\t\t\t\tfor (z = zoom - 1; z > parent._zoom; z--) {\r\n\t\t\t\t\tlastParent = new this._markerCluster(this, z, lastParent);\r\n\t\t\t\t\tgridClusters[z].addObject(lastParent, this._map.project(closest.getLatLng(), z));\r\n\t\t\t\t}\r\n\t\t\t\tparent._addChild(lastParent);\r\n\r\n\t\t\t\t//Remove closest from this zoom level and any above that it is in, replace with newCluster\r\n\t\t\t\tthis._removeFromGridUnclustered(closest, zoom);\r\n\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Didn't manage to cluster in at this zoom, record us as a marker here and continue upwards\r\n\t\t\tgridUnclustered[zoom].addObject(layer, markerPoint);\r\n\t\t}\r\n\r\n\t\t//Didn't get in anything, add us to the top\r\n\t\tthis._topClusterLevel._addChild(layer);\r\n\t\tlayer.__parent = this._topClusterLevel;\r\n\t\treturn;\r\n\t},\r\n\r\n\t/**\r\n\t * Refreshes the icon of all \"dirty\" visible clusters.\r\n\t * Non-visible \"dirty\" clusters will be updated when they are added to the map.\r\n\t * @private\r\n\t */\r\n\t_refreshClustersIcons: function () {\r\n\t\tthis._featureGroup.eachLayer(function (c) {\r\n\t\t\tif (c instanceof L.MarkerCluster && c._iconNeedsUpdate) {\r\n\t\t\t\tc._updateIcon();\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\r\n\t//Enqueue code to fire after the marker expand/contract has happened\r\n\t_enqueue: function (fn) {\r\n\t\tthis._queue.push(fn);\r\n\t\tif (!this._queueTimeout) {\r\n\t\t\tthis._queueTimeout = setTimeout(L.bind(this._processQueue, this), 300);\r\n\t\t}\r\n\t},\r\n\t_processQueue: function () {\r\n\t\tfor (var i = 0; i < this._queue.length; i++) {\r\n\t\t\tthis._queue[i].call(this);\r\n\t\t}\r\n\t\tthis._queue.length = 0;\r\n\t\tclearTimeout(this._queueTimeout);\r\n\t\tthis._queueTimeout = null;\r\n\t},\r\n\r\n\t//Merge and split any existing clusters that are too big or small\r\n\t_mergeSplitClusters: function () {\r\n\t\tvar mapZoom = Math.round(this._map._zoom);\r\n\r\n\t\t//In case we are starting to split before the animation finished\r\n\t\tthis._processQueue();\r\n\r\n\t\tif (this._zoom < mapZoom && this._currentShownBounds.intersects(this._getExpandedVisibleBounds())) { //Zoom in, split\r\n\t\t\tthis._animationStart();\r\n\t\t\t//Remove clusters now off screen\r\n\t\t\tthis._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), this._zoom, this._getExpandedVisibleBounds());\r\n\r\n\t\t\tthis._animationZoomIn(this._zoom, mapZoom);\r\n\r\n\t\t} else if (this._zoom > mapZoom) { //Zoom out, merge\r\n\t\t\tthis._animationStart();\r\n\r\n\t\t\tthis._animationZoomOut(this._zoom, mapZoom);\r\n\t\t} else {\r\n\t\t\tthis._moveEnd();\r\n\t\t}\r\n\t},\r\n\r\n\t//Gets the maps visible bounds expanded in each direction by the size of the screen (so the user cannot see an area we do not cover in one pan)\r\n\t_getExpandedVisibleBounds: function () {\r\n\t\tif (!this.options.removeOutsideVisibleBounds) {\r\n\t\t\treturn this._mapBoundsInfinite;\r\n\t\t} else if (L.Browser.mobile) {\r\n\t\t\treturn this._checkBoundsMaxLat(this._map.getBounds());\r\n\t\t}\r\n\r\n\t\treturn this._checkBoundsMaxLat(this._map.getBounds().pad(1)); // Padding expands the bounds by its own dimensions but scaled with the given factor.\r\n\t},\r\n\r\n\t/**\r\n\t * Expands the latitude to Infinity (or -Infinity) if the input bounds reach the map projection maximum defined latitude\r\n\t * (in the case of Web/Spherical Mercator, it is 85.0511287798 / see https://en.wikipedia.org/wiki/Web_Mercator#Formulas).\r\n\t * Otherwise, the removeOutsideVisibleBounds option will remove markers beyond that limit, whereas the same markers without\r\n\t * this option (or outside MCG) will have their position floored (ceiled) by the projection and rendered at that limit,\r\n\t * making the user think that MCG \"eats\" them and never displays them again.\r\n\t * @param bounds L.LatLngBounds\r\n\t * @returns {L.LatLngBounds}\r\n\t * @private\r\n\t */\r\n\t_checkBoundsMaxLat: function (bounds) {\r\n\t\tvar maxLat = this._maxLat;\r\n\r\n\t\tif (maxLat !== undefined) {\r\n\t\t\tif (bounds.getNorth() >= maxLat) {\r\n\t\t\t\tbounds._northEast.lat = Infinity;\r\n\t\t\t}\r\n\t\t\tif (bounds.getSouth() <= -maxLat) {\r\n\t\t\t\tbounds._southWest.lat = -Infinity;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn bounds;\r\n\t},\r\n\r\n\t//Shared animation code\r\n\t_animationAddLayerNonAnimated: function (layer, newCluster) {\r\n\t\tif (newCluster === layer) {\r\n\t\t\tthis._featureGroup.addLayer(layer);\r\n\t\t} else if (newCluster._childCount === 2) {\r\n\t\t\tnewCluster._addToMap();\r\n\r\n\t\t\tvar markers = newCluster.getAllChildMarkers();\r\n\t\t\tthis._featureGroup.removeLayer(markers[0]);\r\n\t\t\tthis._featureGroup.removeLayer(markers[1]);\r\n\t\t} else {\r\n\t\t\tnewCluster._updateIcon();\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Extracts individual (i.e. non-group) layers from a Layer Group.\r\n\t * @param group to extract layers from.\r\n\t * @param output {Array} in which to store the extracted layers.\r\n\t * @returns {*|Array}\r\n\t * @private\r\n\t */\r\n\t_extractNonGroupLayers: function (group, output) {\r\n\t\tvar layers = group.getLayers(),\r\n\t\t i = 0,\r\n\t\t layer;\r\n\r\n\t\toutput = output || [];\r\n\r\n\t\tfor (; i < layers.length; i++) {\r\n\t\t\tlayer = layers[i];\r\n\r\n\t\t\tif (layer instanceof L.LayerGroup) {\r\n\t\t\t\tthis._extractNonGroupLayers(layer, output);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\toutput.push(layer);\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n\r\n\t/**\r\n\t * Implements the singleMarkerMode option.\r\n\t * @param layer Marker to re-style using the Clusters iconCreateFunction.\r\n\t * @returns {L.Icon} The newly created icon.\r\n\t * @private\r\n\t */\r\n\t_overrideMarkerIcon: function (layer) {\r\n\t\tvar icon = layer.options.icon = this.options.iconCreateFunction({\r\n\t\t\tgetChildCount: function () {\r\n\t\t\t\treturn 1;\r\n\t\t\t},\r\n\t\t\tgetAllChildMarkers: function () {\r\n\t\t\t\treturn [layer];\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn icon;\r\n\t}\r\n});\r\n\r\n// Constant bounds used in case option \"removeOutsideVisibleBounds\" is set to false.\r\nL.MarkerClusterGroup.include({\r\n\t_mapBoundsInfinite: new L.LatLngBounds(new L.LatLng(-Infinity, -Infinity), new L.LatLng(Infinity, Infinity))\r\n});\r\n\r\nL.MarkerClusterGroup.include({\r\n\t_noAnimation: {\r\n\t\t//Non Animated versions of everything\r\n\t\t_animationStart: function () {\r\n\t\t\t//Do nothing...\r\n\t\t},\r\n\t\t_animationZoomIn: function (previousZoomLevel, newZoomLevel) {\r\n\t\t\tthis._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel);\r\n\t\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());\r\n\r\n\t\t\t//We didn't actually animate, but we use this event to mean \"clustering animations have finished\"\r\n\t\t\tthis.fire('animationend');\r\n\t\t},\r\n\t\t_animationZoomOut: function (previousZoomLevel, newZoomLevel) {\r\n\t\t\tthis._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel);\r\n\t\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());\r\n\r\n\t\t\t//We didn't actually animate, but we use this event to mean \"clustering animations have finished\"\r\n\t\t\tthis.fire('animationend');\r\n\t\t},\r\n\t\t_animationAddLayer: function (layer, newCluster) {\r\n\t\t\tthis._animationAddLayerNonAnimated(layer, newCluster);\r\n\t\t}\r\n\t},\r\n\r\n\t_withAnimation: {\r\n\t\t//Animated versions here\r\n\t\t_animationStart: function () {\r\n\t\t\tthis._map._mapPane.className += ' leaflet-cluster-anim';\r\n\t\t\tthis._inZoomAnimation++;\r\n\t\t},\r\n\r\n\t\t_animationZoomIn: function (previousZoomLevel, newZoomLevel) {\r\n\t\t\tvar bounds = this._getExpandedVisibleBounds(),\r\n\t\t\t fg = this._featureGroup,\r\n\t\t\t\tminZoom = Math.floor(this._map.getMinZoom()),\r\n\t\t\t i;\r\n\r\n\t\t\tthis._ignoreMove = true;\r\n\r\n\t\t\t//Add all children of current clusters to map and remove those clusters from map\r\n\t\t\tthis._topClusterLevel._recursively(bounds, previousZoomLevel, minZoom, function (c) {\r\n\t\t\t\tvar startPos = c._latlng,\r\n\t\t\t\t markers = c._markers,\r\n\t\t\t\t m;\r\n\r\n\t\t\t\tif (!bounds.contains(startPos)) {\r\n\t\t\t\t\tstartPos = null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (c._isSingleParent() && previousZoomLevel + 1 === newZoomLevel) { //Immediately add the new child and remove us\r\n\t\t\t\t\tfg.removeLayer(c);\r\n\t\t\t\t\tc._recursivelyAddChildrenToMap(null, newZoomLevel, bounds);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//Fade out old cluster\r\n\t\t\t\t\tc.clusterHide();\r\n\t\t\t\t\tc._recursivelyAddChildrenToMap(startPos, newZoomLevel, bounds);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Remove all markers that aren't visible any more\r\n\t\t\t\t//TODO: Do we actually need to do this on the higher levels too?\r\n\t\t\t\tfor (i = markers.length - 1; i >= 0; i--) {\r\n\t\t\t\t\tm = markers[i];\r\n\t\t\t\t\tif (!bounds.contains(m._latlng)) {\r\n\t\t\t\t\t\tfg.removeLayer(m);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t});\r\n\r\n\t\t\tthis._forceLayout();\r\n\r\n\t\t\t//Update opacities\r\n\t\t\tthis._topClusterLevel._recursivelyBecomeVisible(bounds, newZoomLevel);\r\n\t\t\t//TODO Maybe? Update markers in _recursivelyBecomeVisible\r\n\t\t\tfg.eachLayer(function (n) {\r\n\t\t\t\tif (!(n instanceof L.MarkerCluster) && n._icon) {\r\n\t\t\t\t\tn.clusterShow();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//update the positions of the just added clusters/markers\r\n\t\t\tthis._topClusterLevel._recursively(bounds, previousZoomLevel, newZoomLevel, function (c) {\r\n\t\t\t\tc._recursivelyRestoreChildPositions(newZoomLevel);\r\n\t\t\t});\r\n\r\n\t\t\tthis._ignoreMove = false;\r\n\r\n\t\t\t//Remove the old clusters and close the zoom animation\r\n\t\t\tthis._enqueue(function () {\r\n\t\t\t\t//update the positions of the just added clusters/markers\r\n\t\t\t\tthis._topClusterLevel._recursively(bounds, previousZoomLevel, minZoom, function (c) {\r\n\t\t\t\t\tfg.removeLayer(c);\r\n\t\t\t\t\tc.clusterShow();\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis._animationEnd();\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\t_animationZoomOut: function (previousZoomLevel, newZoomLevel) {\r\n\t\t\tthis._animationZoomOutSingle(this._topClusterLevel, previousZoomLevel - 1, newZoomLevel);\r\n\r\n\t\t\t//Need to add markers for those that weren't on the map before but are now\r\n\t\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());\r\n\t\t\t//Remove markers that were on the map before but won't be now\r\n\t\t\tthis._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel, this._getExpandedVisibleBounds());\r\n\t\t},\r\n\r\n\t\t_animationAddLayer: function (layer, newCluster) {\r\n\t\t\tvar me = this,\r\n\t\t\t fg = this._featureGroup;\r\n\r\n\t\t\tfg.addLayer(layer);\r\n\t\t\tif (newCluster !== layer) {\r\n\t\t\t\tif (newCluster._childCount > 2) { //Was already a cluster\r\n\r\n\t\t\t\t\tnewCluster._updateIcon();\r\n\t\t\t\t\tthis._forceLayout();\r\n\t\t\t\t\tthis._animationStart();\r\n\r\n\t\t\t\t\tlayer._setPos(this._map.latLngToLayerPoint(newCluster.getLatLng()));\r\n\t\t\t\t\tlayer.clusterHide();\r\n\r\n\t\t\t\t\tthis._enqueue(function () {\r\n\t\t\t\t\t\tfg.removeLayer(layer);\r\n\t\t\t\t\t\tlayer.clusterShow();\r\n\r\n\t\t\t\t\t\tme._animationEnd();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t} else { //Just became a cluster\r\n\t\t\t\t\tthis._forceLayout();\r\n\r\n\t\t\t\t\tme._animationStart();\r\n\t\t\t\t\tme._animationZoomOutSingle(newCluster, this._map.getMaxZoom(), this._zoom);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t// Private methods for animated versions.\r\n\t_animationZoomOutSingle: function (cluster, previousZoomLevel, newZoomLevel) {\r\n\t\tvar bounds = this._getExpandedVisibleBounds(),\r\n\t\t\tminZoom = Math.floor(this._map.getMinZoom());\r\n\r\n\t\t//Animate all of the markers in the clusters to move to their cluster center point\r\n\t\tcluster._recursivelyAnimateChildrenInAndAddSelfToMap(bounds, minZoom, previousZoomLevel + 1, newZoomLevel);\r\n\r\n\t\tvar me = this;\r\n\r\n\t\t//Update the opacity (If we immediately set it they won't animate)\r\n\t\tthis._forceLayout();\r\n\t\tcluster._recursivelyBecomeVisible(bounds, newZoomLevel);\r\n\r\n\t\t//TODO: Maybe use the transition timing stuff to make this more reliable\r\n\t\t//When the animations are done, tidy up\r\n\t\tthis._enqueue(function () {\r\n\r\n\t\t\t//This cluster stopped being a cluster before the timeout fired\r\n\t\t\tif (cluster._childCount === 1) {\r\n\t\t\t\tvar m = cluster._markers[0];\r\n\t\t\t\t//If we were in a cluster animation at the time then the opacity and position of our child could be wrong now, so fix it\r\n\t\t\t\tthis._ignoreMove = true;\r\n\t\t\t\tm.setLatLng(m.getLatLng());\r\n\t\t\t\tthis._ignoreMove = false;\r\n\t\t\t\tif (m.clusterShow) {\r\n\t\t\t\t\tm.clusterShow();\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tcluster._recursively(bounds, newZoomLevel, minZoom, function (c) {\r\n\t\t\t\t\tc._recursivelyRemoveChildrenFromMap(bounds, minZoom, previousZoomLevel + 1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tme._animationEnd();\r\n\t\t});\r\n\t},\r\n\r\n\t_animationEnd: function () {\r\n\t\tif (this._map) {\r\n\t\t\tthis._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', '');\r\n\t\t}\r\n\t\tthis._inZoomAnimation--;\r\n\t\tthis.fire('animationend');\r\n\t},\r\n\r\n\t//Force a browser layout of stuff in the map\r\n\t// Should apply the current opacity and location to all elements so we can update them again for an animation\r\n\t_forceLayout: function () {\r\n\t\t//In my testing this works, infact offsetWidth of any element seems to work.\r\n\t\t//Could loop all this._layers and do this for each _icon if it stops working\r\n\r\n\t\tL.Util.falseFn(document.body.offsetWidth);\r\n\t}\r\n});\r\n\r\nL.markerClusterGroup = function (options) {\r\n\treturn new L.MarkerClusterGroup(options);\r\n};\n\nvar MarkerCluster = L.MarkerCluster = L.Marker.extend({\r\n\toptions: L.Icon.prototype.options,\r\n\r\n\tinitialize: function (group, zoom, a, b) {\r\n\r\n\t\tL.Marker.prototype.initialize.call(this, a ? (a._cLatLng || a.getLatLng()) : new L.LatLng(0, 0),\r\n { icon: this, pane: group.options.clusterPane });\r\n\r\n\t\tthis._group = group;\r\n\t\tthis._zoom = zoom;\r\n\r\n\t\tthis._markers = [];\r\n\t\tthis._childClusters = [];\r\n\t\tthis._childCount = 0;\r\n\t\tthis._iconNeedsUpdate = true;\r\n\t\tthis._boundsNeedUpdate = true;\r\n\r\n\t\tthis._bounds = new L.LatLngBounds();\r\n\r\n\t\tif (a) {\r\n\t\t\tthis._addChild(a);\r\n\t\t}\r\n\t\tif (b) {\r\n\t\t\tthis._addChild(b);\r\n\t\t}\r\n\t},\r\n\r\n\t//Recursively retrieve all child markers of this cluster\r\n\tgetAllChildMarkers: function (storageArray, ignoreDraggedMarker) {\r\n\t\tstorageArray = storageArray || [];\r\n\r\n\t\tfor (var i = this._childClusters.length - 1; i >= 0; i--) {\r\n\t\t\tthis._childClusters[i].getAllChildMarkers(storageArray);\r\n\t\t}\r\n\r\n\t\tfor (var j = this._markers.length - 1; j >= 0; j--) {\r\n\t\t\tif (ignoreDraggedMarker && this._markers[j].__dragStart) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tstorageArray.push(this._markers[j]);\r\n\t\t}\r\n\r\n\t\treturn storageArray;\r\n\t},\r\n\r\n\t//Returns the count of how many child markers we have\r\n\tgetChildCount: function () {\r\n\t\treturn this._childCount;\r\n\t},\r\n\r\n\t//Zoom to the minimum of showing all of the child markers, or the extents of this cluster\r\n\tzoomToBounds: function (fitBoundsOptions) {\r\n\t\tvar childClusters = this._childClusters.slice(),\r\n\t\t\tmap = this._group._map,\r\n\t\t\tboundsZoom = map.getBoundsZoom(this._bounds),\r\n\t\t\tzoom = this._zoom + 1,\r\n\t\t\tmapZoom = map.getZoom(),\r\n\t\t\ti;\r\n\r\n\t\t//calculate how far we need to zoom down to see all of the markers\r\n\t\twhile (childClusters.length > 0 && boundsZoom > zoom) {\r\n\t\t\tzoom++;\r\n\t\t\tvar newClusters = [];\r\n\t\t\tfor (i = 0; i < childClusters.length; i++) {\r\n\t\t\t\tnewClusters = newClusters.concat(childClusters[i]._childClusters);\r\n\t\t\t}\r\n\t\t\tchildClusters = newClusters;\r\n\t\t}\r\n\r\n\t\tif (boundsZoom > zoom) {\r\n\t\t\tthis._group._map.setView(this._latlng, zoom);\r\n\t\t} else if (boundsZoom <= mapZoom) { //If fitBounds wouldn't zoom us down, zoom us down instead\r\n\t\t\tthis._group._map.setView(this._latlng, mapZoom + 1);\r\n\t\t} else {\r\n\t\t\tthis._group._map.fitBounds(this._bounds, fitBoundsOptions);\r\n\t\t}\r\n\t},\r\n\r\n\tgetBounds: function () {\r\n\t\tvar bounds = new L.LatLngBounds();\r\n\t\tbounds.extend(this._bounds);\r\n\t\treturn bounds;\r\n\t},\r\n\r\n\t_updateIcon: function () {\r\n\t\tthis._iconNeedsUpdate = true;\r\n\t\tif (this._icon) {\r\n\t\t\tthis.setIcon(this);\r\n\t\t}\r\n\t},\r\n\r\n\t//Cludge for Icon, we pretend to be an icon for performance\r\n\tcreateIcon: function () {\r\n\t\tif (this._iconNeedsUpdate) {\r\n\t\t\tthis._iconObj = this._group.options.iconCreateFunction(this);\r\n\t\t\tthis._iconNeedsUpdate = false;\r\n\t\t}\r\n\t\treturn this._iconObj.createIcon();\r\n\t},\r\n\tcreateShadow: function () {\r\n\t\treturn this._iconObj.createShadow();\r\n\t},\r\n\r\n\r\n\t_addChild: function (new1, isNotificationFromChild) {\r\n\r\n\t\tthis._iconNeedsUpdate = true;\r\n\r\n\t\tthis._boundsNeedUpdate = true;\r\n\t\tthis._setClusterCenter(new1);\r\n\r\n\t\tif (new1 instanceof L.MarkerCluster) {\r\n\t\t\tif (!isNotificationFromChild) {\r\n\t\t\t\tthis._childClusters.push(new1);\r\n\t\t\t\tnew1.__parent = this;\r\n\t\t\t}\r\n\t\t\tthis._childCount += new1._childCount;\r\n\t\t} else {\r\n\t\t\tif (!isNotificationFromChild) {\r\n\t\t\t\tthis._markers.push(new1);\r\n\t\t\t}\r\n\t\t\tthis._childCount++;\r\n\t\t}\r\n\r\n\t\tif (this.__parent) {\r\n\t\t\tthis.__parent._addChild(new1, true);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Makes sure the cluster center is set. If not, uses the child center if it is a cluster, or the marker position.\r\n\t * @param child L.MarkerCluster|L.Marker that will be used as cluster center if not defined yet.\r\n\t * @private\r\n\t */\r\n\t_setClusterCenter: function (child) {\r\n\t\tif (!this._cLatLng) {\r\n\t\t\t// when clustering, take position of the first point as the cluster center\r\n\t\t\tthis._cLatLng = child._cLatLng || child._latlng;\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Assigns impossible bounding values so that the next extend entirely determines the new bounds.\r\n\t * This method avoids having to trash the previous L.LatLngBounds object and to create a new one, which is much slower for this class.\r\n\t * As long as the bounds are not extended, most other methods would probably fail, as they would with bounds initialized but not extended.\r\n\t * @private\r\n\t */\r\n\t_resetBounds: function () {\r\n\t\tvar bounds = this._bounds;\r\n\r\n\t\tif (bounds._southWest) {\r\n\t\t\tbounds._southWest.lat = Infinity;\r\n\t\t\tbounds._southWest.lng = Infinity;\r\n\t\t}\r\n\t\tif (bounds._northEast) {\r\n\t\t\tbounds._northEast.lat = -Infinity;\r\n\t\t\tbounds._northEast.lng = -Infinity;\r\n\t\t}\r\n\t},\r\n\r\n\t_recalculateBounds: function () {\r\n\t\tvar markers = this._markers,\r\n\t\t childClusters = this._childClusters,\r\n\t\t latSum = 0,\r\n\t\t lngSum = 0,\r\n\t\t totalCount = this._childCount,\r\n\t\t i, child, childLatLng, childCount;\r\n\r\n\t\t// Case where all markers are removed from the map and we are left with just an empty _topClusterLevel.\r\n\t\tif (totalCount === 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Reset rather than creating a new object, for performance.\r\n\t\tthis._resetBounds();\r\n\r\n\t\t// Child markers.\r\n\t\tfor (i = 0; i < markers.length; i++) {\r\n\t\t\tchildLatLng = markers[i]._latlng;\r\n\r\n\t\t\tthis._bounds.extend(childLatLng);\r\n\r\n\t\t\tlatSum += childLatLng.lat;\r\n\t\t\tlngSum += childLatLng.lng;\r\n\t\t}\r\n\r\n\t\t// Child clusters.\r\n\t\tfor (i = 0; i < childClusters.length; i++) {\r\n\t\t\tchild = childClusters[i];\r\n\r\n\t\t\t// Re-compute child bounds and weighted position first if necessary.\r\n\t\t\tif (child._boundsNeedUpdate) {\r\n\t\t\t\tchild._recalculateBounds();\r\n\t\t\t}\r\n\r\n\t\t\tthis._bounds.extend(child._bounds);\r\n\r\n\t\t\tchildLatLng = child._wLatLng;\r\n\t\t\tchildCount = child._childCount;\r\n\r\n\t\t\tlatSum += childLatLng.lat * childCount;\r\n\t\t\tlngSum += childLatLng.lng * childCount;\r\n\t\t}\r\n\r\n\t\tthis._latlng = this._wLatLng = new L.LatLng(latSum / totalCount, lngSum / totalCount);\r\n\r\n\t\t// Reset dirty flag.\r\n\t\tthis._boundsNeedUpdate = false;\r\n\t},\r\n\r\n\t//Set our markers position as given and add it to the map\r\n\t_addToMap: function (startPos) {\r\n\t\tif (startPos) {\r\n\t\t\tthis._backupLatlng = this._latlng;\r\n\t\t\tthis.setLatLng(startPos);\r\n\t\t}\r\n\t\tthis._group._featureGroup.addLayer(this);\r\n\t},\r\n\r\n\t_recursivelyAnimateChildrenIn: function (bounds, center, maxZoom) {\r\n\t\tthis._recursively(bounds, this._group._map.getMinZoom(), maxZoom - 1,\r\n\t\t\tfunction (c) {\r\n\t\t\t\tvar markers = c._markers,\r\n\t\t\t\t\ti, m;\r\n\t\t\t\tfor (i = markers.length - 1; i >= 0; i--) {\r\n\t\t\t\t\tm = markers[i];\r\n\r\n\t\t\t\t\t//Only do it if the icon is still on the map\r\n\t\t\t\t\tif (m._icon) {\r\n\t\t\t\t\t\tm._setPos(center);\r\n\t\t\t\t\t\tm.clusterHide();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tfunction (c) {\r\n\t\t\t\tvar childClusters = c._childClusters,\r\n\t\t\t\t\tj, cm;\r\n\t\t\t\tfor (j = childClusters.length - 1; j >= 0; j--) {\r\n\t\t\t\t\tcm = childClusters[j];\r\n\t\t\t\t\tif (cm._icon) {\r\n\t\t\t\t\t\tcm._setPos(center);\r\n\t\t\t\t\t\tcm.clusterHide();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t},\r\n\r\n\t_recursivelyAnimateChildrenInAndAddSelfToMap: function (bounds, mapMinZoom, previousZoomLevel, newZoomLevel) {\r\n\t\tthis._recursively(bounds, newZoomLevel, mapMinZoom,\r\n\t\t\tfunction (c) {\r\n\t\t\t\tc._recursivelyAnimateChildrenIn(bounds, c._group._map.latLngToLayerPoint(c.getLatLng()).round(), previousZoomLevel);\r\n\r\n\t\t\t\t//TODO: depthToAnimateIn affects _isSingleParent, if there is a multizoom we may/may not be.\r\n\t\t\t\t//As a hack we only do a animation free zoom on a single level zoom, if someone does multiple levels then we always animate\r\n\t\t\t\tif (c._isSingleParent() && previousZoomLevel - 1 === newZoomLevel) {\r\n\t\t\t\t\tc.clusterShow();\r\n\t\t\t\t\tc._recursivelyRemoveChildrenFromMap(bounds, mapMinZoom, previousZoomLevel); //Immediately remove our children as we are replacing them. TODO previousBounds not bounds\r\n\t\t\t\t} else {\r\n\t\t\t\t\tc.clusterHide();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tc._addToMap();\r\n\t\t\t}\r\n\t\t);\r\n\t},\r\n\r\n\t_recursivelyBecomeVisible: function (bounds, zoomLevel) {\r\n\t\tthis._recursively(bounds, this._group._map.getMinZoom(), zoomLevel, null, function (c) {\r\n\t\t\tc.clusterShow();\r\n\t\t});\r\n\t},\r\n\r\n\t_recursivelyAddChildrenToMap: function (startPos, zoomLevel, bounds) {\r\n\t\tthis._recursively(bounds, this._group._map.getMinZoom() - 1, zoomLevel,\r\n\t\t\tfunction (c) {\r\n\t\t\t\tif (zoomLevel === c._zoom) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Add our child markers at startPos (so they can be animated out)\r\n\t\t\t\tfor (var i = c._markers.length - 1; i >= 0; i--) {\r\n\t\t\t\t\tvar nm = c._markers[i];\r\n\r\n\t\t\t\t\tif (!bounds.contains(nm._latlng)) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (startPos) {\r\n\t\t\t\t\t\tnm._backupLatlng = nm.getLatLng();\r\n\r\n\t\t\t\t\t\tnm.setLatLng(startPos);\r\n\t\t\t\t\t\tif (nm.clusterHide) {\r\n\t\t\t\t\t\t\tnm.clusterHide();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tc._group._featureGroup.addLayer(nm);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tfunction (c) {\r\n\t\t\t\tc._addToMap(startPos);\r\n\t\t\t}\r\n\t\t);\r\n\t},\r\n\r\n\t_recursivelyRestoreChildPositions: function (zoomLevel) {\r\n\t\t//Fix positions of child markers\r\n\t\tfor (var i = this._markers.length - 1; i >= 0; i--) {\r\n\t\t\tvar nm = this._markers[i];\r\n\t\t\tif (nm._backupLatlng) {\r\n\t\t\t\tnm.setLatLng(nm._backupLatlng);\r\n\t\t\t\tdelete nm._backupLatlng;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (zoomLevel - 1 === this._zoom) {\r\n\t\t\t//Reposition child clusters\r\n\t\t\tfor (var j = this._childClusters.length - 1; j >= 0; j--) {\r\n\t\t\t\tthis._childClusters[j]._restorePosition();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tfor (var k = this._childClusters.length - 1; k >= 0; k--) {\r\n\t\t\t\tthis._childClusters[k]._recursivelyRestoreChildPositions(zoomLevel);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_restorePosition: function () {\r\n\t\tif (this._backupLatlng) {\r\n\t\t\tthis.setLatLng(this._backupLatlng);\r\n\t\t\tdelete this._backupLatlng;\r\n\t\t}\r\n\t},\r\n\r\n\t//exceptBounds: If set, don't remove any markers/clusters in it\r\n\t_recursivelyRemoveChildrenFromMap: function (previousBounds, mapMinZoom, zoomLevel, exceptBounds) {\r\n\t\tvar m, i;\r\n\t\tthis._recursively(previousBounds, mapMinZoom - 1, zoomLevel - 1,\r\n\t\t\tfunction (c) {\r\n\t\t\t\t//Remove markers at every level\r\n\t\t\t\tfor (i = c._markers.length - 1; i >= 0; i--) {\r\n\t\t\t\t\tm = c._markers[i];\r\n\t\t\t\t\tif (!exceptBounds || !exceptBounds.contains(m._latlng)) {\r\n\t\t\t\t\t\tc._group._featureGroup.removeLayer(m);\r\n\t\t\t\t\t\tif (m.clusterShow) {\r\n\t\t\t\t\t\t\tm.clusterShow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tfunction (c) {\r\n\t\t\t\t//Remove child clusters at just the bottom level\r\n\t\t\t\tfor (i = c._childClusters.length - 1; i >= 0; i--) {\r\n\t\t\t\t\tm = c._childClusters[i];\r\n\t\t\t\t\tif (!exceptBounds || !exceptBounds.contains(m._latlng)) {\r\n\t\t\t\t\t\tc._group._featureGroup.removeLayer(m);\r\n\t\t\t\t\t\tif (m.clusterShow) {\r\n\t\t\t\t\t\t\tm.clusterShow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t},\r\n\r\n\t//Run the given functions recursively to this and child clusters\r\n\t// boundsToApplyTo: a L.LatLngBounds representing the bounds of what clusters to recurse in to\r\n\t// zoomLevelToStart: zoom level to start running functions (inclusive)\r\n\t// zoomLevelToStop: zoom level to stop running functions (inclusive)\r\n\t// runAtEveryLevel: function that takes an L.MarkerCluster as an argument that should be applied on every level\r\n\t// runAtBottomLevel: function that takes an L.MarkerCluster as an argument that should be applied at only the bottom level\r\n\t_recursively: function (boundsToApplyTo, zoomLevelToStart, zoomLevelToStop, runAtEveryLevel, runAtBottomLevel) {\r\n\t\tvar childClusters = this._childClusters,\r\n\t\t zoom = this._zoom,\r\n\t\t i, c;\r\n\r\n\t\tif (zoomLevelToStart <= zoom) {\r\n\t\t\tif (runAtEveryLevel) {\r\n\t\t\t\trunAtEveryLevel(this);\r\n\t\t\t}\r\n\t\t\tif (runAtBottomLevel && zoom === zoomLevelToStop) {\r\n\t\t\t\trunAtBottomLevel(this);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (zoom < zoomLevelToStart || zoom < zoomLevelToStop) {\r\n\t\t\tfor (i = childClusters.length - 1; i >= 0; i--) {\r\n\t\t\t\tc = childClusters[i];\r\n\t\t\t\tif (c._boundsNeedUpdate) {\r\n\t\t\t\t\tc._recalculateBounds();\r\n\t\t\t\t}\r\n\t\t\t\tif (boundsToApplyTo.intersects(c._bounds)) {\r\n\t\t\t\t\tc._recursively(boundsToApplyTo, zoomLevelToStart, zoomLevelToStop, runAtEveryLevel, runAtBottomLevel);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//Returns true if we are the parent of only one cluster and that cluster is the same as us\r\n\t_isSingleParent: function () {\r\n\t\t//Don't need to check this._markers as the rest won't work if there are any\r\n\t\treturn this._childClusters.length > 0 && this._childClusters[0]._childCount === this._childCount;\r\n\t}\r\n});\n\n/*\r\n* Extends L.Marker to include two extra methods: clusterHide and clusterShow.\r\n* \r\n* They work as setOpacity(0) and setOpacity(1) respectively, but\r\n* don't overwrite the options.opacity\r\n* \r\n*/\r\n\r\nL.Marker.include({\r\n\tclusterHide: function () {\r\n\t\tvar backup = this.options.opacity;\r\n\t\tthis.setOpacity(0);\r\n\t\tthis.options.opacity = backup;\r\n\t\treturn this;\r\n\t},\r\n\t\r\n\tclusterShow: function () {\r\n\t\treturn this.setOpacity(this.options.opacity);\r\n\t}\r\n});\n\nL.DistanceGrid = function (cellSize) {\r\n\tthis._cellSize = cellSize;\r\n\tthis._sqCellSize = cellSize * cellSize;\r\n\tthis._grid = {};\r\n\tthis._objectPoint = { };\r\n};\r\n\r\nL.DistanceGrid.prototype = {\r\n\r\n\taddObject: function (obj, point) {\r\n\t\tvar x = this._getCoord(point.x),\r\n\t\t y = this._getCoord(point.y),\r\n\t\t grid = this._grid,\r\n\t\t row = grid[y] = grid[y] || {},\r\n\t\t cell = row[x] = row[x] || [],\r\n\t\t stamp = L.Util.stamp(obj);\r\n\r\n\t\tthis._objectPoint[stamp] = point;\r\n\r\n\t\tcell.push(obj);\r\n\t},\r\n\r\n\tupdateObject: function (obj, point) {\r\n\t\tthis.removeObject(obj);\r\n\t\tthis.addObject(obj, point);\r\n\t},\r\n\r\n\t//Returns true if the object was found\r\n\tremoveObject: function (obj, point) {\r\n\t\tvar x = this._getCoord(point.x),\r\n\t\t y = this._getCoord(point.y),\r\n\t\t grid = this._grid,\r\n\t\t row = grid[y] = grid[y] || {},\r\n\t\t cell = row[x] = row[x] || [],\r\n\t\t i, len;\r\n\r\n\t\tdelete this._objectPoint[L.Util.stamp(obj)];\r\n\r\n\t\tfor (i = 0, len = cell.length; i < len; i++) {\r\n\t\t\tif (cell[i] === obj) {\r\n\r\n\t\t\t\tcell.splice(i, 1);\r\n\r\n\t\t\t\tif (len === 1) {\r\n\t\t\t\t\tdelete row[x];\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t},\r\n\r\n\teachObject: function (fn, context) {\r\n\t\tvar i, j, k, len, row, cell, removed,\r\n\t\t grid = this._grid;\r\n\r\n\t\tfor (i in grid) {\r\n\t\t\trow = grid[i];\r\n\r\n\t\t\tfor (j in row) {\r\n\t\t\t\tcell = row[j];\r\n\r\n\t\t\t\tfor (k = 0, len = cell.length; k < len; k++) {\r\n\t\t\t\t\tremoved = fn.call(context, cell[k]);\r\n\t\t\t\t\tif (removed) {\r\n\t\t\t\t\t\tk--;\r\n\t\t\t\t\t\tlen--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tgetNearObject: function (point) {\r\n\t\tvar x = this._getCoord(point.x),\r\n\t\t y = this._getCoord(point.y),\r\n\t\t i, j, k, row, cell, len, obj, dist,\r\n\t\t objectPoint = this._objectPoint,\r\n\t\t closestDistSq = this._sqCellSize,\r\n\t\t closest = null;\r\n\r\n\t\tfor (i = y - 1; i <= y + 1; i++) {\r\n\t\t\trow = this._grid[i];\r\n\t\t\tif (row) {\r\n\r\n\t\t\t\tfor (j = x - 1; j <= x + 1; j++) {\r\n\t\t\t\t\tcell = row[j];\r\n\t\t\t\t\tif (cell) {\r\n\r\n\t\t\t\t\t\tfor (k = 0, len = cell.length; k < len; k++) {\r\n\t\t\t\t\t\t\tobj = cell[k];\r\n\t\t\t\t\t\t\tdist = this._sqDist(objectPoint[L.Util.stamp(obj)], point);\r\n\t\t\t\t\t\t\tif (dist < closestDistSq ||\r\n\t\t\t\t\t\t\t\tdist <= closestDistSq && closest === null) {\r\n\t\t\t\t\t\t\t\tclosestDistSq = dist;\r\n\t\t\t\t\t\t\t\tclosest = obj;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn closest;\r\n\t},\r\n\r\n\t_getCoord: function (x) {\r\n\t\tvar coord = Math.floor(x / this._cellSize);\r\n\t\treturn isFinite(coord) ? coord : x;\r\n\t},\r\n\r\n\t_sqDist: function (p, p2) {\r\n\t\tvar dx = p2.x - p.x,\r\n\t\t dy = p2.y - p.y;\r\n\t\treturn dx * dx + dy * dy;\r\n\t}\r\n};\n\n/* Copyright (c) 2012 the authors listed at the following URL, and/or\r\nthe authors of referenced articles or incorporated external code:\r\nhttp://en.literateprograms.org/Quickhull_(Javascript)?action=history&offset=20120410175256\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n\r\nRetrieved from: http://en.literateprograms.org/Quickhull_(Javascript)?oldid=18434\r\n*/\r\n\r\n(function () {\r\n\tL.QuickHull = {\r\n\r\n\t\t/*\r\n\t\t * @param {Object} cpt a point to be measured from the baseline\r\n\t\t * @param {Array} bl the baseline, as represented by a two-element\r\n\t\t * array of latlng objects.\r\n\t\t * @returns {Number} an approximate distance measure\r\n\t\t */\r\n\t\tgetDistant: function (cpt, bl) {\r\n\t\t\tvar vY = bl[1].lat - bl[0].lat,\r\n\t\t\t\tvX = bl[0].lng - bl[1].lng;\r\n\t\t\treturn (vX * (cpt.lat - bl[0].lat) + vY * (cpt.lng - bl[0].lng));\r\n\t\t},\r\n\r\n\t\t/*\r\n\t\t * @param {Array} baseLine a two-element array of latlng objects\r\n\t\t * representing the baseline to project from\r\n\t\t * @param {Array} latLngs an array of latlng objects\r\n\t\t * @returns {Object} the maximum point and all new points to stay\r\n\t\t * in consideration for the hull.\r\n\t\t */\r\n\t\tfindMostDistantPointFromBaseLine: function (baseLine, latLngs) {\r\n\t\t\tvar maxD = 0,\r\n\t\t\t\tmaxPt = null,\r\n\t\t\t\tnewPoints = [],\r\n\t\t\t\ti, pt, d;\r\n\r\n\t\t\tfor (i = latLngs.length - 1; i >= 0; i--) {\r\n\t\t\t\tpt = latLngs[i];\r\n\t\t\t\td = this.getDistant(pt, baseLine);\r\n\r\n\t\t\t\tif (d > 0) {\r\n\t\t\t\t\tnewPoints.push(pt);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (d > maxD) {\r\n\t\t\t\t\tmaxD = d;\r\n\t\t\t\t\tmaxPt = pt;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn { maxPoint: maxPt, newPoints: newPoints };\r\n\t\t},\r\n\r\n\r\n\t\t/*\r\n\t\t * Given a baseline, compute the convex hull of latLngs as an array\r\n\t\t * of latLngs.\r\n\t\t *\r\n\t\t * @param {Array} latLngs\r\n\t\t * @returns {Array}\r\n\t\t */\r\n\t\tbuildConvexHull: function (baseLine, latLngs) {\r\n\t\t\tvar convexHullBaseLines = [],\r\n\t\t\t\tt = this.findMostDistantPointFromBaseLine(baseLine, latLngs);\r\n\r\n\t\t\tif (t.maxPoint) { // if there is still a point \"outside\" the base line\r\n\t\t\t\tconvexHullBaseLines =\r\n\t\t\t\t\tconvexHullBaseLines.concat(\r\n\t\t\t\t\t\tthis.buildConvexHull([baseLine[0], t.maxPoint], t.newPoints)\r\n\t\t\t\t\t);\r\n\t\t\t\tconvexHullBaseLines =\r\n\t\t\t\t\tconvexHullBaseLines.concat(\r\n\t\t\t\t\t\tthis.buildConvexHull([t.maxPoint, baseLine[1]], t.newPoints)\r\n\t\t\t\t\t);\r\n\t\t\t\treturn convexHullBaseLines;\r\n\t\t\t} else { // if there is no more point \"outside\" the base line, the current base line is part of the convex hull\r\n\t\t\t\treturn [baseLine[0]];\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t/*\r\n\t\t * Given an array of latlngs, compute a convex hull as an array\r\n\t\t * of latlngs\r\n\t\t *\r\n\t\t * @param {Array} latLngs\r\n\t\t * @returns {Array}\r\n\t\t */\r\n\t\tgetConvexHull: function (latLngs) {\r\n\t\t\t// find first baseline\r\n\t\t\tvar maxLat = false, minLat = false,\r\n\t\t\t\tmaxLng = false, minLng = false,\r\n\t\t\t\tmaxLatPt = null, minLatPt = null,\r\n\t\t\t\tmaxLngPt = null, minLngPt = null,\r\n\t\t\t\tmaxPt = null, minPt = null,\r\n\t\t\t\ti;\r\n\r\n\t\t\tfor (i = latLngs.length - 1; i >= 0; i--) {\r\n\t\t\t\tvar pt = latLngs[i];\r\n\t\t\t\tif (maxLat === false || pt.lat > maxLat) {\r\n\t\t\t\t\tmaxLatPt = pt;\r\n\t\t\t\t\tmaxLat = pt.lat;\r\n\t\t\t\t}\r\n\t\t\t\tif (minLat === false || pt.lat < minLat) {\r\n\t\t\t\t\tminLatPt = pt;\r\n\t\t\t\t\tminLat = pt.lat;\r\n\t\t\t\t}\r\n\t\t\t\tif (maxLng === false || pt.lng > maxLng) {\r\n\t\t\t\t\tmaxLngPt = pt;\r\n\t\t\t\t\tmaxLng = pt.lng;\r\n\t\t\t\t}\r\n\t\t\t\tif (minLng === false || pt.lng < minLng) {\r\n\t\t\t\t\tminLngPt = pt;\r\n\t\t\t\t\tminLng = pt.lng;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (minLat !== maxLat) {\r\n\t\t\t\tminPt = minLatPt;\r\n\t\t\t\tmaxPt = maxLatPt;\r\n\t\t\t} else {\r\n\t\t\t\tminPt = minLngPt;\r\n\t\t\t\tmaxPt = maxLngPt;\r\n\t\t\t}\r\n\r\n\t\t\tvar ch = [].concat(this.buildConvexHull([minPt, maxPt], latLngs),\r\n\t\t\t\t\t\t\t\tthis.buildConvexHull([maxPt, minPt], latLngs));\r\n\t\t\treturn ch;\r\n\t\t}\r\n\t};\r\n}());\r\n\r\nL.MarkerCluster.include({\r\n\tgetConvexHull: function () {\r\n\t\tvar childMarkers = this.getAllChildMarkers(),\r\n\t\t\tpoints = [],\r\n\t\t\tp, i;\r\n\r\n\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\r\n\t\t\tp = childMarkers[i].getLatLng();\r\n\t\t\tpoints.push(p);\r\n\t\t}\r\n\r\n\t\treturn L.QuickHull.getConvexHull(points);\r\n\t}\r\n});\n\n//This code is 100% based on https://github.com/jawj/OverlappingMarkerSpiderfier-Leaflet\r\n//Huge thanks to jawj for implementing it first to make my job easy :-)\r\n\r\nL.MarkerCluster.include({\r\n\r\n\t_2PI: Math.PI * 2,\r\n\t_circleFootSeparation: 25, //related to circumference of circle\r\n\t_circleStartAngle: 0,\r\n\r\n\t_spiralFootSeparation: 28, //related to size of spiral (experiment!)\r\n\t_spiralLengthStart: 11,\r\n\t_spiralLengthFactor: 5,\r\n\r\n\t_circleSpiralSwitchover: 9, //show spiral instead of circle from this marker count upwards.\r\n\t\t\t\t\t\t\t\t// 0 -> always spiral; Infinity -> always circle\r\n\r\n\tspiderfy: function () {\r\n\t\tif (this._group._spiderfied === this || this._group._inZoomAnimation) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar childMarkers = this.getAllChildMarkers(null, true),\r\n\t\t\tgroup = this._group,\r\n\t\t\tmap = group._map,\r\n\t\t\tcenter = map.latLngToLayerPoint(this._latlng),\r\n\t\t\tpositions;\r\n\r\n\t\tthis._group._unspiderfy();\r\n\t\tthis._group._spiderfied = this;\r\n\r\n\t\t//TODO Maybe: childMarkers order by distance to center\r\n\r\n\t\tif (childMarkers.length >= this._circleSpiralSwitchover) {\r\n\t\t\tpositions = this._generatePointsSpiral(childMarkers.length, center);\r\n\t\t} else {\r\n\t\t\tcenter.y += 10; // Otherwise circles look wrong => hack for standard blue icon, renders differently for other icons.\r\n\t\t\tpositions = this._generatePointsCircle(childMarkers.length, center);\r\n\t\t}\r\n\r\n\t\tthis._animationSpiderfy(childMarkers, positions);\r\n\t},\r\n\r\n\tunspiderfy: function (zoomDetails) {\r\n\t\t/// <param Name=\"zoomDetails\">Argument from zoomanim if being called in a zoom animation or null otherwise</param>\r\n\t\tif (this._group._inZoomAnimation) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._animationUnspiderfy(zoomDetails);\r\n\r\n\t\tthis._group._spiderfied = null;\r\n\t},\r\n\r\n\t_generatePointsCircle: function (count, centerPt) {\r\n\t\tvar circumference = this._group.options.spiderfyDistanceMultiplier * this._circleFootSeparation * (2 + count),\r\n\t\t\tlegLength = circumference / this._2PI, //radius from circumference\r\n\t\t\tangleStep = this._2PI / count,\r\n\t\t\tres = [],\r\n\t\t\ti, angle;\r\n\r\n\t\tlegLength = Math.max(legLength, 35); // Minimum distance to get outside the cluster icon.\r\n\r\n\t\tres.length = count;\r\n\r\n\t\tfor (i = 0; i < count; i++) { // Clockwise, like spiral.\r\n\t\t\tangle = this._circleStartAngle + i * angleStep;\r\n\t\t\tres[i] = new L.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle))._round();\r\n\t\t}\r\n\r\n\t\treturn res;\r\n\t},\r\n\r\n\t_generatePointsSpiral: function (count, centerPt) {\r\n\t\tvar spiderfyDistanceMultiplier = this._group.options.spiderfyDistanceMultiplier,\r\n\t\t\tlegLength = spiderfyDistanceMultiplier * this._spiralLengthStart,\r\n\t\t\tseparation = spiderfyDistanceMultiplier * this._spiralFootSeparation,\r\n\t\t\tlengthFactor = spiderfyDistanceMultiplier * this._spiralLengthFactor * this._2PI,\r\n\t\t\tangle = 0,\r\n\t\t\tres = [],\r\n\t\t\ti;\r\n\r\n\t\tres.length = count;\r\n\r\n\t\t// Higher index, closer position to cluster center.\r\n\t\tfor (i = count; i >= 0; i--) {\r\n\t\t\t// Skip the first position, so that we are already farther from center and we avoid\r\n\t\t\t// being under the default cluster icon (especially important for Circle Markers).\r\n\t\t\tif (i < count) {\r\n\t\t\t\tres[i] = new L.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle))._round();\r\n\t\t\t}\r\n\t\t\tangle += separation / legLength + i * 0.0005;\r\n\t\t\tlegLength += lengthFactor / angle;\r\n\t\t}\r\n\t\treturn res;\r\n\t},\r\n\r\n\t_noanimationUnspiderfy: function () {\r\n\t\tvar group = this._group,\r\n\t\t\tmap = group._map,\r\n\t\t\tfg = group._featureGroup,\r\n\t\t\tchildMarkers = this.getAllChildMarkers(null, true),\r\n\t\t\tm, i;\r\n\r\n\t\tgroup._ignoreMove = true;\r\n\r\n\t\tthis.setOpacity(1);\r\n\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\r\n\t\t\tm = childMarkers[i];\r\n\r\n\t\t\tfg.removeLayer(m);\r\n\r\n\t\t\tif (m._preSpiderfyLatlng) {\r\n\t\t\t\tm.setLatLng(m._preSpiderfyLatlng);\r\n\t\t\t\tdelete m._preSpiderfyLatlng;\r\n\t\t\t}\r\n\t\t\tif (m.setZIndexOffset) {\r\n\t\t\t\tm.setZIndexOffset(0);\r\n\t\t\t}\r\n\r\n\t\t\tif (m._spiderLeg) {\r\n\t\t\t\tmap.removeLayer(m._spiderLeg);\r\n\t\t\t\tdelete m._spiderLeg;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tgroup.fire('unspiderfied', {\r\n\t\t\tcluster: this,\r\n\t\t\tmarkers: childMarkers\r\n\t\t});\r\n\t\tgroup._ignoreMove = false;\r\n\t\tgroup._spiderfied = null;\r\n\t}\r\n});\r\n\r\n//Non Animated versions of everything\r\nL.MarkerClusterNonAnimated = L.MarkerCluster.extend({\r\n\t_animationSpiderfy: function (childMarkers, positions) {\r\n\t\tvar group = this._group,\r\n\t\t\tmap = group._map,\r\n\t\t\tfg = group._featureGroup,\r\n\t\t\tlegOptions = this._group.options.spiderLegPolylineOptions,\r\n\t\t\ti, m, leg, newPos;\r\n\r\n\t\tgroup._ignoreMove = true;\r\n\r\n\t\t// Traverse in ascending order to make sure that inner circleMarkers are on top of further legs. Normal markers are re-ordered by newPosition.\r\n\t\t// The reverse order trick no longer improves performance on modern browsers.\r\n\t\tfor (i = 0; i < childMarkers.length; i++) {\r\n\t\t\tnewPos = map.layerPointToLatLng(positions[i]);\r\n\t\t\tm = childMarkers[i];\r\n\r\n\t\t\t// Add the leg before the marker, so that in case the latter is a circleMarker, the leg is behind it.\r\n\t\t\tleg = new L.Polyline([this._latlng, newPos], legOptions);\r\n\t\t\tmap.addLayer(leg);\r\n\t\t\tm._spiderLeg = leg;\r\n\r\n\t\t\t// Now add the marker.\r\n\t\t\tm._preSpiderfyLatlng = m._latlng;\r\n\t\t\tm.setLatLng(newPos);\r\n\t\t\tif (m.setZIndexOffset) {\r\n\t\t\t\tm.setZIndexOffset(1000000); //Make these appear on top of EVERYTHING\r\n\t\t\t}\r\n\r\n\t\t\tfg.addLayer(m);\r\n\t\t}\r\n\t\tthis.setOpacity(0.3);\r\n\r\n\t\tgroup._ignoreMove = false;\r\n\t\tgroup.fire('spiderfied', {\r\n\t\t\tcluster: this,\r\n\t\t\tmarkers: childMarkers\r\n\t\t});\r\n\t},\r\n\r\n\t_animationUnspiderfy: function () {\r\n\t\tthis._noanimationUnspiderfy();\r\n\t}\r\n});\r\n\r\n//Animated versions here\r\nL.MarkerCluster.include({\r\n\r\n\t_animationSpiderfy: function (childMarkers, positions) {\r\n\t\tvar me = this,\r\n\t\t\tgroup = this._group,\r\n\t\t\tmap = group._map,\r\n\t\t\tfg = group._featureGroup,\r\n\t\t\tthisLayerLatLng = this._latlng,\r\n\t\t\tthisLayerPos = map.latLngToLayerPoint(thisLayerLatLng),\r\n\t\t\tsvg = L.Path.SVG,\r\n\t\t\tlegOptions = L.extend({}, this._group.options.spiderLegPolylineOptions), // Copy the options so that we can modify them for animation.\r\n\t\t\tfinalLegOpacity = legOptions.opacity,\r\n\t\t\ti, m, leg, legPath, legLength, newPos;\r\n\r\n\t\tif (finalLegOpacity === undefined) {\r\n\t\t\tfinalLegOpacity = L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity;\r\n\t\t}\r\n\r\n\t\tif (svg) {\r\n\t\t\t// If the initial opacity of the spider leg is not 0 then it appears before the animation starts.\r\n\t\t\tlegOptions.opacity = 0;\r\n\r\n\t\t\t// Add the class for CSS transitions.\r\n\t\t\tlegOptions.className = (legOptions.className || '') + ' leaflet-cluster-spider-leg';\r\n\t\t} else {\r\n\t\t\t// Make sure we have a defined opacity.\r\n\t\t\tlegOptions.opacity = finalLegOpacity;\r\n\t\t}\r\n\r\n\t\tgroup._ignoreMove = true;\r\n\r\n\t\t// Add markers and spider legs to map, hidden at our center point.\r\n\t\t// Traverse in ascending order to make sure that inner circleMarkers are on top of further legs. Normal markers are re-ordered by newPosition.\r\n\t\t// The reverse order trick no longer improves performance on modern browsers.\r\n\t\tfor (i = 0; i < childMarkers.length; i++) {\r\n\t\t\tm = childMarkers[i];\r\n\r\n\t\t\tnewPos = map.layerPointToLatLng(positions[i]);\r\n\r\n\t\t\t// Add the leg before the marker, so that in case the latter is a circleMarker, the leg is behind it.\r\n\t\t\tleg = new L.Polyline([thisLayerLatLng, newPos], legOptions);\r\n\t\t\tmap.addLayer(leg);\r\n\t\t\tm._spiderLeg = leg;\r\n\r\n\t\t\t// Explanations: https://jakearchibald.com/2013/animated-line-drawing-svg/\r\n\t\t\t// In our case the transition property is declared in the CSS file.\r\n\t\t\tif (svg) {\r\n\t\t\t\tlegPath = leg._path;\r\n\t\t\t\tlegLength = legPath.getTotalLength() + 0.1; // Need a small extra length to avoid remaining dot in Firefox.\r\n\t\t\t\tlegPath.style.strokeDasharray = legLength; // Just 1 length is enough, it will be duplicated.\r\n\t\t\t\tlegPath.style.strokeDashoffset = legLength;\r\n\t\t\t}\r\n\r\n\t\t\t// If it is a marker, add it now and we'll animate it out\r\n\t\t\tif (m.setZIndexOffset) {\r\n\t\t\t\tm.setZIndexOffset(1000000); // Make normal markers appear on top of EVERYTHING\r\n\t\t\t}\r\n\t\t\tif (m.clusterHide) {\r\n\t\t\t\tm.clusterHide();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Vectors just get immediately added\r\n\t\t\tfg.addLayer(m);\r\n\r\n\t\t\tif (m._setPos) {\r\n\t\t\t\tm._setPos(thisLayerPos);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tgroup._forceLayout();\r\n\t\tgroup._animationStart();\r\n\r\n\t\t// Reveal markers and spider legs.\r\n\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\r\n\t\t\tnewPos = map.layerPointToLatLng(positions[i]);\r\n\t\t\tm = childMarkers[i];\r\n\r\n\t\t\t//Move marker to new position\r\n\t\t\tm._preSpiderfyLatlng = m._latlng;\r\n\t\t\tm.setLatLng(newPos);\r\n\t\t\t\r\n\t\t\tif (m.clusterShow) {\r\n\t\t\t\tm.clusterShow();\r\n\t\t\t}\r\n\r\n\t\t\t// Animate leg (animation is actually delegated to CSS transition).\r\n\t\t\tif (svg) {\r\n\t\t\t\tleg = m._spiderLeg;\r\n\t\t\t\tlegPath = leg._path;\r\n\t\t\t\tlegPath.style.strokeDashoffset = 0;\r\n\t\t\t\t//legPath.style.strokeOpacity = finalLegOpacity;\r\n\t\t\t\tleg.setStyle({opacity: finalLegOpacity});\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.setOpacity(0.3);\r\n\r\n\t\tgroup._ignoreMove = false;\r\n\r\n\t\tsetTimeout(function () {\r\n\t\t\tgroup._animationEnd();\r\n\t\t\tgroup.fire('spiderfied', {\r\n\t\t\t\tcluster: me,\r\n\t\t\t\tmarkers: childMarkers\r\n\t\t\t});\r\n\t\t}, 200);\r\n\t},\r\n\r\n\t_animationUnspiderfy: function (zoomDetails) {\r\n\t\tvar me = this,\r\n\t\t\tgroup = this._group,\r\n\t\t\tmap = group._map,\r\n\t\t\tfg = group._featureGroup,\r\n\t\t\tthisLayerPos = zoomDetails ? map._latLngToNewLayerPoint(this._latlng, zoomDetails.zoom, zoomDetails.center) : map.latLngToLayerPoint(this._latlng),\r\n\t\t\tchildMarkers = this.getAllChildMarkers(null, true),\r\n\t\t\tsvg = L.Path.SVG,\r\n\t\t\tm, i, leg, legPath, legLength, nonAnimatable;\r\n\r\n\t\tgroup._ignoreMove = true;\r\n\t\tgroup._animationStart();\r\n\r\n\t\t//Make us visible and bring the child markers back in\r\n\t\tthis.setOpacity(1);\r\n\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\r\n\t\t\tm = childMarkers[i];\r\n\r\n\t\t\t//Marker was added to us after we were spiderfied\r\n\t\t\tif (!m._preSpiderfyLatlng) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t//Close any popup on the marker first, otherwise setting the location of the marker will make the map scroll\r\n\t\t\tm.closePopup();\r\n\r\n\t\t\t//Fix up the location to the real one\r\n\t\t\tm.setLatLng(m._preSpiderfyLatlng);\r\n\t\t\tdelete m._preSpiderfyLatlng;\r\n\r\n\t\t\t//Hack override the location to be our center\r\n\t\t\tnonAnimatable = true;\r\n\t\t\tif (m._setPos) {\r\n\t\t\t\tm._setPos(thisLayerPos);\r\n\t\t\t\tnonAnimatable = false;\r\n\t\t\t}\r\n\t\t\tif (m.clusterHide) {\r\n\t\t\t\tm.clusterHide();\r\n\t\t\t\tnonAnimatable = false;\r\n\t\t\t}\r\n\t\t\tif (nonAnimatable) {\r\n\t\t\t\tfg.removeLayer(m);\r\n\t\t\t}\r\n\r\n\t\t\t// Animate the spider leg back in (animation is actually delegated to CSS transition).\r\n\t\t\tif (svg) {\r\n\t\t\t\tleg = m._spiderLeg;\r\n\t\t\t\tlegPath = leg._path;\r\n\t\t\t\tlegLength = legPath.getTotalLength() + 0.1;\r\n\t\t\t\tlegPath.style.strokeDashoffset = legLength;\r\n\t\t\t\tleg.setStyle({opacity: 0});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tgroup._ignoreMove = false;\r\n\r\n\t\tsetTimeout(function () {\r\n\t\t\t//If we have only <= one child left then that marker will be shown on the map so don't remove it!\r\n\t\t\tvar stillThereChildCount = 0;\r\n\t\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\r\n\t\t\t\tm = childMarkers[i];\r\n\t\t\t\tif (m._spiderLeg) {\r\n\t\t\t\t\tstillThereChildCount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\r\n\t\t\t\tm = childMarkers[i];\r\n\r\n\t\t\t\tif (!m._spiderLeg) { //Has already been unspiderfied\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (m.clusterShow) {\r\n\t\t\t\t\tm.clusterShow();\r\n\t\t\t\t}\r\n\t\t\t\tif (m.setZIndexOffset) {\r\n\t\t\t\t\tm.setZIndexOffset(0);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (stillThereChildCount > 1) {\r\n\t\t\t\t\tfg.removeLayer(m);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tmap.removeLayer(m._spiderLeg);\r\n\t\t\t\tdelete m._spiderLeg;\r\n\t\t\t}\r\n\t\t\tgroup._animationEnd();\r\n\t\t\tgroup.fire('unspiderfied', {\r\n\t\t\t\tcluster: me,\r\n\t\t\t\tmarkers: childMarkers\r\n\t\t\t});\r\n\t\t}, 200);\r\n\t}\r\n});\r\n\r\n\r\nL.MarkerClusterGroup.include({\r\n\t//The MarkerCluster currently spiderfied (if any)\r\n\t_spiderfied: null,\r\n\r\n\tunspiderfy: function () {\r\n\t\tthis._unspiderfy.apply(this, arguments);\r\n\t},\r\n\r\n\t_spiderfierOnAdd: function () {\r\n\t\tthis._map.on('click', this._unspiderfyWrapper, this);\r\n\r\n\t\tif (this._map.options.zoomAnimation) {\r\n\t\t\tthis._map.on('zoomstart', this._unspiderfyZoomStart, this);\r\n\t\t}\r\n\t\t//Browsers without zoomAnimation or a big zoom don't fire zoomstart\r\n\t\tthis._map.on('zoomend', this._noanimationUnspiderfy, this);\r\n\r\n\t\tif (!L.Browser.touch) {\r\n\t\t\tthis._map.getRenderer(this);\r\n\t\t\t//Needs to happen in the pageload, not after, or animations don't work in webkit\r\n\t\t\t// http://stackoverflow.com/questions/8455200/svg-animate-with-dynamically-added-elements\r\n\t\t\t//Disable on touch browsers as the animation messes up on a touch zoom and isn't very noticable\r\n\t\t}\r\n\t},\r\n\r\n\t_spiderfierOnRemove: function () {\r\n\t\tthis._map.off('click', this._unspiderfyWrapper, this);\r\n\t\tthis._map.off('zoomstart', this._unspiderfyZoomStart, this);\r\n\t\tthis._map.off('zoomanim', this._unspiderfyZoomAnim, this);\r\n\t\tthis._map.off('zoomend', this._noanimationUnspiderfy, this);\r\n\r\n\t\t//Ensure that markers are back where they should be\r\n\t\t// Use no animation to avoid a sticky leaflet-cluster-anim class on mapPane\r\n\t\tthis._noanimationUnspiderfy();\r\n\t},\r\n\r\n\t//On zoom start we add a zoomanim handler so that we are guaranteed to be last (after markers are animated)\r\n\t//This means we can define the animation they do rather than Markers doing an animation to their actual location\r\n\t_unspiderfyZoomStart: function () {\r\n\t\tif (!this._map) { //May have been removed from the map by a zoomEnd handler\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._map.on('zoomanim', this._unspiderfyZoomAnim, this);\r\n\t},\r\n\r\n\t_unspiderfyZoomAnim: function (zoomDetails) {\r\n\t\t//Wait until the first zoomanim after the user has finished touch-zooming before running the animation\r\n\t\tif (L.DomUtil.hasClass(this._map._mapPane, 'leaflet-touching')) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._map.off('zoomanim', this._unspiderfyZoomAnim, this);\r\n\t\tthis._unspiderfy(zoomDetails);\r\n\t},\r\n\r\n\t_unspiderfyWrapper: function () {\r\n\t\t/// <summary>_unspiderfy but passes no arguments</summary>\r\n\t\tthis._unspiderfy();\r\n\t},\r\n\r\n\t_unspiderfy: function (zoomDetails) {\r\n\t\tif (this._spiderfied) {\r\n\t\t\tthis._spiderfied.unspiderfy(zoomDetails);\r\n\t\t}\r\n\t},\r\n\r\n\t_noanimationUnspiderfy: function () {\r\n\t\tif (this._spiderfied) {\r\n\t\t\tthis._spiderfied._noanimationUnspiderfy();\r\n\t\t}\r\n\t},\r\n\r\n\t//If the given layer is currently being spiderfied then we unspiderfy it so it isn't on the map anymore etc\r\n\t_unspiderfyLayer: function (layer) {\r\n\t\tif (layer._spiderLeg) {\r\n\t\t\tthis._featureGroup.removeLayer(layer);\r\n\r\n\t\t\tif (layer.clusterShow) {\r\n\t\t\t\tlayer.clusterShow();\r\n\t\t\t}\r\n\t\t\t\t//Position will be fixed up immediately in _animationUnspiderfy\r\n\t\t\tif (layer.setZIndexOffset) {\r\n\t\t\t\tlayer.setZIndexOffset(0);\r\n\t\t\t}\r\n\r\n\t\t\tthis._map.removeLayer(layer._spiderLeg);\r\n\t\t\tdelete layer._spiderLeg;\r\n\t\t}\r\n\t}\r\n});\n\n/**\r\n * Adds 1 public method to MCG and 1 to L.Marker to facilitate changing\r\n * markers' icon options and refreshing their icon and their parent clusters\r\n * accordingly (case where their iconCreateFunction uses data of childMarkers\r\n * to make up the cluster icon).\r\n */\r\n\r\n\r\nL.MarkerClusterGroup.include({\r\n\t/**\r\n\t * Updates the icon of all clusters which are parents of the given marker(s).\r\n\t * In singleMarkerMode, also updates the given marker(s) icon.\r\n\t * @param layers L.MarkerClusterGroup|L.LayerGroup|Array(L.Marker)|Map(L.Marker)|\r\n\t * L.MarkerCluster|L.Marker (optional) list of markers (or single marker) whose parent\r\n\t * clusters need to be updated. If not provided, retrieves all child markers of this.\r\n\t * @returns {L.MarkerClusterGroup}\r\n\t */\r\n\trefreshClusters: function (layers) {\r\n\t\tif (!layers) {\r\n\t\t\tlayers = this._topClusterLevel.getAllChildMarkers();\r\n\t\t} else if (layers instanceof L.MarkerClusterGroup) {\r\n\t\t\tlayers = layers._topClusterLevel.getAllChildMarkers();\r\n\t\t} else if (layers instanceof L.LayerGroup) {\r\n\t\t\tlayers = layers._layers;\r\n\t\t} else if (layers instanceof L.MarkerCluster) {\r\n\t\t\tlayers = layers.getAllChildMarkers();\r\n\t\t} else if (layers instanceof L.Marker) {\r\n\t\t\tlayers = [layers];\r\n\t\t} // else: must be an Array(L.Marker)|Map(L.Marker)\r\n\t\tthis._flagParentsIconsNeedUpdate(layers);\r\n\t\tthis._refreshClustersIcons();\r\n\r\n\t\t// In case of singleMarkerMode, also re-draw the markers.\r\n\t\tif (this.options.singleMarkerMode) {\r\n\t\t\tthis._refreshSingleMarkerModeMarkers(layers);\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t/**\r\n\t * Simply flags all parent clusters of the given markers as having a \"dirty\" icon.\r\n\t * @param layers Array(L.Marker)|Map(L.Marker) list of markers.\r\n\t * @private\r\n\t */\r\n\t_flagParentsIconsNeedUpdate: function (layers) {\r\n\t\tvar id, parent;\r\n\r\n\t\t// Assumes layers is an Array or an Object whose prototype is non-enumerable.\r\n\t\tfor (id in layers) {\r\n\t\t\t// Flag parent clusters' icon as \"dirty\", all the way up.\r\n\t\t\t// Dumb process that flags multiple times upper parents, but still\r\n\t\t\t// much more efficient than trying to be smart and make short lists,\r\n\t\t\t// at least in the case of a hierarchy following a power law:\r\n\t\t\t// http://jsperf.com/flag-nodes-in-power-hierarchy/2\r\n\t\t\tparent = layers[id].__parent;\r\n\t\t\twhile (parent) {\r\n\t\t\t\tparent._iconNeedsUpdate = true;\r\n\t\t\t\tparent = parent.__parent;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Re-draws the icon of the supplied markers.\r\n\t * To be used in singleMarkerMode only.\r\n\t * @param layers Array(L.Marker)|Map(L.Marker) list of markers.\r\n\t * @private\r\n\t */\r\n\t_refreshSingleMarkerModeMarkers: function (layers) {\r\n\t\tvar id, layer;\r\n\r\n\t\tfor (id in layers) {\r\n\t\t\tlayer = layers[id];\r\n\r\n\t\t\t// Make sure we do not override markers that do not belong to THIS group.\r\n\t\t\tif (this.hasLayer(layer)) {\r\n\t\t\t\t// Need to re-create the icon first, then re-draw the marker.\r\n\t\t\t\tlayer.setIcon(this._overrideMarkerIcon(layer));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n});\r\n\r\nL.Marker.include({\r\n\t/**\r\n\t * Updates the given options in the marker's icon and refreshes the marker.\r\n\t * @param options map object of icon options.\r\n\t * @param directlyRefreshClusters boolean (optional) true to trigger\r\n\t * MCG.refreshClustersOf() right away with this single marker.\r\n\t * @returns {L.Marker}\r\n\t */\r\n\trefreshIconOptions: function (options, directlyRefreshClusters) {\r\n\t\tvar icon = this.options.icon;\r\n\r\n\t\tL.setOptions(icon, options);\r\n\r\n\t\tthis.setIcon(icon);\r\n\r\n\t\t// Shortcut to refresh the associated MCG clusters right away.\r\n\t\t// To be used when refreshing a single marker.\r\n\t\t// Otherwise, better use MCG.refreshClusters() once at the end with\r\n\t\t// the list of modified markers.\r\n\t\tif (directlyRefreshClusters && this.__parent) {\r\n\t\t\tthis.__parent._group.refreshClusters(this);\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t}\r\n});\n\nexports.MarkerClusterGroup = MarkerClusterGroup;\nexports.MarkerCluster = MarkerCluster;\n\n})));\n//# sourceMappingURL=leaflet.markercluster-src.js.map\n\n\n//# sourceURL=webpack://ReactLeafletDeflate/./node_modules/leaflet.markercluster/dist/leaflet.markercluster-src.js?");
|
|
171
|
+
eval("{/*\n * Leaflet.markercluster 1.5.3+master.e5124b2,\n * Provides Beautiful Animated Marker Clustering functionality for Leaflet, a JS library for interactive maps.\n * https://github.com/Leaflet/Leaflet.markercluster\n * (c) 2012-2017, Dave Leaver, smartrak\n */\n(function (global, factory) {\n\t true ? factory(exports) :\n\t0;\n}(this, function (exports) { 'use strict';\n\n\t/*\n\t * L.MarkerClusterGroup extends L.FeatureGroup by clustering the markers contained within\n\t */\n\n\tvar MarkerClusterGroup = L.MarkerClusterGroup = L.FeatureGroup.extend({\n\n\t\toptions: {\n\t\t\tmaxClusterRadius: 80, //A cluster will cover at most this many pixels from its center\n\t\t\ticonCreateFunction: null,\n\t\t\tclusterPane: L.Marker.prototype.options.pane,\n\n\t\t\tspiderfyOnEveryZoom: false,\n\t\t\tspiderfyOnMaxZoom: true,\n\t\t\tshowCoverageOnHover: true,\n\t\t\tzoomToBoundsOnClick: true,\n\t\t\tsingleMarkerMode: false,\n\n\t\t\tdisableClusteringAtZoom: null,\n\n\t\t\t// Setting this to false prevents the removal of any clusters outside of the viewpoint, which\n\t\t\t// is the default behaviour for performance reasons.\n\t\t\tremoveOutsideVisibleBounds: true,\n\n\t\t\t// Set to false to disable all animations (zoom and spiderfy).\n\t\t\t// If false, option animateAddingMarkers below has no effect.\n\t\t\t// If L.DomUtil.TRANSITION is falsy, this option has no effect.\n\t\t\tanimate: true,\n\n\t\t\t//Whether to animate adding markers after adding the MarkerClusterGroup to the map\n\t\t\t// If you are adding individual markers set to true, if adding bulk markers leave false for massive performance gains.\n\t\t\tanimateAddingMarkers: false,\n\n\t\t\t// Make it possible to provide custom function to calculate spiderfy shape positions\n\t\t\tspiderfyShapePositions: null,\n\n\t\t\t//Increase to increase the distance away that spiderfied markers appear from the center\n\t\t\tspiderfyDistanceMultiplier: 1,\n\n\t\t\t// Make it possible to specify a polyline options on a spider leg\n\t\t\tspiderLegPolylineOptions: { weight: 1.5, color: '#222', opacity: 0.5 },\n\n\t\t\t// When bulk adding layers, adds markers in chunks. Means addLayers may not add all the layers in the call, others will be loaded during setTimeouts\n\t\t\tchunkedLoading: false,\n\t\t\tchunkInterval: 200, // process markers for a maximum of ~ n milliseconds (then trigger the chunkProgress callback)\n\t\t\tchunkDelay: 50, // at the end of each interval, give n milliseconds back to system/browser\n\t\t\tchunkProgress: null, // progress callback: function(processed, total, elapsed) (e.g. for a progress indicator)\n\n\t\t\t//Options to pass to the L.Polygon constructor\n\t\t\tpolygonOptions: {}\n\t\t},\n\n\t\tinitialize: function (options) {\n\t\t\tL.Util.setOptions(this, options);\n\t\t\tif (!this.options.iconCreateFunction) {\n\t\t\t\tthis.options.iconCreateFunction = this._defaultIconCreateFunction;\n\t\t\t}\n\n\t\t\tthis._featureGroup = L.featureGroup();\n\t\t\tthis._featureGroup.addEventParent(this);\n\n\t\t\tthis._nonPointGroup = L.featureGroup();\n\t\t\tthis._nonPointGroup.addEventParent(this);\n\n\t\t\tthis._inZoomAnimation = 0;\n\t\t\tthis._needsClustering = [];\n\t\t\tthis._needsRemoving = []; //Markers removed while we aren't on the map need to be kept track of\n\t\t\t//The bounds of the currently shown area (from _getExpandedVisibleBounds) Updated on zoom/move\n\t\t\tthis._currentShownBounds = null;\n\n\t\t\tthis._queue = [];\n\n\t\t\tthis._childMarkerEventHandlers = {\n\t\t\t\t'dragstart': this._childMarkerDragStart,\n\t\t\t\t'move': this._childMarkerMoved,\n\t\t\t\t'dragend': this._childMarkerDragEnd,\n\t\t\t};\n\n\t\t\t// Hook the appropriate animation methods.\n\t\t\tvar animate = L.DomUtil.TRANSITION && this.options.animate;\n\t\t\tL.extend(this, animate ? this._withAnimation : this._noAnimation);\n\t\t\t// Remember which MarkerCluster class to instantiate (animated or not).\n\t\t\tthis._markerCluster = animate ? L.MarkerCluster : L.MarkerClusterNonAnimated;\n\t\t},\n\n\t\taddLayer: function (layer) {\n\n\t\t\tif (layer instanceof L.LayerGroup) {\n\t\t\t\treturn this.addLayers([layer]);\n\t\t\t}\n\n\t\t\t//Don't cluster non point data\n\t\t\tif (!layer.getLatLng) {\n\t\t\t\tthis._nonPointGroup.addLayer(layer);\n\t\t\t\tthis.fire('layeradd', { layer: layer });\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tif (!this._map) {\n\t\t\t\tthis._needsClustering.push(layer);\n\t\t\t\tthis.fire('layeradd', { layer: layer });\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tif (this.hasLayer(layer)) {\n\t\t\t\treturn this;\n\t\t\t}\n\n\n\t\t\t//If we have already clustered we'll need to add this one to a cluster\n\n\t\t\tif (this._unspiderfy) {\n\t\t\t\tthis._unspiderfy();\n\t\t\t}\n\n\t\t\tthis._addLayer(layer, this._maxZoom);\n\t\t\tthis.fire('layeradd', { layer: layer });\n\n\t\t\t// Refresh bounds and weighted positions.\n\t\t\tthis._topClusterLevel._recalculateBounds();\n\n\t\t\tthis._refreshClustersIcons();\n\n\t\t\t//Work out what is visible\n\t\t\tvar visibleLayer = layer,\n\t\t\t currentZoom = this._zoom;\n\t\t\tif (layer.__parent) {\n\t\t\t\twhile (visibleLayer.__parent._zoom >= currentZoom) {\n\t\t\t\t\tvisibleLayer = visibleLayer.__parent;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this._currentShownBounds.contains(visibleLayer.getLatLng())) {\n\t\t\t\tif (this.options.animateAddingMarkers) {\n\t\t\t\t\tthis._animationAddLayer(layer, visibleLayer);\n\t\t\t\t} else {\n\t\t\t\t\tthis._animationAddLayerNonAnimated(layer, visibleLayer);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\n\t\tremoveLayer: function (layer) {\n\n\t\t\tif (layer instanceof L.LayerGroup) {\n\t\t\t\treturn this.removeLayers([layer]);\n\t\t\t}\n\n\t\t\t//Non point layers\n\t\t\tif (!layer.getLatLng) {\n\t\t\t\tthis._nonPointGroup.removeLayer(layer);\n\t\t\t\tthis.fire('layerremove', { layer: layer });\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tif (!this._map) {\n\t\t\t\tif (!this._arraySplice(this._needsClustering, layer) && this.hasLayer(layer)) {\n\t\t\t\t\tthis._needsRemoving.push({ layer: layer, latlng: layer._latlng });\n\t\t\t\t}\n\t\t\t\tthis.fire('layerremove', { layer: layer });\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tif (!layer.__parent) {\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tif (this._unspiderfy) {\n\t\t\t\tthis._unspiderfy();\n\t\t\t\tthis._unspiderfyLayer(layer);\n\t\t\t}\n\n\t\t\t//Remove the marker from clusters\n\t\t\tthis._removeLayer(layer, true);\n\t\t\tthis.fire('layerremove', { layer: layer });\n\n\t\t\t// Refresh bounds and weighted positions.\n\t\t\tthis._topClusterLevel._recalculateBounds();\n\n\t\t\tthis._refreshClustersIcons();\n\n\t\t\tlayer.off(this._childMarkerEventHandlers, this);\n\n\t\t\tif (this._featureGroup.hasLayer(layer)) {\n\t\t\t\tthis._featureGroup.removeLayer(layer);\n\t\t\t\tif (layer.clusterShow) {\n\t\t\t\t\tlayer.clusterShow();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this;\n\t\t},\n\n\t\t//Takes an array of markers and adds them in bulk\n\t\taddLayers: function (layersArray, skipLayerAddEvent) {\n\t\t\tif (!L.Util.isArray(layersArray)) {\n\t\t\t\treturn this.addLayer(layersArray);\n\t\t\t}\n\n\t\t\tvar fg = this._featureGroup,\n\t\t\t npg = this._nonPointGroup,\n\t\t\t chunked = this.options.chunkedLoading,\n\t\t\t chunkInterval = this.options.chunkInterval,\n\t\t\t chunkProgress = this.options.chunkProgress,\n\t\t\t l = layersArray.length,\n\t\t\t offset = 0,\n\t\t\t originalArray = true,\n\t\t\t m;\n\n\t\t\tif (this._map) {\n\t\t\t\tvar started = (new Date()).getTime();\n\t\t\t\tvar process = L.bind(function () {\n\t\t\t\t\tvar start = (new Date()).getTime();\n\n\t\t\t\t\t// Make sure to unspiderfy before starting to add some layers\n\t\t\t\t\tif (this._map && this._unspiderfy) {\n\t\t\t\t\t\tthis._unspiderfy();\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (; offset < l; offset++) {\n\t\t\t\t\t\tif (chunked && offset % 200 === 0) {\n\t\t\t\t\t\t\t// every couple hundred markers, instrument the time elapsed since processing started:\n\t\t\t\t\t\t\tvar elapsed = (new Date()).getTime() - start;\n\t\t\t\t\t\t\tif (elapsed > chunkInterval) {\n\t\t\t\t\t\t\t\tbreak; // been working too hard, time to take a break :-)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tm = layersArray[offset];\n\n\t\t\t\t\t\t// Group of layers, append children to layersArray and skip.\n\t\t\t\t\t\t// Side effects:\n\t\t\t\t\t\t// - Total increases, so chunkProgress ratio jumps backward.\n\t\t\t\t\t\t// - Groups are not included in this group, only their non-group child layers (hasLayer).\n\t\t\t\t\t\t// Changing array length while looping does not affect performance in current browsers:\n\t\t\t\t\t\t// http://jsperf.com/for-loop-changing-length/6\n\t\t\t\t\t\tif (m instanceof L.LayerGroup) {\n\t\t\t\t\t\t\tif (originalArray) {\n\t\t\t\t\t\t\t\tlayersArray = layersArray.slice();\n\t\t\t\t\t\t\t\toriginalArray = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis._extractNonGroupLayers(m, layersArray);\n\t\t\t\t\t\t\tl = layersArray.length;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Not point data, can't be clustered\n\t\t\t\t\t\tif (!m.getLatLng) {\n\t\t\t\t\t\t\tnpg.addLayer(m);\n\t\t\t\t\t\t\tif (!skipLayerAddEvent) {\n\t\t\t\t\t\t\t\tthis.fire('layeradd', { layer: m });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (this.hasLayer(m)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis._addLayer(m, this._maxZoom);\n\t\t\t\t\t\tif (!skipLayerAddEvent) {\n\t\t\t\t\t\t\tthis.fire('layeradd', { layer: m });\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//If we just made a cluster of size 2 then we need to remove the other marker from the map (if it is) or we never will\n\t\t\t\t\t\tif (m.__parent) {\n\t\t\t\t\t\t\tif (m.__parent.getChildCount() === 2) {\n\t\t\t\t\t\t\t\tvar markers = m.__parent.getAllChildMarkers(),\n\t\t\t\t\t\t\t\t otherMarker = markers[0] === m ? markers[1] : markers[0];\n\t\t\t\t\t\t\t\tfg.removeLayer(otherMarker);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (chunkProgress) {\n\t\t\t\t\t\t// report progress and time elapsed:\n\t\t\t\t\t\tchunkProgress(offset, l, (new Date()).getTime() - started);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Completed processing all markers.\n\t\t\t\t\tif (offset === l) {\n\n\t\t\t\t\t\t// Refresh bounds and weighted positions.\n\t\t\t\t\t\tthis._topClusterLevel._recalculateBounds();\n\n\t\t\t\t\t\tthis._refreshClustersIcons();\n\n\t\t\t\t\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetTimeout(process, this.options.chunkDelay);\n\t\t\t\t\t}\n\t\t\t\t}, this);\n\n\t\t\t\tprocess();\n\t\t\t} else {\n\t\t\t\tvar needsClustering = this._needsClustering;\n\n\t\t\t\tfor (; offset < l; offset++) {\n\t\t\t\t\tm = layersArray[offset];\n\n\t\t\t\t\t// Group of layers, append children to layersArray and skip.\n\t\t\t\t\tif (m instanceof L.LayerGroup) {\n\t\t\t\t\t\tif (originalArray) {\n\t\t\t\t\t\t\tlayersArray = layersArray.slice();\n\t\t\t\t\t\t\toriginalArray = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._extractNonGroupLayers(m, layersArray);\n\t\t\t\t\t\tl = layersArray.length;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t//Not point data, can't be clustered\n\t\t\t\t\tif (!m.getLatLng) {\n\t\t\t\t\t\tnpg.addLayer(m);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.hasLayer(m)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tneedsClustering.push(m);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\n\t\t//Takes an array of markers and removes them in bulk\n\t\tremoveLayers: function (layersArray) {\n\t\t\tvar i, m,\n\t\t\t l = layersArray.length,\n\t\t\t fg = this._featureGroup,\n\t\t\t npg = this._nonPointGroup,\n\t\t\t originalArray = true;\n\n\t\t\tif (!this._map) {\n\t\t\t\tfor (i = 0; i < l; i++) {\n\t\t\t\t\tm = layersArray[i];\n\n\t\t\t\t\t// Group of layers, append children to layersArray and skip.\n\t\t\t\t\tif (m instanceof L.LayerGroup) {\n\t\t\t\t\t\tif (originalArray) {\n\t\t\t\t\t\t\tlayersArray = layersArray.slice();\n\t\t\t\t\t\t\toriginalArray = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._extractNonGroupLayers(m, layersArray);\n\t\t\t\t\t\tl = layersArray.length;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._arraySplice(this._needsClustering, m);\n\t\t\t\t\tnpg.removeLayer(m);\n\t\t\t\t\tif (this.hasLayer(m)) {\n\t\t\t\t\t\tthis._needsRemoving.push({ layer: m, latlng: m._latlng });\n\t\t\t\t\t}\n\t\t\t\t\tthis.fire('layerremove', { layer: m });\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tif (this._unspiderfy) {\n\t\t\t\tthis._unspiderfy();\n\n\t\t\t\t// Work on a copy of the array, so that next loop is not affected.\n\t\t\t\tvar layersArray2 = layersArray.slice(),\n\t\t\t\t l2 = l;\n\t\t\t\tfor (i = 0; i < l2; i++) {\n\t\t\t\t\tm = layersArray2[i];\n\n\t\t\t\t\t// Group of layers, append children to layersArray and skip.\n\t\t\t\t\tif (m instanceof L.LayerGroup) {\n\t\t\t\t\t\tthis._extractNonGroupLayers(m, layersArray2);\n\t\t\t\t\t\tl2 = layersArray2.length;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._unspiderfyLayer(m);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (i = 0; i < l; i++) {\n\t\t\t\tm = layersArray[i];\n\n\t\t\t\t// Group of layers, append children to layersArray and skip.\n\t\t\t\tif (m instanceof L.LayerGroup) {\n\t\t\t\t\tif (originalArray) {\n\t\t\t\t\t\tlayersArray = layersArray.slice();\n\t\t\t\t\t\toriginalArray = false;\n\t\t\t\t\t}\n\t\t\t\t\tthis._extractNonGroupLayers(m, layersArray);\n\t\t\t\t\tl = layersArray.length;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (!m.__parent) {\n\t\t\t\t\tnpg.removeLayer(m);\n\t\t\t\t\tthis.fire('layerremove', { layer: m });\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tthis._removeLayer(m, true, true);\n\t\t\t\tthis.fire('layerremove', { layer: m });\n\n\t\t\t\tif (fg.hasLayer(m)) {\n\t\t\t\t\tfg.removeLayer(m);\n\t\t\t\t\tif (m.clusterShow) {\n\t\t\t\t\t\tm.clusterShow();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Refresh bounds and weighted positions.\n\t\t\tthis._topClusterLevel._recalculateBounds();\n\n\t\t\tthis._refreshClustersIcons();\n\n\t\t\t//Fix up the clusters and markers on the map\n\t\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds);\n\n\t\t\treturn this;\n\t\t},\n\n\t\t//Removes all layers from the MarkerClusterGroup\n\t\tclearLayers: function () {\n\t\t\t//Need our own special implementation as the LayerGroup one doesn't work for us\n\n\t\t\t//If we aren't on the map (yet), blow away the markers we know of\n\t\t\tif (!this._map) {\n\t\t\t\tthis._needsClustering = [];\n\t\t\t\tthis._needsRemoving = [];\n\t\t\t\tdelete this._gridClusters;\n\t\t\t\tdelete this._gridUnclustered;\n\t\t\t}\n\n\t\t\tif (this._noanimationUnspiderfy) {\n\t\t\t\tthis._noanimationUnspiderfy();\n\t\t\t}\n\n\t\t\t//Remove all the visible layers\n\t\t\tthis._featureGroup.clearLayers();\n\t\t\tthis._nonPointGroup.clearLayers();\n\n\t\t\tthis.eachLayer(function (marker) {\n\t\t\t\tmarker.off(this._childMarkerEventHandlers, this);\n\t\t\t\tdelete marker.__parent;\n\t\t\t}, this);\n\n\t\t\tif (this._map) {\n\t\t\t\t//Reset _topClusterLevel and the DistanceGrids\n\t\t\t\tthis._generateInitialClusters();\n\t\t\t}\n\n\t\t\treturn this;\n\t\t},\n\n\t\t//Override FeatureGroup.getBounds as it doesn't work\n\t\tgetBounds: function () {\n\t\t\tvar bounds = new L.LatLngBounds();\n\n\t\t\tif (this._topClusterLevel) {\n\t\t\t\tbounds.extend(this._topClusterLevel._bounds);\n\t\t\t}\n\n\t\t\tfor (var i = this._needsClustering.length - 1; i >= 0; i--) {\n\t\t\t\tbounds.extend(this._needsClustering[i].getLatLng());\n\t\t\t}\n\n\t\t\tbounds.extend(this._nonPointGroup.getBounds());\n\n\t\t\treturn bounds;\n\t\t},\n\n\t\t//Overrides LayerGroup.eachLayer\n\t\teachLayer: function (method, context) {\n\t\t\tvar markers = this._needsClustering.slice(),\n\t\t\t\tneedsRemoving = this._needsRemoving,\n\t\t\t\tthisNeedsRemoving, i, j;\n\n\t\t\tif (this._topClusterLevel) {\n\t\t\t\tthis._topClusterLevel.getAllChildMarkers(markers);\n\t\t\t}\n\n\t\t\tfor (i = markers.length - 1; i >= 0; i--) {\n\t\t\t\tthisNeedsRemoving = true;\n\n\t\t\t\tfor (j = needsRemoving.length - 1; j >= 0; j--) {\n\t\t\t\t\tif (needsRemoving[j].layer === markers[i]) {\n\t\t\t\t\t\tthisNeedsRemoving = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (thisNeedsRemoving) {\n\t\t\t\t\tmethod.call(context, markers[i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._nonPointGroup.eachLayer(method, context);\n\t\t},\n\n\t\t//Overrides LayerGroup.getLayers\n\t\tgetLayers: function () {\n\t\t\tvar layers = [];\n\t\t\tthis.eachLayer(function (l) {\n\t\t\t\tlayers.push(l);\n\t\t\t});\n\t\t\treturn layers;\n\t\t},\n\n\t\t//Overrides LayerGroup.getLayer, WARNING: Really bad performance\n\t\tgetLayer: function (id) {\n\t\t\tvar result = null;\n\n\t\t\tid = parseInt(id, 10);\n\n\t\t\tthis.eachLayer(function (l) {\n\t\t\t\tif (L.stamp(l) === id) {\n\t\t\t\t\tresult = l;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn result;\n\t\t},\n\n\t\t//Returns true if the given layer is in this MarkerClusterGroup\n\t\thasLayer: function (layer) {\n\t\t\tif (!layer) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar i, anArray = this._needsClustering;\n\n\t\t\tfor (i = anArray.length - 1; i >= 0; i--) {\n\t\t\t\tif (anArray[i] === layer) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tanArray = this._needsRemoving;\n\t\t\tfor (i = anArray.length - 1; i >= 0; i--) {\n\t\t\t\tif (anArray[i].layer === layer) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn !!(layer.__parent && layer.__parent._group === this) || this._nonPointGroup.hasLayer(layer);\n\t\t},\n\n\t\t//Zoom down to show the given layer (spiderfying if necessary) then calls the callback\n\t\tzoomToShowLayer: function (layer, callback) {\n\n\t\t\tvar map = this._map;\n\n\t\t\tif (typeof callback !== 'function') {\n\t\t\t\tcallback = function () {};\n\t\t\t}\n\n\t\t\tvar showMarker = function () {\n\t\t\t\t// Assumes that map.hasLayer checks for direct appearance on map, not recursively calling\n\t\t\t\t// hasLayer on Layer Groups that are on map (typically not calling this MarkerClusterGroup.hasLayer, which would always return true)\n\t\t\t\tif ((map.hasLayer(layer) || map.hasLayer(layer.__parent)) && !this._inZoomAnimation) {\n\t\t\t\t\tthis._map.off('moveend', showMarker, this);\n\t\t\t\t\tthis.off('animationend', showMarker, this);\n\n\t\t\t\t\tif (map.hasLayer(layer)) {\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t} else if (layer.__parent._icon) {\n\t\t\t\t\t\tthis.once('spiderfied', callback, this);\n\t\t\t\t\t\tlayer.__parent.spiderfy();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tif (layer._icon && this._map.getBounds().contains(layer.getLatLng())) {\n\t\t\t\t//Layer is visible ond on screen, immediate return\n\t\t\t\tcallback();\n\t\t\t} else if (layer.__parent._zoom < Math.round(this._map._zoom)) {\n\t\t\t\t//Layer should be visible at this zoom level. It must not be on screen so just pan over to it\n\t\t\t\tthis._map.on('moveend', showMarker, this);\n\t\t\t\tthis._map.panTo(layer.getLatLng());\n\t\t\t} else {\n\t\t\t\tthis._map.on('moveend', showMarker, this);\n\t\t\t\tthis.on('animationend', showMarker, this);\n\t\t\t\tlayer.__parent.zoomToBounds();\n\t\t\t}\n\t\t},\n\n\t\t//Overrides FeatureGroup.onAdd\n\t\tonAdd: function (map) {\n\t\t\tthis._map = map;\n\t\t\tvar i, l, layer;\n\n\t\t\tif (!isFinite(this._map.getMaxZoom())) {\n\t\t\t\tthrow \"Map has no maxZoom specified\";\n\t\t\t}\n\n\t\t\tthis._featureGroup.addTo(map);\n\t\t\tthis._nonPointGroup.addTo(map);\n\n\t\t\tif (!this._gridClusters) {\n\t\t\t\tthis._generateInitialClusters();\n\t\t\t}\n\n\t\t\tthis._maxLat = map.options.crs.projection.MAX_LATITUDE;\n\n\t\t\t//Restore all the positions as they are in the MCG before removing them\n\t\t\tfor (i = 0, l = this._needsRemoving.length; i < l; i++) {\n\t\t\t\tlayer = this._needsRemoving[i];\n\t\t\t\tlayer.newlatlng = layer.layer._latlng;\n\t\t\t\tlayer.layer._latlng = layer.latlng;\n\t\t\t}\n\t\t\t//Remove them, then restore their new positions\n\t\t\tfor (i = 0, l = this._needsRemoving.length; i < l; i++) {\n\t\t\t\tlayer = this._needsRemoving[i];\n\t\t\t\tthis._removeLayer(layer.layer, true);\n\t\t\t\tlayer.layer._latlng = layer.newlatlng;\n\t\t\t}\n\t\t\tthis._needsRemoving = [];\n\n\t\t\t//Remember the current zoom level and bounds\n\t\t\tthis._zoom = Math.round(this._map._zoom);\n\t\t\tthis._currentShownBounds = this._getExpandedVisibleBounds();\n\n\t\t\tthis._map.on('zoomend', this._zoomEnd, this);\n\t\t\tthis._map.on('moveend', this._moveEnd, this);\n\n\t\t\tif (this._spiderfierOnAdd) { //TODO FIXME: Not sure how to have spiderfier add something on here nicely\n\t\t\t\tthis._spiderfierOnAdd();\n\t\t\t}\n\n\t\t\tthis._bindEvents();\n\n\t\t\t//Actually add our markers to the map:\n\t\t\tl = this._needsClustering;\n\t\t\tthis._needsClustering = [];\n\t\t\tthis.addLayers(l, true);\n\t\t},\n\n\t\t//Overrides FeatureGroup.onRemove\n\t\tonRemove: function (map) {\n\t\t\tmap.off('zoomend', this._zoomEnd, this);\n\t\t\tmap.off('moveend', this._moveEnd, this);\n\n\t\t\tthis._unbindEvents();\n\n\t\t\t//In case we are in a cluster animation\n\t\t\tthis._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', '');\n\n\t\t\tif (this._spiderfierOnRemove) { //TODO FIXME: Not sure how to have spiderfier add something on here nicely\n\t\t\t\tthis._spiderfierOnRemove();\n\t\t\t}\n\n\t\t\tdelete this._maxLat;\n\n\t\t\t//Clean up all the layers we added to the map\n\t\t\tthis._hideCoverage();\n\t\t\tthis._featureGroup.remove();\n\t\t\tthis._nonPointGroup.remove();\n\n\t\t\tthis._featureGroup.clearLayers();\n\n\t\t\tthis._map = null;\n\t\t},\n\n\t\tgetVisibleParent: function (marker) {\n\t\t\tvar vMarker = marker;\n\t\t\twhile (vMarker && !vMarker._icon) {\n\t\t\t\tvMarker = vMarker.__parent;\n\t\t\t}\n\t\t\treturn vMarker || null;\n\t\t},\n\n\t\t//Remove the given object from the given array\n\t\t_arraySplice: function (anArray, obj) {\n\t\t\tfor (var i = anArray.length - 1; i >= 0; i--) {\n\t\t\t\tif (anArray[i] === obj) {\n\t\t\t\t\tanArray.splice(i, 1);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Removes a marker from all _gridUnclustered zoom levels, starting at the supplied zoom.\n\t\t * @param marker to be removed from _gridUnclustered.\n\t\t * @param z integer bottom start zoom level (included)\n\t\t * @private\n\t\t */\n\t\t_removeFromGridUnclustered: function (marker, z) {\n\t\t\tvar map = this._map,\n\t\t\t gridUnclustered = this._gridUnclustered,\n\t\t\t\tminZoom = Math.floor(this._map.getMinZoom());\n\n\t\t\tfor (; z >= minZoom; z--) {\n\t\t\t\tif (!gridUnclustered[z].removeObject(marker, map.project(marker.getLatLng(), z))) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t_childMarkerDragStart: function (e) {\n\t\t\te.target.__dragStart = e.target._latlng;\n\t\t},\n\n\t\t_childMarkerMoved: function (e) {\n\t\t\tif (!this._ignoreMove && !e.target.__dragStart) {\n\t\t\t\tvar isPopupOpen = e.target._popup && e.target._popup.isOpen();\n\n\t\t\t\tthis._moveChild(e.target, e.oldLatLng, e.latlng);\n\n\t\t\t\tif (isPopupOpen) {\n\t\t\t\t\te.target.openPopup();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t_moveChild: function (layer, from, to) {\n\t\t\tlayer._latlng = from;\n\t\t\tthis.removeLayer(layer);\n\n\t\t\tlayer._latlng = to;\n\t\t\tthis.addLayer(layer);\n\t\t},\n\n\t\t_childMarkerDragEnd: function (e) {\n\t\t\tvar dragStart = e.target.__dragStart;\n\t\t\tdelete e.target.__dragStart;\n\t\t\tif (dragStart) {\n\t\t\t\tthis._moveChild(e.target, dragStart, e.target._latlng);\n\t\t\t}\t\t\n\t\t},\n\n\n\t\t//Internal function for removing a marker from everything.\n\t\t//dontUpdateMap: set to true if you will handle updating the map manually (for bulk functions)\n\t\t_removeLayer: function (marker, removeFromDistanceGrid, dontUpdateMap) {\n\t\t\tvar gridClusters = this._gridClusters,\n\t\t\t\tgridUnclustered = this._gridUnclustered,\n\t\t\t\tfg = this._featureGroup,\n\t\t\t\tmap = this._map,\n\t\t\t\tminZoom = Math.floor(this._map.getMinZoom());\n\n\t\t\t//Remove the marker from distance clusters it might be in\n\t\t\tif (removeFromDistanceGrid) {\n\t\t\t\tthis._removeFromGridUnclustered(marker, this._maxZoom);\n\t\t\t}\n\n\t\t\t//Work our way up the clusters removing them as we go if required\n\t\t\tvar cluster = marker.__parent,\n\t\t\t\tmarkers = cluster._markers,\n\t\t\t\totherMarker;\n\n\t\t\t//Remove the marker from the immediate parents marker list\n\t\t\tthis._arraySplice(markers, marker);\n\n\t\t\twhile (cluster) {\n\t\t\t\tcluster._childCount--;\n\t\t\t\tcluster._boundsNeedUpdate = true;\n\n\t\t\t\tif (cluster._zoom < minZoom) {\n\t\t\t\t\t//Top level, do nothing\n\t\t\t\t\tbreak;\n\t\t\t\t} else if (removeFromDistanceGrid && cluster._childCount <= 1) { //Cluster no longer required\n\t\t\t\t\t//We need to push the other marker up to the parent\n\t\t\t\t\totherMarker = cluster._markers[0] === marker ? cluster._markers[1] : cluster._markers[0];\n\n\t\t\t\t\t//Update distance grid\n\t\t\t\t\tgridClusters[cluster._zoom].removeObject(cluster, map.project(cluster._cLatLng, cluster._zoom));\n\t\t\t\t\tgridUnclustered[cluster._zoom].addObject(otherMarker, map.project(otherMarker.getLatLng(), cluster._zoom));\n\n\t\t\t\t\t//Move otherMarker up to parent\n\t\t\t\t\tthis._arraySplice(cluster.__parent._childClusters, cluster);\n\t\t\t\t\tcluster.__parent._markers.push(otherMarker);\n\t\t\t\t\totherMarker.__parent = cluster.__parent;\n\n\t\t\t\t\tif (cluster._icon) {\n\t\t\t\t\t\t//Cluster is currently on the map, need to put the marker on the map instead\n\t\t\t\t\t\tfg.removeLayer(cluster);\n\t\t\t\t\t\tif (!dontUpdateMap) {\n\t\t\t\t\t\t\tfg.addLayer(otherMarker);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tcluster._iconNeedsUpdate = true;\n\t\t\t\t}\n\n\t\t\t\tcluster = cluster.__parent;\n\t\t\t}\n\n\t\t\tdelete marker.__parent;\n\t\t},\n\n\t\t_isOrIsParent: function (el, oel) {\n\t\t\twhile (oel) {\n\t\t\t\tif (el === oel) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\toel = oel.parentNode;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\n\t\t//Override L.Evented.fire\n\t\tfire: function (type, data, propagate) {\n\t\t\tif (data && data.layer instanceof L.MarkerCluster) {\n\t\t\t\t//Prevent multiple clustermouseover/off events if the icon is made up of stacked divs (Doesn't work in ie <= 8, no relatedTarget)\n\t\t\t\tif (data.originalEvent && this._isOrIsParent(data.layer._icon, data.originalEvent.relatedTarget)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttype = 'cluster' + type;\n\t\t\t}\n\n\t\t\tL.FeatureGroup.prototype.fire.call(this, type, data, propagate);\n\t\t},\n\n\t\t//Override L.Evented.listens\n\t\tlistens: function (type, propagate) {\n\t\t\treturn L.FeatureGroup.prototype.listens.call(this, type, propagate) || L.FeatureGroup.prototype.listens.call(this, 'cluster' + type, propagate);\n\t\t},\n\n\t\t//Default functionality\n\t\t_defaultIconCreateFunction: function (cluster) {\n\t\t\tvar childCount = cluster.getChildCount();\n\n\t\t\tvar c = ' marker-cluster-';\n\t\t\tif (childCount < 10) {\n\t\t\t\tc += 'small';\n\t\t\t} else if (childCount < 100) {\n\t\t\t\tc += 'medium';\n\t\t\t} else {\n\t\t\t\tc += 'large';\n\t\t\t}\n\n\t\t\treturn new L.DivIcon({ html: '<div><span>' + childCount + '</span></div>', className: 'marker-cluster' + c, iconSize: new L.Point(40, 40) });\n\t\t},\n\n\t\t_bindEvents: function () {\n\t\t\tvar map = this._map,\n\t\t\t spiderfyOnMaxZoom = this.options.spiderfyOnMaxZoom,\n\t\t\t showCoverageOnHover = this.options.showCoverageOnHover,\n\t\t\t zoomToBoundsOnClick = this.options.zoomToBoundsOnClick,\n\t\t\t spiderfyOnEveryZoom = this.options.spiderfyOnEveryZoom;\n\n\t\t\t//Zoom on cluster click or spiderfy if we are at the lowest level\n\t\t\tif (spiderfyOnMaxZoom || zoomToBoundsOnClick || spiderfyOnEveryZoom) {\n\t\t\t\tthis.on('clusterclick clusterkeypress', this._zoomOrSpiderfy, this);\n\t\t\t}\n\n\t\t\t//Show convex hull (boundary) polygon on mouse over\n\t\t\tif (showCoverageOnHover) {\n\t\t\t\tthis.on('clustermouseover', this._showCoverage, this);\n\t\t\t\tthis.on('clustermouseout', this._hideCoverage, this);\n\t\t\t\tmap.on('zoomend', this._hideCoverage, this);\n\t\t\t}\n\t\t},\n\n\t\t_zoomOrSpiderfy: function (e) {\n\t\t\tvar cluster = e.layer,\n\t\t\t bottomCluster = cluster;\n\n\t\t\tif (e.type === 'clusterkeypress' && e.originalEvent && e.originalEvent.keyCode !== 13) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\twhile (bottomCluster._childClusters.length === 1) {\n\t\t\t\tbottomCluster = bottomCluster._childClusters[0];\n\t\t\t}\n\n\t\t\tif (bottomCluster._zoom === this._maxZoom &&\n\t\t\t\tbottomCluster._childCount === cluster._childCount &&\n\t\t\t\tthis.options.spiderfyOnMaxZoom) {\n\n\t\t\t\t// All child markers are contained in a single cluster from this._maxZoom to this cluster.\n\t\t\t\tcluster.spiderfy();\n\t\t\t} else if (this.options.zoomToBoundsOnClick) {\n\t\t\t\tcluster.zoomToBounds();\n\t\t\t}\n\n\t\t\tif (this.options.spiderfyOnEveryZoom) {\n\t\t\t\tcluster.spiderfy();\n\t\t\t}\n\n\t\t\t// Focus the map again for keyboard users.\n\t\t\tif (e.originalEvent && e.originalEvent.keyCode === 13) {\n\t\t\t\tthis._map._container.focus();\n\t\t\t}\n\t\t},\n\n\t\t_showCoverage: function (e) {\n\t\t\tvar map = this._map;\n\t\t\tif (this._inZoomAnimation) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (this._shownPolygon) {\n\t\t\t\tmap.removeLayer(this._shownPolygon);\n\t\t\t}\n\t\t\tif (e.layer.getChildCount() > 2 && e.layer !== this._spiderfied) {\n\t\t\t\tthis._shownPolygon = new L.Polygon(e.layer.getConvexHull(), this.options.polygonOptions);\n\t\t\t\tmap.addLayer(this._shownPolygon);\n\t\t\t}\n\t\t},\n\n\t\t_hideCoverage: function () {\n\t\t\tif (this._shownPolygon) {\n\t\t\t\tthis._map.removeLayer(this._shownPolygon);\n\t\t\t\tthis._shownPolygon = null;\n\t\t\t}\n\t\t},\n\n\t\t_unbindEvents: function () {\n\t\t\tvar spiderfyOnMaxZoom = this.options.spiderfyOnMaxZoom,\n\t\t\t\tshowCoverageOnHover = this.options.showCoverageOnHover,\n\t\t\t\tzoomToBoundsOnClick = this.options.zoomToBoundsOnClick,\n\t\t\t\tspiderfyOnEveryZoom = this.options.spiderfyOnEveryZoom,\n\t\t\t\tmap = this._map;\n\n\t\t\tif (spiderfyOnMaxZoom || zoomToBoundsOnClick || spiderfyOnEveryZoom) {\n\t\t\t\tthis.off('clusterclick clusterkeypress', this._zoomOrSpiderfy, this);\n\t\t\t}\n\t\t\tif (showCoverageOnHover) {\n\t\t\t\tthis.off('clustermouseover', this._showCoverage, this);\n\t\t\t\tthis.off('clustermouseout', this._hideCoverage, this);\n\t\t\t\tmap.off('zoomend', this._hideCoverage, this);\n\t\t\t}\n\t\t},\n\n\t\t_zoomEnd: function () {\n\t\t\tif (!this._map) { //May have been removed from the map by a zoomEnd handler\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._mergeSplitClusters();\n\n\t\t\tthis._zoom = Math.round(this._map._zoom);\n\t\t\tthis._currentShownBounds = this._getExpandedVisibleBounds();\n\t\t},\n\n\t\t_moveEnd: function () {\n\t\t\tif (this._inZoomAnimation) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar newBounds = this._getExpandedVisibleBounds();\n\n\t\t\tthis._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), this._zoom, newBounds);\n\t\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, Math.round(this._map._zoom), newBounds);\n\n\t\t\tthis._currentShownBounds = newBounds;\n\t\t\treturn;\n\t\t},\n\n\t\t_generateInitialClusters: function () {\n\t\t\tvar maxZoom = Math.ceil(this._map.getMaxZoom()),\n\t\t\t\tminZoom = Math.floor(this._map.getMinZoom()),\n\t\t\t\tradius = this.options.maxClusterRadius,\n\t\t\t\tradiusFn = radius;\n\n\t\t\t//If we just set maxClusterRadius to a single number, we need to create\n\t\t\t//a simple function to return that number. Otherwise, we just have to\n\t\t\t//use the function we've passed in.\n\t\t\tif (typeof radius !== \"function\") {\n\t\t\t\tradiusFn = function () { return radius; };\n\t\t\t}\n\n\t\t\tif (this.options.disableClusteringAtZoom !== null) {\n\t\t\t\tmaxZoom = this.options.disableClusteringAtZoom - 1;\n\t\t\t}\n\t\t\tthis._maxZoom = maxZoom;\n\t\t\tthis._gridClusters = {};\n\t\t\tthis._gridUnclustered = {};\n\n\t\t\t//Set up DistanceGrids for each zoom\n\t\t\tfor (var zoom = maxZoom; zoom >= minZoom; zoom--) {\n\t\t\t\tthis._gridClusters[zoom] = new L.DistanceGrid(radiusFn(zoom));\n\t\t\t\tthis._gridUnclustered[zoom] = new L.DistanceGrid(radiusFn(zoom));\n\t\t\t}\n\n\t\t\t// Instantiate the appropriate L.MarkerCluster class (animated or not).\n\t\t\tthis._topClusterLevel = new this._markerCluster(this, minZoom - 1);\n\t\t},\n\n\t\t//Zoom: Zoom to start adding at (Pass this._maxZoom to start at the bottom)\n\t\t_addLayer: function (layer, zoom) {\n\t\t\tvar gridClusters = this._gridClusters,\n\t\t\t gridUnclustered = this._gridUnclustered,\n\t\t\t\tminZoom = Math.floor(this._map.getMinZoom()),\n\t\t\t markerPoint, z;\n\n\t\t\tif (this.options.singleMarkerMode) {\n\t\t\t\tthis._overrideMarkerIcon(layer);\n\t\t\t}\n\n\t\t\tlayer.on(this._childMarkerEventHandlers, this);\n\n\t\t\t//Find the lowest zoom level to slot this one in\n\t\t\tfor (; zoom >= minZoom; zoom--) {\n\t\t\t\tmarkerPoint = this._map.project(layer.getLatLng(), zoom); // calculate pixel position\n\n\t\t\t\t//Try find a cluster close by\n\t\t\t\tvar closest = gridClusters[zoom].getNearObject(markerPoint);\n\t\t\t\tif (closest) {\n\t\t\t\t\tclosest._addChild(layer);\n\t\t\t\t\tlayer.__parent = closest;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//Try find a marker close by to form a new cluster with\n\t\t\t\tclosest = gridUnclustered[zoom].getNearObject(markerPoint);\n\t\t\t\tif (closest) {\n\t\t\t\t\tvar parent = closest.__parent;\n\t\t\t\t\tif (parent) {\n\t\t\t\t\t\tthis._removeLayer(closest, false);\n\t\t\t\t\t}\n\n\t\t\t\t\t//Create new cluster with these 2 in it\n\n\t\t\t\t\tvar newCluster = new this._markerCluster(this, zoom, closest, layer);\n\t\t\t\t\tgridClusters[zoom].addObject(newCluster, this._map.project(newCluster._cLatLng, zoom));\n\t\t\t\t\tclosest.__parent = newCluster;\n\t\t\t\t\tlayer.__parent = newCluster;\n\n\t\t\t\t\t//First create any new intermediate parent clusters that don't exist\n\t\t\t\t\tvar lastParent = newCluster;\n\t\t\t\t\tfor (z = zoom - 1; z > parent._zoom; z--) {\n\t\t\t\t\t\tlastParent = new this._markerCluster(this, z, lastParent);\n\t\t\t\t\t\tgridClusters[z].addObject(lastParent, this._map.project(closest.getLatLng(), z));\n\t\t\t\t\t}\n\t\t\t\t\tparent._addChild(lastParent);\n\n\t\t\t\t\t//Remove closest from this zoom level and any above that it is in, replace with newCluster\n\t\t\t\t\tthis._removeFromGridUnclustered(closest, zoom);\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//Didn't manage to cluster in at this zoom, record us as a marker here and continue upwards\n\t\t\t\tgridUnclustered[zoom].addObject(layer, markerPoint);\n\t\t\t}\n\n\t\t\t//Didn't get in anything, add us to the top\n\t\t\tthis._topClusterLevel._addChild(layer);\n\t\t\tlayer.__parent = this._topClusterLevel;\n\t\t\treturn;\n\t\t},\n\n\t\t/**\n\t\t * Refreshes the icon of all \"dirty\" visible clusters.\n\t\t * Non-visible \"dirty\" clusters will be updated when they are added to the map.\n\t\t * @private\n\t\t */\n\t\t_refreshClustersIcons: function () {\n\t\t\tthis._featureGroup.eachLayer(function (c) {\n\t\t\t\tif (c instanceof L.MarkerCluster && c._iconNeedsUpdate) {\n\t\t\t\t\tc._updateIcon();\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\t//Enqueue code to fire after the marker expand/contract has happened\n\t\t_enqueue: function (fn) {\n\t\t\tthis._queue.push(fn);\n\t\t\tif (!this._queueTimeout) {\n\t\t\t\tthis._queueTimeout = setTimeout(L.bind(this._processQueue, this), 300);\n\t\t\t}\n\t\t},\n\t\t_processQueue: function () {\n\t\t\tfor (var i = 0; i < this._queue.length; i++) {\n\t\t\t\tthis._queue[i].call(this);\n\t\t\t}\n\t\t\tthis._queue.length = 0;\n\t\t\tclearTimeout(this._queueTimeout);\n\t\t\tthis._queueTimeout = null;\n\t\t},\n\n\t\t//Merge and split any existing clusters that are too big or small\n\t\t_mergeSplitClusters: function () {\n\t\t\tvar mapZoom = Math.round(this._map._zoom);\n\n\t\t\t//In case we are starting to split before the animation finished\n\t\t\tthis._processQueue();\n\n\t\t\tif (this._zoom < mapZoom && this._currentShownBounds.intersects(this._getExpandedVisibleBounds())) { //Zoom in, split\n\t\t\t\tthis._animationStart();\n\t\t\t\t//Remove clusters now off screen\n\t\t\t\tthis._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), this._zoom, this._getExpandedVisibleBounds());\n\n\t\t\t\tthis._animationZoomIn(this._zoom, mapZoom);\n\n\t\t\t} else if (this._zoom > mapZoom) { //Zoom out, merge\n\t\t\t\tthis._animationStart();\n\n\t\t\t\tthis._animationZoomOut(this._zoom, mapZoom);\n\t\t\t} else {\n\t\t\t\tthis._moveEnd();\n\t\t\t}\n\t\t},\n\n\t\t//Gets the maps visible bounds expanded in each direction by the size of the screen (so the user cannot see an area we do not cover in one pan)\n\t\t_getExpandedVisibleBounds: function () {\n\t\t\tif (!this.options.removeOutsideVisibleBounds) {\n\t\t\t\treturn this._mapBoundsInfinite;\n\t\t\t} else if (L.Browser.mobile) {\n\t\t\t\treturn this._checkBoundsMaxLat(this._map.getBounds());\n\t\t\t}\n\n\t\t\treturn this._checkBoundsMaxLat(this._map.getBounds().pad(1)); // Padding expands the bounds by its own dimensions but scaled with the given factor.\n\t\t},\n\n\t\t/**\n\t\t * Expands the latitude to Infinity (or -Infinity) if the input bounds reach the map projection maximum defined latitude\n\t\t * (in the case of Web/Spherical Mercator, it is 85.0511287798 / see https://en.wikipedia.org/wiki/Web_Mercator#Formulas).\n\t\t * Otherwise, the removeOutsideVisibleBounds option will remove markers beyond that limit, whereas the same markers without\n\t\t * this option (or outside MCG) will have their position floored (ceiled) by the projection and rendered at that limit,\n\t\t * making the user think that MCG \"eats\" them and never displays them again.\n\t\t * @param bounds L.LatLngBounds\n\t\t * @returns {L.LatLngBounds}\n\t\t * @private\n\t\t */\n\t\t_checkBoundsMaxLat: function (bounds) {\n\t\t\tvar maxLat = this._maxLat;\n\n\t\t\tif (maxLat !== undefined) {\n\t\t\t\tif (bounds.getNorth() >= maxLat) {\n\t\t\t\t\tbounds._northEast.lat = Infinity;\n\t\t\t\t}\n\t\t\t\tif (bounds.getSouth() <= -maxLat) {\n\t\t\t\t\tbounds._southWest.lat = -Infinity;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn bounds;\n\t\t},\n\n\t\t//Shared animation code\n\t\t_animationAddLayerNonAnimated: function (layer, newCluster) {\n\t\t\tif (newCluster === layer) {\n\t\t\t\tthis._featureGroup.addLayer(layer);\n\t\t\t} else if (newCluster._childCount === 2) {\n\t\t\t\tnewCluster._addToMap();\n\n\t\t\t\tvar markers = newCluster.getAllChildMarkers();\n\t\t\t\tthis._featureGroup.removeLayer(markers[0]);\n\t\t\t\tthis._featureGroup.removeLayer(markers[1]);\n\t\t\t} else {\n\t\t\t\tnewCluster._updateIcon();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Extracts individual (i.e. non-group) layers from a Layer Group.\n\t\t * @param group to extract layers from.\n\t\t * @param output {Array} in which to store the extracted layers.\n\t\t * @returns {*|Array}\n\t\t * @private\n\t\t */\n\t\t_extractNonGroupLayers: function (group, output) {\n\t\t\tvar layers = group.getLayers(),\n\t\t\t i = 0,\n\t\t\t layer;\n\n\t\t\toutput = output || [];\n\n\t\t\tfor (; i < layers.length; i++) {\n\t\t\t\tlayer = layers[i];\n\n\t\t\t\tif (layer instanceof L.LayerGroup) {\n\t\t\t\t\tthis._extractNonGroupLayers(layer, output);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\toutput.push(layer);\n\t\t\t}\n\n\t\t\treturn output;\n\t\t},\n\n\t\t/**\n\t\t * Implements the singleMarkerMode option.\n\t\t * @param layer Marker to re-style using the Clusters iconCreateFunction.\n\t\t * @returns {L.Icon} The newly created icon.\n\t\t * @private\n\t\t */\n\t\t_overrideMarkerIcon: function (layer) {\n\t\t\tvar icon = layer.options.icon = this.options.iconCreateFunction({\n\t\t\t\tgetChildCount: function () {\n\t\t\t\t\treturn 1;\n\t\t\t\t},\n\t\t\t\tgetAllChildMarkers: function () {\n\t\t\t\t\treturn [layer];\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn icon;\n\t\t}\n\t});\n\n\t// Constant bounds used in case option \"removeOutsideVisibleBounds\" is set to false.\n\tL.MarkerClusterGroup.include({\n\t\t_mapBoundsInfinite: new L.LatLngBounds(new L.LatLng(-Infinity, -Infinity), new L.LatLng(Infinity, Infinity))\n\t});\n\n\tL.MarkerClusterGroup.include({\n\t\t_noAnimation: {\n\t\t\t//Non Animated versions of everything\n\t\t\t_animationStart: function () {\n\t\t\t\t//Do nothing...\n\t\t\t},\n\t\t\t_animationZoomIn: function (previousZoomLevel, newZoomLevel) {\n\t\t\t\tthis._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel);\n\t\t\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());\n\n\t\t\t\t//We didn't actually animate, but we use this event to mean \"clustering animations have finished\"\n\t\t\t\tthis.fire('animationend');\n\t\t\t},\n\t\t\t_animationZoomOut: function (previousZoomLevel, newZoomLevel) {\n\t\t\t\tthis._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel);\n\t\t\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());\n\n\t\t\t\t//We didn't actually animate, but we use this event to mean \"clustering animations have finished\"\n\t\t\t\tthis.fire('animationend');\n\t\t\t},\n\t\t\t_animationAddLayer: function (layer, newCluster) {\n\t\t\t\tthis._animationAddLayerNonAnimated(layer, newCluster);\n\t\t\t}\n\t\t},\n\n\t\t_withAnimation: {\n\t\t\t//Animated versions here\n\t\t\t_animationStart: function () {\n\t\t\t\tthis._map._mapPane.className += ' leaflet-cluster-anim';\n\t\t\t\tthis._inZoomAnimation++;\n\t\t\t},\n\n\t\t\t_animationZoomIn: function (previousZoomLevel, newZoomLevel) {\n\t\t\t\tvar bounds = this._getExpandedVisibleBounds(),\n\t\t\t\t fg = this._featureGroup,\n\t\t\t\t\tminZoom = Math.floor(this._map.getMinZoom()),\n\t\t\t\t i;\n\n\t\t\t\tthis._ignoreMove = true;\n\n\t\t\t\t//Add all children of current clusters to map and remove those clusters from map\n\t\t\t\tthis._topClusterLevel._recursively(bounds, previousZoomLevel, minZoom, function (c) {\n\t\t\t\t\tvar startPos = c._latlng,\n\t\t\t\t\t markers = c._markers,\n\t\t\t\t\t m;\n\n\t\t\t\t\tif (!bounds.contains(startPos)) {\n\t\t\t\t\t\tstartPos = null;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (c._isSingleParent() && previousZoomLevel + 1 === newZoomLevel) { //Immediately add the new child and remove us\n\t\t\t\t\t\tfg.removeLayer(c);\n\t\t\t\t\t\tc._recursivelyAddChildrenToMap(null, newZoomLevel, bounds);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//Fade out old cluster\n\t\t\t\t\t\tc.clusterHide();\n\t\t\t\t\t\tc._recursivelyAddChildrenToMap(startPos, newZoomLevel, bounds);\n\t\t\t\t\t}\n\n\t\t\t\t\t//Remove all markers that aren't visible any more\n\t\t\t\t\t//TODO: Do we actually need to do this on the higher levels too?\n\t\t\t\t\tfor (i = markers.length - 1; i >= 0; i--) {\n\t\t\t\t\t\tm = markers[i];\n\t\t\t\t\t\tif (!bounds.contains(m._latlng)) {\n\t\t\t\t\t\t\tfg.removeLayer(m);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t});\n\n\t\t\t\tthis._forceLayout();\n\n\t\t\t\t//Update opacities\n\t\t\t\tthis._topClusterLevel._recursivelyBecomeVisible(bounds, newZoomLevel);\n\t\t\t\t//TODO Maybe? Update markers in _recursivelyBecomeVisible\n\t\t\t\tfg.eachLayer(function (n) {\n\t\t\t\t\tif (!(n instanceof L.MarkerCluster) && n._icon) {\n\t\t\t\t\t\tn.clusterShow();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t//update the positions of the just added clusters/markers\n\t\t\t\tthis._topClusterLevel._recursively(bounds, previousZoomLevel, newZoomLevel, function (c) {\n\t\t\t\t\tc._recursivelyRestoreChildPositions(newZoomLevel);\n\t\t\t\t});\n\n\t\t\t\tthis._ignoreMove = false;\n\n\t\t\t\t//Remove the old clusters and close the zoom animation\n\t\t\t\tthis._enqueue(function () {\n\t\t\t\t\t//update the positions of the just added clusters/markers\n\t\t\t\t\tthis._topClusterLevel._recursively(bounds, previousZoomLevel, minZoom, function (c) {\n\t\t\t\t\t\tfg.removeLayer(c);\n\t\t\t\t\t\tc.clusterShow();\n\t\t\t\t\t});\n\n\t\t\t\t\tthis._animationEnd();\n\t\t\t\t});\n\t\t\t},\n\n\t\t\t_animationZoomOut: function (previousZoomLevel, newZoomLevel) {\n\t\t\t\tthis._animationZoomOutSingle(this._topClusterLevel, previousZoomLevel - 1, newZoomLevel);\n\n\t\t\t\t//Need to add markers for those that weren't on the map before but are now\n\t\t\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());\n\t\t\t\t//Remove markers that were on the map before but won't be now\n\t\t\t\tthis._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel, this._getExpandedVisibleBounds());\n\t\t\t},\n\n\t\t\t_animationAddLayer: function (layer, newCluster) {\n\t\t\t\tvar me = this,\n\t\t\t\t fg = this._featureGroup;\n\n\t\t\t\tfg.addLayer(layer);\n\t\t\t\tif (newCluster !== layer) {\n\t\t\t\t\tif (newCluster._childCount > 2) { //Was already a cluster\n\n\t\t\t\t\t\tnewCluster._updateIcon();\n\t\t\t\t\t\tthis._forceLayout();\n\t\t\t\t\t\tthis._animationStart();\n\n\t\t\t\t\t\tlayer._setPos(this._map.latLngToLayerPoint(newCluster.getLatLng()));\n\t\t\t\t\t\tlayer.clusterHide();\n\n\t\t\t\t\t\tthis._enqueue(function () {\n\t\t\t\t\t\t\tfg.removeLayer(layer);\n\t\t\t\t\t\t\tlayer.clusterShow();\n\n\t\t\t\t\t\t\tme._animationEnd();\n\t\t\t\t\t\t});\n\n\t\t\t\t\t} else { //Just became a cluster\n\t\t\t\t\t\tthis._forceLayout();\n\n\t\t\t\t\t\tme._animationStart();\n\t\t\t\t\t\tme._animationZoomOutSingle(newCluster, this._map.getMaxZoom(), this._zoom);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t// Private methods for animated versions.\n\t\t_animationZoomOutSingle: function (cluster, previousZoomLevel, newZoomLevel) {\n\t\t\tvar bounds = this._getExpandedVisibleBounds(),\n\t\t\t\tminZoom = Math.floor(this._map.getMinZoom());\n\n\t\t\t//Animate all of the markers in the clusters to move to their cluster center point\n\t\t\tcluster._recursivelyAnimateChildrenInAndAddSelfToMap(bounds, minZoom, previousZoomLevel + 1, newZoomLevel);\n\n\t\t\tvar me = this;\n\n\t\t\t//Update the opacity (If we immediately set it they won't animate)\n\t\t\tthis._forceLayout();\n\t\t\tcluster._recursivelyBecomeVisible(bounds, newZoomLevel);\n\n\t\t\t//TODO: Maybe use the transition timing stuff to make this more reliable\n\t\t\t//When the animations are done, tidy up\n\t\t\tthis._enqueue(function () {\n\n\t\t\t\t//This cluster stopped being a cluster before the timeout fired\n\t\t\t\tif (cluster._childCount === 1) {\n\t\t\t\t\tvar m = cluster._markers[0];\n\t\t\t\t\t//If we were in a cluster animation at the time then the opacity and position of our child could be wrong now, so fix it\n\t\t\t\t\tthis._ignoreMove = true;\n\t\t\t\t\tm.setLatLng(m.getLatLng());\n\t\t\t\t\tthis._ignoreMove = false;\n\t\t\t\t\tif (m.clusterShow) {\n\t\t\t\t\t\tm.clusterShow();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tcluster._recursively(bounds, newZoomLevel, minZoom, function (c) {\n\t\t\t\t\t\tc._recursivelyRemoveChildrenFromMap(bounds, minZoom, previousZoomLevel + 1);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tme._animationEnd();\n\t\t\t});\n\t\t},\n\n\t\t_animationEnd: function () {\n\t\t\tif (this._map) {\n\t\t\t\tthis._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', '');\n\t\t\t}\n\t\t\tthis._inZoomAnimation--;\n\t\t\tthis.fire('animationend');\n\t\t},\n\n\t\t//Force a browser layout of stuff in the map\n\t\t// Should apply the current opacity and location to all elements so we can update them again for an animation\n\t\t_forceLayout: function () {\n\t\t\t//In my testing this works, infact offsetWidth of any element seems to work.\n\t\t\t//Could loop all this._layers and do this for each _icon if it stops working\n\n\t\t\tL.Util.falseFn(document.body.offsetWidth);\n\t\t}\n\t});\n\n\tL.markerClusterGroup = function (options) {\n\t\treturn new L.MarkerClusterGroup(options);\n\t};\n\n\tvar MarkerCluster = L.MarkerCluster = L.Marker.extend({\n\t\toptions: L.Icon.prototype.options,\n\n\t\tinitialize: function (group, zoom, a, b) {\n\n\t\t\tL.Marker.prototype.initialize.call(this, a ? (a._cLatLng || a.getLatLng()) : new L.LatLng(0, 0),\n\t { icon: this, pane: group.options.clusterPane });\n\n\t\t\tthis._group = group;\n\t\t\tthis._zoom = zoom;\n\n\t\t\tthis._markers = [];\n\t\t\tthis._childClusters = [];\n\t\t\tthis._childCount = 0;\n\t\t\tthis._iconNeedsUpdate = true;\n\t\t\tthis._boundsNeedUpdate = true;\n\n\t\t\tthis._bounds = new L.LatLngBounds();\n\n\t\t\tif (a) {\n\t\t\t\tthis._addChild(a);\n\t\t\t}\n\t\t\tif (b) {\n\t\t\t\tthis._addChild(b);\n\t\t\t}\n\t\t},\n\n\t\t//Recursively retrieve all child markers of this cluster\n\t\tgetAllChildMarkers: function (storageArray, ignoreDraggedMarker) {\n\t\t\tstorageArray = storageArray || [];\n\n\t\t\tfor (var i = this._childClusters.length - 1; i >= 0; i--) {\n\t\t\t\tthis._childClusters[i].getAllChildMarkers(storageArray, ignoreDraggedMarker);\n\t\t\t}\n\n\t\t\tfor (var j = this._markers.length - 1; j >= 0; j--) {\n\t\t\t\tif (ignoreDraggedMarker && this._markers[j].__dragStart) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tstorageArray.push(this._markers[j]);\n\t\t\t}\n\n\t\t\treturn storageArray;\n\t\t},\n\n\t\t//Returns the count of how many child markers we have\n\t\tgetChildCount: function () {\n\t\t\treturn this._childCount;\n\t\t},\n\n\t\t//Zoom to the minimum of showing all of the child markers, or the extents of this cluster\n\t\tzoomToBounds: function (fitBoundsOptions) {\n\t\t\tvar childClusters = this._childClusters.slice(),\n\t\t\t\tmap = this._group._map,\n\t\t\t\tboundsZoom = map.getBoundsZoom(this._bounds),\n\t\t\t\tzoom = this._zoom + 1,\n\t\t\t\tmapZoom = map.getZoom(),\n\t\t\t\ti;\n\n\t\t\t//calculate how far we need to zoom down to see all of the markers\n\t\t\twhile (childClusters.length > 0 && boundsZoom > zoom) {\n\t\t\t\tzoom++;\n\t\t\t\tvar newClusters = [];\n\t\t\t\tfor (i = 0; i < childClusters.length; i++) {\n\t\t\t\t\tnewClusters = newClusters.concat(childClusters[i]._childClusters);\n\t\t\t\t}\n\t\t\t\tchildClusters = newClusters;\n\t\t\t}\n\n\t\t\tif (boundsZoom > zoom) {\n\t\t\t\tthis._group._map.setView(this._latlng, zoom);\n\t\t\t} else if (boundsZoom <= mapZoom) { //If fitBounds wouldn't zoom us down, zoom us down instead\n\t\t\t\tthis._group._map.setView(this._latlng, mapZoom + 1);\n\t\t\t} else {\n\t\t\t\tthis._group._map.fitBounds(this._bounds, fitBoundsOptions);\n\t\t\t}\n\t\t},\n\n\t\tgetBounds: function () {\n\t\t\tvar bounds = new L.LatLngBounds();\n\t\t\tbounds.extend(this._bounds);\n\t\t\treturn bounds;\n\t\t},\n\n\t\t_updateIcon: function () {\n\t\t\tthis._iconNeedsUpdate = true;\n\t\t\tif (this._icon) {\n\t\t\t\tthis.setIcon(this);\n\t\t\t}\n\t\t},\n\n\t\t//Cludge for Icon, we pretend to be an icon for performance\n\t\tcreateIcon: function () {\n\t\t\tif (this._iconNeedsUpdate) {\n\t\t\t\tthis._iconObj = this._group.options.iconCreateFunction(this);\n\t\t\t\tthis._iconNeedsUpdate = false;\n\t\t\t}\n\t\t\treturn this._iconObj.createIcon();\n\t\t},\n\t\tcreateShadow: function () {\n\t\t\treturn this._iconObj.createShadow();\n\t\t},\n\n\n\t\t_addChild: function (new1, isNotificationFromChild) {\n\n\t\t\tthis._iconNeedsUpdate = true;\n\n\t\t\tthis._boundsNeedUpdate = true;\n\t\t\tthis._setClusterCenter(new1);\n\n\t\t\tif (new1 instanceof L.MarkerCluster) {\n\t\t\t\tif (!isNotificationFromChild) {\n\t\t\t\t\tthis._childClusters.push(new1);\n\t\t\t\t\tnew1.__parent = this;\n\t\t\t\t}\n\t\t\t\tthis._childCount += new1._childCount;\n\t\t\t} else {\n\t\t\t\tif (!isNotificationFromChild) {\n\t\t\t\t\tthis._markers.push(new1);\n\t\t\t\t}\n\t\t\t\tthis._childCount++;\n\t\t\t}\n\n\t\t\tif (this.__parent) {\n\t\t\t\tthis.__parent._addChild(new1, true);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Makes sure the cluster center is set. If not, uses the child center if it is a cluster, or the marker position.\n\t\t * @param child L.MarkerCluster|L.Marker that will be used as cluster center if not defined yet.\n\t\t * @private\n\t\t */\n\t\t_setClusterCenter: function (child) {\n\t\t\tif (!this._cLatLng) {\n\t\t\t\t// when clustering, take position of the first point as the cluster center\n\t\t\t\tthis._cLatLng = child._cLatLng || child._latlng;\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Assigns impossible bounding values so that the next extend entirely determines the new bounds.\n\t\t * This method avoids having to trash the previous L.LatLngBounds object and to create a new one, which is much slower for this class.\n\t\t * As long as the bounds are not extended, most other methods would probably fail, as they would with bounds initialized but not extended.\n\t\t * @private\n\t\t */\n\t\t_resetBounds: function () {\n\t\t\tvar bounds = this._bounds;\n\n\t\t\tif (bounds._southWest) {\n\t\t\t\tbounds._southWest.lat = Infinity;\n\t\t\t\tbounds._southWest.lng = Infinity;\n\t\t\t}\n\t\t\tif (bounds._northEast) {\n\t\t\t\tbounds._northEast.lat = -Infinity;\n\t\t\t\tbounds._northEast.lng = -Infinity;\n\t\t\t}\n\t\t},\n\n\t\t_recalculateBounds: function () {\n\t\t\tvar markers = this._markers,\n\t\t\t childClusters = this._childClusters,\n\t\t\t latSum = 0,\n\t\t\t lngSum = 0,\n\t\t\t totalCount = this._childCount,\n\t\t\t i, child, childLatLng, childCount;\n\n\t\t\t// Case where all markers are removed from the map and we are left with just an empty _topClusterLevel.\n\t\t\tif (totalCount === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Reset rather than creating a new object, for performance.\n\t\t\tthis._resetBounds();\n\n\t\t\t// Child markers.\n\t\t\tfor (i = 0; i < markers.length; i++) {\n\t\t\t\tchildLatLng = markers[i]._latlng;\n\n\t\t\t\tthis._bounds.extend(childLatLng);\n\n\t\t\t\tlatSum += childLatLng.lat;\n\t\t\t\tlngSum += childLatLng.lng;\n\t\t\t}\n\n\t\t\t// Child clusters.\n\t\t\tfor (i = 0; i < childClusters.length; i++) {\n\t\t\t\tchild = childClusters[i];\n\n\t\t\t\t// Re-compute child bounds and weighted position first if necessary.\n\t\t\t\tif (child._boundsNeedUpdate) {\n\t\t\t\t\tchild._recalculateBounds();\n\t\t\t\t}\n\n\t\t\t\tthis._bounds.extend(child._bounds);\n\n\t\t\t\tchildLatLng = child._wLatLng;\n\t\t\t\tchildCount = child._childCount;\n\n\t\t\t\tlatSum += childLatLng.lat * childCount;\n\t\t\t\tlngSum += childLatLng.lng * childCount;\n\t\t\t}\n\n\t\t\tthis._latlng = this._wLatLng = new L.LatLng(latSum / totalCount, lngSum / totalCount);\n\n\t\t\t// Reset dirty flag.\n\t\t\tthis._boundsNeedUpdate = false;\n\t\t},\n\n\t\t//Set our markers position as given and add it to the map\n\t\t_addToMap: function (startPos) {\n\t\t\tif (startPos) {\n\t\t\t\tthis._backupLatlng = this._latlng;\n\t\t\t\tthis.setLatLng(startPos);\n\t\t\t}\n\t\t\tthis._group._featureGroup.addLayer(this);\n\t\t},\n\n\t\t_recursivelyAnimateChildrenIn: function (bounds, center, maxZoom) {\n\t\t\tthis._recursively(bounds, this._group._map.getMinZoom(), maxZoom - 1,\n\t\t\t\tfunction (c) {\n\t\t\t\t\tvar markers = c._markers,\n\t\t\t\t\t\ti, m;\n\t\t\t\t\tfor (i = markers.length - 1; i >= 0; i--) {\n\t\t\t\t\t\tm = markers[i];\n\n\t\t\t\t\t\t//Only do it if the icon is still on the map\n\t\t\t\t\t\tif (m._icon) {\n\t\t\t\t\t\t\tm._setPos(center);\n\t\t\t\t\t\t\tm.clusterHide();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tfunction (c) {\n\t\t\t\t\tvar childClusters = c._childClusters,\n\t\t\t\t\t\tj, cm;\n\t\t\t\t\tfor (j = childClusters.length - 1; j >= 0; j--) {\n\t\t\t\t\t\tcm = childClusters[j];\n\t\t\t\t\t\tif (cm._icon) {\n\t\t\t\t\t\t\tcm._setPos(center);\n\t\t\t\t\t\t\tcm.clusterHide();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\n\t\t_recursivelyAnimateChildrenInAndAddSelfToMap: function (bounds, mapMinZoom, previousZoomLevel, newZoomLevel) {\n\t\t\tthis._recursively(bounds, newZoomLevel, mapMinZoom,\n\t\t\t\tfunction (c) {\n\t\t\t\t\tc._recursivelyAnimateChildrenIn(bounds, c._group._map.latLngToLayerPoint(c.getLatLng()).round(), previousZoomLevel);\n\n\t\t\t\t\t//TODO: depthToAnimateIn affects _isSingleParent, if there is a multizoom we may/may not be.\n\t\t\t\t\t//As a hack we only do a animation free zoom on a single level zoom, if someone does multiple levels then we always animate\n\t\t\t\t\tif (c._isSingleParent() && previousZoomLevel - 1 === newZoomLevel) {\n\t\t\t\t\t\tc.clusterShow();\n\t\t\t\t\t\tc._recursivelyRemoveChildrenFromMap(bounds, mapMinZoom, previousZoomLevel); //Immediately remove our children as we are replacing them. TODO previousBounds not bounds\n\t\t\t\t\t} else {\n\t\t\t\t\t\tc.clusterHide();\n\t\t\t\t\t}\n\n\t\t\t\t\tc._addToMap();\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\n\t\t_recursivelyBecomeVisible: function (bounds, zoomLevel) {\n\t\t\tthis._recursively(bounds, this._group._map.getMinZoom(), zoomLevel, null, function (c) {\n\t\t\t\tc.clusterShow();\n\t\t\t});\n\t\t},\n\n\t\t_recursivelyAddChildrenToMap: function (startPos, zoomLevel, bounds) {\n\t\t\tthis._recursively(bounds, this._group._map.getMinZoom() - 1, zoomLevel,\n\t\t\t\tfunction (c) {\n\t\t\t\t\tif (zoomLevel === c._zoom) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t//Add our child markers at startPos (so they can be animated out)\n\t\t\t\t\tfor (var i = c._markers.length - 1; i >= 0; i--) {\n\t\t\t\t\t\tvar nm = c._markers[i];\n\n\t\t\t\t\t\tif (!bounds.contains(nm._latlng)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (startPos) {\n\t\t\t\t\t\t\tnm._backupLatlng = nm.getLatLng();\n\n\t\t\t\t\t\t\tnm.setLatLng(startPos);\n\t\t\t\t\t\t\tif (nm.clusterHide) {\n\t\t\t\t\t\t\t\tnm.clusterHide();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tc._group._featureGroup.addLayer(nm);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tfunction (c) {\n\t\t\t\t\tc._addToMap(startPos);\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\n\t\t_recursivelyRestoreChildPositions: function (zoomLevel) {\n\t\t\t//Fix positions of child markers\n\t\t\tfor (var i = this._markers.length - 1; i >= 0; i--) {\n\t\t\t\tvar nm = this._markers[i];\n\t\t\t\tif (nm._backupLatlng) {\n\t\t\t\t\tnm.setLatLng(nm._backupLatlng);\n\t\t\t\t\tdelete nm._backupLatlng;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (zoomLevel - 1 === this._zoom) {\n\t\t\t\t//Reposition child clusters\n\t\t\t\tfor (var j = this._childClusters.length - 1; j >= 0; j--) {\n\t\t\t\t\tthis._childClusters[j]._restorePosition();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (var k = this._childClusters.length - 1; k >= 0; k--) {\n\t\t\t\t\tthis._childClusters[k]._recursivelyRestoreChildPositions(zoomLevel);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t_restorePosition: function () {\n\t\t\tif (this._backupLatlng) {\n\t\t\t\tthis.setLatLng(this._backupLatlng);\n\t\t\t\tdelete this._backupLatlng;\n\t\t\t}\n\t\t},\n\n\t\t//exceptBounds: If set, don't remove any markers/clusters in it\n\t\t_recursivelyRemoveChildrenFromMap: function (previousBounds, mapMinZoom, zoomLevel, exceptBounds) {\n\t\t\tvar m, i;\n\t\t\tthis._recursively(previousBounds, mapMinZoom - 1, zoomLevel - 1,\n\t\t\t\tfunction (c) {\n\t\t\t\t\t//Remove markers at every level\n\t\t\t\t\tfor (i = c._markers.length - 1; i >= 0; i--) {\n\t\t\t\t\t\tm = c._markers[i];\n\t\t\t\t\t\tif (!exceptBounds || !exceptBounds.contains(m._latlng)) {\n\t\t\t\t\t\t\tc._group._featureGroup.removeLayer(m);\n\t\t\t\t\t\t\tif (m.clusterShow) {\n\t\t\t\t\t\t\t\tm.clusterShow();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tfunction (c) {\n\t\t\t\t\t//Remove child clusters at just the bottom level\n\t\t\t\t\tfor (i = c._childClusters.length - 1; i >= 0; i--) {\n\t\t\t\t\t\tm = c._childClusters[i];\n\t\t\t\t\t\tif (!exceptBounds || !exceptBounds.contains(m._latlng)) {\n\t\t\t\t\t\t\tc._group._featureGroup.removeLayer(m);\n\t\t\t\t\t\t\tif (m.clusterShow) {\n\t\t\t\t\t\t\t\tm.clusterShow();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\n\t\t//Run the given functions recursively to this and child clusters\n\t\t// boundsToApplyTo: a L.LatLngBounds representing the bounds of what clusters to recurse in to\n\t\t// zoomLevelToStart: zoom level to start running functions (inclusive)\n\t\t// zoomLevelToStop: zoom level to stop running functions (inclusive)\n\t\t// runAtEveryLevel: function that takes an L.MarkerCluster as an argument that should be applied on every level\n\t\t// runAtBottomLevel: function that takes an L.MarkerCluster as an argument that should be applied at only the bottom level\n\t\t_recursively: function (boundsToApplyTo, zoomLevelToStart, zoomLevelToStop, runAtEveryLevel, runAtBottomLevel) {\n\t\t\tvar childClusters = this._childClusters,\n\t\t\t zoom = this._zoom,\n\t\t\t i, c;\n\n\t\t\tif (zoomLevelToStart <= zoom) {\n\t\t\t\tif (runAtEveryLevel) {\n\t\t\t\t\trunAtEveryLevel(this);\n\t\t\t\t}\n\t\t\t\tif (runAtBottomLevel && zoom === zoomLevelToStop) {\n\t\t\t\t\trunAtBottomLevel(this);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (zoom < zoomLevelToStart || zoom < zoomLevelToStop) {\n\t\t\t\tfor (i = childClusters.length - 1; i >= 0; i--) {\n\t\t\t\t\tc = childClusters[i];\n\t\t\t\t\tif (c._boundsNeedUpdate) {\n\t\t\t\t\t\tc._recalculateBounds();\n\t\t\t\t\t}\n\t\t\t\t\tif (boundsToApplyTo.intersects(c._bounds)) {\n\t\t\t\t\t\tc._recursively(boundsToApplyTo, zoomLevelToStart, zoomLevelToStop, runAtEveryLevel, runAtBottomLevel);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t//Returns true if we are the parent of only one cluster and that cluster is the same as us\n\t\t_isSingleParent: function () {\n\t\t\t//Don't need to check this._markers as the rest won't work if there are any\n\t\t\treturn this._childClusters.length > 0 && this._childClusters[0]._childCount === this._childCount;\n\t\t}\n\t});\n\n\t/*\n\t* Extends L.Marker to include two extra methods: clusterHide and clusterShow.\n\t* \n\t* They work as setOpacity(0) and setOpacity(1) respectively, but\n\t* don't overwrite the options.opacity\n\t* \n\t*/\n\n\tL.Marker.include({\n\t\tclusterHide: function () {\n\t\t\tvar backup = this.options.opacity;\n\t\t\tthis.setOpacity(0);\n\t\t\tthis.options.opacity = backup;\n\t\t\treturn this;\n\t\t},\n\t\t\n\t\tclusterShow: function () {\n\t\t\treturn this.setOpacity(this.options.opacity);\n\t\t}\n\t});\n\n\tL.DistanceGrid = function (cellSize) {\n\t\tthis._cellSize = cellSize;\n\t\tthis._sqCellSize = cellSize * cellSize;\n\t\tthis._grid = {};\n\t\tthis._objectPoint = { };\n\t};\n\n\tL.DistanceGrid.prototype = {\n\n\t\taddObject: function (obj, point) {\n\t\t\tvar x = this._getCoord(point.x),\n\t\t\t y = this._getCoord(point.y),\n\t\t\t grid = this._grid,\n\t\t\t row = grid[y] = grid[y] || {},\n\t\t\t cell = row[x] = row[x] || [],\n\t\t\t stamp = L.Util.stamp(obj);\n\n\t\t\tthis._objectPoint[stamp] = point;\n\n\t\t\tcell.push(obj);\n\t\t},\n\n\t\tupdateObject: function (obj, point) {\n\t\t\tthis.removeObject(obj);\n\t\t\tthis.addObject(obj, point);\n\t\t},\n\n\t\t//Returns true if the object was found\n\t\tremoveObject: function (obj, point) {\n\t\t\tvar x = this._getCoord(point.x),\n\t\t\t y = this._getCoord(point.y),\n\t\t\t grid = this._grid,\n\t\t\t row = grid[y] = grid[y] || {},\n\t\t\t cell = row[x] = row[x] || [],\n\t\t\t i, len;\n\n\t\t\tdelete this._objectPoint[L.Util.stamp(obj)];\n\n\t\t\tfor (i = 0, len = cell.length; i < len; i++) {\n\t\t\t\tif (cell[i] === obj) {\n\n\t\t\t\t\tcell.splice(i, 1);\n\n\t\t\t\t\tif (len === 1) {\n\t\t\t\t\t\tdelete row[x];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t},\n\n\t\teachObject: function (fn, context) {\n\t\t\tvar i, j, k, len, row, cell, removed,\n\t\t\t grid = this._grid;\n\n\t\t\tfor (i in grid) {\n\t\t\t\trow = grid[i];\n\n\t\t\t\tfor (j in row) {\n\t\t\t\t\tcell = row[j];\n\n\t\t\t\t\tfor (k = 0, len = cell.length; k < len; k++) {\n\t\t\t\t\t\tremoved = fn.call(context, cell[k]);\n\t\t\t\t\t\tif (removed) {\n\t\t\t\t\t\t\tk--;\n\t\t\t\t\t\t\tlen--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tgetNearObject: function (point) {\n\t\t\tvar x = this._getCoord(point.x),\n\t\t\t y = this._getCoord(point.y),\n\t\t\t i, j, k, row, cell, len, obj, dist,\n\t\t\t objectPoint = this._objectPoint,\n\t\t\t closestDistSq = this._sqCellSize,\n\t\t\t closest = null;\n\n\t\t\tfor (i = y - 1; i <= y + 1; i++) {\n\t\t\t\trow = this._grid[i];\n\t\t\t\tif (row) {\n\n\t\t\t\t\tfor (j = x - 1; j <= x + 1; j++) {\n\t\t\t\t\t\tcell = row[j];\n\t\t\t\t\t\tif (cell) {\n\n\t\t\t\t\t\t\tfor (k = 0, len = cell.length; k < len; k++) {\n\t\t\t\t\t\t\t\tobj = cell[k];\n\t\t\t\t\t\t\t\tdist = this._sqDist(objectPoint[L.Util.stamp(obj)], point);\n\t\t\t\t\t\t\t\tif (dist < closestDistSq ||\n\t\t\t\t\t\t\t\t\tdist <= closestDistSq && closest === null) {\n\t\t\t\t\t\t\t\t\tclosestDistSq = dist;\n\t\t\t\t\t\t\t\t\tclosest = obj;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn closest;\n\t\t},\n\n\t\t_getCoord: function (x) {\n\t\t\tvar coord = Math.floor(x / this._cellSize);\n\t\t\treturn isFinite(coord) ? coord : x;\n\t\t},\n\n\t\t_sqDist: function (p, p2) {\n\t\t\tvar dx = p2.x - p.x,\n\t\t\t dy = p2.y - p.y;\n\t\t\treturn dx * dx + dy * dy;\n\t\t}\n\t};\n\n\t/* Copyright (c) 2012 the authors listed at the following URL, and/or\n\tthe authors of referenced articles or incorporated external code:\n\thttp://en.literateprograms.org/Quickhull_(Javascript)?action=history&offset=20120410175256\n\n\tPermission is hereby granted, free of charge, to any person obtaining\n\ta copy of this software and associated documentation files (the\n\t\"Software\"), to deal in the Software without restriction, including\n\twithout limitation the rights to use, copy, modify, merge, publish,\n\tdistribute, sublicense, and/or sell copies of the Software, and to\n\tpermit persons to whom the Software is furnished to do so, subject to\n\tthe following conditions:\n\n\tThe above copyright notice and this permission notice shall be\n\tincluded in all copies or substantial portions of the Software.\n\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n\tEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\tMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n\tIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n\tCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n\tTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n\tSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\tRetrieved from: http://en.literateprograms.org/Quickhull_(Javascript)?oldid=18434\n\t*/\n\n\t(function () {\n\t\tL.QuickHull = {\n\n\t\t\t/*\n\t\t\t * @param {Object} cpt a point to be measured from the baseline\n\t\t\t * @param {Array} bl the baseline, as represented by a two-element\n\t\t\t * array of latlng objects.\n\t\t\t * @returns {Number} an approximate distance measure\n\t\t\t */\n\t\t\tgetDistant: function (cpt, bl) {\n\t\t\t\tvar vY = bl[1].lat - bl[0].lat,\n\t\t\t\t\tvX = bl[0].lng - bl[1].lng;\n\t\t\t\treturn (vX * (cpt.lat - bl[0].lat) + vY * (cpt.lng - bl[0].lng));\n\t\t\t},\n\n\t\t\t/*\n\t\t\t * @param {Array} baseLine a two-element array of latlng objects\n\t\t\t * representing the baseline to project from\n\t\t\t * @param {Array} latLngs an array of latlng objects\n\t\t\t * @returns {Object} the maximum point and all new points to stay\n\t\t\t * in consideration for the hull.\n\t\t\t */\n\t\t\tfindMostDistantPointFromBaseLine: function (baseLine, latLngs) {\n\t\t\t\tvar maxD = 0,\n\t\t\t\t\tmaxPt = null,\n\t\t\t\t\tnewPoints = [],\n\t\t\t\t\ti, pt, d;\n\n\t\t\t\tfor (i = latLngs.length - 1; i >= 0; i--) {\n\t\t\t\t\tpt = latLngs[i];\n\t\t\t\t\td = this.getDistant(pt, baseLine);\n\n\t\t\t\t\tif (d > 0) {\n\t\t\t\t\t\tnewPoints.push(pt);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (d > maxD) {\n\t\t\t\t\t\tmaxD = d;\n\t\t\t\t\t\tmaxPt = pt;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn { maxPoint: maxPt, newPoints: newPoints };\n\t\t\t},\n\n\n\t\t\t/*\n\t\t\t * Given a baseline, compute the convex hull of latLngs as an array\n\t\t\t * of latLngs.\n\t\t\t *\n\t\t\t * @param {Array} latLngs\n\t\t\t * @returns {Array}\n\t\t\t */\n\t\t\tbuildConvexHull: function (baseLine, latLngs) {\n\t\t\t\tvar convexHullBaseLines = [],\n\t\t\t\t\tt = this.findMostDistantPointFromBaseLine(baseLine, latLngs);\n\n\t\t\t\tif (t.maxPoint) { // if there is still a point \"outside\" the base line\n\t\t\t\t\tconvexHullBaseLines =\n\t\t\t\t\t\tconvexHullBaseLines.concat(\n\t\t\t\t\t\t\tthis.buildConvexHull([baseLine[0], t.maxPoint], t.newPoints)\n\t\t\t\t\t\t);\n\t\t\t\t\tconvexHullBaseLines =\n\t\t\t\t\t\tconvexHullBaseLines.concat(\n\t\t\t\t\t\t\tthis.buildConvexHull([t.maxPoint, baseLine[1]], t.newPoints)\n\t\t\t\t\t\t);\n\t\t\t\t\treturn convexHullBaseLines;\n\t\t\t\t} else { // if there is no more point \"outside\" the base line, the current base line is part of the convex hull\n\t\t\t\t\treturn [baseLine[0]];\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t/*\n\t\t\t * Given an array of latlngs, compute a convex hull as an array\n\t\t\t * of latlngs\n\t\t\t *\n\t\t\t * @param {Array} latLngs\n\t\t\t * @returns {Array}\n\t\t\t */\n\t\t\tgetConvexHull: function (latLngs) {\n\t\t\t\t// find first baseline\n\t\t\t\tvar maxLat = false, minLat = false,\n\t\t\t\t\tmaxLng = false, minLng = false,\n\t\t\t\t\tmaxLatPt = null, minLatPt = null,\n\t\t\t\t\tmaxLngPt = null, minLngPt = null,\n\t\t\t\t\tmaxPt = null, minPt = null,\n\t\t\t\t\ti;\n\n\t\t\t\tfor (i = latLngs.length - 1; i >= 0; i--) {\n\t\t\t\t\tvar pt = latLngs[i];\n\t\t\t\t\tif (maxLat === false || pt.lat > maxLat) {\n\t\t\t\t\t\tmaxLatPt = pt;\n\t\t\t\t\t\tmaxLat = pt.lat;\n\t\t\t\t\t}\n\t\t\t\t\tif (minLat === false || pt.lat < minLat) {\n\t\t\t\t\t\tminLatPt = pt;\n\t\t\t\t\t\tminLat = pt.lat;\n\t\t\t\t\t}\n\t\t\t\t\tif (maxLng === false || pt.lng > maxLng) {\n\t\t\t\t\t\tmaxLngPt = pt;\n\t\t\t\t\t\tmaxLng = pt.lng;\n\t\t\t\t\t}\n\t\t\t\t\tif (minLng === false || pt.lng < minLng) {\n\t\t\t\t\t\tminLngPt = pt;\n\t\t\t\t\t\tminLng = pt.lng;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (minLat !== maxLat) {\n\t\t\t\t\tminPt = minLatPt;\n\t\t\t\t\tmaxPt = maxLatPt;\n\t\t\t\t} else {\n\t\t\t\t\tminPt = minLngPt;\n\t\t\t\t\tmaxPt = maxLngPt;\n\t\t\t\t}\n\n\t\t\t\tvar ch = [].concat(this.buildConvexHull([minPt, maxPt], latLngs),\n\t\t\t\t\t\t\t\t\tthis.buildConvexHull([maxPt, minPt], latLngs));\n\t\t\t\treturn ch;\n\t\t\t}\n\t\t};\n\t}());\n\n\tL.MarkerCluster.include({\n\t\tgetConvexHull: function () {\n\t\t\tvar childMarkers = this.getAllChildMarkers(),\n\t\t\t\tpoints = [],\n\t\t\t\tp, i;\n\n\t\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\n\t\t\t\tp = childMarkers[i].getLatLng();\n\t\t\t\tpoints.push(p);\n\t\t\t}\n\n\t\t\treturn L.QuickHull.getConvexHull(points);\n\t\t}\n\t});\n\n\t//This code is 100% based on https://github.com/jawj/OverlappingMarkerSpiderfier-Leaflet\n\t//Huge thanks to jawj for implementing it first to make my job easy :-)\n\n\tL.MarkerCluster.include({\n\n\t\t_2PI: Math.PI * 2,\n\t\t_circleFootSeparation: 25, //related to circumference of circle\n\t\t_circleStartAngle: 0,\n\n\t\t_spiralFootSeparation: 28, //related to size of spiral (experiment!)\n\t\t_spiralLengthStart: 11,\n\t\t_spiralLengthFactor: 5,\n\n\t\t_circleSpiralSwitchover: 9, //show spiral instead of circle from this marker count upwards.\n\t\t\t\t\t\t\t\t\t// 0 -> always spiral; Infinity -> always circle\n\n\t\tspiderfy: function () {\n\t\t\tif (this._group._spiderfied === this || this._group._inZoomAnimation) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar childMarkers = this.getAllChildMarkers(null, true),\n\t\t\t\tgroup = this._group,\n\t\t\t\tmap = group._map,\n\t\t\t\tcenter = map.latLngToLayerPoint(this._latlng),\n\t\t\t\tpositions;\n\n\t\t\tthis._group._unspiderfy();\n\t\t\tthis._group._spiderfied = this;\n\n\t\t\t//TODO Maybe: childMarkers order by distance to center\n\n\t\t\tif (this._group.options.spiderfyShapePositions) {\n\t\t\t\tpositions = this._group.options.spiderfyShapePositions(childMarkers.length, center);\n\t\t\t} else if (childMarkers.length >= this._circleSpiralSwitchover) {\n\t\t\t\tpositions = this._generatePointsSpiral(childMarkers.length, center);\n\t\t\t} else {\n\t\t\t\tcenter.y += 10; // Otherwise circles look wrong => hack for standard blue icon, renders differently for other icons.\n\t\t\t\tpositions = this._generatePointsCircle(childMarkers.length, center);\n\t\t\t}\n\n\t\t\tthis._animationSpiderfy(childMarkers, positions);\n\t\t},\n\n\t\tunspiderfy: function (zoomDetails) {\n\t\t\t/// <param Name=\"zoomDetails\">Argument from zoomanim if being called in a zoom animation or null otherwise</param>\n\t\t\tif (this._group._inZoomAnimation) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._animationUnspiderfy(zoomDetails);\n\n\t\t\tthis._group._spiderfied = null;\n\t\t},\n\n\t\t_generatePointsCircle: function (count, centerPt) {\n\t\t\tvar circumference = this._group.options.spiderfyDistanceMultiplier * this._circleFootSeparation * (2 + count),\n\t\t\t\tlegLength = circumference / this._2PI, //radius from circumference\n\t\t\t\tangleStep = this._2PI / count,\n\t\t\t\tres = [],\n\t\t\t\ti, angle;\n\n\t\t\tlegLength = Math.max(legLength, 35); // Minimum distance to get outside the cluster icon.\n\n\t\t\tres.length = count;\n\n\t\t\tfor (i = 0; i < count; i++) { // Clockwise, like spiral.\n\t\t\t\tangle = this._circleStartAngle + i * angleStep;\n\t\t\t\tres[i] = new L.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle))._round();\n\t\t\t}\n\n\t\t\treturn res;\n\t\t},\n\n\t\t_generatePointsSpiral: function (count, centerPt) {\n\t\t\tvar spiderfyDistanceMultiplier = this._group.options.spiderfyDistanceMultiplier,\n\t\t\t\tlegLength = spiderfyDistanceMultiplier * this._spiralLengthStart,\n\t\t\t\tseparation = spiderfyDistanceMultiplier * this._spiralFootSeparation,\n\t\t\t\tlengthFactor = spiderfyDistanceMultiplier * this._spiralLengthFactor * this._2PI,\n\t\t\t\tangle = 0,\n\t\t\t\tres = [],\n\t\t\t\ti;\n\n\t\t\tres.length = count;\n\n\t\t\t// Higher index, closer position to cluster center.\n\t\t\tfor (i = count; i >= 0; i--) {\n\t\t\t\t// Skip the first position, so that we are already farther from center and we avoid\n\t\t\t\t// being under the default cluster icon (especially important for Circle Markers).\n\t\t\t\tif (i < count) {\n\t\t\t\t\tres[i] = new L.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle))._round();\n\t\t\t\t}\n\t\t\t\tangle += separation / legLength + i * 0.0005;\n\t\t\t\tlegLength += lengthFactor / angle;\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\n\t\t_noanimationUnspiderfy: function () {\n\t\t\tvar group = this._group,\n\t\t\t\tmap = group._map,\n\t\t\t\tfg = group._featureGroup,\n\t\t\t\tchildMarkers = this.getAllChildMarkers(null, true),\n\t\t\t\tm, i;\n\n\t\t\tgroup._ignoreMove = true;\n\n\t\t\tthis.setOpacity(1);\n\t\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\n\t\t\t\tm = childMarkers[i];\n\n\t\t\t\tfg.removeLayer(m);\n\n\t\t\t\tif (m._preSpiderfyLatlng) {\n\t\t\t\t\tm.setLatLng(m._preSpiderfyLatlng);\n\t\t\t\t\tdelete m._preSpiderfyLatlng;\n\t\t\t\t}\n\t\t\t\tif (m.setZIndexOffset) {\n\t\t\t\t\tm.setZIndexOffset(0);\n\t\t\t\t}\n\n\t\t\t\tif (m._spiderLeg) {\n\t\t\t\t\tmap.removeLayer(m._spiderLeg);\n\t\t\t\t\tdelete m._spiderLeg;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tgroup.fire('unspiderfied', {\n\t\t\t\tcluster: this,\n\t\t\t\tmarkers: childMarkers\n\t\t\t});\n\t\t\tgroup._ignoreMove = false;\n\t\t\tgroup._spiderfied = null;\n\t\t}\n\t});\n\n\t//Non Animated versions of everything\n\tL.MarkerClusterNonAnimated = L.MarkerCluster.extend({\n\t\t_animationSpiderfy: function (childMarkers, positions) {\n\t\t\tvar group = this._group,\n\t\t\t\tmap = group._map,\n\t\t\t\tfg = group._featureGroup,\n\t\t\t\tlegOptions = this._group.options.spiderLegPolylineOptions,\n\t\t\t\ti, m, leg, newPos;\n\n\t\t\tgroup._ignoreMove = true;\n\n\t\t\t// Traverse in ascending order to make sure that inner circleMarkers are on top of further legs. Normal markers are re-ordered by newPosition.\n\t\t\t// The reverse order trick no longer improves performance on modern browsers.\n\t\t\tfor (i = 0; i < childMarkers.length; i++) {\n\t\t\t\tnewPos = map.layerPointToLatLng(positions[i]);\n\t\t\t\tm = childMarkers[i];\n\n\t\t\t\t// Add the leg before the marker, so that in case the latter is a circleMarker, the leg is behind it.\n\t\t\t\tleg = new L.Polyline([this._latlng, newPos], legOptions);\n\t\t\t\tmap.addLayer(leg);\n\t\t\t\tm._spiderLeg = leg;\n\n\t\t\t\t// Now add the marker.\n\t\t\t\tm._preSpiderfyLatlng = m._latlng;\n\t\t\t\tm.setLatLng(newPos);\n\t\t\t\tif (m.setZIndexOffset) {\n\t\t\t\t\tm.setZIndexOffset(1000000); //Make these appear on top of EVERYTHING\n\t\t\t\t}\n\n\t\t\t\tfg.addLayer(m);\n\t\t\t}\n\t\t\tthis.setOpacity(0.3);\n\n\t\t\tgroup._ignoreMove = false;\n\t\t\tgroup.fire('spiderfied', {\n\t\t\t\tcluster: this,\n\t\t\t\tmarkers: childMarkers\n\t\t\t});\n\t\t},\n\n\t\t_animationUnspiderfy: function () {\n\t\t\tthis._noanimationUnspiderfy();\n\t\t}\n\t});\n\n\t//Animated versions here\n\tL.MarkerCluster.include({\n\n\t\t_animationSpiderfy: function (childMarkers, positions) {\n\t\t\tvar me = this,\n\t\t\t\tgroup = this._group,\n\t\t\t\tmap = group._map,\n\t\t\t\tfg = group._featureGroup,\n\t\t\t\tthisLayerLatLng = this._latlng,\n\t\t\t\tthisLayerPos = map.latLngToLayerPoint(thisLayerLatLng),\n\t\t\t\tsvg = L.Path.SVG,\n\t\t\t\tlegOptions = L.extend({}, this._group.options.spiderLegPolylineOptions), // Copy the options so that we can modify them for animation.\n\t\t\t\tfinalLegOpacity = legOptions.opacity,\n\t\t\t\ti, m, leg, legPath, legLength, newPos;\n\n\t\t\tif (finalLegOpacity === undefined) {\n\t\t\t\tfinalLegOpacity = L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity;\n\t\t\t}\n\n\t\t\tif (svg) {\n\t\t\t\t// If the initial opacity of the spider leg is not 0 then it appears before the animation starts.\n\t\t\t\tlegOptions.opacity = 0;\n\n\t\t\t\t// Add the class for CSS transitions.\n\t\t\t\tlegOptions.className = (legOptions.className || '') + ' leaflet-cluster-spider-leg';\n\t\t\t} else {\n\t\t\t\t// Make sure we have a defined opacity.\n\t\t\t\tlegOptions.opacity = finalLegOpacity;\n\t\t\t}\n\n\t\t\tgroup._ignoreMove = true;\n\n\t\t\t// Add markers and spider legs to map, hidden at our center point.\n\t\t\t// Traverse in ascending order to make sure that inner circleMarkers are on top of further legs. Normal markers are re-ordered by newPosition.\n\t\t\t// The reverse order trick no longer improves performance on modern browsers.\n\t\t\tfor (i = 0; i < childMarkers.length; i++) {\n\t\t\t\tm = childMarkers[i];\n\n\t\t\t\tnewPos = map.layerPointToLatLng(positions[i]);\n\n\t\t\t\t// Add the leg before the marker, so that in case the latter is a circleMarker, the leg is behind it.\n\t\t\t\tleg = new L.Polyline([thisLayerLatLng, newPos], legOptions);\n\t\t\t\tmap.addLayer(leg);\n\t\t\t\tm._spiderLeg = leg;\n\n\t\t\t\t// Explanations: https://jakearchibald.com/2013/animated-line-drawing-svg/\n\t\t\t\t// In our case the transition property is declared in the CSS file.\n\t\t\t\tif (svg) {\n\t\t\t\t\tlegPath = leg._path;\n\t\t\t\t\tlegLength = legPath.getTotalLength() + 0.1; // Need a small extra length to avoid remaining dot in Firefox.\n\t\t\t\t\tlegPath.style.strokeDasharray = legLength; // Just 1 length is enough, it will be duplicated.\n\t\t\t\t\tlegPath.style.strokeDashoffset = legLength;\n\t\t\t\t}\n\n\t\t\t\t// If it is a marker, add it now and we'll animate it out\n\t\t\t\tif (m.setZIndexOffset) {\n\t\t\t\t\tm.setZIndexOffset(1000000); // Make normal markers appear on top of EVERYTHING\n\t\t\t\t}\n\t\t\t\tif (m.clusterHide) {\n\t\t\t\t\tm.clusterHide();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Vectors just get immediately added\n\t\t\t\tfg.addLayer(m);\n\n\t\t\t\tif (m._setPos) {\n\t\t\t\t\tm._setPos(thisLayerPos);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tgroup._forceLayout();\n\t\t\tgroup._animationStart();\n\n\t\t\t// Reveal markers and spider legs.\n\t\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\n\t\t\t\tnewPos = map.layerPointToLatLng(positions[i]);\n\t\t\t\tm = childMarkers[i];\n\n\t\t\t\t//Move marker to new position\n\t\t\t\tm._preSpiderfyLatlng = m._latlng;\n\t\t\t\tm.setLatLng(newPos);\n\t\t\t\t\n\t\t\t\tif (m.clusterShow) {\n\t\t\t\t\tm.clusterShow();\n\t\t\t\t}\n\n\t\t\t\t// Animate leg (animation is actually delegated to CSS transition).\n\t\t\t\tif (svg) {\n\t\t\t\t\tleg = m._spiderLeg;\n\t\t\t\t\tlegPath = leg._path;\n\t\t\t\t\tlegPath.style.strokeDashoffset = 0;\n\t\t\t\t\t//legPath.style.strokeOpacity = finalLegOpacity;\n\t\t\t\t\tleg.setStyle({opacity: finalLegOpacity});\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.setOpacity(0.3);\n\n\t\t\tgroup._ignoreMove = false;\n\n\t\t\tsetTimeout(function () {\n\t\t\t\tgroup._animationEnd();\n\t\t\t\tgroup.fire('spiderfied', {\n\t\t\t\t\tcluster: me,\n\t\t\t\t\tmarkers: childMarkers\n\t\t\t\t});\n\t\t\t}, 200);\n\t\t},\n\n\t\t_animationUnspiderfy: function (zoomDetails) {\n\t\t\tvar me = this,\n\t\t\t\tgroup = this._group,\n\t\t\t\tmap = group._map,\n\t\t\t\tfg = group._featureGroup,\n\t\t\t\tthisLayerPos = zoomDetails ? map._latLngToNewLayerPoint(this._latlng, zoomDetails.zoom, zoomDetails.center) : map.latLngToLayerPoint(this._latlng),\n\t\t\t\tchildMarkers = this.getAllChildMarkers(null, true),\n\t\t\t\tsvg = L.Path.SVG,\n\t\t\t\tm, i, leg, legPath, legLength, nonAnimatable;\n\n\t\t\tgroup._ignoreMove = true;\n\t\t\tgroup._animationStart();\n\n\t\t\t//Make us visible and bring the child markers back in\n\t\t\tthis.setOpacity(1);\n\t\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\n\t\t\t\tm = childMarkers[i];\n\n\t\t\t\t//Marker was added to us after we were spiderfied\n\t\t\t\tif (!m._preSpiderfyLatlng) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t//Close any popup on the marker first, otherwise setting the location of the marker will make the map scroll\n\t\t\t\tm.closePopup();\n\n\t\t\t\t//Fix up the location to the real one\n\t\t\t\tm.setLatLng(m._preSpiderfyLatlng);\n\t\t\t\tdelete m._preSpiderfyLatlng;\n\n\t\t\t\t//Hack override the location to be our center\n\t\t\t\tnonAnimatable = true;\n\t\t\t\tif (m._setPos) {\n\t\t\t\t\tm._setPos(thisLayerPos);\n\t\t\t\t\tnonAnimatable = false;\n\t\t\t\t}\n\t\t\t\tif (m.clusterHide) {\n\t\t\t\t\tm.clusterHide();\n\t\t\t\t\tnonAnimatable = false;\n\t\t\t\t}\n\t\t\t\tif (nonAnimatable) {\n\t\t\t\t\tfg.removeLayer(m);\n\t\t\t\t}\n\n\t\t\t\t// Animate the spider leg back in (animation is actually delegated to CSS transition).\n\t\t\t\tif (svg) {\n\t\t\t\t\tleg = m._spiderLeg;\n\t\t\t\t\tlegPath = leg._path;\n\t\t\t\t\tlegLength = legPath.getTotalLength() + 0.1;\n\t\t\t\t\tlegPath.style.strokeDashoffset = legLength;\n\t\t\t\t\tleg.setStyle({opacity: 0});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tgroup._ignoreMove = false;\n\n\t\t\tsetTimeout(function () {\n\t\t\t\t//If we have only <= one child left then that marker will be shown on the map so don't remove it!\n\t\t\t\tvar stillThereChildCount = 0;\n\t\t\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\n\t\t\t\t\tm = childMarkers[i];\n\t\t\t\t\tif (m._spiderLeg) {\n\t\t\t\t\t\tstillThereChildCount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\n\t\t\t\t\tm = childMarkers[i];\n\n\t\t\t\t\tif (!m._spiderLeg) { //Has already been unspiderfied\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (m.clusterShow) {\n\t\t\t\t\t\tm.clusterShow();\n\t\t\t\t\t}\n\t\t\t\t\tif (m.setZIndexOffset) {\n\t\t\t\t\t\tm.setZIndexOffset(0);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (stillThereChildCount > 1) {\n\t\t\t\t\t\tfg.removeLayer(m);\n\t\t\t\t\t}\n\n\t\t\t\t\tmap.removeLayer(m._spiderLeg);\n\t\t\t\t\tdelete m._spiderLeg;\n\t\t\t\t}\n\t\t\t\tgroup._animationEnd();\n\t\t\t\tgroup.fire('unspiderfied', {\n\t\t\t\t\tcluster: me,\n\t\t\t\t\tmarkers: childMarkers\n\t\t\t\t});\n\t\t\t}, 200);\n\t\t}\n\t});\n\n\n\tL.MarkerClusterGroup.include({\n\t\t//The MarkerCluster currently spiderfied (if any)\n\t\t_spiderfied: null,\n\n\t\tunspiderfy: function () {\n\t\t\tthis._unspiderfy.apply(this, arguments);\n\t\t},\n\n\t\t_spiderfierOnAdd: function () {\n\t\t\tthis._map.on('click', this._unspiderfyWrapper, this);\n\n\t\t\tif (this._map.options.zoomAnimation) {\n\t\t\t\tthis._map.on('zoomstart', this._unspiderfyZoomStart, this);\n\t\t\t}\n\t\t\t//Browsers without zoomAnimation or a big zoom don't fire zoomstart\n\t\t\tthis._map.on('zoomend', this._noanimationUnspiderfy, this);\n\n\t\t\tif (!L.Browser.touch) {\n\t\t\t\tthis._map.getRenderer(this);\n\t\t\t\t//Needs to happen in the pageload, not after, or animations don't work in webkit\n\t\t\t\t// http://stackoverflow.com/questions/8455200/svg-animate-with-dynamically-added-elements\n\t\t\t\t//Disable on touch browsers as the animation messes up on a touch zoom and isn't very noticable\n\t\t\t}\n\t\t},\n\n\t\t_spiderfierOnRemove: function () {\n\t\t\tthis._map.off('click', this._unspiderfyWrapper, this);\n\t\t\tthis._map.off('zoomstart', this._unspiderfyZoomStart, this);\n\t\t\tthis._map.off('zoomanim', this._unspiderfyZoomAnim, this);\n\t\t\tthis._map.off('zoomend', this._noanimationUnspiderfy, this);\n\n\t\t\t//Ensure that markers are back where they should be\n\t\t\t// Use no animation to avoid a sticky leaflet-cluster-anim class on mapPane\n\t\t\tthis._noanimationUnspiderfy();\n\t\t},\n\n\t\t//On zoom start we add a zoomanim handler so that we are guaranteed to be last (after markers are animated)\n\t\t//This means we can define the animation they do rather than Markers doing an animation to their actual location\n\t\t_unspiderfyZoomStart: function () {\n\t\t\tif (!this._map) { //May have been removed from the map by a zoomEnd handler\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._map.on('zoomanim', this._unspiderfyZoomAnim, this);\n\t\t},\n\n\t\t_unspiderfyZoomAnim: function (zoomDetails) {\n\t\t\t//Wait until the first zoomanim after the user has finished touch-zooming before running the animation\n\t\t\tif (L.DomUtil.hasClass(this._map._mapPane, 'leaflet-touching')) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._map.off('zoomanim', this._unspiderfyZoomAnim, this);\n\t\t\tthis._unspiderfy(zoomDetails);\n\t\t},\n\n\t\t_unspiderfyWrapper: function () {\n\t\t\t/// <summary>_unspiderfy but passes no arguments</summary>\n\t\t\tthis._unspiderfy();\n\t\t},\n\n\t\t_unspiderfy: function (zoomDetails) {\n\t\t\tif (this._spiderfied) {\n\t\t\t\tthis._spiderfied.unspiderfy(zoomDetails);\n\t\t\t}\n\t\t},\n\n\t\t_noanimationUnspiderfy: function () {\n\t\t\tif (this._spiderfied) {\n\t\t\t\tthis._spiderfied._noanimationUnspiderfy();\n\t\t\t}\n\t\t},\n\n\t\t//If the given layer is currently being spiderfied then we unspiderfy it so it isn't on the map anymore etc\n\t\t_unspiderfyLayer: function (layer) {\n\t\t\tif (layer._spiderLeg) {\n\t\t\t\tthis._featureGroup.removeLayer(layer);\n\n\t\t\t\tif (layer.clusterShow) {\n\t\t\t\t\tlayer.clusterShow();\n\t\t\t\t}\n\t\t\t\t\t//Position will be fixed up immediately in _animationUnspiderfy\n\t\t\t\tif (layer.setZIndexOffset) {\n\t\t\t\t\tlayer.setZIndexOffset(0);\n\t\t\t\t}\n\n\t\t\t\tthis._map.removeLayer(layer._spiderLeg);\n\t\t\t\tdelete layer._spiderLeg;\n\t\t\t}\n\t\t}\n\t});\n\n\t/**\n\t * Adds 1 public method to MCG and 1 to L.Marker to facilitate changing\n\t * markers' icon options and refreshing their icon and their parent clusters\n\t * accordingly (case where their iconCreateFunction uses data of childMarkers\n\t * to make up the cluster icon).\n\t */\n\n\n\tL.MarkerClusterGroup.include({\n\t\t/**\n\t\t * Updates the icon of all clusters which are parents of the given marker(s).\n\t\t * In singleMarkerMode, also updates the given marker(s) icon.\n\t\t * @param layers L.MarkerClusterGroup|L.LayerGroup|Array(L.Marker)|Map(L.Marker)|\n\t\t * L.MarkerCluster|L.Marker (optional) list of markers (or single marker) whose parent\n\t\t * clusters need to be updated. If not provided, retrieves all child markers of this.\n\t\t * @returns {L.MarkerClusterGroup}\n\t\t */\n\t\trefreshClusters: function (layers) {\n\t\t\tif (!layers) {\n\t\t\t\tlayers = this._topClusterLevel.getAllChildMarkers();\n\t\t\t} else if (layers instanceof L.MarkerClusterGroup) {\n\t\t\t\tlayers = layers._topClusterLevel.getAllChildMarkers();\n\t\t\t} else if (layers instanceof L.LayerGroup) {\n\t\t\t\tlayers = layers._layers;\n\t\t\t} else if (layers instanceof L.MarkerCluster) {\n\t\t\t\tlayers = layers.getAllChildMarkers();\n\t\t\t} else if (layers instanceof L.Marker) {\n\t\t\t\tlayers = [layers];\n\t\t\t} // else: must be an Array(L.Marker)|Map(L.Marker)\n\t\t\tthis._flagParentsIconsNeedUpdate(layers);\n\t\t\tthis._refreshClustersIcons();\n\n\t\t\t// In case of singleMarkerMode, also re-draw the markers.\n\t\t\tif (this.options.singleMarkerMode) {\n\t\t\t\tthis._refreshSingleMarkerModeMarkers(layers);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t},\n\n\t\t/**\n\t\t * Simply flags all parent clusters of the given markers as having a \"dirty\" icon.\n\t\t * @param layers Array(L.Marker)|Map(L.Marker) list of markers.\n\t\t * @private\n\t\t */\n\t\t_flagParentsIconsNeedUpdate: function (layers) {\n\t\t\tvar id, parent;\n\n\t\t\t// Assumes layers is an Array or an Object whose prototype is non-enumerable.\n\t\t\tfor (id in layers) {\n\t\t\t\t// Flag parent clusters' icon as \"dirty\", all the way up.\n\t\t\t\t// Dumb process that flags multiple times upper parents, but still\n\t\t\t\t// much more efficient than trying to be smart and make short lists,\n\t\t\t\t// at least in the case of a hierarchy following a power law:\n\t\t\t\t// http://jsperf.com/flag-nodes-in-power-hierarchy/2\n\t\t\t\tparent = layers[id].__parent;\n\t\t\t\twhile (parent) {\n\t\t\t\t\tparent._iconNeedsUpdate = true;\n\t\t\t\t\tparent = parent.__parent;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Re-draws the icon of the supplied markers.\n\t\t * To be used in singleMarkerMode only.\n\t\t * @param layers Array(L.Marker)|Map(L.Marker) list of markers.\n\t\t * @private\n\t\t */\n\t\t_refreshSingleMarkerModeMarkers: function (layers) {\n\t\t\tvar id, layer;\n\n\t\t\tfor (id in layers) {\n\t\t\t\tlayer = layers[id];\n\n\t\t\t\t// Make sure we do not override markers that do not belong to THIS group.\n\t\t\t\tif (this.hasLayer(layer)) {\n\t\t\t\t\t// Need to re-create the icon first, then re-draw the marker.\n\t\t\t\t\tlayer.setIcon(this._overrideMarkerIcon(layer));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\tL.Marker.include({\n\t\t/**\n\t\t * Updates the given options in the marker's icon and refreshes the marker.\n\t\t * @param options map object of icon options.\n\t\t * @param directlyRefreshClusters boolean (optional) true to trigger\n\t\t * MCG.refreshClustersOf() right away with this single marker.\n\t\t * @returns {L.Marker}\n\t\t */\n\t\trefreshIconOptions: function (options, directlyRefreshClusters) {\n\t\t\tvar icon = this.options.icon;\n\n\t\t\tL.setOptions(icon, options);\n\n\t\t\tthis.setIcon(icon);\n\n\t\t\t// Shortcut to refresh the associated MCG clusters right away.\n\t\t\t// To be used when refreshing a single marker.\n\t\t\t// Otherwise, better use MCG.refreshClusters() once at the end with\n\t\t\t// the list of modified markers.\n\t\t\tif (directlyRefreshClusters && this.__parent) {\n\t\t\t\tthis.__parent._group.refreshClusters(this);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\t});\n\n\texports.MarkerClusterGroup = MarkerClusterGroup;\n\texports.MarkerCluster = MarkerCluster;\n\n\tObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n//# sourceMappingURL=leaflet.markercluster-src.js.map\n\n\n//# sourceURL=webpack://ReactLeafletDeflate/./node_modules/leaflet.markercluster/dist/leaflet.markercluster-src.js?\n}");
|
|
119
172
|
|
|
120
173
|
/***/ }),
|
|
121
174
|
|
|
122
|
-
/***/ "./
|
|
123
|
-
|
|
124
|
-
!*** ./
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
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__) => {
|
|
128
180
|
|
|
129
181
|
"use strict";
|
|
130
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _leaflet = __webpack_require__(/*! leaflet */ \"leaflet\");\n\nvar _leaflet2 = _interopRequireDefault(_leaflet);\n\nvar _Leaflet = __webpack_require__(/*! Leaflet.Deflate */ \"./node_modules/Leaflet.Deflate/dist/L.Deflate.js\");\n\nvar _reactLeaflet = __webpack_require__(/*! react-leaflet */ \"react-leaflet\");\n\n__webpack_require__(/*! leaflet.markercluster */ \"./node_modules/leaflet.markercluster/dist/leaflet.markercluster-src.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Deflate = function (_MapLayer) {\n\t_inherits(Deflate, _MapLayer);\n\n\tfunction Deflate() {\n\t\t_classCallCheck(this, Deflate);\n\n\t\treturn _possibleConstructorReturn(this, (Deflate.__proto__ || Object.getPrototypeOf(Deflate)).apply(this, arguments));\n\t}\n\n\t_createClass(Deflate, [{\n\t\tkey: 'initMapClasses',\n\t\tvalue: function initMapClasses() {\n\t\t\tvar _ref = this.props.leaflet || this.context,\n\t\t\t map = _ref.map;\n\n\t\t\tvar mapClassName = map._container.className;\n\n\t\t\tvar isAnimClassApplied = mapClassName.indexOf('leaflet-cluster-anim') !== -1;\n\t\t\tvar isStyledClassApplied = mapClassName.indexOf('marker-cluster-styled') !== -1;\n\t\t\tvar isAnimatedClassApplied = mapClassName.indexOf('marker-cluster-animated') !== -1;\n\n\t\t\t!isAnimClassApplied && (map._container.className += ' leaflet-cluster-anim');\n\n\t\t\t!isStyledClassApplied && (map._container.className += ' marker-cluster-styled');\n\n\t\t\tisAnimatedClassApplied && (map._container.className += ' marker-cluster-animated');\n\t\t}\n\t}, {\n\t\tkey: 'createLeafletElement',\n\t\tvalue: function createLeafletElement(props) {\n\t\t\treturn new _leaflet2.default.Deflate(props);\n\t\t}\n\t}, {\n\t\tkey: 'componentDidMount',\n\t\tvalue: function componentDidMount() {\n\t\t\tvar _ref2 = this.props.leaflet || this.context,\n\t\t\t map = _ref2.map;\n\n\t\t\tvar markerCluster = this.props.markerCluster;\n\t\t\t// This will add our Leaflet.Deflate (this.leafletElement) to the map--something that must happen BEFORE\n\t\t\t// we can add anything to Leaflet.Deflate itself.\n\n\t\t\t_get(Deflate.prototype.__proto__ || Object.getPrototypeOf(Deflate.prototype), 'componentDidMount', this).call(this);\n\t\t\t_leaflet2.default.geoJSON(this.props.data, this.props).addTo(this.leafletElement);\n\t\t\tif (markerCluster) this.initMapClasses();\n\t\t}\n\t}, {\n\t\tkey: 'updateLeafletElement',\n\t\tvalue: function updateLeafletElement(fromProps, toProps) {\n\t\t\tvar _ref3 = this.props.leaflet || this.context,\n\t\t\t layerContainer = _ref3.layerContainer;\n\n\t\t\tlayerContainer.removeLayer(this.leafletElement);\n\t\t\tthis.leafletElement = new _leaflet2.default.Deflate(toProps);\n\t\t\tlayerContainer.addLayer(this.leafletElement);\n\t\t\t_leaflet2.default.geoJSON(toProps.data, toProps).addTo(this.leafletElement);\n\t\t}\n\t}]);\n\n\treturn Deflate;\n}(_reactLeaflet.MapLayer);\n\nexports.default = Deflate;\n\n//# sourceURL=webpack://ReactLeafletDeflate/./src/Deflate.js?");
|
|
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}");
|
|
131
183
|
|
|
132
184
|
/***/ }),
|
|
133
185
|
|
|
134
|
-
/***/ "./
|
|
135
|
-
|
|
136
|
-
!*** ./
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
186
|
+
/***/ "./node_modules/react-dom/index.js":
|
|
187
|
+
/*!*****************************************!*\
|
|
188
|
+
!*** ./node_modules/react-dom/index.js ***!
|
|
189
|
+
\*****************************************/
|
|
190
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
140
191
|
|
|
141
192
|
"use strict";
|
|
142
|
-
eval("\n\
|
|
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}");
|
|
143
194
|
|
|
144
195
|
/***/ }),
|
|
145
196
|
|
|
146
|
-
/***/ "leaflet":
|
|
147
|
-
|
|
148
|
-
!***
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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
|
+
/***/ "./src/Deflate.jsx":
|
|
209
|
+
/*!*************************!*\
|
|
210
|
+
!*** ./src/Deflate.jsx ***!
|
|
211
|
+
\*************************/
|
|
212
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
152
213
|
|
|
153
|
-
|
|
214
|
+
"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 react_leaflet_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-leaflet/hooks */ \"./node_modules/react-leaflet/lib/hooks.js\");\n/* harmony import */ var _react_leaflet_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @react-leaflet/core */ \"./node_modules/@react-leaflet/core/lib/element.js\");\n/* harmony import */ var _react_leaflet_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @react-leaflet/core */ \"./node_modules/@react-leaflet/core/lib/generic.js\");\n/* harmony import */ var _react_leaflet_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @react-leaflet/core */ \"./node_modules/@react-leaflet/core/lib/grid-layer.js\");\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_hooks__WEBPACK_IMPORTED_MODULE_0__.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_1__.createElementObject)(layer, context);\n};\nvar updateDeflateLayer = function updateDeflateLayer(layer, props, prevProps) {\n (0,_react_leaflet_core__WEBPACK_IMPORTED_MODULE_3__.updateGridLayer)(layer, props, prevProps);\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_react_leaflet_core__WEBPACK_IMPORTED_MODULE_2__.createLayerComponent)(createDeflateLayer, updateDeflateLayer));\n\n//# sourceURL=webpack://ReactLeafletDeflate/./src/Deflate.jsx?\n}");
|
|
154
216
|
|
|
155
217
|
/***/ }),
|
|
156
218
|
|
|
157
|
-
/***/ "
|
|
158
|
-
|
|
159
|
-
!***
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
219
|
+
/***/ "./src/index.jsx":
|
|
220
|
+
/*!***********************!*\
|
|
221
|
+
!*** ./src/index.jsx ***!
|
|
222
|
+
\***********************/
|
|
223
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
224
|
+
|
|
225
|
+
"use strict";
|
|
226
|
+
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 _Deflate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Deflate */ \"./src/Deflate.jsx\");\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_Deflate__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n\n//# sourceURL=webpack://ReactLeafletDeflate/./src/index.jsx?\n}");
|
|
227
|
+
|
|
228
|
+
/***/ }),
|
|
229
|
+
|
|
230
|
+
/***/ "react":
|
|
231
|
+
/*!************************************************************************!*\
|
|
232
|
+
!*** external {"commonjs":"react","commonjs2":"react","root":"React"} ***!
|
|
233
|
+
\************************************************************************/
|
|
234
|
+
/***/ ((module) => {
|
|
163
235
|
|
|
164
|
-
|
|
236
|
+
"use strict";
|
|
237
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_react__;
|
|
165
238
|
|
|
166
239
|
/***/ })
|
|
167
240
|
|
|
168
|
-
/******/
|
|
241
|
+
/******/ });
|
|
242
|
+
/************************************************************************/
|
|
243
|
+
/******/ // The module cache
|
|
244
|
+
/******/ var __webpack_module_cache__ = {};
|
|
245
|
+
/******/
|
|
246
|
+
/******/ // The require function
|
|
247
|
+
/******/ function __webpack_require__(moduleId) {
|
|
248
|
+
/******/ // Check if module is in cache
|
|
249
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
250
|
+
/******/ if (cachedModule !== undefined) {
|
|
251
|
+
/******/ return cachedModule.exports;
|
|
252
|
+
/******/ }
|
|
253
|
+
/******/ // Create a new module (and put it into the cache)
|
|
254
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
255
|
+
/******/ // no module.id needed
|
|
256
|
+
/******/ // no module.loaded needed
|
|
257
|
+
/******/ exports: {}
|
|
258
|
+
/******/ };
|
|
259
|
+
/******/
|
|
260
|
+
/******/ // Execute the module function
|
|
261
|
+
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
262
|
+
/******/
|
|
263
|
+
/******/ // Return the exports of the module
|
|
264
|
+
/******/ return module.exports;
|
|
265
|
+
/******/ }
|
|
266
|
+
/******/
|
|
267
|
+
/************************************************************************/
|
|
268
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
269
|
+
/******/ (() => {
|
|
270
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
271
|
+
/******/ __webpack_require__.n = (module) => {
|
|
272
|
+
/******/ var getter = module && module.__esModule ?
|
|
273
|
+
/******/ () => (module['default']) :
|
|
274
|
+
/******/ () => (module);
|
|
275
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
276
|
+
/******/ return getter;
|
|
277
|
+
/******/ };
|
|
278
|
+
/******/ })();
|
|
279
|
+
/******/
|
|
280
|
+
/******/ /* webpack/runtime/define property getters */
|
|
281
|
+
/******/ (() => {
|
|
282
|
+
/******/ // define getter functions for harmony exports
|
|
283
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
284
|
+
/******/ for(var key in definition) {
|
|
285
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
286
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
287
|
+
/******/ }
|
|
288
|
+
/******/ }
|
|
289
|
+
/******/ };
|
|
290
|
+
/******/ })();
|
|
291
|
+
/******/
|
|
292
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
293
|
+
/******/ (() => {
|
|
294
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
295
|
+
/******/ })();
|
|
296
|
+
/******/
|
|
297
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
298
|
+
/******/ (() => {
|
|
299
|
+
/******/ // define __esModule on exports
|
|
300
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
301
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
302
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
303
|
+
/******/ }
|
|
304
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
305
|
+
/******/ };
|
|
306
|
+
/******/ })();
|
|
307
|
+
/******/
|
|
308
|
+
/************************************************************************/
|
|
309
|
+
/******/
|
|
310
|
+
/******/ // startup
|
|
311
|
+
/******/ // Load entry module and return exports
|
|
312
|
+
/******/ // This entry module can't be inlined because the eval devtool is used.
|
|
313
|
+
/******/ var __webpack_exports__ = __webpack_require__("./src/index.jsx");
|
|
314
|
+
/******/ __webpack_exports__ = __webpack_exports__["default"];
|
|
315
|
+
/******/
|
|
316
|
+
/******/ return __webpack_exports__;
|
|
317
|
+
/******/ })()
|
|
318
|
+
;
|
|
169
319
|
});
|