Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 221.39 KB | None | 0 0
  1. /* @preserve
  2. * Leaflet 1.3.1, a JS library for interactive maps. http://leafletjs.com
  3. * (c) 2010-2017 Vladimir Agafonkin, (c) 2010-2011 CloudMade
  4. */
  5. ! function(t, i) {
  6. "object" == typeof exports && "undefined" != typeof module ? i(exports) : "function" == typeof define && define.amd ? define(["exports"], i) : i(t.L = {})
  7. }(this, function(t) {
  8. "use strict";
  9.  
  10. function i(t) {
  11. var i, e, n, o;
  12. for (e = 1, n = arguments.length; e < n; e++) {
  13. o = arguments[e];
  14. for (i in o) t[i] = o[i]
  15. }
  16. return t
  17. }
  18.  
  19. function e(t, i) {
  20. var e = Array.prototype.slice;
  21. if (t.bind) return t.bind.apply(t, e.call(arguments, 1));
  22. var n = e.call(arguments, 2);
  23. return function() {
  24. return t.apply(i, n.length ? n.concat(e.call(arguments)) : arguments)
  25. }
  26. }
  27.  
  28. function n(t) {
  29. return t._leaflet_id = t._leaflet_id || ++ti, t._leaflet_id
  30. }
  31.  
  32. function o(t, i, e) {
  33. var n, o, s, r;
  34. return r = function() {
  35. n = !1, o && (s.apply(e, o), o = !1)
  36. }, s = function() {
  37. n ? o = arguments : (t.apply(e, arguments), setTimeout(r, i), n = !0)
  38. }
  39. }
  40.  
  41. function s(t, i, e) {
  42. var n = i[1],
  43. o = i[0],
  44. s = n - o;
  45. return t === n && e ? t : ((t - o) % s + s) % s + o
  46. }
  47.  
  48. function r() {
  49. return !1
  50. }
  51.  
  52. function a(t, i) {
  53. var e = Math.pow(10, void 0 === i ? 6 : i);
  54. return Math.round(t * e) / e
  55. }
  56.  
  57. function h(t) {
  58. return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "")
  59. }
  60.  
  61. function u(t) {
  62. return h(t).split(/\s+/)
  63. }
  64.  
  65. function l(t, i) {
  66. t.hasOwnProperty("options") || (t.options = t.options ? Qt(t.options) : {});
  67. for (var e in i) t.options[e] = i[e];
  68. return t.options
  69. }
  70.  
  71. function c(t, i, e) {
  72. var n = [];
  73. for (var o in t) n.push(encodeURIComponent(e ? o.toUpperCase() : o) + "=" + encodeURIComponent(t[o]));
  74. return (i && -1 !== i.indexOf("?") ? "&" : "?") + n.join("&")
  75. }
  76.  
  77. function _(t, i) {
  78. return t.replace(ii, function(t, e) {
  79. var n = i[e];
  80. if (void 0 === n) throw new Error("No value provided for variable " + t);
  81. return "function" == typeof n && (n = n(i)), n
  82. })
  83. }
  84.  
  85. function d(t, i) {
  86. for (var e = 0; e < t.length; e++)
  87. if (t[e] === i) return e;
  88. return -1
  89. }
  90.  
  91. function p(t) {
  92. return window["webkit" + t] || window["moz" + t] || window["ms" + t]
  93. }
  94.  
  95. function m(t) {
  96. var i = +new Date,
  97. e = Math.max(0, 16 - (i - oi));
  98. return oi = i + e, window.setTimeout(t, e)
  99. }
  100.  
  101. function f(t, i, n) {
  102. if (!n || si !== m) return si.call(window, e(t, i));
  103. t.call(i)
  104. }
  105.  
  106. function g(t) {
  107. t && ri.call(window, t)
  108. }
  109.  
  110. function v() {}
  111.  
  112. function y(t) {
  113. if ("undefined" != typeof L && L && L.Mixin) {
  114. t = ei(t) ? t : [t];
  115. for (var i = 0; i < t.length; i++) t[i] === L.Mixin.Events && console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.", (new Error).stack)
  116. }
  117. }
  118.  
  119. function x(t, i, e) {
  120. this.x = e ? Math.round(t) : t, this.y = e ? Math.round(i) : i
  121. }
  122.  
  123. function w(t, i, e) {
  124. return t instanceof x ? t : ei(t) ? new x(t[0], t[1]) : void 0 === t || null === t ? t : "object" == typeof t && "x" in t && "y" in t ? new x(t.x, t.y) : new x(t, i, e)
  125. }
  126.  
  127. function P(t, i) {
  128. if (t)
  129. for (var e = i ? [t, i] : t, n = 0, o = e.length; n < o; n++) this.extend(e[n])
  130. }
  131.  
  132. function b(t, i) {
  133. return !t || t instanceof P ? t : new P(t, i)
  134. }
  135.  
  136. function T(t, i) {
  137. if (t)
  138. for (var e = i ? [t, i] : t, n = 0, o = e.length; n < o; n++) this.extend(e[n])
  139. }
  140.  
  141. function z(t, i) {
  142. return t instanceof T ? t : new T(t, i)
  143. }
  144.  
  145. function M(t, i, e) {
  146. if (isNaN(t) || isNaN(i)) throw new Error("Invalid LatLng object: (" + t + ", " + i + ")");
  147. this.lat = +t, this.lng = +i, void 0 !== e && (this.alt = +e)
  148. }
  149.  
  150. function C(t, i, e) {
  151. return t instanceof M ? t : ei(t) && "object" != typeof t[0] ? 3 === t.length ? new M(t[0], t[1], t[2]) : 2 === t.length ? new M(t[0], t[1]) : null : void 0 === t || null === t ? t : "object" == typeof t && "lat" in t ? new M(t.lat, "lng" in t ? t.lng : t.lon, t.alt) : void 0 === i ? null : new M(t, i, e)
  152. }
  153.  
  154. function Z(t, i, e, n) {
  155. if (ei(t)) return this._a = t[0], this._b = t[1], this._c = t[2], void(this._d = t[3]);
  156. this._a = t, this._b = i, this._c = e, this._d = n
  157. }
  158.  
  159. function S(t, i, e, n) {
  160. return new Z(t, i, e, n)
  161. }
  162.  
  163. function E(t) {
  164. return document.createElementNS("http://www.w3.org/2000/svg", t)
  165. }
  166.  
  167. function k(t, i) {
  168. var e, n, o, s, r, a, h = "";
  169. for (e = 0, o = t.length; e < o; e++) {
  170. for (n = 0, s = (r = t[e]).length; n < s; n++) a = r[n], h += (n ? "L" : "M") + a.x + " " + a.y;
  171. h += i ? Xi ? "z" : "x" : ""
  172. }
  173. return h || "M0 0"
  174. }
  175.  
  176. function I(t) {
  177. return navigator.userAgent.toLowerCase().indexOf(t) >= 0
  178. }
  179.  
  180. function A(t, i, e, n) {
  181. return "touchstart" === i ? O(t, e, n) : "touchmove" === i ? W(t, e, n) : "touchend" === i && H(t, e, n), this
  182. }
  183.  
  184. function B(t, i, e) {
  185. var n = t["_leaflet_" + i + e];
  186. return "touchstart" === i ? t.removeEventListener(Qi, n, !1) : "touchmove" === i ? t.removeEventListener(te, n, !1) : "touchend" === i && (t.removeEventListener(ie, n, !1), t.removeEventListener(ee, n, !1)), this
  187. }
  188.  
  189. function O(t, i, n) {
  190. var o = e(function(t) {
  191. if ("mouse" !== t.pointerType && t.MSPOINTER_TYPE_MOUSE && t.pointerType !== t.MSPOINTER_TYPE_MOUSE) {
  192. if (!(ne.indexOf(t.target.tagName) < 0)) return;
  193. $(t)
  194. }
  195. j(t, i)
  196. });
  197. t["_leaflet_touchstart" + n] = o, t.addEventListener(Qi, o, !1), se || (document.documentElement.addEventListener(Qi, R, !0), document.documentElement.addEventListener(te, D, !0), document.documentElement.addEventListener(ie, N, !0), document.documentElement.addEventListener(ee, N, !0), se = !0)
  198. }
  199.  
  200. function R(t) {
  201. oe[t.pointerId] = t, re++
  202. }
  203.  
  204. function D(t) {
  205. oe[t.pointerId] && (oe[t.pointerId] = t)
  206. }
  207.  
  208. function N(t) {
  209. delete oe[t.pointerId], re--
  210. }
  211.  
  212. function j(t, i) {
  213. t.touches = [];
  214. for (var e in oe) t.touches.push(oe[e]);
  215. t.changedTouches = [t], i(t)
  216. }
  217.  
  218. function W(t, i, e) {
  219. var n = function(t) {
  220. (t.pointerType !== t.MSPOINTER_TYPE_MOUSE && "mouse" !== t.pointerType || 0 !== t.buttons) && j(t, i)
  221. };
  222. t["_leaflet_touchmove" + e] = n, t.addEventListener(te, n, !1)
  223. }
  224.  
  225. function H(t, i, e) {
  226. var n = function(t) {
  227. j(t, i)
  228. };
  229. t["_leaflet_touchend" + e] = n, t.addEventListener(ie, n, !1), t.addEventListener(ee, n, !1)
  230. }
  231.  
  232. function F(t, i, e) {
  233. function n(t) {
  234. var i;
  235. if (Ui) {
  236. if (!Pi || "mouse" === t.pointerType) return;
  237. i = re
  238. } else i = t.touches.length;
  239. if (!(i > 1)) {
  240. var e = Date.now(),
  241. n = e - (s || e);
  242. r = t.touches ? t.touches[0] : t, a = n > 0 && n <= h, s = e
  243. }
  244. }
  245.  
  246. function o(t) {
  247. if (a && !r.cancelBubble) {
  248. if (Ui) {
  249. if (!Pi || "mouse" === t.pointerType) return;
  250. var e, n, o = {};
  251. for (n in r) e = r[n], o[n] = e && e.bind ? e.bind(r) : e;
  252. r = o
  253. }
  254. r.type = "dblclick", i(r), s = null
  255. }
  256. }
  257. var s, r, a = !1,
  258. h = 250;
  259. return t[ue + ae + e] = n, t[ue + he + e] = o, t[ue + "dblclick" + e] = i, t.addEventListener(ae, n, !1), t.addEventListener(he, o, !1), t.addEventListener("dblclick", i, !1), this
  260. }
  261.  
  262. function U(t, i) {
  263. var e = t[ue + ae + i],
  264. n = t[ue + he + i],
  265. o = t[ue + "dblclick" + i];
  266. return t.removeEventListener(ae, e, !1), t.removeEventListener(he, n, !1), Pi || t.removeEventListener("dblclick", o, !1), this
  267. }
  268.  
  269. function V(t, i, e, n) {
  270. if ("object" == typeof i)
  271. for (var o in i) G(t, o, i[o], e);
  272. else
  273. for (var s = 0, r = (i = u(i)).length; s < r; s++) G(t, i[s], e, n);
  274. return this
  275. }
  276.  
  277. function q(t, i, e, n) {
  278. if ("object" == typeof i)
  279. for (var o in i) K(t, o, i[o], e);
  280. else if (i)
  281. for (var s = 0, r = (i = u(i)).length; s < r; s++) K(t, i[s], e, n);
  282. else {
  283. for (var a in t[le]) K(t, a, t[le][a]);
  284. delete t[le]
  285. }
  286. return this
  287. }
  288.  
  289. function G(t, i, e, o) {
  290. var s = i + n(e) + (o ? "_" + n(o) : "");
  291. if (t[le] && t[le][s]) return this;
  292. var r = function(i) {
  293. return e.call(o || t, i || window.event)
  294. },
  295. a = r;
  296. Ui && 0 === i.indexOf("touch") ? A(t, i, r, s) : !Vi || "dblclick" !== i || !F || Ui && Si ? "addEventListener" in t ? "mousewheel" === i ? t.addEventListener("onwheel" in t ? "wheel" : "mousewheel", r, !1) : "mouseenter" === i || "mouseleave" === i ? (r = function(i) {
  297. i = i || window.event, ot(t, i) && a(i)
  298. }, t.addEventListener("mouseenter" === i ? "mouseover" : "mouseout", r, !1)) : ("click" === i && Ti && (r = function(t) {
  299. st(t, a)
  300. }), t.addEventListener(i, r, !1)) : "attachEvent" in t && t.attachEvent("on" + i, r) : F(t, r, s), t[le] = t[le] || {}, t[le][s] = r
  301. }
  302.  
  303. function K(t, i, e, o) {
  304. var s = i + n(e) + (o ? "_" + n(o) : ""),
  305. r = t[le] && t[le][s];
  306. if (!r) return this;
  307. Ui && 0 === i.indexOf("touch") ? B(t, i, s) : !Vi || "dblclick" !== i || !U || Ui && Si ? "removeEventListener" in t ? "mousewheel" === i ? t.removeEventListener("onwheel" in t ? "wheel" : "mousewheel", r, !1) : t.removeEventListener("mouseenter" === i ? "mouseover" : "mouseleave" === i ? "mouseout" : i, r, !1) : "detachEvent" in t && t.detachEvent("on" + i, r) : U(t, s), t[le][s] = null
  308. }
  309.  
  310. function Y(t) {
  311. return t.stopPropagation ? t.stopPropagation() : t.originalEvent ? t.originalEvent._stopped = !0 : t.cancelBubble = !0, nt(t), this
  312. }
  313.  
  314. function X(t) {
  315. return G(t, "mousewheel", Y), this
  316. }
  317.  
  318. function J(t) {
  319. return V(t, "mousedown touchstart dblclick", Y), G(t, "click", et), this
  320. }
  321.  
  322. function $(t) {
  323. return t.preventDefault ? t.preventDefault() : t.returnValue = !1, this
  324. }
  325.  
  326. function Q(t) {
  327. return $(t), Y(t), this
  328. }
  329.  
  330. function tt(t, i) {
  331. if (!i) return new x(t.clientX, t.clientY);
  332. var e = i.getBoundingClientRect(),
  333. n = e.width / i.offsetWidth || 1,
  334. o = e.height / i.offsetHeight || 1;
  335. return new x(t.clientX / n - e.left - i.clientLeft, t.clientY / o - e.top - i.clientTop)
  336. }
  337.  
  338. function it(t) {
  339. return Pi ? t.wheelDeltaY / 2 : t.deltaY && 0 === t.deltaMode ? -t.deltaY / ce : t.deltaY && 1 === t.deltaMode ? 20 * -t.deltaY : t.deltaY && 2 === t.deltaMode ? 60 * -t.deltaY : t.deltaX || t.deltaZ ? 0 : t.wheelDelta ? (t.wheelDeltaY || t.wheelDelta) / 2 : t.detail && Math.abs(t.detail) < 32765 ? 20 * -t.detail : t.detail ? t.detail / -32765 * 60 : 0
  340. }
  341.  
  342. function et(t) {
  343. _e[t.type] = !0
  344. }
  345.  
  346. function nt(t) {
  347. var i = _e[t.type];
  348. return _e[t.type] = !1, i
  349. }
  350.  
  351. function ot(t, i) {
  352. var e = i.relatedTarget;
  353. if (!e) return !0;
  354. try {
  355. for (; e && e !== t;) e = e.parentNode
  356. } catch (t) {
  357. return !1
  358. }
  359. return e !== t
  360. }
  361.  
  362. function st(t, i) {
  363. var e = t.timeStamp || t.originalEvent && t.originalEvent.timeStamp,
  364. n = pi && e - pi;
  365. n && n > 100 && n < 500 || t.target._simulatedClick && !t._simulated ? Q(t) : (pi = e, i(t))
  366. }
  367.  
  368. function rt(t) {
  369. return "string" == typeof t ? document.getElementById(t) : t
  370. }
  371.  
  372. function at(t, i) {
  373. var e = t.style[i] || t.currentStyle && t.currentStyle[i];
  374. if ((!e || "auto" === e) && document.defaultView) {
  375. var n = document.defaultView.getComputedStyle(t, null);
  376. e = n ? n[i] : null
  377. }
  378. return "auto" === e ? null : e
  379. }
  380.  
  381. function ht(t, i, e) {
  382. var n = document.createElement(t);
  383. return n.className = i || "", e && e.appendChild(n), n
  384. }
  385.  
  386. function ut(t) {
  387. var i = t.parentNode;
  388. i && i.removeChild(t)
  389. }
  390.  
  391. function lt(t) {
  392. for (; t.firstChild;) t.removeChild(t.firstChild)
  393. }
  394.  
  395. function ct(t) {
  396. var i = t.parentNode;
  397. i.lastChild !== t && i.appendChild(t)
  398. }
  399.  
  400. function _t(t) {
  401. var i = t.parentNode;
  402. i.firstChild !== t && i.insertBefore(t, i.firstChild)
  403. }
  404.  
  405. function dt(t, i) {
  406. if (void 0 !== t.classList) return t.classList.contains(i);
  407. var e = gt(t);
  408. return e.length > 0 && new RegExp("(^|\\s)" + i + "(\\s|$)").test(e)
  409. }
  410.  
  411. function pt(t, i) {
  412. if (void 0 !== t.classList)
  413. for (var e = u(i), n = 0, o = e.length; n < o; n++) t.classList.add(e[n]);
  414. else if (!dt(t, i)) {
  415. var s = gt(t);
  416. ft(t, (s ? s + " " : "") + i)
  417. }
  418. }
  419.  
  420. function mt(t, i) {
  421. void 0 !== t.classList ? t.classList.remove(i) : ft(t, h((" " + gt(t) + " ").replace(" " + i + " ", " ")))
  422. }
  423.  
  424. function ft(t, i) {
  425. void 0 === t.className.baseVal ? t.className = i : t.className.baseVal = i
  426. }
  427.  
  428. function gt(t) {
  429. return void 0 === t.className.baseVal ? t.className : t.className.baseVal
  430. }
  431.  
  432. function vt(t, i) {
  433. "opacity" in t.style ? t.style.opacity = i : "filter" in t.style && yt(t, i)
  434. }
  435.  
  436. function yt(t, i) {
  437. var e = !1,
  438. n = "DXImageTransform.Microsoft.Alpha";
  439. try {
  440. e = t.filters.item(n)
  441. } catch (t) {
  442. if (1 === i) return
  443. }
  444. i = Math.round(100 * i), e ? (e.Enabled = 100 !== i, e.Opacity = i) : t.style.filter += " progid:" + n + "(opacity=" + i + ")"
  445. }
  446.  
  447. function xt(t) {
  448. for (var i = document.documentElement.style, e = 0; e < t.length; e++)
  449. if (t[e] in i) return t[e];
  450. return !1
  451. }
  452.  
  453. function wt(t, i, e) {
  454. var n = i || new x(0, 0);
  455. t.style[pe] = (Oi ? "translate(" + n.x + "px," + n.y + "px)" : "translate3d(" + n.x + "px," + n.y + "px,0)") + (e ? " scale(" + e + ")" : "")
  456. }
  457.  
  458. function Lt(t, i) {
  459. t._leaflet_pos = i, Ni ? wt(t, i) : (t.style.left = i.x + "px", t.style.top = i.y + "px")
  460. }
  461.  
  462. function Pt(t) {
  463. return t._leaflet_pos || new x(0, 0)
  464. }
  465.  
  466. function bt() {
  467. V(window, "dragstart", $)
  468. }
  469.  
  470. function Tt() {
  471. q(window, "dragstart", $)
  472. }
  473.  
  474. function zt(t) {
  475. for (; - 1 === t.tabIndex;) t = t.parentNode;
  476. t.style && (Mt(), ve = t, ye = t.style.outline, t.style.outline = "none", V(window, "keydown", Mt))
  477. }
  478.  
  479. function Mt() {
  480. ve && (ve.style.outline = ye, ve = void 0, ye = void 0, q(window, "keydown", Mt))
  481. }
  482.  
  483. function Ct(t, i) {
  484. if (!i || !t.length) return t.slice();
  485. var e = i * i;
  486. return t = kt(t, e), t = St(t, e)
  487. }
  488.  
  489. function Zt(t, i, e) {
  490. return Math.sqrt(Rt(t, i, e, !0))
  491. }
  492.  
  493. function St(t, i) {
  494. var e = t.length,
  495. n = new(typeof Uint8Array != void 0 + "" ? Uint8Array : Array)(e);
  496. n[0] = n[e - 1] = 1, Et(t, n, i, 0, e - 1);
  497. var o, s = [];
  498. for (o = 0; o < e; o++) n[o] && s.push(t[o]);
  499. return s
  500. }
  501.  
  502. function Et(t, i, e, n, o) {
  503. var s, r, a, h = 0;
  504. for (r = n + 1; r <= o - 1; r++)(a = Rt(t[r], t[n], t[o], !0)) > h && (s = r, h = a);
  505. h > e && (i[s] = 1, Et(t, i, e, n, s), Et(t, i, e, s, o))
  506. }
  507.  
  508. function kt(t, i) {
  509. for (var e = [t[0]], n = 1, o = 0, s = t.length; n < s; n++) Ot(t[n], t[o]) > i && (e.push(t[n]), o = n);
  510. return o < s - 1 && e.push(t[s - 1]), e
  511. }
  512.  
  513. function It(t, i, e, n, o) {
  514. var s, r, a, h = n ? Se : Bt(t, e),
  515. u = Bt(i, e);
  516. for (Se = u;;) {
  517. if (!(h | u)) return [t, i];
  518. if (h & u) return !1;
  519. a = Bt(r = At(t, i, s = h || u, e, o), e), s === h ? (t = r, h = a) : (i = r, u = a)
  520. }
  521. }
  522.  
  523. function At(t, i, e, n, o) {
  524. var s, r, a = i.x - t.x,
  525. h = i.y - t.y,
  526. u = n.min,
  527. l = n.max;
  528. return 8 & e ? (s = t.x + a * (l.y - t.y) / h, r = l.y) : 4 & e ? (s = t.x + a * (u.y - t.y) / h, r = u.y) : 2 & e ? (s = l.x, r = t.y + h * (l.x - t.x) / a) : 1 & e && (s = u.x, r = t.y + h * (u.x - t.x) / a), new x(s, r, o)
  529. }
  530.  
  531. function Bt(t, i) {
  532. var e = 0;
  533. return t.x < i.min.x ? e |= 1 : t.x > i.max.x && (e |= 2), t.y < i.min.y ? e |= 4 : t.y > i.max.y && (e |= 8), e
  534. }
  535.  
  536. function Ot(t, i) {
  537. var e = i.x - t.x,
  538. n = i.y - t.y;
  539. return e * e + n * n
  540. }
  541.  
  542. function Rt(t, i, e, n) {
  543. var o, s = i.x,
  544. r = i.y,
  545. a = e.x - s,
  546. h = e.y - r,
  547. u = a * a + h * h;
  548. return u > 0 && ((o = ((t.x - s) * a + (t.y - r) * h) / u) > 1 ? (s = e.x, r = e.y) : o > 0 && (s += a * o, r += h * o)), a = t.x - s, h = t.y - r, n ? a * a + h * h : new x(s, r)
  549. }
  550.  
  551. function Dt(t) {
  552. return !ei(t[0]) || "object" != typeof t[0][0] && void 0 !== t[0][0]
  553. }
  554.  
  555. function Nt(t) {
  556. return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."), Dt(t)
  557. }
  558.  
  559. function jt(t, i, e) {
  560. var n, o, s, r, a, h, u, l, c, _ = [1, 4, 2, 8];
  561. for (o = 0, u = t.length; o < u; o++) t[o]._code = Bt(t[o], i);
  562. for (r = 0; r < 4; r++) {
  563. for (l = _[r], n = [], o = 0, s = (u = t.length) - 1; o < u; s = o++) a = t[o], h = t[s], a._code & l ? h._code & l || ((c = At(h, a, l, i, e))._code = Bt(c, i), n.push(c)) : (h._code & l && ((c = At(h, a, l, i, e))._code = Bt(c, i), n.push(c)), n.push(a));
  564. t = n
  565. }
  566. return t
  567. }
  568.  
  569. function Wt(t, i) {
  570. var e, n, o, s, r = "Feature" === t.type ? t.geometry : t,
  571. a = r ? r.coordinates : null,
  572. h = [],
  573. u = i && i.pointToLayer,
  574. l = i && i.coordsToLatLng || Ht;
  575. if (!a && !r) return null;
  576. switch (r.type) {
  577. case "Point":
  578. return e = l(a), u ? u(t, e) : new Xe(e);
  579. case "MultiPoint":
  580. for (o = 0, s = a.length; o < s; o++) e = l(a[o]), h.push(u ? u(t, e) : new Xe(e));
  581. return new qe(h);
  582. case "LineString":
  583. case "MultiLineString":
  584. return n = Ft(a, "LineString" === r.type ? 0 : 1, l), new tn(n, i);
  585. case "Polygon":
  586. case "MultiPolygon":
  587. return n = Ft(a, "Polygon" === r.type ? 1 : 2, l), new en(n, i);
  588. case "GeometryCollection":
  589. for (o = 0, s = r.geometries.length; o < s; o++) {
  590. var c = Wt({
  591. geometry: r.geometries[o],
  592. type: "Feature",
  593. properties: t.properties
  594. }, i);
  595. c && h.push(c)
  596. }
  597. return new qe(h);
  598. default:
  599. throw new Error("Invalid GeoJSON object.")
  600. }
  601. }
  602.  
  603. function Ht(t) {
  604. return new M(t[1], t[0], t[2])
  605. }
  606.  
  607. function Ft(t, i, e) {
  608. for (var n, o = [], s = 0, r = t.length; s < r; s++) n = i ? Ft(t[s], i - 1, e) : (e || Ht)(t[s]), o.push(n);
  609. return o
  610. }
  611.  
  612. function Ut(t, i) {
  613. return i = "number" == typeof i ? i : 6, void 0 !== t.alt ? [a(t.lng, i), a(t.lat, i), a(t.alt, i)] : [a(t.lng, i), a(t.lat, i)]
  614. }
  615.  
  616. function Vt(t, i, e, n) {
  617. for (var o = [], s = 0, r = t.length; s < r; s++) o.push(i ? Vt(t[s], i - 1, e, n) : Ut(t[s], n));
  618. return !i && e && o.push(o[0]), o
  619. }
  620.  
  621. function qt(t, e) {
  622. return t.feature ? i({}, t.feature, {
  623. geometry: e
  624. }) : Gt(e)
  625. }
  626.  
  627. function Gt(t) {
  628. return "Feature" === t.type || "FeatureCollection" === t.type ? t : {
  629. type: "Feature",
  630. properties: {},
  631. geometry: t
  632. }
  633. }
  634.  
  635. function Kt(t, i) {
  636. return new nn(t, i)
  637. }
  638.  
  639. function Yt(t, i) {
  640. return new dn(t, i)
  641. }
  642.  
  643. function Xt(t) {
  644. return Yi ? new fn(t) : null
  645. }
  646.  
  647. function Jt(t) {
  648. return Xi || Ji ? new xn(t) : null
  649. }
  650. var $t = Object.freeze;
  651. Object.freeze = function(t) {
  652. return t
  653. };
  654. var Qt = Object.create || function() {
  655. function t() {}
  656. return function(i) {
  657. return t.prototype = i, new t
  658. }
  659. }(),
  660. ti = 0,
  661. ii = /\{ *([\w_-]+) *\}/g,
  662. ei = Array.isArray || function(t) {
  663. return "[object Array]" === Object.prototype.toString.call(t)
  664. },
  665. ni = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",
  666. oi = 0,
  667. si = window.requestAnimationFrame || p("RequestAnimationFrame") || m,
  668. ri = window.cancelAnimationFrame || p("CancelAnimationFrame") || p("CancelRequestAnimationFrame") || function(t) {
  669. window.clearTimeout(t)
  670. },
  671. ai = (Object.freeze || Object)({
  672. freeze: $t,
  673. extend: i,
  674. create: Qt,
  675. bind: e,
  676. lastId: ti,
  677. stamp: n,
  678. throttle: o,
  679. wrapNum: s,
  680. falseFn: r,
  681. formatNum: a,
  682. trim: h,
  683. splitWords: u,
  684. setOptions: l,
  685. getParamString: c,
  686. template: _,
  687. isArray: ei,
  688. indexOf: d,
  689. emptyImageUrl: ni,
  690. requestFn: si,
  691. cancelFn: ri,
  692. requestAnimFrame: f,
  693. cancelAnimFrame: g
  694. });
  695. v.extend = function(t) {
  696. var e = function() {
  697. this.initialize && this.initialize.apply(this, arguments), this.callInitHooks()
  698. },
  699. n = e.__super__ = this.prototype,
  700. o = Qt(n);
  701. o.constructor = e, e.prototype = o;
  702. for (var s in this) this.hasOwnProperty(s) && "prototype" !== s && "__super__" !== s && (e[s] = this[s]);
  703. return t.statics && (i(e, t.statics), delete t.statics), t.includes && (y(t.includes), i.apply(null, [o].concat(t.includes)), delete t.includes), o.options && (t.options = i(Qt(o.options), t.options)), i(o, t), o._initHooks = [], o.callInitHooks = function() {
  704. if (!this._initHooksCalled) {
  705. n.callInitHooks && n.callInitHooks.call(this), this._initHooksCalled = !0;
  706. for (var t = 0, i = o._initHooks.length; t < i; t++) o._initHooks[t].call(this)
  707. }
  708. }, e
  709. }, v.include = function(t) {
  710. return i(this.prototype, t), this
  711. }, v.mergeOptions = function(t) {
  712. return i(this.prototype.options, t), this
  713. }, v.addInitHook = function(t) {
  714. var i = Array.prototype.slice.call(arguments, 1),
  715. e = "function" == typeof t ? t : function() {
  716. this[t].apply(this, i)
  717. };
  718. return this.prototype._initHooks = this.prototype._initHooks || [], this.prototype._initHooks.push(e), this
  719. };
  720. var hi = {
  721. on: function(t, i, e) {
  722. if ("object" == typeof t)
  723. for (var n in t) this._on(n, t[n], i);
  724. else
  725. for (var o = 0, s = (t = u(t)).length; o < s; o++) this._on(t[o], i, e);
  726. return this
  727. },
  728. off: function(t, i, e) {
  729. if (t)
  730. if ("object" == typeof t)
  731. for (var n in t) this._off(n, t[n], i);
  732. else
  733. for (var o = 0, s = (t = u(t)).length; o < s; o++) this._off(t[o], i, e);
  734. else delete this._events;
  735. return this
  736. },
  737. _on: function(t, i, e) {
  738. this._events = this._events || {};
  739. var n = this._events[t];
  740. n || (n = [], this._events[t] = n), e === this && (e = void 0);
  741. for (var o = {
  742. fn: i,
  743. ctx: e
  744. }, s = n, r = 0, a = s.length; r < a; r++)
  745. if (s[r].fn === i && s[r].ctx === e) return;
  746. s.push(o)
  747. },
  748. _off: function(t, i, e) {
  749. var n, o, s;
  750. if (this._events && (n = this._events[t]))
  751. if (i) {
  752. if (e === this && (e = void 0), n)
  753. for (o = 0, s = n.length; o < s; o++) {
  754. var a = n[o];
  755. if (a.ctx === e && a.fn === i) return a.fn = r, this._firingCount && (this._events[t] = n = n.slice()), void n.splice(o, 1)
  756. }
  757. } else {
  758. for (o = 0, s = n.length; o < s; o++) n[o].fn = r;
  759. delete this._events[t]
  760. }
  761. },
  762. fire: function(t, e, n) {
  763. if (!this.listens(t, n)) return this;
  764. var o = i({}, e, {
  765. type: t,
  766. target: this,
  767. sourceTarget: e && e.sourceTarget || this
  768. });
  769. if (this._events) {
  770. var s = this._events[t];
  771. if (s) {
  772. this._firingCount = this._firingCount + 1 || 1;
  773. for (var r = 0, a = s.length; r < a; r++) {
  774. var h = s[r];
  775. h.fn.call(h.ctx || this, o)
  776. }
  777. this._firingCount--
  778. }
  779. }
  780. return n && this._propagateEvent(o), this
  781. },
  782. listens: function(t, i) {
  783. var e = this._events && this._events[t];
  784. if (e && e.length) return !0;
  785. if (i)
  786. for (var n in this._eventParents)
  787. if (this._eventParents[n].listens(t, i)) return !0;
  788. return !1
  789. },
  790. once: function(t, i, n) {
  791. if ("object" == typeof t) {
  792. for (var o in t) this.once(o, t[o], i);
  793. return this
  794. }
  795. var s = e(function() {
  796. this.off(t, i, n).off(t, s, n)
  797. }, this);
  798. return this.on(t, i, n).on(t, s, n)
  799. },
  800. addEventParent: function(t) {
  801. return this._eventParents = this._eventParents || {}, this._eventParents[n(t)] = t, this
  802. },
  803. removeEventParent: function(t) {
  804. return this._eventParents && delete this._eventParents[n(t)], this
  805. },
  806. _propagateEvent: function(t) {
  807. for (var e in this._eventParents) this._eventParents[e].fire(t.type, i({
  808. layer: t.target,
  809. propagatedFrom: t.target
  810. }, t), !0)
  811. }
  812. };
  813. hi.addEventListener = hi.on, hi.removeEventListener = hi.clearAllEventListeners = hi.off, hi.addOneTimeEventListener = hi.once, hi.fireEvent = hi.fire, hi.hasEventListeners = hi.listens;
  814. var ui = v.extend(hi),
  815. li = Math.trunc || function(t) {
  816. return t > 0 ? Math.floor(t) : Math.ceil(t)
  817. };
  818. x.prototype = {
  819. clone: function() {
  820. return new x(this.x, this.y)
  821. },
  822. add: function(t) {
  823. return this.clone()._add(w(t))
  824. },
  825. _add: function(t) {
  826. return this.x += t.x, this.y += t.y, this
  827. },
  828. subtract: function(t) {
  829. return this.clone()._subtract(w(t))
  830. },
  831. _subtract: function(t) {
  832. return this.x -= t.x, this.y -= t.y, this
  833. },
  834. divideBy: function(t) {
  835. return this.clone()._divideBy(t)
  836. },
  837. _divideBy: function(t) {
  838. return this.x /= t, this.y /= t, this
  839. },
  840. multiplyBy: function(t) {
  841. return this.clone()._multiplyBy(t)
  842. },
  843. _multiplyBy: function(t) {
  844. return this.x *= t, this.y *= t, this
  845. },
  846. scaleBy: function(t) {
  847. return new x(this.x * t.x, this.y * t.y)
  848. },
  849. unscaleBy: function(t) {
  850. return new x(this.x / t.x, this.y / t.y)
  851. },
  852. round: function() {
  853. return this.clone()._round()
  854. },
  855. _round: function() {
  856. return this.x = Math.round(this.x), this.y = Math.round(this.y), this
  857. },
  858. floor: function() {
  859. return this.clone()._floor()
  860. },
  861. _floor: function() {
  862. return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this
  863. },
  864. ceil: function() {
  865. return this.clone()._ceil()
  866. },
  867. _ceil: function() {
  868. return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this
  869. },
  870. trunc: function() {
  871. return this.clone()._trunc()
  872. },
  873. _trunc: function() {
  874. return this.x = li(this.x), this.y = li(this.y), this
  875. },
  876. distanceTo: function(t) {
  877. var i = (t = w(t)).x - this.x,
  878. e = t.y - this.y;
  879. return Math.sqrt(i * i + e * e)
  880. },
  881. equals: function(t) {
  882. return (t = w(t)).x === this.x && t.y === this.y
  883. },
  884. contains: function(t) {
  885. return t = w(t), Math.abs(t.x) <= Math.abs(this.x) && Math.abs(t.y) <= Math.abs(this.y)
  886. },
  887. toString: function() {
  888. return "Point(" + a(this.x) + ", " + a(this.y) + ")"
  889. }
  890. }, P.prototype = {
  891. extend: function(t) {
  892. return t = w(t), this.min || this.max ? (this.min.x = Math.min(t.x, this.min.x), this.max.x = Math.max(t.x, this.max.x), this.min.y = Math.min(t.y, this.min.y), this.max.y = Math.max(t.y, this.max.y)) : (this.min = t.clone(), this.max = t.clone()), this
  893. },
  894. getCenter: function(t) {
  895. return new x((this.min.x + this.max.x) / 2, (this.min.y + this.max.y) / 2, t)
  896. },
  897. getBottomLeft: function() {
  898. return new x(this.min.x, this.max.y)
  899. },
  900. getTopRight: function() {
  901. return new x(this.max.x, this.min.y)
  902. },
  903. getTopLeft: function() {
  904. return this.min
  905. },
  906. getBottomRight: function() {
  907. return this.max
  908. },
  909. getSize: function() {
  910. return this.max.subtract(this.min)
  911. },
  912. contains: function(t) {
  913. var i, e;
  914. return (t = "number" == typeof t[0] || t instanceof x ? w(t) : b(t)) instanceof P ? (i = t.min, e = t.max) : i = e = t, i.x >= this.min.x && e.x <= this.max.x && i.y >= this.min.y && e.y <= this.max.y
  915. },
  916. intersects: function(t) {
  917. t = b(t);
  918. var i = this.min,
  919. e = this.max,
  920. n = t.min,
  921. o = t.max,
  922. s = o.x >= i.x && n.x <= e.x,
  923. r = o.y >= i.y && n.y <= e.y;
  924. return s && r
  925. },
  926. overlaps: function(t) {
  927. t = b(t);
  928. var i = this.min,
  929. e = this.max,
  930. n = t.min,
  931. o = t.max,
  932. s = o.x > i.x && n.x < e.x,
  933. r = o.y > i.y && n.y < e.y;
  934. return s && r
  935. },
  936. isValid: function() {
  937. return !(!this.min || !this.max)
  938. }
  939. }, T.prototype = {
  940. extend: function(t) {
  941. var i, e, n = this._southWest,
  942. o = this._northEast;
  943. if (t instanceof M) i = t, e = t;
  944. else {
  945. if (!(t instanceof T)) return t ? this.extend(C(t) || z(t)) : this;
  946. if (i = t._southWest, e = t._northEast, !i || !e) return this
  947. }
  948. return n || o ? (n.lat = Math.min(i.lat, n.lat), n.lng = Math.min(i.lng, n.lng), o.lat = Math.max(e.lat, o.lat), o.lng = Math.max(e.lng, o.lng)) : (this._southWest = new M(i.lat, i.lng), this._northEast = new M(e.lat, e.lng)), this
  949. },
  950. pad: function(t) {
  951. var i = this._southWest,
  952. e = this._northEast,
  953. n = Math.abs(i.lat - e.lat) * t,
  954. o = Math.abs(i.lng - e.lng) * t;
  955. return new T(new M(i.lat - n, i.lng - o), new M(e.lat + n, e.lng + o))
  956. },
  957. getCenter: function() {
  958. return new M((this._southWest.lat + this._northEast.lat) / 2, (this._southWest.lng + this._northEast.lng) / 2)
  959. },
  960. getSouthWest: function() {
  961. return this._southWest
  962. },
  963. getNorthEast: function() {
  964. return this._northEast
  965. },
  966. getNorthWest: function() {
  967. return new M(this.getNorth(), this.getWest())
  968. },
  969. getSouthEast: function() {
  970. return new M(this.getSouth(), this.getEast())
  971. },
  972. getWest: function() {
  973. return this._southWest.lng
  974. },
  975. getSouth: function() {
  976. return this._southWest.lat
  977. },
  978. getEast: function() {
  979. return this._northEast.lng
  980. },
  981. getNorth: function() {
  982. return this._northEast.lat
  983. },
  984. contains: function(t) {
  985. t = "number" == typeof t[0] || t instanceof M || "lat" in t ? C(t) : z(t);
  986. var i, e, n = this._southWest,
  987. o = this._northEast;
  988. return t instanceof T ? (i = t.getSouthWest(), e = t.getNorthEast()) : i = e = t, i.lat >= n.lat && e.lat <= o.lat && i.lng >= n.lng && e.lng <= o.lng
  989. },
  990. intersects: function(t) {
  991. t = z(t);
  992. var i = this._southWest,
  993. e = this._northEast,
  994. n = t.getSouthWest(),
  995. o = t.getNorthEast(),
  996. s = o.lat >= i.lat && n.lat <= e.lat,
  997. r = o.lng >= i.lng && n.lng <= e.lng;
  998. return s && r
  999. },
  1000. overlaps: function(t) {
  1001. t = z(t);
  1002. var i = this._southWest,
  1003. e = this._northEast,
  1004. n = t.getSouthWest(),
  1005. o = t.getNorthEast(),
  1006. s = o.lat > i.lat && n.lat < e.lat,
  1007. r = o.lng > i.lng && n.lng < e.lng;
  1008. return s && r
  1009. },
  1010. toBBoxString: function() {
  1011. return [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(",")
  1012. },
  1013. equals: function(t, i) {
  1014. return !!t && (t = z(t), this._southWest.equals(t.getSouthWest(), i) && this._northEast.equals(t.getNorthEast(), i))
  1015. },
  1016. isValid: function() {
  1017. return !(!this._southWest || !this._northEast)
  1018. }
  1019. }, M.prototype = {
  1020. equals: function(t, i) {
  1021. return !!t && (t = C(t), Math.max(Math.abs(this.lat - t.lat), Math.abs(this.lng - t.lng)) <= (void 0 === i ? 1e-9 : i))
  1022. },
  1023. toString: function(t) {
  1024. return "LatLng(" + a(this.lat, t) + ", " + a(this.lng, t) + ")"
  1025. },
  1026. distanceTo: function(t) {
  1027. return _i.distance(this, C(t))
  1028. },
  1029. wrap: function() {
  1030. return _i.wrapLatLng(this)
  1031. },
  1032. toBounds: function(t) {
  1033. var i = 180 * t / 40075017,
  1034. e = i / Math.cos(Math.PI / 180 * this.lat);
  1035. return z([this.lat - i, this.lng - e], [this.lat + i, this.lng + e])
  1036. },
  1037. clone: function() {
  1038. return new M(this.lat, this.lng, this.alt)
  1039. }
  1040. };
  1041. var ci = {
  1042. latLngToPoint: function(t, i) {
  1043. var e = this.projection.project(t),
  1044. n = this.scale(i);
  1045. return this.transformation._transform(e, n)
  1046. },
  1047. pointToLatLng: function(t, i) {
  1048. var e = this.scale(i),
  1049. n = this.transformation.untransform(t, e);
  1050. return this.projection.unproject(n)
  1051. },
  1052. project: function(t) {
  1053. return this.projection.project(t)
  1054. },
  1055. unproject: function(t) {
  1056. return this.projection.unproject(t)
  1057. },
  1058. scale: function(t) {
  1059. return 256 * Math.pow(2, t)
  1060. },
  1061. zoom: function(t) {
  1062. return Math.log(t / 256) / Math.LN2
  1063. },
  1064. getProjectedBounds: function(t) {
  1065. if (this.infinite) return null;
  1066. var i = this.projection.bounds,
  1067. e = this.scale(t);
  1068. return new P(this.transformation.transform(i.min, e), this.transformation.transform(i.max, e))
  1069. },
  1070. infinite: !1,
  1071. wrapLatLng: function(t) {
  1072. var i = this.wrapLng ? s(t.lng, this.wrapLng, !0) : t.lng;
  1073. return new M(this.wrapLat ? s(t.lat, this.wrapLat, !0) : t.lat, i, t.alt)
  1074. },
  1075. wrapLatLngBounds: function(t) {
  1076. var i = t.getCenter(),
  1077. e = this.wrapLatLng(i),
  1078. n = i.lat - e.lat,
  1079. o = i.lng - e.lng;
  1080. if (0 === n && 0 === o) return t;
  1081. var s = t.getSouthWest(),
  1082. r = t.getNorthEast();
  1083. return new T(new M(s.lat - n, s.lng - o), new M(r.lat - n, r.lng - o))
  1084. }
  1085. },
  1086. _i = i({}, ci, {
  1087. wrapLng: [-180, 180],
  1088. R: 6371e3,
  1089. distance: function(t, i) {
  1090. var e = Math.PI / 180,
  1091. n = t.lat * e,
  1092. o = i.lat * e,
  1093. s = Math.sin((i.lat - t.lat) * e / 2),
  1094. r = Math.sin((i.lng - t.lng) * e / 2),
  1095. a = s * s + Math.cos(n) * Math.cos(o) * r * r,
  1096. h = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
  1097. return this.R * h
  1098. }
  1099. }),
  1100. di = {
  1101. R: 6378137,
  1102. MAX_LATITUDE: 85.0511287798,
  1103. project: function(t) {
  1104. var i = Math.PI / 180,
  1105. e = this.MAX_LATITUDE,
  1106. n = Math.max(Math.min(e, t.lat), -e),
  1107. o = Math.sin(n * i);
  1108. return new x(this.R * t.lng * i, this.R * Math.log((1 + o) / (1 - o)) / 2)
  1109. },
  1110. unproject: function(t) {
  1111. var i = 180 / Math.PI;
  1112. return new M((2 * Math.atan(Math.exp(t.y / this.R)) - Math.PI / 2) * i, t.x * i / this.R)
  1113. },
  1114. bounds: function() {
  1115. var t = 6378137 * Math.PI;
  1116. return new P([-t, -t], [t, t])
  1117. }()
  1118. };
  1119. Z.prototype = {
  1120. transform: function(t, i) {
  1121. return this._transform(t.clone(), i)
  1122. },
  1123. _transform: function(t, i) {
  1124. return i = i || 1, t.x = i * (this._a * t.x + this._b), t.y = i * (this._c * t.y + this._d), t
  1125. },
  1126. untransform: function(t, i) {
  1127. return i = i || 1, new x((t.x / i - this._b) / this._a, (t.y / i - this._d) / this._c)
  1128. }
  1129. };
  1130. var pi, mi, fi, gi, vi = i({}, _i, {
  1131. code: "EPSG:3857",
  1132. projection: di,
  1133. transformation: function() {
  1134. var t = .5 / (Math.PI * di.R);
  1135. return S(t, .5, -t, .5)
  1136. }()
  1137. }),
  1138. yi = i({}, vi, {
  1139. code: "EPSG:900913"
  1140. }),
  1141. xi = document.documentElement.style,
  1142. wi = "ActiveXObject" in window,
  1143. Li = wi && !document.addEventListener,
  1144. Pi = "msLaunchUri" in navigator && !("documentMode" in document),
  1145. bi = I("webkit"),
  1146. Ti = I("android"),
  1147. zi = I("android 2") || I("android 3"),
  1148. Mi = parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1], 10),
  1149. Ci = Ti && I("Google") && Mi < 537 && !("AudioNode" in window),
  1150. Zi = !!window.opera,
  1151. Si = I("chrome"),
  1152. Ei = I("gecko") && !bi && !Zi && !wi,
  1153. ki = !Si && I("safari"),
  1154. Ii = I("phantom"),
  1155. Ai = "OTransition" in xi,
  1156. Bi = 0 === navigator.platform.indexOf("Win"),
  1157. Oi = wi && "transition" in xi,
  1158. Ri = "WebKitCSSMatrix" in window && "m11" in new window.WebKitCSSMatrix && !zi,
  1159. Di = "MozPerspective" in xi,
  1160. Ni = !window.L_DISABLE_3D && (Oi || Ri || Di) && !Ai && !Ii,
  1161. ji = "undefined" != typeof orientation || I("mobile"),
  1162. Wi = ji && bi,
  1163. Hi = ji && Ri,
  1164. Fi = !window.PointerEvent && window.MSPointerEvent,
  1165. Ui = !(!window.PointerEvent && !Fi),
  1166. Vi = !window.L_NO_TOUCH && (Ui || "ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch),
  1167. qi = ji && Zi,
  1168. Gi = ji && Ei,
  1169. Ki = (window.devicePixelRatio || window.screen.deviceXDPI / window.screen.logicalXDPI) > 1,
  1170. Yi = !!document.createElement("canvas").getContext,
  1171. Xi = !(!document.createElementNS || !E("svg").createSVGRect),
  1172. Ji = !Xi && function() {
  1173. try {
  1174. var t = document.createElement("div");
  1175. t.innerHTML = '<v:shape adj="1"/>';
  1176. var i = t.firstChild;
  1177. return i.style.behavior = "url(#default#VML)", i && "object" == typeof i.adj
  1178. } catch (t) {
  1179. return !1
  1180. }
  1181. }(),
  1182. $i = (Object.freeze || Object)({
  1183. ie: wi,
  1184. ielt9: Li,
  1185. edge: Pi,
  1186. webkit: bi,
  1187. android: Ti,
  1188. android23: zi,
  1189. androidStock: Ci,
  1190. opera: Zi,
  1191. chrome: Si,
  1192. gecko: Ei,
  1193. safari: ki,
  1194. phantom: Ii,
  1195. opera12: Ai,
  1196. win: Bi,
  1197. ie3d: Oi,
  1198. webkit3d: Ri,
  1199. gecko3d: Di,
  1200. any3d: Ni,
  1201. mobile: ji,
  1202. mobileWebkit: Wi,
  1203. mobileWebkit3d: Hi,
  1204. msPointer: Fi,
  1205. pointer: Ui,
  1206. touch: Vi,
  1207. mobileOpera: qi,
  1208. mobileGecko: Gi,
  1209. retina: Ki,
  1210. canvas: Yi,
  1211. svg: Xi,
  1212. vml: Ji
  1213. }),
  1214. Qi = Fi ? "MSPointerDown" : "pointerdown",
  1215. te = Fi ? "MSPointerMove" : "pointermove",
  1216. ie = Fi ? "MSPointerUp" : "pointerup",
  1217. ee = Fi ? "MSPointerCancel" : "pointercancel",
  1218. ne = ["INPUT", "SELECT", "OPTION"],
  1219. oe = {},
  1220. se = !1,
  1221. re = 0,
  1222. ae = Fi ? "MSPointerDown" : Ui ? "pointerdown" : "touchstart",
  1223. he = Fi ? "MSPointerUp" : Ui ? "pointerup" : "touchend",
  1224. ue = "_leaflet_",
  1225. le = "_leaflet_events",
  1226. ce = Bi && Si ? 2 * window.devicePixelRatio : Ei ? window.devicePixelRatio : 1,
  1227. _e = {},
  1228. de = (Object.freeze || Object)({
  1229. on: V,
  1230. off: q,
  1231. stopPropagation: Y,
  1232. disableScrollPropagation: X,
  1233. disableClickPropagation: J,
  1234. preventDefault: $,
  1235. stop: Q,
  1236. getMousePosition: tt,
  1237. getWheelDelta: it,
  1238. fakeStop: et,
  1239. skipped: nt,
  1240. isExternalTarget: ot,
  1241. addListener: V,
  1242. removeListener: q
  1243. }),
  1244. pe = xt(["transform", "WebkitTransform", "OTransform", "MozTransform", "msTransform"]),
  1245. me = xt(["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition"]),
  1246. fe = "webkitTransition" === me || "OTransition" === me ? me + "End" : "transitionend";
  1247. if ("onselectstart" in document) mi = function() {
  1248. V(window, "selectstart", $)
  1249. }, fi = function() {
  1250. q(window, "selectstart", $)
  1251. };
  1252. else {
  1253. var ge = xt(["userSelect", "WebkitUserSelect", "OUserSelect", "MozUserSelect", "msUserSelect"]);
  1254. mi = function() {
  1255. if (ge) {
  1256. var t = document.documentElement.style;
  1257. gi = t[ge], t[ge] = "none"
  1258. }
  1259. }, fi = function() {
  1260. ge && (document.documentElement.style[ge] = gi, gi = void 0)
  1261. }
  1262. }
  1263. var ve, ye, xe = (Object.freeze || Object)({
  1264. TRANSFORM: pe,
  1265. TRANSITION: me,
  1266. TRANSITION_END: fe,
  1267. get: rt,
  1268. getStyle: at,
  1269. create: ht,
  1270. remove: ut,
  1271. empty: lt,
  1272. toFront: ct,
  1273. toBack: _t,
  1274. hasClass: dt,
  1275. addClass: pt,
  1276. removeClass: mt,
  1277. setClass: ft,
  1278. getClass: gt,
  1279. setOpacity: vt,
  1280. testProp: xt,
  1281. setTransform: wt,
  1282. setPosition: Lt,
  1283. getPosition: Pt,
  1284. disableTextSelection: mi,
  1285. enableTextSelection: fi,
  1286. disableImageDrag: bt,
  1287. enableImageDrag: Tt,
  1288. preventOutline: zt,
  1289. restoreOutline: Mt
  1290. }),
  1291. we = ui.extend({
  1292. run: function(t, i, e, n) {
  1293. this.stop(), this._el = t, this._inProgress = !0, this._duration = e || .25, this._easeOutPower = 1 / Math.max(n || .5, .2), this._startPos = Pt(t), this._offset = i.subtract(this._startPos), this._startTime = +new Date, this.fire("start"), this._animate()
  1294. },
  1295. stop: function() {
  1296. this._inProgress && (this._step(!0), this._complete())
  1297. },
  1298. _animate: function() {
  1299. this._animId = f(this._animate, this), this._step()
  1300. },
  1301. _step: function(t) {
  1302. var i = +new Date - this._startTime,
  1303. e = 1e3 * this._duration;
  1304. i < e ? this._runFrame(this._easeOut(i / e), t) : (this._runFrame(1), this._complete())
  1305. },
  1306. _runFrame: function(t, i) {
  1307. var e = this._startPos.add(this._offset.multiplyBy(t));
  1308. i && e._round(), Lt(this._el, e), this.fire("step")
  1309. },
  1310. _complete: function() {
  1311. g(this._animId), this._inProgress = !1, this.fire("end")
  1312. },
  1313. _easeOut: function(t) {
  1314. return 1 - Math.pow(1 - t, this._easeOutPower)
  1315. }
  1316. }),
  1317. Le = ui.extend({
  1318. options: {
  1319. crs: vi,
  1320. center: void 0,
  1321. zoom: void 0,
  1322. minZoom: void 0,
  1323. maxZoom: void 0,
  1324. layers: [],
  1325. maxBounds: void 0,
  1326. renderer: void 0,
  1327. zoomAnimation: !0,
  1328. zoomAnimationThreshold: 4,
  1329. fadeAnimation: !0,
  1330. markerZoomAnimation: !0,
  1331. transform3DLimit: 8388608,
  1332. zoomSnap: 1,
  1333. zoomDelta: 1,
  1334. trackResize: !0
  1335. },
  1336. initialize: function(t, i) {
  1337. i = l(this, i), this._initContainer(t), this._initLayout(), this._onResize = e(this._onResize, this), this._initEvents(), i.maxBounds && this.setMaxBounds(i.maxBounds), void 0 !== i.zoom && (this._zoom = this._limitZoom(i.zoom)), i.center && void 0 !== i.zoom && this.setView(C(i.center), i.zoom, {
  1338. reset: !0
  1339. }), this._handlers = [], this._layers = {}, this._zoomBoundLayers = {}, this._sizeChanged = !0, this.callInitHooks(), this._zoomAnimated = me && Ni && !qi && this.options.zoomAnimation, this._zoomAnimated && (this._createAnimProxy(), V(this._proxy, fe, this._catchTransitionEnd, this)), this._addLayers(this.options.layers)
  1340. },
  1341. setView: function(t, e, n) {
  1342. return e = void 0 === e ? this._zoom : this._limitZoom(e), t = this._limitCenter(C(t), e, this.options.maxBounds), n = n || {}, this._stop(), this._loaded && !n.reset && !0 !== n && (void 0 !== n.animate && (n.zoom = i({
  1343. animate: n.animate
  1344. }, n.zoom), n.pan = i({
  1345. animate: n.animate,
  1346. duration: n.duration
  1347. }, n.pan)), this._zoom !== e ? this._tryAnimatedZoom && this._tryAnimatedZoom(t, e, n.zoom) : this._tryAnimatedPan(t, n.pan)) ? (clearTimeout(this._sizeTimer), this) : (this._resetView(t, e), this)
  1348. },
  1349. setZoom: function(t, i) {
  1350. return this._loaded ? this.setView(this.getCenter(), t, {
  1351. zoom: i
  1352. }) : (this._zoom = t, this)
  1353. },
  1354. zoomIn: function(t, i) {
  1355. return t = t || (Ni ? this.options.zoomDelta : 1), this.setZoom(this._zoom + t, i)
  1356. },
  1357. zoomOut: function(t, i) {
  1358. return t = t || (Ni ? this.options.zoomDelta : 1), this.setZoom(this._zoom - t, i)
  1359. },
  1360. setZoomAround: function(t, i, e) {
  1361. var n = this.getZoomScale(i),
  1362. o = this.getSize().divideBy(2),
  1363. s = (t instanceof x ? t : this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1 - 1 / n),
  1364. r = this.containerPointToLatLng(o.add(s));
  1365. return this.setView(r, i, {
  1366. zoom: e
  1367. })
  1368. },
  1369. _getBoundsCenterZoom: function(t, i) {
  1370. i = i || {}, t = t.getBounds ? t.getBounds() : z(t);
  1371. var e = w(i.paddingTopLeft || i.padding || [0, 0]),
  1372. n = w(i.paddingBottomRight || i.padding || [0, 0]),
  1373. o = this.getBoundsZoom(t, !1, e.add(n));
  1374. if ((o = "number" == typeof i.maxZoom ? Math.min(i.maxZoom, o) : o) === 1 / 0) return {
  1375. center: t.getCenter(),
  1376. zoom: o
  1377. };
  1378. var s = n.subtract(e).divideBy(2),
  1379. r = this.project(t.getSouthWest(), o),
  1380. a = this.project(t.getNorthEast(), o);
  1381. return {
  1382. center: this.unproject(r.add(a).divideBy(2).add(s), o),
  1383. zoom: o
  1384. }
  1385. },
  1386. fitBounds: function(t, i) {
  1387. if (!(t = z(t)).isValid()) throw new Error("Bounds are not valid.");
  1388. var e = this._getBoundsCenterZoom(t, i);
  1389. return this.setView(e.center, e.zoom, i)
  1390. },
  1391. fitWorld: function(t) {
  1392. return this.fitBounds([
  1393. [-90, -180],
  1394. [90, 180]
  1395. ], t)
  1396. },
  1397. panTo: function(t, i) {
  1398. return this.setView(t, this._zoom, {
  1399. pan: i
  1400. })
  1401. },
  1402. panBy: function(t, i) {
  1403. if (t = w(t).round(), i = i || {}, !t.x && !t.y) return this.fire("moveend");
  1404. if (!0 !== i.animate && !this.getSize().contains(t)) return this._resetView(this.unproject(this.project(this.getCenter()).add(t)), this.getZoom()), this;
  1405. if (this._panAnim || (this._panAnim = new we, this._panAnim.on({
  1406. step: this._onPanTransitionStep,
  1407. end: this._onPanTransitionEnd
  1408. }, this)), i.noMoveStart || this.fire("movestart"), !1 !== i.animate) {
  1409. pt(this._mapPane, "leaflet-pan-anim");
  1410. var e = this._getMapPanePos().subtract(t).round();
  1411. this._panAnim.run(this._mapPane, e, i.duration || .25, i.easeLinearity)
  1412. } else this._rawPanBy(t), this.fire("move").fire("moveend");
  1413. return this
  1414. },
  1415. flyTo: function(t, i, e) {
  1416. function n(t) {
  1417. var i = (g * g - m * m + (t ? -1 : 1) * x * x * v * v) / (2 * (t ? g : m) * x * v),
  1418. e = Math.sqrt(i * i + 1) - i;
  1419. return e < 1e-9 ? -18 : Math.log(e)
  1420. }
  1421.  
  1422. function o(t) {
  1423. return (Math.exp(t) - Math.exp(-t)) / 2
  1424. }
  1425.  
  1426. function s(t) {
  1427. return (Math.exp(t) + Math.exp(-t)) / 2
  1428. }
  1429.  
  1430. function r(t) {
  1431. return o(t) / s(t)
  1432. }
  1433.  
  1434. function a(t) {
  1435. return m * (s(w) / s(w + y * t))
  1436. }
  1437.  
  1438. function h(t) {
  1439. return m * (s(w) * r(w + y * t) - o(w)) / x
  1440. }
  1441.  
  1442. function u(t) {
  1443. return 1 - Math.pow(1 - t, 1.5)
  1444. }
  1445.  
  1446. function l() {
  1447. var e = (Date.now() - L) / b,
  1448. n = u(e) * P;
  1449. e <= 1 ? (this._flyToFrame = f(l, this), this._move(this.unproject(c.add(_.subtract(c).multiplyBy(h(n) / v)), p), this.getScaleZoom(m / a(n), p), {
  1450. flyTo: !0
  1451. })) : this._move(t, i)._moveEnd(!0)
  1452. }
  1453. if (!1 === (e = e || {}).animate || !Ni) return this.setView(t, i, e);
  1454. this._stop();
  1455. var c = this.project(this.getCenter()),
  1456. _ = this.project(t),
  1457. d = this.getSize(),
  1458. p = this._zoom;
  1459. t = C(t), i = void 0 === i ? p : i;
  1460. var m = Math.max(d.x, d.y),
  1461. g = m * this.getZoomScale(p, i),
  1462. v = _.distanceTo(c) || 1,
  1463. y = 1.42,
  1464. x = y * y,
  1465. w = n(0),
  1466. L = Date.now(),
  1467. P = (n(1) - w) / y,
  1468. b = e.duration ? 1e3 * e.duration : 1e3 * P * .8;
  1469. return this._moveStart(!0, e.noMoveStart), l.call(this), this
  1470. },
  1471. flyToBounds: function(t, i) {
  1472. var e = this._getBoundsCenterZoom(t, i);
  1473. return this.flyTo(e.center, e.zoom, i)
  1474. },
  1475. setMaxBounds: function(t) {
  1476. return (t = z(t)).isValid() ? (this.options.maxBounds && this.off("moveend", this._panInsideMaxBounds), this.options.maxBounds = t, this._loaded && this._panInsideMaxBounds(), this.on("moveend", this._panInsideMaxBounds)) : (this.options.maxBounds = null, this.off("moveend", this._panInsideMaxBounds))
  1477. },
  1478. setMinZoom: function(t) {
  1479. var i = this.options.minZoom;
  1480. return this.options.minZoom = t, this._loaded && i !== t && (this.fire("zoomlevelschange"), this.getZoom() < this.options.minZoom) ? this.setZoom(t) : this
  1481. },
  1482. setMaxZoom: function(t) {
  1483. var i = this.options.maxZoom;
  1484. return this.options.maxZoom = t, this._loaded && i !== t && (this.fire("zoomlevelschange"), this.getZoom() > this.options.maxZoom) ? this.setZoom(t) : this
  1485. },
  1486. panInsideBounds: function(t, i) {
  1487. this._enforcingBounds = !0;
  1488. var e = this.getCenter(),
  1489. n = this._limitCenter(e, this._zoom, z(t));
  1490. return e.equals(n) || this.panTo(n, i), this._enforcingBounds = !1, this
  1491. },
  1492. invalidateSize: function(t) {
  1493. if (!this._loaded) return this;
  1494. t = i({
  1495. animate: !1,
  1496. pan: !0
  1497. }, !0 === t ? {
  1498. animate: !0
  1499. } : t);
  1500. var n = this.getSize();
  1501. this._sizeChanged = !0, this._lastCenter = null;
  1502. var o = this.getSize(),
  1503. s = n.divideBy(2).round(),
  1504. r = o.divideBy(2).round(),
  1505. a = s.subtract(r);
  1506. return a.x || a.y ? (t.animate && t.pan ? this.panBy(a) : (t.pan && this._rawPanBy(a), this.fire("move"), t.debounceMoveend ? (clearTimeout(this._sizeTimer), this._sizeTimer = setTimeout(e(this.fire, this, "moveend"), 200)) : this.fire("moveend")), this.fire("resize", {
  1507. oldSize: n,
  1508. newSize: o
  1509. })) : this
  1510. },
  1511. stop: function() {
  1512. return this.setZoom(this._limitZoom(this._zoom)), this.options.zoomSnap || this.fire("viewreset"), this._stop()
  1513. },
  1514. locate: function(t) {
  1515. if (t = this._locateOptions = i({
  1516. timeout: 1e4,
  1517. watch: !1
  1518. }, t), !("geolocation" in navigator)) return this._handleGeolocationError({
  1519. code: 0,
  1520. message: "Geolocation not supported."
  1521. }), this;
  1522. var n = e(this._handleGeolocationResponse, this),
  1523. o = e(this._handleGeolocationError, this);
  1524. return t.watch ? this._locationWatchId = navigator.geolocation.watchPosition(n, o, t) : navigator.geolocation.getCurrentPosition(n, o, t), this
  1525. },
  1526. stopLocate: function() {
  1527. return navigator.geolocation && navigator.geolocation.clearWatch && navigator.geolocation.clearWatch(this._locationWatchId), this._locateOptions && (this._locateOptions.setView = !1), this
  1528. },
  1529. _handleGeolocationError: function(t) {
  1530. var i = t.code,
  1531. e = t.message || (1 === i ? "permission denied" : 2 === i ? "position unavailable" : "timeout");
  1532. this._locateOptions.setView && !this._loaded && this.fitWorld(), this.fire("locationerror", {
  1533. code: i,
  1534. message: "Geolocation error: " + e + "."
  1535. })
  1536. },
  1537. _handleGeolocationResponse: function(t) {
  1538. var i = new M(t.coords.latitude, t.coords.longitude),
  1539. e = i.toBounds(t.coords.accuracy),
  1540. n = this._locateOptions;
  1541. if (n.setView) {
  1542. var o = this.getBoundsZoom(e);
  1543. this.setView(i, n.maxZoom ? Math.min(o, n.maxZoom) : o)
  1544. }
  1545. var s = {
  1546. latlng: i,
  1547. bounds: e,
  1548. timestamp: t.timestamp
  1549. };
  1550. for (var r in t.coords) "number" == typeof t.coords[r] && (s[r] = t.coords[r]);
  1551. this.fire("locationfound", s)
  1552. },
  1553. addHandler: function(t, i) {
  1554. if (!i) return this;
  1555. var e = this[t] = new i(this);
  1556. return this._handlers.push(e), this.options[t] && e.enable(), this
  1557. },
  1558. remove: function() {
  1559. if (this._initEvents(!0), this._containerId !== this._container._leaflet_id) throw new Error("Map container is being reused by another instance");
  1560. try {
  1561. delete this._container._leaflet_id, delete this._containerId
  1562. } catch (t) {
  1563. this._container._leaflet_id = void 0, this._containerId = void 0
  1564. }
  1565. void 0 !== this._locationWatchId && this.stopLocate(), this._stop(), ut(this._mapPane), this._clearControlPos && this._clearControlPos(), this._clearHandlers(), this._loaded && this.fire("unload");
  1566. var t;
  1567. for (t in this._layers) this._layers[t].remove();
  1568. for (t in this._panes) ut(this._panes[t]);
  1569. return this._layers = [], this._panes = [], delete this._mapPane, delete this._renderer, this
  1570. },
  1571. createPane: function(t, i) {
  1572. var e = ht("div", "leaflet-pane" + (t ? " leaflet-" + t.replace("Pane", "") + "-pane" : ""), i || this._mapPane);
  1573. return t && (this._panes[t] = e), e
  1574. },
  1575. getCenter: function() {
  1576. return this._checkIfLoaded(), this._lastCenter && !this._moved() ? this._lastCenter : this.layerPointToLatLng(this._getCenterLayerPoint())
  1577. },
  1578. getZoom: function() {
  1579. return this._zoom
  1580. },
  1581. getBounds: function() {
  1582. var t = this.getPixelBounds();
  1583. return new T(this.unproject(t.getBottomLeft()), this.unproject(t.getTopRight()))
  1584. },
  1585. getMinZoom: function() {
  1586. return void 0 === this.options.minZoom ? this._layersMinZoom || 0 : this.options.minZoom
  1587. },
  1588. getMaxZoom: function() {
  1589. return void 0 === this.options.maxZoom ? void 0 === this._layersMaxZoom ? 1 / 0 : this._layersMaxZoom : this.options.maxZoom
  1590. },
  1591. getBoundsZoom: function(t, i, e) {
  1592. t = z(t), e = w(e || [0, 0]);
  1593. var n = this.getZoom() || 0,
  1594. o = this.getMinZoom(),
  1595. s = this.getMaxZoom(),
  1596. r = t.getNorthWest(),
  1597. a = t.getSouthEast(),
  1598. h = this.getSize().subtract(e),
  1599. u = b(this.project(a, n), this.project(r, n)).getSize(),
  1600. l = Ni ? this.options.zoomSnap : 1,
  1601. c = h.x / u.x,
  1602. _ = h.y / u.y,
  1603. d = i ? Math.max(c, _) : Math.min(c, _);
  1604. return n = this.getScaleZoom(d, n), l && (n = Math.round(n / (l / 100)) * (l / 100), n = i ? Math.ceil(n / l) * l : Math.floor(n / l) * l), Math.max(o, Math.min(s, n))
  1605. },
  1606. getSize: function() {
  1607. return this._size && !this._sizeChanged || (this._size = new x(this._container.clientWidth || 0, this._container.clientHeight || 0), this._sizeChanged = !1), this._size.clone()
  1608. },
  1609. getPixelBounds: function(t, i) {
  1610. var e = this._getTopLeftPoint(t, i);
  1611. return new P(e, e.add(this.getSize()))
  1612. },
  1613. getPixelOrigin: function() {
  1614. return this._checkIfLoaded(), this._pixelOrigin
  1615. },
  1616. getPixelWorldBounds: function(t) {
  1617. return this.options.crs.getProjectedBounds(void 0 === t ? this.getZoom() : t)
  1618. },
  1619. getPane: function(t) {
  1620. return "string" == typeof t ? this._panes[t] : t
  1621. },
  1622. getPanes: function() {
  1623. return this._panes
  1624. },
  1625. getContainer: function() {
  1626. return this._container
  1627. },
  1628. getZoomScale: function(t, i) {
  1629. var e = this.options.crs;
  1630. return i = void 0 === i ? this._zoom : i, e.scale(t) / e.scale(i)
  1631. },
  1632. getScaleZoom: function(t, i) {
  1633. var e = this.options.crs;
  1634. i = void 0 === i ? this._zoom : i;
  1635. var n = e.zoom(t * e.scale(i));
  1636. return isNaN(n) ? 1 / 0 : n
  1637. },
  1638. project: function(t, i) {
  1639. return i = void 0 === i ? this._zoom : i, this.options.crs.latLngToPoint(C(t), i)
  1640. },
  1641. unproject: function(t, i) {
  1642. return i = void 0 === i ? this._zoom : i, this.options.crs.pointToLatLng(w(t), i)
  1643. },
  1644. layerPointToLatLng: function(t) {
  1645. var i = w(t).add(this.getPixelOrigin());
  1646. return this.unproject(i)
  1647. },
  1648. latLngToLayerPoint: function(t) {
  1649. return this.project(C(t))._round()._subtract(this.getPixelOrigin())
  1650. },
  1651. wrapLatLng: function(t) {
  1652. return this.options.crs.wrapLatLng(C(t))
  1653. },
  1654. wrapLatLngBounds: function(t) {
  1655. return this.options.crs.wrapLatLngBounds(z(t))
  1656. },
  1657. distance: function(t, i) {
  1658. return this.options.crs.distance(C(t), C(i))
  1659. },
  1660. containerPointToLayerPoint: function(t) {
  1661. return w(t).subtract(this._getMapPanePos())
  1662. },
  1663. layerPointToContainerPoint: function(t) {
  1664. return w(t).add(this._getMapPanePos())
  1665. },
  1666. containerPointToLatLng: function(t) {
  1667. var i = this.containerPointToLayerPoint(w(t));
  1668. return this.layerPointToLatLng(i)
  1669. },
  1670. latLngToContainerPoint: function(t) {
  1671. return this.layerPointToContainerPoint(this.latLngToLayerPoint(C(t)))
  1672. },
  1673. mouseEventToContainerPoint: function(t) {
  1674. return tt(t, this._container)
  1675. },
  1676. mouseEventToLayerPoint: function(t) {
  1677. return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))
  1678. },
  1679. mouseEventToLatLng: function(t) {
  1680. return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))
  1681. },
  1682. _initContainer: function(t) {
  1683. var i = this._container = rt(t);
  1684. if (!i) throw new Error("Map container not found.");
  1685. if (i._leaflet_id) throw new Error("Map container is already initialized.");
  1686. V(i, "scroll", this._onScroll, this), this._containerId = n(i)
  1687. },
  1688. _initLayout: function() {
  1689. var t = this._container;
  1690. this._fadeAnimated = this.options.fadeAnimation && Ni, pt(t, "leaflet-container" + (Vi ? " leaflet-touch" : "") + (Ki ? " leaflet-retina" : "") + (Li ? " leaflet-oldie" : "") + (ki ? " leaflet-safari" : "") + (this._fadeAnimated ? " leaflet-fade-anim" : ""));
  1691. var i = at(t, "position");
  1692. "absolute" !== i && "relative" !== i && "fixed" !== i && (t.style.position = "relative"), this._initPanes(), this._initControlPos && this._initControlPos()
  1693. },
  1694. _initPanes: function() {
  1695. var t = this._panes = {};
  1696. this._paneRenderers = {}, this._mapPane = this.createPane("mapPane", this._container), Lt(this._mapPane, new x(0, 0)), this.createPane("tilePane"), this.createPane("shadowPane"), this.createPane("overlayPane"), this.createPane("markerPane"), this.createPane("tooltipPane"), this.createPane("popupPane"), this.options.markerZoomAnimation || (pt(t.markerPane, "leaflet-zoom-hide"), pt(t.shadowPane, "leaflet-zoom-hide"))
  1697. },
  1698. _resetView: function(t, i) {
  1699. Lt(this._mapPane, new x(0, 0));
  1700. var e = !this._loaded;
  1701. this._loaded = !0, i = this._limitZoom(i), this.fire("viewprereset");
  1702. var n = this._zoom !== i;
  1703. this._moveStart(n, !1)._move(t, i)._moveEnd(n), this.fire("viewreset"), e && this.fire("load")
  1704. },
  1705. _moveStart: function(t, i) {
  1706. return t && this.fire("zoomstart"), i || this.fire("movestart"), this
  1707. },
  1708. _move: function(t, i, e) {
  1709. void 0 === i && (i = this._zoom);
  1710. var n = this._zoom !== i;
  1711. return this._zoom = i, this._lastCenter = t, this._pixelOrigin = this._getNewPixelOrigin(t), (n || e && e.pinch) && this.fire("zoom", e), this.fire("move", e)
  1712. },
  1713. _moveEnd: function(t) {
  1714. return t && this.fire("zoomend"), this.fire("moveend")
  1715. },
  1716. _stop: function() {
  1717. return g(this._flyToFrame), this._panAnim && this._panAnim.stop(), this
  1718. },
  1719. _rawPanBy: function(t) {
  1720. Lt(this._mapPane, this._getMapPanePos().subtract(t))
  1721. },
  1722. _getZoomSpan: function() {
  1723. return this.getMaxZoom() - this.getMinZoom()
  1724. },
  1725. _panInsideMaxBounds: function() {
  1726. this._enforcingBounds || this.panInsideBounds(this.options.maxBounds)
  1727. },
  1728. _checkIfLoaded: function() {
  1729. if (!this._loaded) throw new Error("Set map center and zoom first.")
  1730. },
  1731. _initEvents: function(t) {
  1732. this._targets = {}, this._targets[n(this._container)] = this;
  1733. var i = t ? q : V;
  1734. i(this._container, "click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress", this._handleDOMEvent, this), this.options.trackResize && i(window, "resize", this._onResize, this), Ni && this.options.transform3DLimit && (t ? this.off : this.on).call(this, "moveend", this._onMoveEnd)
  1735. },
  1736. _onResize: function() {
  1737. g(this._resizeRequest), this._resizeRequest = f(function() {
  1738. this.invalidateSize({
  1739. debounceMoveend: !0
  1740. })
  1741. }, this)
  1742. },
  1743. _onScroll: function() {
  1744. this._container.scrollTop = 0, this._container.scrollLeft = 0
  1745. },
  1746. _onMoveEnd: function() {
  1747. var t = this._getMapPanePos();
  1748. Math.max(Math.abs(t.x), Math.abs(t.y)) >= this.options.transform3DLimit && this._resetView(this.getCenter(), this.getZoom())
  1749. },
  1750. _findEventTargets: function(t, i) {
  1751. for (var e, o = [], s = "mouseout" === i || "mouseover" === i, r = t.target || t.srcElement, a = !1; r;) {
  1752. if ((e = this._targets[n(r)]) && ("click" === i || "preclick" === i) && !t._simulated && this._draggableMoved(e)) {
  1753. a = !0;
  1754. break
  1755. }
  1756. if (e && e.listens(i, !0)) {
  1757. if (s && !ot(r, t)) break;
  1758. if (o.push(e), s) break
  1759. }
  1760. if (r === this._container) break;
  1761. r = r.parentNode
  1762. }
  1763. return o.length || a || s || !ot(r, t) || (o = [this]), o
  1764. },
  1765. _handleDOMEvent: function(t) {
  1766. if (this._loaded && !nt(t)) {
  1767. var i = t.type;
  1768. "mousedown" !== i && "keypress" !== i || zt(t.target || t.srcElement), this._fireDOMEvent(t, i)
  1769. }
  1770. },
  1771. _mouseEvents: ["click", "dblclick", "mouseover", "mouseout", "contextmenu"],
  1772. _fireDOMEvent: function(t, e, n) {
  1773. if ("click" === t.type) {
  1774. var o = i({}, t);
  1775. o.type = "preclick", this._fireDOMEvent(o, o.type, n)
  1776. }
  1777. if (!t._stopped && (n = (n || []).concat(this._findEventTargets(t, e))).length) {
  1778. var s = n[0];
  1779. "contextmenu" === e && s.listens(e, !0) && $(t);
  1780. var r = {
  1781. originalEvent: t
  1782. };
  1783. if ("keypress" !== t.type) {
  1784. var a = s.getLatLng && (!s._radius || s._radius <= 10);
  1785. r.containerPoint = a ? this.latLngToContainerPoint(s.getLatLng()) : this.mouseEventToContainerPoint(t), r.layerPoint = this.containerPointToLayerPoint(r.containerPoint), r.latlng = a ? s.getLatLng() : this.layerPointToLatLng(r.layerPoint)
  1786. }
  1787. for (var h = 0; h < n.length; h++)
  1788. if (n[h].fire(e, r, !0), r.originalEvent._stopped || !1 === n[h].options.bubblingMouseEvents && -1 !== d(this._mouseEvents, e)) return
  1789. }
  1790. },
  1791. _draggableMoved: function(t) {
  1792. return (t = t.dragging && t.dragging.enabled() ? t : this).dragging && t.dragging.moved() || this.boxZoom && this.boxZoom.moved()
  1793. },
  1794. _clearHandlers: function() {
  1795. for (var t = 0, i = this._handlers.length; t < i; t++) this._handlers[t].disable()
  1796. },
  1797. whenReady: function(t, i) {
  1798. return this._loaded ? t.call(i || this, {
  1799. target: this
  1800. }) : this.on("load", t, i), this
  1801. },
  1802. _getMapPanePos: function() {
  1803. return Pt(this._mapPane) || new x(0, 0)
  1804. },
  1805. _moved: function() {
  1806. var t = this._getMapPanePos();
  1807. return t && !t.equals([0, 0])
  1808. },
  1809. _getTopLeftPoint: function(t, i) {
  1810. return (t && void 0 !== i ? this._getNewPixelOrigin(t, i) : this.getPixelOrigin()).subtract(this._getMapPanePos())
  1811. },
  1812. _getNewPixelOrigin: function(t, i) {
  1813. var e = this.getSize()._divideBy(2);
  1814. return this.project(t, i)._subtract(e)._add(this._getMapPanePos())._round()
  1815. },
  1816. _latLngToNewLayerPoint: function(t, i, e) {
  1817. var n = this._getNewPixelOrigin(e, i);
  1818. return this.project(t, i)._subtract(n)
  1819. },
  1820. _latLngBoundsToNewLayerBounds: function(t, i, e) {
  1821. var n = this._getNewPixelOrigin(e, i);
  1822. return b([this.project(t.getSouthWest(), i)._subtract(n), this.project(t.getNorthWest(), i)._subtract(n), this.project(t.getSouthEast(), i)._subtract(n), this.project(t.getNorthEast(), i)._subtract(n)])
  1823. },
  1824. _getCenterLayerPoint: function() {
  1825. return this.containerPointToLayerPoint(this.getSize()._divideBy(2))
  1826. },
  1827. _getCenterOffset: function(t) {
  1828. return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())
  1829. },
  1830. _limitCenter: function(t, i, e) {
  1831. if (!e) return t;
  1832. var n = this.project(t, i),
  1833. o = this.getSize().divideBy(2),
  1834. s = new P(n.subtract(o), n.add(o)),
  1835. r = this._getBoundsOffset(s, e, i);
  1836. return r.round().equals([0, 0]) ? t : this.unproject(n.add(r), i)
  1837. },
  1838. _limitOffset: function(t, i) {
  1839. if (!i) return t;
  1840. var e = this.getPixelBounds(),
  1841. n = new P(e.min.add(t), e.max.add(t));
  1842. return t.add(this._getBoundsOffset(n, i))
  1843. },
  1844. _getBoundsOffset: function(t, i, e) {
  1845. var n = b(this.project(i.getNorthEast(), e), this.project(i.getSouthWest(), e)),
  1846. o = n.min.subtract(t.min),
  1847. s = n.max.subtract(t.max);
  1848. return new x(this._rebound(o.x, -s.x), this._rebound(o.y, -s.y))
  1849. },
  1850. _rebound: function(t, i) {
  1851. return t + i > 0 ? Math.round(t - i) / 2 : Math.max(0, Math.ceil(t)) - Math.max(0, Math.floor(i))
  1852. },
  1853. _limitZoom: function(t) {
  1854. var i = this.getMinZoom(),
  1855. e = this.getMaxZoom(),
  1856. n = Ni ? this.options.zoomSnap : 1;
  1857. return n && (t = Math.round(t / n) * n), Math.max(i, Math.min(e, t))
  1858. },
  1859. _onPanTransitionStep: function() {
  1860. this.fire("move")
  1861. },
  1862. _onPanTransitionEnd: function() {
  1863. mt(this._mapPane, "leaflet-pan-anim"), this.fire("moveend")
  1864. },
  1865. _tryAnimatedPan: function(t, i) {
  1866. var e = this._getCenterOffset(t)._trunc();
  1867. return !(!0 !== (i && i.animate) && !this.getSize().contains(e)) && (this.panBy(e, i), !0)
  1868. },
  1869. _createAnimProxy: function() {
  1870. var t = this._proxy = ht("div", "leaflet-proxy leaflet-zoom-animated");
  1871. this._panes.mapPane.appendChild(t), this.on("zoomanim", function(t) {
  1872. var i = pe,
  1873. e = this._proxy.style[i];
  1874. wt(this._proxy, this.project(t.center, t.zoom), this.getZoomScale(t.zoom, 1)), e === this._proxy.style[i] && this._animatingZoom && this._onZoomTransitionEnd()
  1875. }, this), this.on("load moveend", function() {
  1876. var t = this.getCenter(),
  1877. i = this.getZoom();
  1878. wt(this._proxy, this.project(t, i), this.getZoomScale(i, 1))
  1879. }, this), this._on("unload", this._destroyAnimProxy, this)
  1880. },
  1881. _destroyAnimProxy: function() {
  1882. ut(this._proxy), delete this._proxy
  1883. },
  1884. _catchTransitionEnd: function(t) {
  1885. this._animatingZoom && t.propertyName.indexOf("transform") >= 0 && this._onZoomTransitionEnd()
  1886. },
  1887. _nothingToAnimate: function() {
  1888. return !this._container.getElementsByClassName("leaflet-zoom-animated").length
  1889. },
  1890. _tryAnimatedZoom: function(t, i, e) {
  1891. if (this._animatingZoom) return !0;
  1892. if (e = e || {}, !this._zoomAnimated || !1 === e.animate || this._nothingToAnimate() || Math.abs(i - this._zoom) > this.options.zoomAnimationThreshold) return !1;
  1893. var n = this.getZoomScale(i),
  1894. o = this._getCenterOffset(t)._divideBy(1 - 1 / n);
  1895. return !(!0 !== e.animate && !this.getSize().contains(o)) && (f(function() {
  1896. this._moveStart(!0, !1)._animateZoom(t, i, !0)
  1897. }, this), !0)
  1898. },
  1899. _animateZoom: function(t, i, n, o) {
  1900. this._mapPane && (n && (this._animatingZoom = !0, this._animateToCenter = t, this._animateToZoom = i, pt(this._mapPane, "leaflet-zoom-anim")), this.fire("zoomanim", {
  1901. center: t,
  1902. zoom: i,
  1903. noUpdate: o
  1904. }), setTimeout(e(this._onZoomTransitionEnd, this), 250))
  1905. },
  1906. _onZoomTransitionEnd: function() {
  1907. this._animatingZoom && (this._mapPane && mt(this._mapPane, "leaflet-zoom-anim"), this._animatingZoom = !1, this._move(this._animateToCenter, this._animateToZoom), f(function() {
  1908. this._moveEnd(!0)
  1909. }, this))
  1910. }
  1911. }),
  1912. Pe = v.extend({
  1913. options: {
  1914. position: "topright"
  1915. },
  1916. initialize: function(t) {
  1917. l(this, t)
  1918. },
  1919. getPosition: function() {
  1920. return this.options.position
  1921. },
  1922. setPosition: function(t) {
  1923. var i = this._map;
  1924. return i && i.removeControl(this), this.options.position = t, i && i.addControl(this), this
  1925. },
  1926. getContainer: function() {
  1927. return this._container
  1928. },
  1929. addTo: function(t) {
  1930. this.remove(), this._map = t;
  1931. var i = this._container = this.onAdd(t),
  1932. e = this.getPosition(),
  1933. n = t._controlCorners[e];
  1934. return pt(i, "leaflet-control"), -1 !== e.indexOf("bottom") ? n.insertBefore(i, n.firstChild) : n.appendChild(i), this
  1935. },
  1936. remove: function() {
  1937. return this._map ? (ut(this._container), this.onRemove && this.onRemove(this._map), this._map = null, this) : this
  1938. },
  1939. _refocusOnMap: function(t) {
  1940. this._map && t && t.screenX > 0 && t.screenY > 0 && this._map.getContainer().focus()
  1941. }
  1942. }),
  1943. be = function(t) {
  1944. return new Pe(t)
  1945. };
  1946. Le.include({
  1947. addControl: function(t) {
  1948. return t.addTo(this), this
  1949. },
  1950. removeControl: function(t) {
  1951. return t.remove(), this
  1952. },
  1953. _initControlPos: function() {
  1954. function t(t, o) {
  1955. var s = e + t + " " + e + o;
  1956. i[t + o] = ht("div", s, n)
  1957. }
  1958. var i = this._controlCorners = {},
  1959. e = "leaflet-",
  1960. n = this._controlContainer = ht("div", e + "control-container", this._container);
  1961. t("top", "left"), t("top", "right"), t("bottom", "left"), t("bottom", "right")
  1962. },
  1963. _clearControlPos: function() {
  1964. for (var t in this._controlCorners) ut(this._controlCorners[t]);
  1965. ut(this._controlContainer), delete this._controlCorners, delete this._controlContainer
  1966. }
  1967. });
  1968. var Te = Pe.extend({
  1969. options: {
  1970. collapsed: !0,
  1971. position: "topright",
  1972. autoZIndex: !0,
  1973. hideSingleBase: !1,
  1974. sortLayers: !1,
  1975. sortFunction: function(t, i, e, n) {
  1976. return e < n ? -1 : n < e ? 1 : 0
  1977. }
  1978. },
  1979. initialize: function(t, i, e) {
  1980. l(this, e), this._layerControlInputs = [], this._layers = [], this._lastZIndex = 0, this._handlingClick = !1;
  1981. for (var n in t) this._addLayer(t[n], n);
  1982. for (n in i) this._addLayer(i[n], n, !0)
  1983. },
  1984. onAdd: function(t) {
  1985. this._initLayout(), this._update(), this._map = t, t.on("zoomend", this._checkDisabledLayers, this);
  1986. for (var i = 0; i < this._layers.length; i++) this._layers[i].layer.on("add remove", this._onLayerChange, this);
  1987. return this._container
  1988. },
  1989. addTo: function(t) {
  1990. return Pe.prototype.addTo.call(this, t), this._expandIfNotCollapsed()
  1991. },
  1992. onRemove: function() {
  1993. this._map.off("zoomend", this._checkDisabledLayers, this);
  1994. for (var t = 0; t < this._layers.length; t++) this._layers[t].layer.off("add remove", this._onLayerChange, this)
  1995. },
  1996. addBaseLayer: function(t, i) {
  1997. return this._addLayer(t, i), this._map ? this._update() : this
  1998. },
  1999. addOverlay: function(t, i) {
  2000. return this._addLayer(t, i, !0), this._map ? this._update() : this
  2001. },
  2002. removeLayer: function(t) {
  2003. t.off("add remove", this._onLayerChange, this);
  2004. var i = this._getLayer(n(t));
  2005. return i && this._layers.splice(this._layers.indexOf(i), 1), this._map ? this._update() : this
  2006. },
  2007. expand: function() {
  2008. pt(this._container, "leaflet-control-layers-expanded"), this._form.style.height = null;
  2009. var t = this._map.getSize().y - (this._container.offsetTop + 50);
  2010. return t < this._form.clientHeight ? (pt(this._form, "leaflet-control-layers-scrollbar"), this._form.style.height = t + "px") : mt(this._form, "leaflet-control-layers-scrollbar"), this._checkDisabledLayers(), this
  2011. },
  2012. collapse: function() {
  2013. return mt(this._container, "leaflet-control-layers-expanded"), this
  2014. },
  2015. _initLayout: function() {
  2016. var t = "leaflet-control-layers",
  2017. i = this._container = ht("div", t),
  2018. e = this.options.collapsed;
  2019. i.setAttribute("aria-haspopup", !0), J(i), X(i);
  2020. var n = this._form = ht("form", t + "-list");
  2021. e && (this._map.on("click", this.collapse, this), Ti || V(i, {
  2022. mouseenter: this.expand,
  2023. mouseleave: this.collapse
  2024. }, this));
  2025. var o = this._layersLink = ht("a", t + "-toggle", i);
  2026. o.href = "#", o.title = "Layers", Vi ? (V(o, "click", Q), V(o, "click", this.expand, this)) : V(o, "focus", this.expand, this), e || this.expand(), this._baseLayersList = ht("div", t + "-base", n), this._separator = ht("div", t + "-separator", n), this._overlaysList = ht("div", t + "-overlays", n), i.appendChild(n)
  2027. },
  2028. _getLayer: function(t) {
  2029. for (var i = 0; i < this._layers.length; i++)
  2030. if (this._layers[i] && n(this._layers[i].layer) === t) return this._layers[i]
  2031. },
  2032. _addLayer: function(t, i, n) {
  2033. this._map && t.on("add remove", this._onLayerChange, this), this._layers.push({
  2034. layer: t,
  2035. name: i,
  2036. overlay: n
  2037. }), this.options.sortLayers && this._layers.sort(e(function(t, i) {
  2038. return this.options.sortFunction(t.layer, i.layer, t.name, i.name)
  2039. }, this)), this.options.autoZIndex && t.setZIndex && (this._lastZIndex++, t.setZIndex(this._lastZIndex)), this._expandIfNotCollapsed()
  2040. },
  2041. _update: function() {
  2042. if (!this._container) return this;
  2043. lt(this._baseLayersList), lt(this._overlaysList), this._layerControlInputs = [];
  2044. var t, i, e, n, o = 0;
  2045. for (e = 0; e < this._layers.length; e++) n = this._layers[e], this._addItem(n), i = i || n.overlay, t = t || !n.overlay, o += n.overlay ? 0 : 1;
  2046. return this.options.hideSingleBase && (t = t && o > 1, this._baseLayersList.style.display = t ? "" : "none"), this._separator.style.display = i && t ? "" : "none", this
  2047. },
  2048. _onLayerChange: function(t) {
  2049. this._handlingClick || this._update();
  2050. var i = this._getLayer(n(t.target)),
  2051. e = i.overlay ? "add" === t.type ? "overlayadd" : "overlayremove" : "add" === t.type ? "baselayerchange" : null;
  2052. e && this._map.fire(e, i)
  2053. },
  2054. _createRadioElement: function(t, i) {
  2055. var e = '<input type="radio" class="leaflet-control-layers-selector" name="' + t + '"' + (i ? ' checked="checked"' : "") + "/>",
  2056. n = document.createElement("div");
  2057. return n.innerHTML = e, n.firstChild
  2058. },
  2059. _addItem: function(t) {
  2060. var i, e = document.createElement("label"),
  2061. o = this._map.hasLayer(t.layer);
  2062. t.overlay ? ((i = document.createElement("input")).type = "checkbox", i.className = "leaflet-control-layers-selector", i.defaultChecked = o) : i = this._createRadioElement("leaflet-base-layers", o), this._layerControlInputs.push(i), i.layerId = n(t.layer), V(i, "click", this._onInputClick, this);
  2063. var s = document.createElement("span");
  2064. s.innerHTML = " " + t.name;
  2065. var r = document.createElement("div");
  2066. return e.appendChild(r), r.appendChild(i), r.appendChild(s), (t.overlay ? this._overlaysList : this._baseLayersList).appendChild(e), this._checkDisabledLayers(), e
  2067. },
  2068. _onInputClick: function() {
  2069. var t, i, e = this._layerControlInputs,
  2070. n = [],
  2071. o = [];
  2072. this._handlingClick = !0;
  2073. for (var s = e.length - 1; s >= 0; s--) t = e[s], i = this._getLayer(t.layerId).layer, t.checked ? n.push(i) : t.checked || o.push(i);
  2074. for (s = 0; s < o.length; s++) this._map.hasLayer(o[s]) && this._map.removeLayer(o[s]);
  2075. for (s = 0; s < n.length; s++) this._map.hasLayer(n[s]) || this._map.addLayer(n[s]);
  2076. this._handlingClick = !1, this._refocusOnMap()
  2077. },
  2078. _checkDisabledLayers: function() {
  2079. for (var t, i, e = this._layerControlInputs, n = this._map.getZoom(), o = e.length - 1; o >= 0; o--) t = e[o], i = this._getLayer(t.layerId).layer, t.disabled = void 0 !== i.options.minZoom && n < i.options.minZoom || void 0 !== i.options.maxZoom && n > i.options.maxZoom
  2080. },
  2081. _expandIfNotCollapsed: function() {
  2082. return this._map && !this.options.collapsed && this.expand(), this
  2083. },
  2084. _expand: function() {
  2085. return this.expand()
  2086. },
  2087. _collapse: function() {
  2088. return this.collapse()
  2089. }
  2090. }),
  2091. ze = Pe.extend({
  2092. options: {
  2093. position: "topleft",
  2094. zoomInText: "+",
  2095. zoomInTitle: "Zoom in",
  2096. zoomOutText: "&#x2212;",
  2097. zoomOutTitle: "Zoom out"
  2098. },
  2099. onAdd: function(t) {
  2100. var i = "leaflet-control-zoom",
  2101. e = ht("div", i + " leaflet-bar"),
  2102. n = this.options;
  2103. return this._zoomInButton = this._createButton(n.zoomInText, n.zoomInTitle, i + "-in", e, this._zoomIn), this._zoomOutButton = this._createButton(n.zoomOutText, n.zoomOutTitle, i + "-out", e, this._zoomOut), this._updateDisabled(), t.on("zoomend zoomlevelschange", this._updateDisabled, this), e
  2104. },
  2105. onRemove: function(t) {
  2106. t.off("zoomend zoomlevelschange", this._updateDisabled, this)
  2107. },
  2108. disable: function() {
  2109. return this._disabled = !0, this._updateDisabled(), this
  2110. },
  2111. enable: function() {
  2112. return this._disabled = !1, this._updateDisabled(), this
  2113. },
  2114. _zoomIn: function(t) {
  2115. !this._disabled && this._map._zoom < this._map.getMaxZoom() && this._map.zoomIn(this._map.options.zoomDelta * (t.shiftKey ? 3 : 1))
  2116. },
  2117. _zoomOut: function(t) {
  2118. !this._disabled && this._map._zoom > this._map.getMinZoom() && this._map.zoomOut(this._map.options.zoomDelta * (t.shiftKey ? 3 : 1))
  2119. },
  2120. _createButton: function(t, i, e, n, o) {
  2121. var s = ht("a", e, n);
  2122. return s.innerHTML = t, s.href = "#", s.title = i, s.setAttribute("role", "button"), s.setAttribute("aria-label", i), J(s), V(s, "click", Q), V(s, "click", o, this), V(s, "click", this._refocusOnMap, this), s
  2123. },
  2124. _updateDisabled: function() {
  2125. var t = this._map,
  2126. i = "leaflet-disabled";
  2127. mt(this._zoomInButton, i), mt(this._zoomOutButton, i), (this._disabled || t._zoom === t.getMinZoom()) && pt(this._zoomOutButton, i), (this._disabled || t._zoom === t.getMaxZoom()) && pt(this._zoomInButton, i)
  2128. }
  2129. });
  2130. Le.mergeOptions({
  2131. zoomControl: !0
  2132. }), Le.addInitHook(function() {
  2133. this.options.zoomControl && (this.zoomControl = new ze, this.addControl(this.zoomControl))
  2134. });
  2135. var Me = Pe.extend({
  2136. options: {
  2137. position: "bottomleft",
  2138. maxWidth: 100,
  2139. metric: !0,
  2140. imperial: !0
  2141. },
  2142. onAdd: function(t) {
  2143. var i = ht("div", "leaflet-control-scale"),
  2144. e = this.options;
  2145. return this._addScales(e, "leaflet-control-scale-line", i), t.on(e.updateWhenIdle ? "moveend" : "move", this._update, this), t.whenReady(this._update, this), i
  2146. },
  2147. onRemove: function(t) {
  2148. t.off(this.options.updateWhenIdle ? "moveend" : "move", this._update, this)
  2149. },
  2150. _addScales: function(t, i, e) {
  2151. t.metric && (this._mScale = ht("div", i, e)), t.imperial && (this._iScale = ht("div", i, e))
  2152. },
  2153. _update: function() {
  2154. var t = this._map,
  2155. i = t.getSize().y / 2,
  2156. e = t.distance(t.containerPointToLatLng([0, i]), t.containerPointToLatLng([this.options.maxWidth, i]));
  2157. this._updateScales(e)
  2158. },
  2159. _updateScales: function(t) {
  2160. this.options.metric && t && this._updateMetric(t), this.options.imperial && t && this._updateImperial(t)
  2161. },
  2162. _updateMetric: function(t) {
  2163. var i = this._getRoundNum(t),
  2164. e = i < 1e3 ? i + " m" : i / 1e3 + " km";
  2165. this._updateScale(this._mScale, e, i / t)
  2166. },
  2167. _updateImperial: function(t) {
  2168. var i, e, n, o = 3.2808399 * t;
  2169. o > 5280 ? (i = o / 5280, e = this._getRoundNum(i), this._updateScale(this._iScale, e + " mi", e / i)) : (n = this._getRoundNum(o), this._updateScale(this._iScale, n + " ft", n / o))
  2170. },
  2171. _updateScale: function(t, i, e) {
  2172. t.style.width = Math.round(this.options.maxWidth * e) + "px", t.innerHTML = i
  2173. },
  2174. _getRoundNum: function(t) {
  2175. var i = Math.pow(10, (Math.floor(t) + "").length - 1),
  2176. e = t / i;
  2177. return e = e >= 10 ? 10 : e >= 5 ? 5 : e >= 3 ? 3 : e >= 2 ? 2 : 1, i * e
  2178. }
  2179. }),
  2180. Ce = Pe.extend({
  2181. options: {
  2182. position: "bottomright",
  2183. prefix: '<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'
  2184. },
  2185. initialize: function(t) {
  2186. l(this, t), this._attributions = {}
  2187. },
  2188. onAdd: function(t) {
  2189. t.attributionControl = this, this._container = ht("div", "leaflet-control-attribution"), J(this._container);
  2190. for (var i in t._layers) t._layers[i].getAttribution && this.addAttribution(t._layers[i].getAttribution());
  2191. return this._update(), this._container
  2192. },
  2193. setPrefix: function(t) {
  2194. return this.options.prefix = t, this._update(), this
  2195. },
  2196. addAttribution: function(t) {
  2197. return t ? (this._attributions[t] || (this._attributions[t] = 0), this._attributions[t]++, this._update(), this) : this
  2198. },
  2199. removeAttribution: function(t) {
  2200. return t ? (this._attributions[t] && (this._attributions[t]--, this._update()), this) : this
  2201. },
  2202. _update: function() {
  2203. if (this._map) {
  2204. var t = [];
  2205. for (var i in this._attributions) this._attributions[i] && t.push(i);
  2206. var e = [];
  2207. this.options.prefix && e.push(this.options.prefix), t.length && e.push(t.join(", ")), this._container.innerHTML = e.join(" | ")
  2208. }
  2209. }
  2210. });
  2211. Le.mergeOptions({
  2212. attributionControl: !0
  2213. }), Le.addInitHook(function() {
  2214. this.options.attributionControl && (new Ce).addTo(this)
  2215. });
  2216. Pe.Layers = Te, Pe.Zoom = ze, Pe.Scale = Me, Pe.Attribution = Ce, be.layers = function(t, i, e) {
  2217. return new Te(t, i, e)
  2218. }, be.zoom = function(t) {
  2219. return new ze(t)
  2220. }, be.scale = function(t) {
  2221. return new Me(t)
  2222. }, be.attribution = function(t) {
  2223. return new Ce(t)
  2224. };
  2225. var Ze = v.extend({
  2226. initialize: function(t) {
  2227. this._map = t
  2228. },
  2229. enable: function() {
  2230. return this._enabled ? this : (this._enabled = !0, this.addHooks(), this)
  2231. },
  2232. disable: function() {
  2233. return this._enabled ? (this._enabled = !1, this.removeHooks(), this) : this
  2234. },
  2235. enabled: function() {
  2236. return !!this._enabled
  2237. }
  2238. });
  2239. Ze.addTo = function(t, i) {
  2240. return t.addHandler(i, this), this
  2241. };
  2242. var Se, Ee = {
  2243. Events: hi
  2244. },
  2245. ke = Vi ? "touchstart mousedown" : "mousedown",
  2246. Ie = {
  2247. mousedown: "mouseup",
  2248. touchstart: "touchend",
  2249. pointerdown: "touchend",
  2250. MSPointerDown: "touchend"
  2251. },
  2252. Ae = {
  2253. mousedown: "mousemove",
  2254. touchstart: "touchmove",
  2255. pointerdown: "touchmove",
  2256. MSPointerDown: "touchmove"
  2257. },
  2258. Be = ui.extend({
  2259. options: {
  2260. clickTolerance: 3
  2261. },
  2262. initialize: function(t, i, e, n) {
  2263. l(this, n), this._element = t, this._dragStartTarget = i || t, this._preventOutline = e
  2264. },
  2265. enable: function() {
  2266. this._enabled || (V(this._dragStartTarget, ke, this._onDown, this), this._enabled = !0)
  2267. },
  2268. disable: function() {
  2269. this._enabled && (Be._dragging === this && this.finishDrag(), q(this._dragStartTarget, ke, this._onDown, this), this._enabled = !1, this._moved = !1)
  2270. },
  2271. _onDown: function(t) {
  2272. if (!t._simulated && this._enabled && (this._moved = !1, !dt(this._element, "leaflet-zoom-anim") && !(Be._dragging || t.shiftKey || 1 !== t.which && 1 !== t.button && !t.touches || (Be._dragging = this, this._preventOutline && zt(this._element), bt(), mi(), this._moving)))) {
  2273. this.fire("down");
  2274. var i = t.touches ? t.touches[0] : t;
  2275. this._startPoint = new x(i.clientX, i.clientY), V(document, Ae[t.type], this._onMove, this), V(document, Ie[t.type], this._onUp, this)
  2276. }
  2277. },
  2278. _onMove: function(t) {
  2279. if (!t._simulated && this._enabled)
  2280. if (t.touches && t.touches.length > 1) this._moved = !0;
  2281. else {
  2282. var i = t.touches && 1 === t.touches.length ? t.touches[0] : t,
  2283. e = new x(i.clientX, i.clientY).subtract(this._startPoint);
  2284. (e.x || e.y) && (Math.abs(e.x) + Math.abs(e.y) < this.options.clickTolerance || ($(t), this._moved || (this.fire("dragstart"), this._moved = !0, this._startPos = Pt(this._element).subtract(e), pt(document.body, "leaflet-dragging"), this._lastTarget = t.target || t.srcElement, window.SVGElementInstance && this._lastTarget instanceof SVGElementInstance && (this._lastTarget = this._lastTarget.correspondingUseElement), pt(this._lastTarget, "leaflet-drag-target")), this._newPos = this._startPos.add(e), this._moving = !0, g(this._animRequest), this._lastEvent = t, this._animRequest = f(this._updatePosition, this, !0)))
  2285. }
  2286. },
  2287. _updatePosition: function() {
  2288. var t = {
  2289. originalEvent: this._lastEvent
  2290. };
  2291. this.fire("predrag", t), Lt(this._element, this._newPos), this.fire("drag", t)
  2292. },
  2293. _onUp: function(t) {
  2294. !t._simulated && this._enabled && this.finishDrag()
  2295. },
  2296. finishDrag: function() {
  2297. mt(document.body, "leaflet-dragging"), this._lastTarget && (mt(this._lastTarget, "leaflet-drag-target"), this._lastTarget = null);
  2298. for (var t in Ae) q(document, Ae[t], this._onMove, this), q(document, Ie[t], this._onUp, this);
  2299. Tt(), fi(), this._moved && this._moving && (g(this._animRequest), this.fire("dragend", {
  2300. distance: this._newPos.distanceTo(this._startPos)
  2301. })), this._moving = !1, Be._dragging = !1
  2302. }
  2303. }),
  2304. Oe = (Object.freeze || Object)({
  2305. simplify: Ct,
  2306. pointToSegmentDistance: Zt,
  2307. closestPointOnSegment: function(t, i, e) {
  2308. return Rt(t, i, e)
  2309. },
  2310. clipSegment: It,
  2311. _getEdgeIntersection: At,
  2312. _getBitCode: Bt,
  2313. _sqClosestPointOnSegment: Rt,
  2314. isFlat: Dt,
  2315. _flat: Nt
  2316. }),
  2317. Re = (Object.freeze || Object)({
  2318. clipPolygon: jt
  2319. }),
  2320. De = {
  2321. project: function(t) {
  2322. return new x(t.lng, t.lat)
  2323. },
  2324. unproject: function(t) {
  2325. return new M(t.y, t.x)
  2326. },
  2327. bounds: new P([-180, -90], [180, 90])
  2328. },
  2329. Ne = {
  2330. R: 6378137,
  2331. R_MINOR: 6356752.314245179,
  2332. bounds: new P([-20037508.34279, -15496570.73972], [20037508.34279, 18764656.23138]),
  2333. project: function(t) {
  2334. var i = Math.PI / 180,
  2335. e = this.R,
  2336. n = t.lat * i,
  2337. o = this.R_MINOR / e,
  2338. s = Math.sqrt(1 - o * o),
  2339. r = s * Math.sin(n),
  2340. a = Math.tan(Math.PI / 4 - n / 2) / Math.pow((1 - r) / (1 + r), s / 2);
  2341. return n = -e * Math.log(Math.max(a, 1e-10)), new x(t.lng * i * e, n)
  2342. },
  2343. unproject: function(t) {
  2344. for (var i, e = 180 / Math.PI, n = this.R, o = this.R_MINOR / n, s = Math.sqrt(1 - o * o), r = Math.exp(-t.y / n), a = Math.PI / 2 - 2 * Math.atan(r), h = 0, u = .1; h < 15 && Math.abs(u) > 1e-7; h++) i = s * Math.sin(a), i = Math.pow((1 - i) / (1 + i), s / 2), a += u = Math.PI / 2 - 2 * Math.atan(r * i) - a;
  2345. return new M(a * e, t.x * e / n)
  2346. }
  2347. },
  2348. je = (Object.freeze || Object)({
  2349. LonLat: De,
  2350. Mercator: Ne,
  2351. SphericalMercator: di
  2352. }),
  2353. We = i({}, _i, {
  2354. code: "EPSG:3395",
  2355. projection: Ne,
  2356. transformation: function() {
  2357. var t = .5 / (Math.PI * Ne.R);
  2358. return S(t, .5, -t, .5)
  2359. }()
  2360. }),
  2361. He = i({}, _i, {
  2362. code: "EPSG:4326",
  2363. projection: De,
  2364. transformation: S(1 / 180, 1, -1 / 180, .5)
  2365. }),
  2366. Fe = i({}, ci, {
  2367. projection: De,
  2368. transformation: S(1, 0, -1, 0),
  2369. scale: function(t) {
  2370. return Math.pow(2, t)
  2371. },
  2372. zoom: function(t) {
  2373. return Math.log(t) / Math.LN2
  2374. },
  2375. distance: function(t, i) {
  2376. var e = i.lng - t.lng,
  2377. n = i.lat - t.lat;
  2378. return Math.sqrt(e * e + n * n)
  2379. },
  2380. infinite: !0
  2381. });
  2382. ci.Earth = _i, ci.EPSG3395 = We, ci.EPSG3857 = vi, ci.EPSG900913 = yi, ci.EPSG4326 = He, ci.Simple = Fe;
  2383. var Ue = ui.extend({
  2384. options: {
  2385. pane: "overlayPane",
  2386. attribution: null,
  2387. bubblingMouseEvents: !0
  2388. },
  2389. addTo: function(t) {
  2390. return t.addLayer(this), this
  2391. },
  2392. remove: function() {
  2393. return this.removeFrom(this._map || this._mapToAdd)
  2394. },
  2395. removeFrom: function(t) {
  2396. return t && t.removeLayer(this), this
  2397. },
  2398. getPane: function(t) {
  2399. return this._map.getPane(t ? this.options[t] || t : this.options.pane)
  2400. },
  2401. addInteractiveTarget: function(t) {
  2402. return this._map._targets[n(t)] = this, this
  2403. },
  2404. removeInteractiveTarget: function(t) {
  2405. return delete this._map._targets[n(t)], this
  2406. },
  2407. getAttribution: function() {
  2408. return this.options.attribution
  2409. },
  2410. _layerAdd: function(t) {
  2411. var i = t.target;
  2412. if (i.hasLayer(this)) {
  2413. if (this._map = i, this._zoomAnimated = i._zoomAnimated, this.getEvents) {
  2414. var e = this.getEvents();
  2415. i.on(e, this), this.once("remove", function() {
  2416. i.off(e, this)
  2417. }, this)
  2418. }
  2419. this.onAdd(i), this.getAttribution && i.attributionControl && i.attributionControl.addAttribution(this.getAttribution()), this.fire("add"), i.fire("layeradd", {
  2420. layer: this
  2421. })
  2422. }
  2423. }
  2424. });
  2425. Le.include({
  2426. addLayer: function(t) {
  2427. if (!t._layerAdd) throw new Error("The provided object is not a Layer.");
  2428. var i = n(t);
  2429. return this._layers[i] ? this : (this._layers[i] = t, t._mapToAdd = this, t.beforeAdd && t.beforeAdd(this), this.whenReady(t._layerAdd, t), this)
  2430. },
  2431. removeLayer: function(t) {
  2432. var i = n(t);
  2433. return this._layers[i] ? (this._loaded && t.onRemove(this), t.getAttribution && this.attributionControl && this.attributionControl.removeAttribution(t.getAttribution()), delete this._layers[i], this._loaded && (this.fire("layerremove", {
  2434. layer: t
  2435. }), t.fire("remove")), t._map = t._mapToAdd = null, this) : this
  2436. },
  2437. hasLayer: function(t) {
  2438. return !!t && n(t) in this._layers
  2439. },
  2440. eachLayer: function(t, i) {
  2441. for (var e in this._layers) t.call(i, this._layers[e]);
  2442. return this
  2443. },
  2444. _addLayers: function(t) {
  2445. for (var i = 0, e = (t = t ? ei(t) ? t : [t] : []).length; i < e; i++) this.addLayer(t[i])
  2446. },
  2447. _addZoomLimit: function(t) {
  2448. !isNaN(t.options.maxZoom) && isNaN(t.options.minZoom) || (this._zoomBoundLayers[n(t)] = t, this._updateZoomLevels())
  2449. },
  2450. _removeZoomLimit: function(t) {
  2451. var i = n(t);
  2452. this._zoomBoundLayers[i] && (delete this._zoomBoundLayers[i], this._updateZoomLevels())
  2453. },
  2454. _updateZoomLevels: function() {
  2455. var t = 1 / 0,
  2456. i = -1 / 0,
  2457. e = this._getZoomSpan();
  2458. for (var n in this._zoomBoundLayers) {
  2459. var o = this._zoomBoundLayers[n].options;
  2460. t = void 0 === o.minZoom ? t : Math.min(t, o.minZoom), i = void 0 === o.maxZoom ? i : Math.max(i, o.maxZoom)
  2461. }
  2462. this._layersMaxZoom = i === -1 / 0 ? void 0 : i, this._layersMinZoom = t === 1 / 0 ? void 0 : t, e !== this._getZoomSpan() && this.fire("zoomlevelschange"), void 0 === this.options.maxZoom && this._layersMaxZoom && this.getZoom() > this._layersMaxZoom && this.setZoom(this._layersMaxZoom), void 0 === this.options.minZoom && this._layersMinZoom && this.getZoom() < this._layersMinZoom && this.setZoom(this._layersMinZoom)
  2463. }
  2464. });
  2465. var Ve = Ue.extend({
  2466. initialize: function(t, i) {
  2467. l(this, i), this._layers = {};
  2468. var e, n;
  2469. if (t)
  2470. for (e = 0, n = t.length; e < n; e++) this.addLayer(t[e])
  2471. },
  2472. addLayer: function(t) {
  2473. var i = this.getLayerId(t);
  2474. return this._layers[i] = t, this._map && this._map.addLayer(t), this
  2475. },
  2476. removeLayer: function(t) {
  2477. var i = t in this._layers ? t : this.getLayerId(t);
  2478. return this._map && this._layers[i] && this._map.removeLayer(this._layers[i]), delete this._layers[i], this
  2479. },
  2480. hasLayer: function(t) {
  2481. return !!t && (t in this._layers || this.getLayerId(t) in this._layers)
  2482. },
  2483. clearLayers: function() {
  2484. return this.eachLayer(this.removeLayer, this)
  2485. },
  2486. invoke: function(t) {
  2487. var i, e, n = Array.prototype.slice.call(arguments, 1);
  2488. for (i in this._layers)(e = this._layers[i])[t] && e[t].apply(e, n);
  2489. return this
  2490. },
  2491. onAdd: function(t) {
  2492. this.eachLayer(t.addLayer, t)
  2493. },
  2494. onRemove: function(t) {
  2495. this.eachLayer(t.removeLayer, t)
  2496. },
  2497. eachLayer: function(t, i) {
  2498. for (var e in this._layers) t.call(i, this._layers[e]);
  2499. return this
  2500. },
  2501. getLayer: function(t) {
  2502. return this._layers[t]
  2503. },
  2504. getLayers: function() {
  2505. var t = [];
  2506. return this.eachLayer(t.push, t), t
  2507. },
  2508. setZIndex: function(t) {
  2509. return this.invoke("setZIndex", t)
  2510. },
  2511. getLayerId: function(t) {
  2512. return n(t)
  2513. }
  2514. }),
  2515. qe = Ve.extend({
  2516. addLayer: function(t) {
  2517. return this.hasLayer(t) ? this : (t.addEventParent(this), Ve.prototype.addLayer.call(this, t), this.fire("layeradd", {
  2518. layer: t
  2519. }))
  2520. },
  2521. removeLayer: function(t) {
  2522. return this.hasLayer(t) ? (t in this._layers && (t = this._layers[t]), t.removeEventParent(this), Ve.prototype.removeLayer.call(this, t), this.fire("layerremove", {
  2523. layer: t
  2524. })) : this
  2525. },
  2526. setStyle: function(t) {
  2527. return this.invoke("setStyle", t)
  2528. },
  2529. bringToFront: function() {
  2530. return this.invoke("bringToFront")
  2531. },
  2532. bringToBack: function() {
  2533. return this.invoke("bringToBack")
  2534. },
  2535. getBounds: function() {
  2536. var t = new T;
  2537. for (var i in this._layers) {
  2538. var e = this._layers[i];
  2539. t.extend(e.getBounds ? e.getBounds() : e.getLatLng())
  2540. }
  2541. return t
  2542. }
  2543. }),
  2544. Ge = v.extend({
  2545. options: {
  2546. popupAnchor: [0, 0],
  2547. tooltipAnchor: [0, 0]
  2548. },
  2549. initialize: function(t) {
  2550. l(this, t)
  2551. },
  2552. createIcon: function(t) {
  2553. return this._createIcon("icon", t)
  2554. },
  2555. createShadow: function(t) {
  2556. return this._createIcon("shadow", t)
  2557. },
  2558. _createIcon: function(t, i) {
  2559. var e = this._getIconUrl(t);
  2560. if (!e) {
  2561. if ("icon" === t) throw new Error("iconUrl not set in Icon options (see the docs).");
  2562. return null
  2563. }
  2564. var n = this._createImg(e, i && "IMG" === i.tagName ? i : null);
  2565. return this._setIconStyles(n, t), n
  2566. },
  2567. _setIconStyles: function(t, i) {
  2568. var e = this.options,
  2569. n = e[i + "Size"];
  2570. "number" == typeof n && (n = [n, n]);
  2571. var o = w(n),
  2572. s = w("shadow" === i && e.shadowAnchor || e.iconAnchor || o && o.divideBy(2, !0));
  2573. t.className = "leaflet-marker-" + i + " " + (e.className || ""), s && (t.style.marginLeft = -s.x + "px", t.style.marginTop = -s.y + "px"), o && (t.style.width = o.x + "px", t.style.height = o.y + "px")
  2574. },
  2575. _createImg: function(t, i) {
  2576. return i = i || document.createElement("img"), i.src = t, i
  2577. },
  2578. _getIconUrl: function(t) {
  2579. return Ki && this.options[t + "RetinaUrl"] || this.options[t + "Url"]
  2580. }
  2581. }),
  2582. Ke = Ge.extend({
  2583. options: {
  2584. iconUrl: "marker-icon.png",
  2585. iconRetinaUrl: "marker-icon-2x.png",
  2586. shadowUrl: "marker-shadow.png",
  2587. iconSize: [25, 41],
  2588. iconAnchor: [12, 41],
  2589. popupAnchor: [1, -34],
  2590. tooltipAnchor: [16, -28],
  2591. shadowSize: [41, 41]
  2592. },
  2593. _getIconUrl: function(t) {
  2594. return Ke.imagePath || (Ke.imagePath = this._detectIconPath()), (this.options.imagePath || Ke.imagePath) + Ge.prototype._getIconUrl.call(this, t)
  2595. },
  2596. _detectIconPath: function() {
  2597. var t = ht("div", "leaflet-default-icon-path", document.body),
  2598. i = at(t, "background-image") || at(t, "backgroundImage");
  2599. return document.body.removeChild(t), i = null === i || 0 !== i.indexOf("url") ? "" : i.replace(/^url\(["']?/, "").replace(/marker-icon\.png["']?\)$/, "")
  2600. }
  2601. }),
  2602. Ye = Ze.extend({
  2603. initialize: function(t) {
  2604. this._marker = t
  2605. },
  2606. addHooks: function() {
  2607. var t = this._marker._icon;
  2608. this._draggable || (this._draggable = new Be(t, t, !0)), this._draggable.on({
  2609. dragstart: this._onDragStart,
  2610. predrag: this._onPreDrag,
  2611. drag: this._onDrag,
  2612. dragend: this._onDragEnd
  2613. }, this).enable(), pt(t, "leaflet-marker-draggable")
  2614. },
  2615. removeHooks: function() {
  2616. this._draggable.off({
  2617. dragstart: this._onDragStart,
  2618. predrag: this._onPreDrag,
  2619. drag: this._onDrag,
  2620. dragend: this._onDragEnd
  2621. }, this).disable(), this._marker._icon && mt(this._marker._icon, "leaflet-marker-draggable")
  2622. },
  2623. moved: function() {
  2624. return this._draggable && this._draggable._moved
  2625. },
  2626. _adjustPan: function(t) {
  2627. var i = this._marker,
  2628. e = i._map,
  2629. n = this._marker.options.autoPanSpeed,
  2630. o = this._marker.options.autoPanPadding,
  2631. s = L.DomUtil.getPosition(i._icon),
  2632. r = e.getPixelBounds(),
  2633. a = e.getPixelOrigin(),
  2634. h = b(r.min._subtract(a).add(o), r.max._subtract(a).subtract(o));
  2635. if (!h.contains(s)) {
  2636. var u = w((Math.max(h.max.x, s.x) - h.max.x) / (r.max.x - h.max.x) - (Math.min(h.min.x, s.x) - h.min.x) / (r.min.x - h.min.x), (Math.max(h.max.y, s.y) - h.max.y) / (r.max.y - h.max.y) - (Math.min(h.min.y, s.y) - h.min.y) / (r.min.y - h.min.y)).multiplyBy(n);
  2637. e.panBy(u, {
  2638. animate: !1
  2639. }), this._draggable._newPos._add(u), this._draggable._startPos._add(u), L.DomUtil.setPosition(i._icon, this._draggable._newPos), this._onDrag(t), this._panRequest = f(this._adjustPan.bind(this, t))
  2640. }
  2641. },
  2642. _onDragStart: function() {
  2643. this._oldLatLng = this._marker.getLatLng(), this._marker.closePopup().fire("movestart").fire("dragstart")
  2644. },
  2645. _onPreDrag: function(t) {
  2646. this._marker.options.autoPan && (g(this._panRequest), this._panRequest = f(this._adjustPan.bind(this, t)))
  2647. },
  2648. _onDrag: function(t) {
  2649. var i = this._marker,
  2650. e = i._shadow,
  2651. n = Pt(i._icon),
  2652. o = i._map.layerPointToLatLng(n);
  2653. e && Lt(e, n), i._latlng = o, t.latlng = o, t.oldLatLng = this._oldLatLng, i.fire("move", t).fire("drag", t)
  2654. },
  2655. _onDragEnd: function(t) {
  2656. g(this._panRequest), delete this._oldLatLng, this._marker.fire("moveend").fire("dragend", t)
  2657. }
  2658. }),
  2659. Xe = Ue.extend({
  2660. options: {
  2661. icon: new Ke,
  2662. interactive: !0,
  2663. draggable: !1,
  2664. autoPan: !1,
  2665. autoPanPadding: [50, 50],
  2666. autoPanSpeed: 10,
  2667. keyboard: !0,
  2668. title: "",
  2669. alt: "",
  2670. zIndexOffset: 0,
  2671. opacity: 1,
  2672. riseOnHover: !1,
  2673. riseOffset: 250,
  2674. pane: "markerPane",
  2675. bubblingMouseEvents: !1
  2676. },
  2677. initialize: function(t, i) {
  2678. l(this, i), this._latlng = C(t)
  2679. },
  2680. onAdd: function(t) {
  2681. this._zoomAnimated = this._zoomAnimated && t.options.markerZoomAnimation, this._zoomAnimated && t.on("zoomanim", this._animateZoom, this), this._initIcon(), this.update()
  2682. },
  2683. onRemove: function(t) {
  2684. this.dragging && this.dragging.enabled() && (this.options.draggable = !0, this.dragging.removeHooks()), delete this.dragging, this._zoomAnimated && t.off("zoomanim", this._animateZoom, this), this._removeIcon(), this._removeShadow()
  2685. },
  2686. getEvents: function() {
  2687. return {
  2688. zoom: this.update,
  2689. viewreset: this.update
  2690. }
  2691. },
  2692. getLatLng: function() {
  2693. return this._latlng
  2694. },
  2695. setLatLng: function(t) {
  2696. var i = this._latlng;
  2697. return this._latlng = C(t), this.update(), this.fire("move", {
  2698. oldLatLng: i,
  2699. latlng: this._latlng
  2700. })
  2701. },
  2702. setZIndexOffset: function(t) {
  2703. return this.options.zIndexOffset = t, this.update()
  2704. },
  2705. setIcon: function(t) {
  2706. return this.options.icon = t, this._map && (this._initIcon(), this.update()), this._popup && this.bindPopup(this._popup, this._popup.options), this
  2707. },
  2708. getElement: function() {
  2709. return this._icon
  2710. },
  2711. update: function() {
  2712. if (this._icon && this._map) {
  2713. var t = this._map.latLngToLayerPoint(this._latlng).round();
  2714. this._setPos(t)
  2715. }
  2716. return this
  2717. },
  2718. _initIcon: function() {
  2719. var t = this.options,
  2720. i = "leaflet-zoom-" + (this._zoomAnimated ? "animated" : "hide"),
  2721. e = t.icon.createIcon(this._icon),
  2722. n = !1;
  2723. e !== this._icon && (this._icon && this._removeIcon(), n = !0, t.title && (e.title = t.title), "IMG" === e.tagName && (e.alt = t.alt || "")), pt(e, i), t.keyboard && (e.tabIndex = "0"), this._icon = e, t.riseOnHover && this.on({
  2724. mouseover: this._bringToFront,
  2725. mouseout: this._resetZIndex
  2726. });
  2727. var o = t.icon.createShadow(this._shadow),
  2728. s = !1;
  2729. o !== this._shadow && (this._removeShadow(), s = !0), o && (pt(o, i), o.alt = ""), this._shadow = o, t.opacity < 1 && this._updateOpacity(), n && this.getPane().appendChild(this._icon), this._initInteraction(), o && s && this.getPane("shadowPane").appendChild(this._shadow)
  2730. },
  2731. _removeIcon: function() {
  2732. this.options.riseOnHover && this.off({
  2733. mouseover: this._bringToFront,
  2734. mouseout: this._resetZIndex
  2735. }), ut(this._icon), this.removeInteractiveTarget(this._icon), this._icon = null
  2736. },
  2737. _removeShadow: function() {
  2738. this._shadow && ut(this._shadow), this._shadow = null
  2739. },
  2740. _setPos: function(t) {
  2741. Lt(this._icon, t), this._shadow && Lt(this._shadow, t), this._zIndex = t.y + this.options.zIndexOffset, this._resetZIndex()
  2742. },
  2743. _updateZIndex: function(t) {
  2744. this._icon.style.zIndex = this._zIndex + t
  2745. },
  2746. _animateZoom: function(t) {
  2747. var i = this._map._latLngToNewLayerPoint(this._latlng, t.zoom, t.center).round();
  2748. this._setPos(i)
  2749. },
  2750. _initInteraction: function() {
  2751. if (this.options.interactive && (pt(this._icon, "leaflet-interactive"), this.addInteractiveTarget(this._icon), Ye)) {
  2752. var t = this.options.draggable;
  2753. this.dragging && (t = this.dragging.enabled(), this.dragging.disable()), this.dragging = new Ye(this), t && this.dragging.enable()
  2754. }
  2755. },
  2756. setOpacity: function(t) {
  2757. return this.options.opacity = t, this._map && this._updateOpacity(), this
  2758. },
  2759. _updateOpacity: function() {
  2760. var t = this.options.opacity;
  2761. vt(this._icon, t), this._shadow && vt(this._shadow, t)
  2762. },
  2763. _bringToFront: function() {
  2764. this._updateZIndex(this.options.riseOffset)
  2765. },
  2766. _resetZIndex: function() {
  2767. this._updateZIndex(0)
  2768. },
  2769. _getPopupAnchor: function() {
  2770. return this.options.icon.options.popupAnchor
  2771. },
  2772. _getTooltipAnchor: function() {
  2773. return this.options.icon.options.tooltipAnchor
  2774. }
  2775. }),
  2776. Je = Ue.extend({
  2777. options: {
  2778. stroke: !0,
  2779. color: "#3388ff",
  2780. weight: 3,
  2781. opacity: 1,
  2782. lineCap: "round",
  2783. lineJoin: "round",
  2784. dashArray: null,
  2785. dashOffset: null,
  2786. fill: !1,
  2787. fillColor: null,
  2788. fillOpacity: .2,
  2789. fillRule: "evenodd",
  2790. interactive: !0,
  2791. bubblingMouseEvents: !0
  2792. },
  2793. beforeAdd: function(t) {
  2794. this._renderer = t.getRenderer(this)
  2795. },
  2796. onAdd: function() {
  2797. this._renderer._initPath(this), this._reset(), this._renderer._addPath(this)
  2798. },
  2799. onRemove: function() {
  2800. this._renderer._removePath(this)
  2801. },
  2802. redraw: function() {
  2803. return this._map && this._renderer._updatePath(this), this
  2804. },
  2805. setStyle: function(t) {
  2806. return l(this, t), this._renderer && this._renderer._updateStyle(this), this
  2807. },
  2808. bringToFront: function() {
  2809. return this._renderer && this._renderer._bringToFront(this), this
  2810. },
  2811. bringToBack: function() {
  2812. return this._renderer && this._renderer._bringToBack(this), this
  2813. },
  2814. getElement: function() {
  2815. return this._path
  2816. },
  2817. _reset: function() {
  2818. this._project(), this._update()
  2819. },
  2820. _clickTolerance: function() {
  2821. return (this.options.stroke ? this.options.weight / 2 : 0) + this._renderer.options.tolerance
  2822. }
  2823. }),
  2824. $e = Je.extend({
  2825. options: {
  2826. fill: !0,
  2827. radius: 10
  2828. },
  2829. initialize: function(t, i) {
  2830. l(this, i), this._latlng = C(t), this._radius = this.options.radius
  2831. },
  2832. setLatLng: function(t) {
  2833. return this._latlng = C(t), this.redraw(), this.fire("move", {
  2834. latlng: this._latlng
  2835. })
  2836. },
  2837. getLatLng: function() {
  2838. return this._latlng
  2839. },
  2840. setRadius: function(t) {
  2841. return this.options.radius = this._radius = t, this.redraw()
  2842. },
  2843. getRadius: function() {
  2844. return this._radius
  2845. },
  2846. setStyle: function(t) {
  2847. var i = t && t.radius || this._radius;
  2848. return Je.prototype.setStyle.call(this, t), this.setRadius(i), this
  2849. },
  2850. _project: function() {
  2851. this._point = this._map.latLngToLayerPoint(this._latlng), this._updateBounds()
  2852. },
  2853. _updateBounds: function() {
  2854. var t = this._radius,
  2855. i = this._radiusY || t,
  2856. e = this._clickTolerance(),
  2857. n = [t + e, i + e];
  2858. this._pxBounds = new P(this._point.subtract(n), this._point.add(n))
  2859. },
  2860. _update: function() {
  2861. this._map && this._updatePath()
  2862. },
  2863. _updatePath: function() {
  2864. this._renderer._updateCircle(this)
  2865. },
  2866. _empty: function() {
  2867. return this._radius && !this._renderer._bounds.intersects(this._pxBounds)
  2868. },
  2869. _containsPoint: function(t) {
  2870. return t.distanceTo(this._point) <= this._radius + this._clickTolerance()
  2871. }
  2872. }),
  2873. Qe = $e.extend({
  2874. initialize: function(t, e, n) {
  2875. if ("number" == typeof e && (e = i({}, n, {
  2876. radius: e
  2877. })), l(this, e), this._latlng = C(t), isNaN(this.options.radius)) throw new Error("Circle radius cannot be NaN");
  2878. this._mRadius = this.options.radius
  2879. },
  2880. setRadius: function(t) {
  2881. return this._mRadius = t, this.redraw()
  2882. },
  2883. getRadius: function() {
  2884. return this._mRadius
  2885. },
  2886. getBounds: function() {
  2887. var t = [this._radius, this._radiusY || this._radius];
  2888. return new T(this._map.layerPointToLatLng(this._point.subtract(t)), this._map.layerPointToLatLng(this._point.add(t)))
  2889. },
  2890. setStyle: Je.prototype.setStyle,
  2891. _project: function() {
  2892. var t = this._latlng.lng,
  2893. i = this._latlng.lat,
  2894. e = this._map,
  2895. n = e.options.crs;
  2896. if (n.distance === _i.distance) {
  2897. var o = Math.PI / 180,
  2898. s = this._mRadius / _i.R / o,
  2899. r = e.project([i + s, t]),
  2900. a = e.project([i - s, t]),
  2901. h = r.add(a).divideBy(2),
  2902. u = e.unproject(h).lat,
  2903. l = Math.acos((Math.cos(s * o) - Math.sin(i * o) * Math.sin(u * o)) / (Math.cos(i * o) * Math.cos(u * o))) / o;
  2904. (isNaN(l) || 0 === l) && (l = s / Math.cos(Math.PI / 180 * i)), this._point = h.subtract(e.getPixelOrigin()), this._radius = isNaN(l) ? 0 : h.x - e.project([u, t - l]).x, this._radiusY = h.y - r.y
  2905. } else {
  2906. var c = n.unproject(n.project(this._latlng).subtract([this._mRadius, 0]));
  2907. this._point = e.latLngToLayerPoint(this._latlng), this._radius = this._point.x - e.latLngToLayerPoint(c).x
  2908. }
  2909. this._updateBounds()
  2910. }
  2911. }),
  2912. tn = Je.extend({
  2913. options: {
  2914. smoothFactor: 1,
  2915. noClip: !1
  2916. },
  2917. initialize: function(t, i) {
  2918. l(this, i), this._setLatLngs(t)
  2919. },
  2920. getLatLngs: function() {
  2921. return this._latlngs
  2922. },
  2923. setLatLngs: function(t) {
  2924. return this._setLatLngs(t), this.redraw()
  2925. },
  2926. isEmpty: function() {
  2927. return !this._latlngs.length
  2928. },
  2929. closestLayerPoint: function(t) {
  2930. for (var i, e, n = 1 / 0, o = null, s = Rt, r = 0, a = this._parts.length; r < a; r++)
  2931. for (var h = this._parts[r], u = 1, l = h.length; u < l; u++) {
  2932. var c = s(t, i = h[u - 1], e = h[u], !0);
  2933. c < n && (n = c, o = s(t, i, e))
  2934. }
  2935. return o && (o.distance = Math.sqrt(n)), o
  2936. },
  2937. getCenter: function() {
  2938. if (!this._map) throw new Error("Must add layer to map before using getCenter()");
  2939. var t, i, e, n, o, s, r, a = this._rings[0],
  2940. h = a.length;
  2941. if (!h) return null;
  2942. for (t = 0, i = 0; t < h - 1; t++) i += a[t].distanceTo(a[t + 1]) / 2;
  2943. if (0 === i) return this._map.layerPointToLatLng(a[0]);
  2944. for (t = 0, n = 0; t < h - 1; t++)
  2945. if (o = a[t], s = a[t + 1], e = o.distanceTo(s), (n += e) > i) return r = (n - i) / e, this._map.layerPointToLatLng([s.x - r * (s.x - o.x), s.y - r * (s.y - o.y)])
  2946. },
  2947. getBounds: function() {
  2948. return this._bounds
  2949. },
  2950. addLatLng: function(t, i) {
  2951. return i = i || this._defaultShape(), t = C(t), i.push(t), this._bounds.extend(t), this.redraw()
  2952. },
  2953. _setLatLngs: function(t) {
  2954. this._bounds = new T, this._latlngs = this._convertLatLngs(t)
  2955. },
  2956. _defaultShape: function() {
  2957. return Dt(this._latlngs) ? this._latlngs : this._latlngs[0]
  2958. },
  2959. _convertLatLngs: function(t) {
  2960. for (var i = [], e = Dt(t), n = 0, o = t.length; n < o; n++) e ? (i[n] = C(t[n]), this._bounds.extend(i[n])) : i[n] = this._convertLatLngs(t[n]);
  2961. return i
  2962. },
  2963. _project: function() {
  2964. var t = new P;
  2965. this._rings = [], this._projectLatlngs(this._latlngs, this._rings, t);
  2966. var i = this._clickTolerance(),
  2967. e = new x(i, i);
  2968. this._bounds.isValid() && t.isValid() && (t.min._subtract(e), t.max._add(e), this._pxBounds = t)
  2969. },
  2970. _projectLatlngs: function(t, i, e) {
  2971. var n, o, s = t[0] instanceof M,
  2972. r = t.length;
  2973. if (s) {
  2974. for (o = [], n = 0; n < r; n++) o[n] = this._map.latLngToLayerPoint(t[n]), e.extend(o[n]);
  2975. i.push(o)
  2976. } else
  2977. for (n = 0; n < r; n++) this._projectLatlngs(t[n], i, e)
  2978. },
  2979. _clipPoints: function() {
  2980. var t = this._renderer._bounds;
  2981. if (this._parts = [], this._pxBounds && this._pxBounds.intersects(t))
  2982. if (this.options.noClip) this._parts = this._rings;
  2983. else {
  2984. var i, e, n, o, s, r, a, h = this._parts;
  2985. for (i = 0, n = 0, o = this._rings.length; i < o; i++)
  2986. for (e = 0, s = (a = this._rings[i]).length; e < s - 1; e++)(r = It(a[e], a[e + 1], t, e, !0)) && (h[n] = h[n] || [], h[n].push(r[0]), r[1] === a[e + 1] && e !== s - 2 || (h[n].push(r[1]), n++))
  2987. }
  2988. },
  2989. _simplifyPoints: function() {
  2990. for (var t = this._parts, i = this.options.smoothFactor, e = 0, n = t.length; e < n; e++) t[e] = Ct(t[e], i)
  2991. },
  2992. _update: function() {
  2993. this._map && (this._clipPoints(), this._simplifyPoints(), this._updatePath())
  2994. },
  2995. _updatePath: function() {
  2996. this._renderer._updatePoly(this)
  2997. },
  2998. _containsPoint: function(t, i) {
  2999. var e, n, o, s, r, a, h = this._clickTolerance();
  3000. if (!this._pxBounds || !this._pxBounds.contains(t)) return !1;
  3001. for (e = 0, s = this._parts.length; e < s; e++)
  3002. for (n = 0, o = (r = (a = this._parts[e]).length) - 1; n < r; o = n++)
  3003. if ((i || 0 !== n) && Zt(t, a[o], a[n]) <= h) return !0;
  3004. return !1
  3005. }
  3006. });
  3007. tn._flat = Nt;
  3008. var en = tn.extend({
  3009. options: {
  3010. fill: !0
  3011. },
  3012. isEmpty: function() {
  3013. return !this._latlngs.length || !this._latlngs[0].length
  3014. },
  3015. getCenter: function() {
  3016. if (!this._map) throw new Error("Must add layer to map before using getCenter()");
  3017. var t, i, e, n, o, s, r, a, h, u = this._rings[0],
  3018. l = u.length;
  3019. if (!l) return null;
  3020. for (s = r = a = 0, t = 0, i = l - 1; t < l; i = t++) e = u[t], n = u[i], o = e.y * n.x - n.y * e.x, r += (e.x + n.x) * o, a += (e.y + n.y) * o, s += 3 * o;
  3021. return h = 0 === s ? u[0] : [r / s, a / s], this._map.layerPointToLatLng(h)
  3022. },
  3023. _convertLatLngs: function(t) {
  3024. var i = tn.prototype._convertLatLngs.call(this, t),
  3025. e = i.length;
  3026. return e >= 2 && i[0] instanceof M && i[0].equals(i[e - 1]) && i.pop(), i
  3027. },
  3028. _setLatLngs: function(t) {
  3029. tn.prototype._setLatLngs.call(this, t), Dt(this._latlngs) && (this._latlngs = [this._latlngs])
  3030. },
  3031. _defaultShape: function() {
  3032. return Dt(this._latlngs[0]) ? this._latlngs[0] : this._latlngs[0][0]
  3033. },
  3034. _clipPoints: function() {
  3035. var t = this._renderer._bounds,
  3036. i = this.options.weight,
  3037. e = new x(i, i);
  3038. if (t = new P(t.min.subtract(e), t.max.add(e)), this._parts = [], this._pxBounds && this._pxBounds.intersects(t))
  3039. if (this.options.noClip) this._parts = this._rings;
  3040. else
  3041. for (var n, o = 0, s = this._rings.length; o < s; o++)(n = jt(this._rings[o], t, !0)).length && this._parts.push(n)
  3042. },
  3043. _updatePath: function() {
  3044. this._renderer._updatePoly(this, !0)
  3045. },
  3046. _containsPoint: function(t) {
  3047. var i, e, n, o, s, r, a, h, u = !1;
  3048. if (!this._pxBounds.contains(t)) return !1;
  3049. for (o = 0, a = this._parts.length; o < a; o++)
  3050. for (s = 0, r = (h = (i = this._parts[o]).length) - 1; s < h; r = s++) e = i[s], n = i[r], e.y > t.y != n.y > t.y && t.x < (n.x - e.x) * (t.y - e.y) / (n.y - e.y) + e.x && (u = !u);
  3051. return u || tn.prototype._containsPoint.call(this, t, !0)
  3052. }
  3053. }),
  3054. nn = qe.extend({
  3055. initialize: function(t, i) {
  3056. l(this, i), this._layers = {}, t && this.addData(t)
  3057. },
  3058. addData: function(t) {
  3059. var i, e, n, o = ei(t) ? t : t.features;
  3060. if (o) {
  3061. for (i = 0, e = o.length; i < e; i++)((n = o[i]).geometries || n.geometry || n.features || n.coordinates) && this.addData(n);
  3062. return this
  3063. }
  3064. var s = this.options;
  3065. if (s.filter && !s.filter(t)) return this;
  3066. var r = Wt(t, s);
  3067. return r ? (r.feature = Gt(t), r.defaultOptions = r.options, this.resetStyle(r), s.onEachFeature && s.onEachFeature(t, r), this.addLayer(r)) : this
  3068. },
  3069. resetStyle: function(t) {
  3070. return t.options = i({}, t.defaultOptions), this._setLayerStyle(t, this.options.style), this
  3071. },
  3072. setStyle: function(t) {
  3073. return this.eachLayer(function(i) {
  3074. this._setLayerStyle(i, t)
  3075. }, this)
  3076. },
  3077. _setLayerStyle: function(t, i) {
  3078. "function" == typeof i && (i = i(t.feature)), t.setStyle && t.setStyle(i)
  3079. }
  3080. }),
  3081. on = {
  3082. toGeoJSON: function(t) {
  3083. return qt(this, {
  3084. type: "Point",
  3085. coordinates: Ut(this.getLatLng(), t)
  3086. })
  3087. }
  3088. };
  3089. Xe.include(on), Qe.include(on), $e.include(on), tn.include({
  3090. toGeoJSON: function(t) {
  3091. var i = !Dt(this._latlngs),
  3092. e = Vt(this._latlngs, i ? 1 : 0, !1, t);
  3093. return qt(this, {
  3094. type: (i ? "Multi" : "") + "LineString",
  3095. coordinates: e
  3096. })
  3097. }
  3098. }), en.include({
  3099. toGeoJSON: function(t) {
  3100. var i = !Dt(this._latlngs),
  3101. e = i && !Dt(this._latlngs[0]),
  3102. n = Vt(this._latlngs, e ? 2 : i ? 1 : 0, !0, t);
  3103. return i || (n = [n]), qt(this, {
  3104. type: (e ? "Multi" : "") + "Polygon",
  3105. coordinates: n
  3106. })
  3107. }
  3108. }), Ve.include({
  3109. toMultiPoint: function(t) {
  3110. var i = [];
  3111. return this.eachLayer(function(e) {
  3112. i.push(e.toGeoJSON(t).geometry.coordinates)
  3113. }), qt(this, {
  3114. type: "MultiPoint",
  3115. coordinates: i
  3116. })
  3117. },
  3118. toGeoJSON: function(t) {
  3119. var i = this.feature && this.feature.geometry && this.feature.geometry.type;
  3120. if ("MultiPoint" === i) return this.toMultiPoint(t);
  3121. var e = "GeometryCollection" === i,
  3122. n = [];
  3123. return this.eachLayer(function(i) {
  3124. if (i.toGeoJSON) {
  3125. var o = i.toGeoJSON(t);
  3126. if (e) n.push(o.geometry);
  3127. else {
  3128. var s = Gt(o);
  3129. "FeatureCollection" === s.type ? n.push.apply(n, s.features) : n.push(s)
  3130. }
  3131. }
  3132. }), e ? qt(this, {
  3133. geometries: n,
  3134. type: "GeometryCollection"
  3135. }) : {
  3136. type: "FeatureCollection",
  3137. features: n
  3138. }
  3139. }
  3140. });
  3141. var sn = Kt,
  3142. rn = Ue.extend({
  3143. options: {
  3144. opacity: 1,
  3145. alt: "",
  3146. interactive: !1,
  3147. crossOrigin: !1,
  3148. errorOverlayUrl: "",
  3149. zIndex: 1,
  3150. className: ""
  3151. },
  3152. initialize: function(t, i, e) {
  3153. this._url = t, this._bounds = z(i), l(this, e)
  3154. },
  3155. onAdd: function() {
  3156. this._image || (this._initImage(), this.options.opacity < 1 && this._updateOpacity()), this.options.interactive && (pt(this._image, "leaflet-interactive"), this.addInteractiveTarget(this._image)), this.getPane().appendChild(this._image), this._reset()
  3157. },
  3158. onRemove: function() {
  3159. ut(this._image), this.options.interactive && this.removeInteractiveTarget(this._image)
  3160. },
  3161. setOpacity: function(t) {
  3162. return this.options.opacity = t, this._image && this._updateOpacity(), this
  3163. },
  3164. setStyle: function(t) {
  3165. return t.opacity && this.setOpacity(t.opacity), this
  3166. },
  3167. bringToFront: function() {
  3168. return this._map && ct(this._image), this
  3169. },
  3170. bringToBack: function() {
  3171. return this._map && _t(this._image), this
  3172. },
  3173. setUrl: function(t) {
  3174. return this._url = t, this._image && (this._image.src = t), this
  3175. },
  3176. setBounds: function(t) {
  3177. return this._bounds = z(t), this._map && this._reset(), this
  3178. },
  3179. getEvents: function() {
  3180. var t = {
  3181. zoom: this._reset,
  3182. viewreset: this._reset
  3183. };
  3184. return this._zoomAnimated && (t.zoomanim = this._animateZoom), t
  3185. },
  3186. setZIndex: function(t) {
  3187. return this.options.zIndex = t, this._updateZIndex(), this
  3188. },
  3189. getBounds: function() {
  3190. return this._bounds
  3191. },
  3192. getElement: function() {
  3193. return this._image
  3194. },
  3195. _initImage: function() {
  3196. var t = "IMG" === this._url.tagName,
  3197. i = this._image = t ? this._url : ht("img");
  3198. pt(i, "leaflet-image-layer"), this._zoomAnimated && pt(i, "leaflet-zoom-animated"), this.options.className && pt(i, this.options.className), i.onselectstart = r, i.onmousemove = r, i.onload = e(this.fire, this, "load"), i.onerror = e(this._overlayOnError, this, "error"), this.options.crossOrigin && (i.crossOrigin = ""), this.options.zIndex && this._updateZIndex(), t ? this._url = i.src : (i.src = this._url, i.alt = this.options.alt)
  3199. },
  3200. _animateZoom: function(t) {
  3201. var i = this._map.getZoomScale(t.zoom),
  3202. e = this._map._latLngBoundsToNewLayerBounds(this._bounds, t.zoom, t.center).min;
  3203. wt(this._image, e, i)
  3204. },
  3205. _reset: function() {
  3206. var t = this._image,
  3207. i = new P(this._map.latLngToLayerPoint(this._bounds.getNorthWest()), this._map.latLngToLayerPoint(this._bounds.getSouthEast())),
  3208. e = i.getSize();
  3209. Lt(t, i.min), t.style.width = e.x + "px", t.style.height = e.y + "px"
  3210. },
  3211. _updateOpacity: function() {
  3212. vt(this._image, this.options.opacity)
  3213. },
  3214. _updateZIndex: function() {
  3215. this._image && void 0 !== this.options.zIndex && null !== this.options.zIndex && (this._image.style.zIndex = this.options.zIndex)
  3216. },
  3217. _overlayOnError: function() {
  3218. this.fire("error");
  3219. var t = this.options.errorOverlayUrl;
  3220. t && this._url !== t && (this._url = t, this._image.src = t)
  3221. }
  3222. }),
  3223. an = rn.extend({
  3224. options: {
  3225. autoplay: !0,
  3226. loop: !0
  3227. },
  3228. _initImage: function() {
  3229. var t = "VIDEO" === this._url.tagName,
  3230. i = this._image = t ? this._url : ht("video");
  3231. if (pt(i, "leaflet-image-layer"), this._zoomAnimated && pt(i, "leaflet-zoom-animated"), i.onselectstart = r, i.onmousemove = r, i.onloadeddata = e(this.fire, this, "load"), t) {
  3232. for (var n = i.getElementsByTagName("source"), o = [], s = 0; s < n.length; s++) o.push(n[s].src);
  3233. this._url = n.length > 0 ? o : [i.src]
  3234. } else {
  3235. ei(this._url) || (this._url = [this._url]), i.autoplay = !!this.options.autoplay, i.loop = !!this.options.loop;
  3236. for (var a = 0; a < this._url.length; a++) {
  3237. var h = ht("source");
  3238. h.src = this._url[a], i.appendChild(h)
  3239. }
  3240. }
  3241. }
  3242. }),
  3243. hn = Ue.extend({
  3244. options: {
  3245. offset: [0, 7],
  3246. className: "",
  3247. pane: "popupPane"
  3248. },
  3249. initialize: function(t, i) {
  3250. l(this, t), this._source = i
  3251. },
  3252. onAdd: function(t) {
  3253. this._zoomAnimated = t._zoomAnimated, this._container || this._initLayout(), t._fadeAnimated && vt(this._container, 0), clearTimeout(this._removeTimeout), this.getPane().appendChild(this._container), this.update(), t._fadeAnimated && vt(this._container, 1), this.bringToFront()
  3254. },
  3255. onRemove: function(t) {
  3256. t._fadeAnimated ? (vt(this._container, 0), this._removeTimeout = setTimeout(e(ut, void 0, this._container), 200)) : ut(this._container)
  3257. },
  3258. getLatLng: function() {
  3259. return this._latlng
  3260. },
  3261. setLatLng: function(t) {
  3262. return this._latlng = C(t), this._map && (this._updatePosition(), this._adjustPan()), this
  3263. },
  3264. getContent: function() {
  3265. return this._content
  3266. },
  3267. setContent: function(t) {
  3268. return this._content = t, this.update(), this
  3269. },
  3270. getElement: function() {
  3271. return this._container
  3272. },
  3273. update: function() {
  3274. this._map && (this._container.style.visibility = "hidden", this._updateContent(), this._updateLayout(), this._updatePosition(), this._container.style.visibility = "", this._adjustPan())
  3275. },
  3276. getEvents: function() {
  3277. var t = {
  3278. zoom: this._updatePosition,
  3279. viewreset: this._updatePosition
  3280. };
  3281. return this._zoomAnimated && (t.zoomanim = this._animateZoom), t
  3282. },
  3283. isOpen: function() {
  3284. return !!this._map && this._map.hasLayer(this)
  3285. },
  3286. bringToFront: function() {
  3287. return this._map && ct(this._container), this
  3288. },
  3289. bringToBack: function() {
  3290. return this._map && _t(this._container), this
  3291. },
  3292. _updateContent: function() {
  3293. if (this._content) {
  3294. var t = this._contentNode,
  3295. i = "function" == typeof this._content ? this._content(this._source || this) : this._content;
  3296. if ("string" == typeof i) t.innerHTML = i;
  3297. else {
  3298. for (; t.hasChildNodes();) t.removeChild(t.firstChild);
  3299. t.appendChild(i)
  3300. }
  3301. this.fire("contentupdate")
  3302. }
  3303. },
  3304. _updatePosition: function() {
  3305. if (this._map) {
  3306. var t = this._map.latLngToLayerPoint(this._latlng),
  3307. i = w(this.options.offset),
  3308. e = this._getAnchor();
  3309. this._zoomAnimated ? Lt(this._container, t.add(e)) : i = i.add(t).add(e);
  3310. var n = this._containerBottom = -i.y,
  3311. o = this._containerLeft = -Math.round(this._containerWidth / 2) + i.x;
  3312. this._container.style.bottom = n + "px", this._container.style.left = o + "px"
  3313. }
  3314. },
  3315. _getAnchor: function() {
  3316. return [0, 0]
  3317. }
  3318. }),
  3319. un = hn.extend({
  3320. options: {
  3321. maxWidth: 300,
  3322. minWidth: 50,
  3323. maxHeight: null,
  3324. autoPan: !0,
  3325. autoPanPaddingTopLeft: null,
  3326. autoPanPaddingBottomRight: null,
  3327. autoPanPadding: [5, 5],
  3328. keepInView: !1,
  3329. closeButton: !0,
  3330. autoClose: !0,
  3331. closeOnEscapeKey: !0,
  3332. className: ""
  3333. },
  3334. openOn: function(t) {
  3335. return t.openPopup(this), this
  3336. },
  3337. onAdd: function(t) {
  3338. hn.prototype.onAdd.call(this, t), t.fire("popupopen", {
  3339. popup: this
  3340. }), this._source && (this._source.fire("popupopen", {
  3341. popup: this
  3342. }, !0), this._source instanceof Je || this._source.on("preclick", Y))
  3343. },
  3344. onRemove: function(t) {
  3345. hn.prototype.onRemove.call(this, t), t.fire("popupclose", {
  3346. popup: this
  3347. }), this._source && (this._source.fire("popupclose", {
  3348. popup: this
  3349. }, !0), this._source instanceof Je || this._source.off("preclick", Y))
  3350. },
  3351. getEvents: function() {
  3352. var t = hn.prototype.getEvents.call(this);
  3353. return (void 0 !== this.options.closeOnClick ? this.options.closeOnClick : this._map.options.closePopupOnClick) && (t.preclick = this._close), this.options.keepInView && (t.moveend = this._adjustPan), t
  3354. },
  3355. _close: function() {
  3356. this._map && this._map.closePopup(this)
  3357. },
  3358. _initLayout: function() {
  3359. var t = "leaflet-popup",
  3360. i = this._container = ht("div", t + " " + (this.options.className || "") + " leaflet-zoom-animated"),
  3361. e = this._wrapper = ht("div", t + "-content-wrapper", i);
  3362. if (this._contentNode = ht("div", t + "-content", e), J(e), X(this._contentNode), V(e, "contextmenu", Y), this._tipContainer = ht("div", t + "-tip-container", i), this._tip = ht("div", t + "-tip", this._tipContainer), this.options.closeButton) {
  3363. var n = this._closeButton = ht("a", t + "-close-button", i);
  3364. n.href = "#close", n.innerHTML = "&#215;", V(n, "click", this._onCloseButtonClick, this)
  3365. }
  3366. },
  3367. _updateLayout: function() {
  3368. var t = this._contentNode,
  3369. i = t.style;
  3370. i.width = "", i.whiteSpace = "nowrap";
  3371. var e = t.offsetWidth;
  3372. e = Math.min(e, this.options.maxWidth), e = Math.max(e, this.options.minWidth), i.width = e + 1 + "px", i.whiteSpace = "", i.height = "";
  3373. var n = t.offsetHeight,
  3374. o = this.options.maxHeight;
  3375. o && n > o ? (i.height = o + "px", pt(t, "leaflet-popup-scrolled")) : mt(t, "leaflet-popup-scrolled"), this._containerWidth = this._container.offsetWidth
  3376. },
  3377. _animateZoom: function(t) {
  3378. var i = this._map._latLngToNewLayerPoint(this._latlng, t.zoom, t.center),
  3379. e = this._getAnchor();
  3380. Lt(this._container, i.add(e))
  3381. },
  3382. _adjustPan: function() {
  3383. if (!(!this.options.autoPan || this._map._panAnim && this._map._panAnim._inProgress)) {
  3384. var t = this._map,
  3385. i = parseInt(at(this._container, "marginBottom"), 10) || 0,
  3386. e = this._container.offsetHeight + i,
  3387. n = this._containerWidth,
  3388. o = new x(this._containerLeft, -e - this._containerBottom);
  3389. o._add(Pt(this._container));
  3390. var s = t.layerPointToContainerPoint(o),
  3391. r = w(this.options.autoPanPadding),
  3392. a = w(this.options.autoPanPaddingTopLeft || r),
  3393. h = w(this.options.autoPanPaddingBottomRight || r),
  3394. u = t.getSize(),
  3395. l = 0,
  3396. c = 0;
  3397. s.x + n + h.x > u.x && (l = s.x + n - u.x + h.x), s.x - l - a.x < 0 && (l = s.x - a.x), s.y + e + h.y > u.y && (c = s.y + e - u.y + h.y), s.y - c - a.y < 0 && (c = s.y - a.y), (l || c) && t.fire("autopanstart").panBy([l, c])
  3398. }
  3399. },
  3400. _onCloseButtonClick: function(t) {
  3401. this._close(), Q(t)
  3402. },
  3403. _getAnchor: function() {
  3404. return w(this._source && this._source._getPopupAnchor ? this._source._getPopupAnchor() : [0, 0])
  3405. }
  3406. });
  3407. Le.mergeOptions({
  3408. closePopupOnClick: !0
  3409. }), Le.include({
  3410. openPopup: function(t, i, e) {
  3411. return t instanceof un || (t = new un(e).setContent(t)), i && t.setLatLng(i), this.hasLayer(t) ? this : (this._popup && this._popup.options.autoClose && this.closePopup(), this._popup = t, this.addLayer(t))
  3412. },
  3413. closePopup: function(t) {
  3414. return t && t !== this._popup || (t = this._popup, this._popup = null), t && this.removeLayer(t), this
  3415. }
  3416. }), Ue.include({
  3417. bindPopup: function(t, i) {
  3418. return t instanceof un ? (l(t, i), this._popup = t, t._source = this) : (this._popup && !i || (this._popup = new un(i, this)), this._popup.setContent(t)), this._popupHandlersAdded || (this.on({
  3419. click: this._openPopup,
  3420. keypress: this._onKeyPress,
  3421. remove: this.closePopup,
  3422. move: this._movePopup
  3423. }), this._popupHandlersAdded = !0), this
  3424. },
  3425. unbindPopup: function() {
  3426. return this._popup && (this.off({
  3427. click: this._openPopup,
  3428. keypress: this._onKeyPress,
  3429. remove: this.closePopup,
  3430. move: this._movePopup
  3431. }), this._popupHandlersAdded = !1, this._popup = null), this
  3432. },
  3433. openPopup: function(t, i) {
  3434. if (t instanceof Ue || (i = t, t = this), t instanceof qe)
  3435. for (var e in this._layers) {
  3436. t = this._layers[e];
  3437. break
  3438. }
  3439. return i || (i = t.getCenter ? t.getCenter() : t.getLatLng()), this._popup && this._map && (this._popup._source = t, this._popup.update(), this._map.openPopup(this._popup, i)), this
  3440. },
  3441. closePopup: function() {
  3442. return this._popup && this._popup._close(), this
  3443. },
  3444. togglePopup: function(t) {
  3445. return this._popup && (this._popup._map ? this.closePopup() : this.openPopup(t)), this
  3446. },
  3447. isPopupOpen: function() {
  3448. return !!this._popup && this._popup.isOpen()
  3449. },
  3450. setPopupContent: function(t) {
  3451. return this._popup && this._popup.setContent(t), this
  3452. },
  3453. getPopup: function() {
  3454. return this._popup
  3455. },
  3456. _openPopup: function(t) {
  3457. var i = t.layer || t.target;
  3458. this._popup && this._map && (Q(t), i instanceof Je ? this.openPopup(t.layer || t.target, t.latlng) : this._map.hasLayer(this._popup) && this._popup._source === i ? this.closePopup() : this.openPopup(i, t.latlng))
  3459. },
  3460. _movePopup: function(t) {
  3461. this._popup.setLatLng(t.latlng)
  3462. },
  3463. _onKeyPress: function(t) {
  3464. 13 === t.originalEvent.keyCode && this._openPopup(t)
  3465. }
  3466. });
  3467. var ln = hn.extend({
  3468. options: {
  3469. pane: "tooltipPane",
  3470. offset: [0, 0],
  3471. direction: "auto",
  3472. permanent: !1,
  3473. sticky: !1,
  3474. interactive: !1,
  3475. opacity: .9
  3476. },
  3477. onAdd: function(t) {
  3478. hn.prototype.onAdd.call(this, t), this.setOpacity(this.options.opacity), t.fire("tooltipopen", {
  3479. tooltip: this
  3480. }), this._source && this._source.fire("tooltipopen", {
  3481. tooltip: this
  3482. }, !0)
  3483. },
  3484. onRemove: function(t) {
  3485. hn.prototype.onRemove.call(this, t), t.fire("tooltipclose", {
  3486. tooltip: this
  3487. }), this._source && this._source.fire("tooltipclose", {
  3488. tooltip: this
  3489. }, !0)
  3490. },
  3491. getEvents: function() {
  3492. var t = hn.prototype.getEvents.call(this);
  3493. return Vi && !this.options.permanent && (t.preclick = this._close), t
  3494. },
  3495. _close: function() {
  3496. this._map && this._map.closeTooltip(this)
  3497. },
  3498. _initLayout: function() {
  3499. var t = "leaflet-tooltip " + (this.options.className || "") + " leaflet-zoom-" + (this._zoomAnimated ? "animated" : "hide");
  3500. this._contentNode = this._container = ht("div", t)
  3501. },
  3502. _updateLayout: function() {},
  3503. _adjustPan: function() {},
  3504. _setPosition: function(t) {
  3505. var i = this._map,
  3506. e = this._container,
  3507. n = i.latLngToContainerPoint(i.getCenter()),
  3508. o = i.layerPointToContainerPoint(t),
  3509. s = this.options.direction,
  3510. r = e.offsetWidth,
  3511. a = e.offsetHeight,
  3512. h = w(this.options.offset),
  3513. u = this._getAnchor();
  3514. "top" === s ? t = t.add(w(-r / 2 + h.x, -a + h.y + u.y, !0)) : "bottom" === s ? t = t.subtract(w(r / 2 - h.x, -h.y, !0)) : "center" === s ? t = t.subtract(w(r / 2 + h.x, a / 2 - u.y + h.y, !0)) : "right" === s || "auto" === s && o.x < n.x ? (s = "right", t = t.add(w(h.x + u.x, u.y - a / 2 + h.y, !0))) : (s = "left", t = t.subtract(w(r + u.x - h.x, a / 2 - u.y - h.y, !0))), mt(e, "leaflet-tooltip-right"), mt(e, "leaflet-tooltip-left"), mt(e, "leaflet-tooltip-top"), mt(e, "leaflet-tooltip-bottom"), pt(e, "leaflet-tooltip-" + s), Lt(e, t)
  3515. },
  3516. _updatePosition: function() {
  3517. var t = this._map.latLngToLayerPoint(this._latlng);
  3518. this._setPosition(t)
  3519. },
  3520. setOpacity: function(t) {
  3521. this.options.opacity = t, this._container && vt(this._container, t)
  3522. },
  3523. _animateZoom: function(t) {
  3524. var i = this._map._latLngToNewLayerPoint(this._latlng, t.zoom, t.center);
  3525. this._setPosition(i)
  3526. },
  3527. _getAnchor: function() {
  3528. return w(this._source && this._source._getTooltipAnchor && !this.options.sticky ? this._source._getTooltipAnchor() : [0, 0])
  3529. }
  3530. });
  3531. Le.include({
  3532. openTooltip: function(t, i, e) {
  3533. return t instanceof ln || (t = new ln(e).setContent(t)), i && t.setLatLng(i), this.hasLayer(t) ? this : this.addLayer(t)
  3534. },
  3535. closeTooltip: function(t) {
  3536. return t && this.removeLayer(t), this
  3537. }
  3538. }), Ue.include({
  3539. bindTooltip: function(t, i) {
  3540. return t instanceof ln ? (l(t, i), this._tooltip = t, t._source = this) : (this._tooltip && !i || (this._tooltip = new ln(i, this)), this._tooltip.setContent(t)), this._initTooltipInteractions(), this._tooltip.options.permanent && this._map && this._map.hasLayer(this) && this.openTooltip(), this
  3541. },
  3542. unbindTooltip: function() {
  3543. return this._tooltip && (this._initTooltipInteractions(!0), this.closeTooltip(), this._tooltip = null), this
  3544. },
  3545. _initTooltipInteractions: function(t) {
  3546. if (t || !this._tooltipHandlersAdded) {
  3547. var i = t ? "off" : "on",
  3548. e = {
  3549. remove: this.closeTooltip,
  3550. move: this._moveTooltip
  3551. };
  3552. this._tooltip.options.permanent ? e.add = this._openTooltip : (e.mouseover = this._openTooltip, e.mouseout = this.closeTooltip, this._tooltip.options.sticky && (e.mousemove = this._moveTooltip), Vi && (e.click = this._openTooltip)), this[i](e), this._tooltipHandlersAdded = !t
  3553. }
  3554. },
  3555. openTooltip: function(t, i) {
  3556. if (t instanceof Ue || (i = t, t = this), t instanceof qe)
  3557. for (var e in this._layers) {
  3558. t = this._layers[e];
  3559. break
  3560. }
  3561. return i || (i = t.getCenter ? t.getCenter() : t.getLatLng()), this._tooltip && this._map && (this._tooltip._source = t, this._tooltip.update(), this._map.openTooltip(this._tooltip, i), this._tooltip.options.interactive && this._tooltip._container && (pt(this._tooltip._container, "leaflet-clickable"), this.addInteractiveTarget(this._tooltip._container))), this
  3562. },
  3563. closeTooltip: function() {
  3564. return this._tooltip && (this._tooltip._close(), this._tooltip.options.interactive && this._tooltip._container && (mt(this._tooltip._container, "leaflet-clickable"), this.removeInteractiveTarget(this._tooltip._container))), this
  3565. },
  3566. toggleTooltip: function(t) {
  3567. return this._tooltip && (this._tooltip._map ? this.closeTooltip() : this.openTooltip(t)), this
  3568. },
  3569. isTooltipOpen: function() {
  3570. return this._tooltip.isOpen()
  3571. },
  3572. setTooltipContent: function(t) {
  3573. return this._tooltip && this._tooltip.setContent(t), this
  3574. },
  3575. getTooltip: function() {
  3576. return this._tooltip
  3577. },
  3578. _openTooltip: function(t) {
  3579. var i = t.layer || t.target;
  3580. this._tooltip && this._map && this.openTooltip(i, this._tooltip.options.sticky ? t.latlng : void 0)
  3581. },
  3582. _moveTooltip: function(t) {
  3583. var i, e, n = t.latlng;
  3584. this._tooltip.options.sticky && t.originalEvent && (i = this._map.mouseEventToContainerPoint(t.originalEvent), e = this._map.containerPointToLayerPoint(i), n = this._map.layerPointToLatLng(e)), this._tooltip.setLatLng(n)
  3585. }
  3586. });
  3587. var cn = Ge.extend({
  3588. options: {
  3589. iconSize: [12, 12],
  3590. html: !1,
  3591. bgPos: null,
  3592. className: "leaflet-div-icon"
  3593. },
  3594. createIcon: function(t) {
  3595. var i = t && "DIV" === t.tagName ? t : document.createElement("div"),
  3596. e = this.options;
  3597. if (i.innerHTML = !1 !== e.html ? e.html : "", e.bgPos) {
  3598. var n = w(e.bgPos);
  3599. i.style.backgroundPosition = -n.x + "px " + -n.y + "px"
  3600. }
  3601. return this._setIconStyles(i, "icon"), i
  3602. },
  3603. createShadow: function() {
  3604. return null
  3605. }
  3606. });
  3607. Ge.Default = Ke;
  3608. var _n = Ue.extend({
  3609. options: {
  3610. tileSize: 256,
  3611. opacity: 1,
  3612. updateWhenIdle: ji,
  3613. updateWhenZooming: !0,
  3614. updateInterval: 200,
  3615. zIndex: 1,
  3616. bounds: null,
  3617. minZoom: 0,
  3618. maxZoom: void 0,
  3619. maxNativeZoom: void 0,
  3620. minNativeZoom: void 0,
  3621. noWrap: !1,
  3622. pane: "tilePane",
  3623. className: "",
  3624. keepBuffer: 2
  3625. },
  3626. initialize: function(t) {
  3627. l(this, t)
  3628. },
  3629. onAdd: function() {
  3630. this._initContainer(), this._levels = {}, this._tiles = {}, this._resetView(), this._update()
  3631. },
  3632. beforeAdd: function(t) {
  3633. t._addZoomLimit(this)
  3634. },
  3635. onRemove: function(t) {
  3636. this._removeAllTiles(), ut(this._container), t._removeZoomLimit(this), this._container = null, this._tileZoom = void 0
  3637. },
  3638. bringToFront: function() {
  3639. return this._map && (ct(this._container), this._setAutoZIndex(Math.max)), this
  3640. },
  3641. bringToBack: function() {
  3642. return this._map && (_t(this._container), this._setAutoZIndex(Math.min)), this
  3643. },
  3644. getContainer: function() {
  3645. return this._container
  3646. },
  3647. setOpacity: function(t) {
  3648. return this.options.opacity = t, this._updateOpacity(), this
  3649. },
  3650. setZIndex: function(t) {
  3651. return this.options.zIndex = t, this._updateZIndex(), this
  3652. },
  3653. isLoading: function() {
  3654. return this._loading
  3655. },
  3656. redraw: function() {
  3657. return this._map && (this._removeAllTiles(), this._update()), this
  3658. },
  3659. getEvents: function() {
  3660. var t = {
  3661. viewprereset: this._invalidateAll,
  3662. viewreset: this._resetView,
  3663. zoom: this._resetView,
  3664. moveend: this._onMoveEnd
  3665. };
  3666. return this.options.updateWhenIdle || (this._onMove || (this._onMove = o(this._onMoveEnd, this.options.updateInterval, this)), t.move = this._onMove), this._zoomAnimated && (t.zoomanim = this._animateZoom), t
  3667. },
  3668. createTile: function() {
  3669. return document.createElement("div")
  3670. },
  3671. getTileSize: function() {
  3672. var t = this.options.tileSize;
  3673. return t instanceof x ? t : new x(t, t)
  3674. },
  3675. _updateZIndex: function() {
  3676. this._container && void 0 !== this.options.zIndex && null !== this.options.zIndex && (this._container.style.zIndex = this.options.zIndex)
  3677. },
  3678. _setAutoZIndex: function(t) {
  3679. for (var i, e = this.getPane().children, n = -t(-1 / 0, 1 / 0), o = 0, s = e.length; o < s; o++) i = e[o].style.zIndex, e[o] !== this._container && i && (n = t(n, +i));
  3680. isFinite(n) && (this.options.zIndex = n + t(-1, 1), this._updateZIndex())
  3681. },
  3682. _updateOpacity: function() {
  3683. if (this._map && !Li) {
  3684. vt(this._container, this.options.opacity);
  3685. var t = +new Date,
  3686. i = !1,
  3687. e = !1;
  3688. for (var n in this._tiles) {
  3689. var o = this._tiles[n];
  3690. if (o.current && o.loaded) {
  3691. var s = Math.min(1, (t - o.loaded) / 200);
  3692. vt(o.el, s), s < 1 ? i = !0 : (o.active ? e = !0 : this._onOpaqueTile(o), o.active = !0)
  3693. }
  3694. }
  3695. e && !this._noPrune && this._pruneTiles(), i && (g(this._fadeFrame), this._fadeFrame = f(this._updateOpacity, this))
  3696. }
  3697. },
  3698. _onOpaqueTile: r,
  3699. _initContainer: function() {
  3700. this._container || (this._container = ht("div", "leaflet-layer " + (this.options.className || "")), this._updateZIndex(), this.options.opacity < 1 && this._updateOpacity(), this.getPane().appendChild(this._container))
  3701. },
  3702. _updateLevels: function() {
  3703. var t = this._tileZoom,
  3704. i = this.options.maxZoom;
  3705. if (void 0 !== t) {
  3706. for (var e in this._levels) this._levels[e].el.children.length || e === t ? (this._levels[e].el.style.zIndex = i - Math.abs(t - e), this._onUpdateLevel(e)) : (ut(this._levels[e].el), this._removeTilesAtZoom(e), this._onRemoveLevel(e), delete this._levels[e]);
  3707. var n = this._levels[t],
  3708. o = this._map;
  3709. return n || ((n = this._levels[t] = {}).el = ht("div", "leaflet-tile-container leaflet-zoom-animated", this._container), n.el.style.zIndex = i, n.origin = o.project(o.unproject(o.getPixelOrigin()), t).round(), n.zoom = t, this._setZoomTransform(n, o.getCenter(), o.getZoom()), n.el.offsetWidth, this._onCreateLevel(n)), this._level = n, n
  3710. }
  3711. },
  3712. _onUpdateLevel: r,
  3713. _onRemoveLevel: r,
  3714. _onCreateLevel: r,
  3715. _pruneTiles: function() {
  3716. if (this._map) {
  3717. var t, i, e = this._map.getZoom();
  3718. if (e > this.options.maxZoom || e < this.options.minZoom) this._removeAllTiles();
  3719. else {
  3720. for (t in this._tiles)(i = this._tiles[t]).retain = i.current;
  3721. for (t in this._tiles)
  3722. if ((i = this._tiles[t]).current && !i.active) {
  3723. var n = i.coords;
  3724. this._retainParent(n.x, n.y, n.z, n.z - 5) || this._retainChildren(n.x, n.y, n.z, n.z + 2)
  3725. }
  3726. for (t in this._tiles) this._tiles[t].retain || this._removeTile(t)
  3727. }
  3728. }
  3729. },
  3730. _removeTilesAtZoom: function(t) {
  3731. for (var i in this._tiles) this._tiles[i].coords.z === t && this._removeTile(i)
  3732. },
  3733. _removeAllTiles: function() {
  3734. for (var t in this._tiles) this._removeTile(t)
  3735. },
  3736. _invalidateAll: function() {
  3737. for (var t in this._levels) ut(this._levels[t].el), this._onRemoveLevel(t), delete this._levels[t];
  3738. this._removeAllTiles(), this._tileZoom = void 0
  3739. },
  3740. _retainParent: function(t, i, e, n) {
  3741. var o = Math.floor(t / 2),
  3742. s = Math.floor(i / 2),
  3743. r = e - 1,
  3744. a = new x(+o, +s);
  3745. a.z = +r;
  3746. var h = this._tileCoordsToKey(a),
  3747. u = this._tiles[h];
  3748. return u && u.active ? (u.retain = !0, !0) : (u && u.loaded && (u.retain = !0), r > n && this._retainParent(o, s, r, n))
  3749. },
  3750. _retainChildren: function(t, i, e, n) {
  3751. for (var o = 2 * t; o < 2 * t + 2; o++)
  3752. for (var s = 2 * i; s < 2 * i + 2; s++) {
  3753. var r = new x(o, s);
  3754. r.z = e + 1;
  3755. var a = this._tileCoordsToKey(r),
  3756. h = this._tiles[a];
  3757. h && h.active ? h.retain = !0 : (h && h.loaded && (h.retain = !0), e + 1 < n && this._retainChildren(o, s, e + 1, n))
  3758. }
  3759. },
  3760. _resetView: function(t) {
  3761. var i = t && (t.pinch || t.flyTo);
  3762. this._setView(this._map.getCenter(), this._map.getZoom(), i, i)
  3763. },
  3764. _animateZoom: function(t) {
  3765. this._setView(t.center, t.zoom, !0, t.noUpdate)
  3766. },
  3767. _clampZoom: function(t) {
  3768. var i = this.options;
  3769. return void 0 !== i.minNativeZoom && t < i.minNativeZoom ? i.minNativeZoom : void 0 !== i.maxNativeZoom && i.maxNativeZoom < t ? i.maxNativeZoom : t
  3770. },
  3771. _setView: function(t, i, e, n) {
  3772. var o = this._clampZoom(Math.round(i));
  3773. (void 0 !== this.options.maxZoom && o > this.options.maxZoom || void 0 !== this.options.minZoom && o < this.options.minZoom) && (o = void 0);
  3774. var s = this.options.updateWhenZooming && o !== this._tileZoom;
  3775. n && !s || (this._tileZoom = o, this._abortLoading && this._abortLoading(), this._updateLevels(), this._resetGrid(), void 0 !== o && this._update(t), e || this._pruneTiles(), this._noPrune = !!e), this._setZoomTransforms(t, i)
  3776. },
  3777. _setZoomTransforms: function(t, i) {
  3778. for (var e in this._levels) this._setZoomTransform(this._levels[e], t, i)
  3779. },
  3780. _setZoomTransform: function(t, i, e) {
  3781. var n = this._map.getZoomScale(e, t.zoom),
  3782. o = t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(i, e)).round();
  3783. Ni ? wt(t.el, o, n) : Lt(t.el, o)
  3784. },
  3785. _resetGrid: function() {
  3786. var t = this._map,
  3787. i = t.options.crs,
  3788. e = this._tileSize = this.getTileSize(),
  3789. n = this._tileZoom,
  3790. o = this._map.getPixelWorldBounds(this._tileZoom);
  3791. o && (this._globalTileRange = this._pxBoundsToTileRange(o)), this._wrapX = i.wrapLng && !this.options.noWrap && [Math.floor(t.project([0, i.wrapLng[0]], n).x / e.x), Math.ceil(t.project([0, i.wrapLng[1]], n).x / e.y)], this._wrapY = i.wrapLat && !this.options.noWrap && [Math.floor(t.project([i.wrapLat[0], 0], n).y / e.x), Math.ceil(t.project([i.wrapLat[1], 0], n).y / e.y)]
  3792. },
  3793. _onMoveEnd: function() {
  3794. this._map && !this._map._animatingZoom && this._update()
  3795. },
  3796. _getTiledPixelBounds: function(t) {
  3797. var i = this._map,
  3798. e = i._animatingZoom ? Math.max(i._animateToZoom, i.getZoom()) : i.getZoom(),
  3799. n = i.getZoomScale(e, this._tileZoom),
  3800. o = i.project(t, this._tileZoom).floor(),
  3801. s = i.getSize().divideBy(2 * n);
  3802. return new P(o.subtract(s), o.add(s))
  3803. },
  3804. _update: function(t) {
  3805. var i = this._map;
  3806. if (i) {
  3807. var e = this._clampZoom(i.getZoom());
  3808. if (void 0 === t && (t = i.getCenter()), void 0 !== this._tileZoom) {
  3809. var n = this._getTiledPixelBounds(t),
  3810. o = this._pxBoundsToTileRange(n),
  3811. s = o.getCenter(),
  3812. r = [],
  3813. a = this.options.keepBuffer,
  3814. h = new P(o.getBottomLeft().subtract([a, -a]), o.getTopRight().add([a, -a]));
  3815. if (!(isFinite(o.min.x) && isFinite(o.min.y) && isFinite(o.max.x) && isFinite(o.max.y))) throw new Error("Attempted to load an infinite number of tiles");
  3816. for (var u in this._tiles) {
  3817. var l = this._tiles[u].coords;
  3818. l.z === this._tileZoom && h.contains(new x(l.x, l.y)) || (this._tiles[u].current = !1)
  3819. }
  3820. if (Math.abs(e - this._tileZoom) > 1) this._setView(t, e);
  3821. else {
  3822. for (var c = o.min.y; c <= o.max.y; c++)
  3823. for (var _ = o.min.x; _ <= o.max.x; _++) {
  3824. var d = new x(_, c);
  3825. if (d.z = this._tileZoom, this._isValidTile(d)) {
  3826. var p = this._tiles[this._tileCoordsToKey(d)];
  3827. p ? p.current = !0 : r.push(d)
  3828. }
  3829. }
  3830. if (r.sort(function(t, i) {
  3831. return t.distanceTo(s) - i.distanceTo(s)
  3832. }), 0 !== r.length) {
  3833. this._loading || (this._loading = !0, this.fire("loading"));
  3834. var m = document.createDocumentFragment();
  3835. for (_ = 0; _ < r.length; _++) this._addTile(r[_], m);
  3836. this._level.el.appendChild(m)
  3837. }
  3838. }
  3839. }
  3840. }
  3841. },
  3842. _isValidTile: function(t) {
  3843. var i = this._map.options.crs;
  3844. if (!i.infinite) {
  3845. var e = this._globalTileRange;
  3846. if (!i.wrapLng && (t.x < e.min.x || t.x > e.max.x) || !i.wrapLat && (t.y < e.min.y || t.y > e.max.y)) return !1
  3847. }
  3848. if (!this.options.bounds) return !0;
  3849. var n = this._tileCoordsToBounds(t);
  3850. return z(this.options.bounds).overlaps(n)
  3851. },
  3852. _keyToBounds: function(t) {
  3853. return this._tileCoordsToBounds(this._keyToTileCoords(t))
  3854. },
  3855. _tileCoordsToNwSe: function(t) {
  3856. var i = this._map,
  3857. e = this.getTileSize(),
  3858. n = t.scaleBy(e),
  3859. o = n.add(e);
  3860. return [i.unproject(n, t.z), i.unproject(o, t.z)]
  3861. },
  3862. _tileCoordsToBounds: function(t) {
  3863. var i = this._tileCoordsToNwSe(t),
  3864. e = new T(i[0], i[1]);
  3865. return this.options.noWrap || (e = this._map.wrapLatLngBounds(e)), e
  3866. },
  3867. _tileCoordsToKey: function(t) {
  3868. return t.x + ":" + t.y + ":" + t.z
  3869. },
  3870. _keyToTileCoords: function(t) {
  3871. var i = t.split(":"),
  3872. e = new x(+i[0], +i[1]);
  3873. return e.z = +i[2], e
  3874. },
  3875. _removeTile: function(t) {
  3876. var i = this._tiles[t];
  3877. i && (Ci || i.el.setAttribute("src", ni), ut(i.el), delete this._tiles[t], this.fire("tileunload", {
  3878. tile: i.el,
  3879. coords: this._keyToTileCoords(t)
  3880. }))
  3881. },
  3882. _initTile: function(t) {
  3883. pt(t, "leaflet-tile");
  3884. var i = this.getTileSize();
  3885. t.style.width = i.x + "px", t.style.height = i.y + "px", t.onselectstart = r, t.onmousemove = r, Li && this.options.opacity < 1 && vt(t, this.options.opacity), Ti && !zi && (t.style.WebkitBackfaceVisibility = "hidden")
  3886. },
  3887. _addTile: function(t, i) {
  3888. var n = this._getTilePos(t),
  3889. o = this._tileCoordsToKey(t),
  3890. s = this.createTile(this._wrapCoords(t), e(this._tileReady, this, t));
  3891. this._initTile(s), this.createTile.length < 2 && f(e(this._tileReady, this, t, null, s)), Lt(s, n), this._tiles[o] = {
  3892. el: s,
  3893. coords: t,
  3894. current: !0
  3895. }, i.appendChild(s), this.fire("tileloadstart", {
  3896. tile: s,
  3897. coords: t
  3898. })
  3899. },
  3900. _tileReady: function(t, i, n) {
  3901. if (this._map) {
  3902. i && this.fire("tileerror", {
  3903. error: i,
  3904. tile: n,
  3905. coords: t
  3906. });
  3907. var o = this._tileCoordsToKey(t);
  3908. (n = this._tiles[o]) && (n.loaded = +new Date, this._map._fadeAnimated ? (vt(n.el, 0), g(this._fadeFrame), this._fadeFrame = f(this._updateOpacity, this)) : (n.active = !0, this._pruneTiles()), i || (pt(n.el, "leaflet-tile-loaded"), this.fire("tileload", {
  3909. tile: n.el,
  3910. coords: t
  3911. })), this._noTilesToLoad() && (this._loading = !1, this.fire("load"), Li || !this._map._fadeAnimated ? f(this._pruneTiles, this) : setTimeout(e(this._pruneTiles, this), 250)))
  3912. }
  3913. },
  3914. _getTilePos: function(t) {
  3915. return t.scaleBy(this.getTileSize()).subtract(this._level.origin)
  3916. },
  3917. _wrapCoords: function(t) {
  3918. var i = new x(this._wrapX ? s(t.x, this._wrapX) : t.x, this._wrapY ? s(t.y, this._wrapY) : t.y);
  3919. return i.z = t.z, i
  3920. },
  3921. _pxBoundsToTileRange: function(t) {
  3922. var i = this.getTileSize();
  3923. return new P(t.min.unscaleBy(i).floor(), t.max.unscaleBy(i).ceil().subtract([1, 1]))
  3924. },
  3925. _noTilesToLoad: function() {
  3926. for (var t in this._tiles)
  3927. if (!this._tiles[t].loaded) return !1;
  3928. return !0
  3929. }
  3930. }),
  3931. dn = _n.extend({
  3932. options: {
  3933. minZoom: 0,
  3934. maxZoom: 18,
  3935. subdomains: "abc",
  3936. errorTileUrl: "",
  3937. zoomOffset: 0,
  3938. tms: !1,
  3939. zoomReverse: !1,
  3940. detectRetina: !1,
  3941. crossOrigin: !1
  3942. },
  3943. initialize: function(t, i) {
  3944. this._url = t, (i = l(this, i)).detectRetina && Ki && i.maxZoom > 0 && (i.tileSize = Math.floor(i.tileSize / 2), i.zoomReverse ? (i.zoomOffset--, i.minZoom++) : (i.zoomOffset++, i.maxZoom--), i.minZoom = Math.max(0, i.minZoom)), "string" == typeof i.subdomains && (i.subdomains = i.subdomains.split("")), Ti || this.on("tileunload", this._onTileRemove)
  3945. },
  3946. setUrl: function(t, i) {
  3947. return this._url = t, i || this.redraw(), this
  3948. },
  3949. createTile: function(t, i) {
  3950. var n = document.createElement("img");
  3951. return V(n, "load", e(this._tileOnLoad, this, i, n)), V(n, "error", e(this._tileOnError, this, i, n)), this.options.crossOrigin && (n.crossOrigin = ""), n.alt = "", n.setAttribute("role", "presentation"), n.src = this.getTileUrl(t), n
  3952. },
  3953. getTileUrl: function(t) {
  3954. var e = {
  3955. r: Ki ? "@2x" : "",
  3956. s: this._getSubdomain(t),
  3957. x: t.x,
  3958. y: t.y,
  3959. z: this._getZoomForUrl()
  3960. };
  3961. if (this._map && !this._map.options.crs.infinite) {
  3962. var n = this._globalTileRange.max.y - t.y;
  3963. this.options.tms && (e.y = n), e["-y"] = n
  3964. }
  3965. return _(this._url, i(e, this.options))
  3966. },
  3967. _tileOnLoad: function(t, i) {
  3968. Li ? setTimeout(e(t, this, null, i), 0) : t(null, i)
  3969. },
  3970. _tileOnError: function(t, i, e) {
  3971. var n = this.options.errorTileUrl;
  3972. n && i.getAttribute("src") !== n && (i.src = n), t(e, i)
  3973. },
  3974. _onTileRemove: function(t) {
  3975. t.tile.onload = null
  3976. },
  3977. _getZoomForUrl: function() {
  3978. var t = this._tileZoom,
  3979. i = this.options.maxZoom,
  3980. e = this.options.zoomReverse,
  3981. n = this.options.zoomOffset;
  3982. return e && (t = i - t), t + n
  3983. },
  3984. _getSubdomain: function(t) {
  3985. var i = Math.abs(t.x + t.y) % this.options.subdomains.length;
  3986. return this.options.subdomains[i]
  3987. },
  3988. _abortLoading: function() {
  3989. var t, i;
  3990. for (t in this._tiles) this._tiles[t].coords.z !== this._tileZoom && ((i = this._tiles[t].el).onload = r, i.onerror = r, i.complete || (i.src = ni, ut(i), delete this._tiles[t]))
  3991. }
  3992. }),
  3993. pn = dn.extend({
  3994. defaultWmsParams: {
  3995. service: "WMS",
  3996. request: "GetMap",
  3997. layers: "",
  3998. styles: "",
  3999. format: "image/jpeg",
  4000. transparent: !1,
  4001. version: "1.1.1"
  4002. },
  4003. options: {
  4004. crs: null,
  4005. uppercase: !1
  4006. },
  4007. initialize: function(t, e) {
  4008. this._url = t;
  4009. var n = i({}, this.defaultWmsParams);
  4010. for (var o in e) o in this.options || (n[o] = e[o]);
  4011. var s = (e = l(this, e)).detectRetina && Ki ? 2 : 1,
  4012. r = this.getTileSize();
  4013. n.width = r.x * s, n.height = r.y * s, this.wmsParams = n
  4014. },
  4015. onAdd: function(t) {
  4016. this._crs = this.options.crs || t.options.crs, this._wmsVersion = parseFloat(this.wmsParams.version);
  4017. var i = this._wmsVersion >= 1.3 ? "crs" : "srs";
  4018. this.wmsParams[i] = this._crs.code, dn.prototype.onAdd.call(this, t)
  4019. },
  4020. getTileUrl: function(t) {
  4021. var i = this._tileCoordsToNwSe(t),
  4022. e = this._crs,
  4023. n = b(e.project(i[0]), e.project(i[1])),
  4024. o = n.min,
  4025. s = n.max,
  4026. r = (this._wmsVersion >= 1.3 && this._crs === He ? [o.y, o.x, s.y, s.x] : [o.x, o.y, s.x, s.y]).join(","),
  4027. a = L.TileLayer.prototype.getTileUrl.call(this, t);
  4028. return a + c(this.wmsParams, a, this.options.uppercase) + (this.options.uppercase ? "&BBOX=" : "&bbox=") + r
  4029. },
  4030. setParams: function(t, e) {
  4031. return i(this.wmsParams, t), e || this.redraw(), this
  4032. }
  4033. });
  4034. dn.WMS = pn, Yt.wms = function(t, i) {
  4035. return new pn(t, i)
  4036. };
  4037. var mn = Ue.extend({
  4038. options: {
  4039. padding: .1,
  4040. tolerance: 0
  4041. },
  4042. initialize: function(t) {
  4043. l(this, t), n(this), this._layers = this._layers || {}
  4044. },
  4045. onAdd: function() {
  4046. this._container || (this._initContainer(), this._zoomAnimated && pt(this._container, "leaflet-zoom-animated")), this.getPane().appendChild(this._container), this._update(), this.on("update", this._updatePaths, this)
  4047. },
  4048. onRemove: function() {
  4049. this.off("update", this._updatePaths, this), this._destroyContainer()
  4050. },
  4051. getEvents: function() {
  4052. var t = {
  4053. viewreset: this._reset,
  4054. zoom: this._onZoom,
  4055. moveend: this._update,
  4056. zoomend: this._onZoomEnd
  4057. };
  4058. return this._zoomAnimated && (t.zoomanim = this._onAnimZoom), t
  4059. },
  4060. _onAnimZoom: function(t) {
  4061. this._updateTransform(t.center, t.zoom)
  4062. },
  4063. _onZoom: function() {
  4064. this._updateTransform(this._map.getCenter(), this._map.getZoom())
  4065. },
  4066. _updateTransform: function(t, i) {
  4067. var e = this._map.getZoomScale(i, this._zoom),
  4068. n = Pt(this._container),
  4069. o = this._map.getSize().multiplyBy(.5 + this.options.padding),
  4070. s = this._map.project(this._center, i),
  4071. r = this._map.project(t, i).subtract(s),
  4072. a = o.multiplyBy(-e).add(n).add(o).subtract(r);
  4073. Ni ? wt(this._container, a, e) : Lt(this._container, a)
  4074. },
  4075. _reset: function() {
  4076. this._update(), this._updateTransform(this._center, this._zoom);
  4077. for (var t in this._layers) this._layers[t]._reset()
  4078. },
  4079. _onZoomEnd: function() {
  4080. for (var t in this._layers) this._layers[t]._project()
  4081. },
  4082. _updatePaths: function() {
  4083. for (var t in this._layers) this._layers[t]._update()
  4084. },
  4085. _update: function() {
  4086. var t = this.options.padding,
  4087. i = this._map.getSize(),
  4088. e = this._map.containerPointToLayerPoint(i.multiplyBy(-t)).round();
  4089. this._bounds = new P(e, e.add(i.multiplyBy(1 + 2 * t)).round()), this._center = this._map.getCenter(), this._zoom = this._map.getZoom()
  4090. }
  4091. }),
  4092. fn = mn.extend({
  4093. getEvents: function() {
  4094. var t = mn.prototype.getEvents.call(this);
  4095. return t.viewprereset = this._onViewPreReset, t
  4096. },
  4097. _onViewPreReset: function() {
  4098. this._postponeUpdatePaths = !0
  4099. },
  4100. onAdd: function() {
  4101. mn.prototype.onAdd.call(this), this._draw()
  4102. },
  4103. _initContainer: function() {
  4104. var t = this._container = document.createElement("canvas");
  4105. V(t, "mousemove", o(this._onMouseMove, 32, this), this), V(t, "click dblclick mousedown mouseup contextmenu", this._onClick, this), V(t, "mouseout", this._handleMouseOut, this), this._ctx = t.getContext("2d")
  4106. },
  4107. _destroyContainer: function() {
  4108. delete this._ctx, ut(this._container), q(this._container), delete this._container
  4109. },
  4110. _updatePaths: function() {
  4111. if (!this._postponeUpdatePaths) {
  4112. this._redrawBounds = null;
  4113. for (var t in this._layers) this._layers[t]._update();
  4114. this._redraw()
  4115. }
  4116. },
  4117. _update: function() {
  4118. if (!this._map._animatingZoom || !this._bounds) {
  4119. this._drawnLayers = {}, mn.prototype._update.call(this);
  4120. var t = this._bounds,
  4121. i = this._container,
  4122. e = t.getSize(),
  4123. n = Ki ? 2 : 1;
  4124. Lt(i, t.min), i.width = n * e.x, i.height = n * e.y, i.style.width = e.x + "px", i.style.height = e.y + "px", Ki && this._ctx.scale(2, 2), this._ctx.translate(-t.min.x, -t.min.y), this.fire("update")
  4125. }
  4126. },
  4127. _reset: function() {
  4128. mn.prototype._reset.call(this), this._postponeUpdatePaths && (this._postponeUpdatePaths = !1, this._updatePaths())
  4129. },
  4130. _initPath: function(t) {
  4131. this._updateDashArray(t), this._layers[n(t)] = t;
  4132. var i = t._order = {
  4133. layer: t,
  4134. prev: this._drawLast,
  4135. next: null
  4136. };
  4137. this._drawLast && (this._drawLast.next = i), this._drawLast = i, this._drawFirst = this._drawFirst || this._drawLast
  4138. },
  4139. _addPath: function(t) {
  4140. this._requestRedraw(t)
  4141. },
  4142. _removePath: function(t) {
  4143. var i = t._order,
  4144. e = i.next,
  4145. n = i.prev;
  4146. e ? e.prev = n : this._drawLast = n, n ? n.next = e : this._drawFirst = e, delete t._order, delete this._layers[L.stamp(t)], this._requestRedraw(t)
  4147. },
  4148. _updatePath: function(t) {
  4149. this._extendRedrawBounds(t), t._project(), t._update(), this._requestRedraw(t)
  4150. },
  4151. _updateStyle: function(t) {
  4152. this._updateDashArray(t), this._requestRedraw(t)
  4153. },
  4154. _updateDashArray: function(t) {
  4155. if (t.options.dashArray) {
  4156. var i, e = t.options.dashArray.split(","),
  4157. n = [];
  4158. for (i = 0; i < e.length; i++) n.push(Number(e[i]));
  4159. t.options._dashArray = n
  4160. }
  4161. },
  4162. _requestRedraw: function(t) {
  4163. this._map && (this._extendRedrawBounds(t), this._redrawRequest = this._redrawRequest || f(this._redraw, this))
  4164. },
  4165. _extendRedrawBounds: function(t) {
  4166. if (t._pxBounds) {
  4167. var i = (t.options.weight || 0) + 1;
  4168. this._redrawBounds = this._redrawBounds || new P, this._redrawBounds.extend(t._pxBounds.min.subtract([i, i])), this._redrawBounds.extend(t._pxBounds.max.add([i, i]))
  4169. }
  4170. },
  4171. _redraw: function() {
  4172. this._redrawRequest = null, this._redrawBounds && (this._redrawBounds.min._floor(), this._redrawBounds.max._ceil()), this._clear(), this._draw(), this._redrawBounds = null
  4173. },
  4174. _clear: function() {
  4175. var t = this._redrawBounds;
  4176. if (t) {
  4177. var i = t.getSize();
  4178. this._ctx.clearRect(t.min.x, t.min.y, i.x, i.y)
  4179. } else this._ctx.clearRect(0, 0, this._container.width, this._container.height)
  4180. },
  4181. _draw: function() {
  4182. var t, i = this._redrawBounds;
  4183. if (this._ctx.save(), i) {
  4184. var e = i.getSize();
  4185. this._ctx.beginPath(), this._ctx.rect(i.min.x, i.min.y, e.x, e.y), this._ctx.clip()
  4186. }
  4187. this._drawing = !0;
  4188. for (var n = this._drawFirst; n; n = n.next) t = n.layer, (!i || t._pxBounds && t._pxBounds.intersects(i)) && t._updatePath();
  4189. this._drawing = !1, this._ctx.restore()
  4190. },
  4191. _updatePoly: function(t, i) {
  4192. if (this._drawing) {
  4193. var e, n, o, s, r = t._parts,
  4194. a = r.length,
  4195. h = this._ctx;
  4196. if (a) {
  4197. for (this._drawnLayers[t._leaflet_id] = t, h.beginPath(), e = 0; e < a; e++) {
  4198. for (n = 0, o = r[e].length; n < o; n++) s = r[e][n], h[n ? "lineTo" : "moveTo"](s.x, s.y);
  4199. i && h.closePath()
  4200. }
  4201. this._fillStroke(h, t)
  4202. }
  4203. }
  4204. },
  4205. _updateCircle: function(t) {
  4206. if (this._drawing && !t._empty()) {
  4207. var i = t._point,
  4208. e = this._ctx,
  4209. n = Math.max(Math.round(t._radius), 1),
  4210. o = (Math.max(Math.round(t._radiusY), 1) || n) / n;
  4211. this._drawnLayers[t._leaflet_id] = t, 1 !== o && (e.save(), e.scale(1, o)), e.beginPath(), e.arc(i.x, i.y / o, n, 0, 2 * Math.PI, !1), 1 !== o && e.restore(), this._fillStroke(e, t)
  4212. }
  4213. },
  4214. _fillStroke: function(t, i) {
  4215. var e = i.options;
  4216. e.fill && (t.globalAlpha = e.fillOpacity, t.fillStyle = e.fillColor || e.color, t.fill(e.fillRule || "evenodd")), e.stroke && 0 !== e.weight && (t.setLineDash && t.setLineDash(i.options && i.options._dashArray || []), t.globalAlpha = e.opacity, t.lineWidth = e.weight, t.strokeStyle = e.color, t.lineCap = e.lineCap, t.lineJoin = e.lineJoin, t.stroke())
  4217. },
  4218. _onClick: function(t) {
  4219. for (var i, e, n = this._map.mouseEventToLayerPoint(t), o = this._drawFirst; o; o = o.next)(i = o.layer).options.interactive && i._containsPoint(n) && !this._map._draggableMoved(i) && (e = i);
  4220. e && (et(t), this._fireEvent([e], t))
  4221. },
  4222. _onMouseMove: function(t) {
  4223. if (this._map && !this._map.dragging.moving() && !this._map._animatingZoom) {
  4224. var i = this._map.mouseEventToLayerPoint(t);
  4225. this._handleMouseHover(t, i)
  4226. }
  4227. },
  4228. _handleMouseOut: function(t) {
  4229. var i = this._hoveredLayer;
  4230. i && (mt(this._container, "leaflet-interactive"), this._fireEvent([i], t, "mouseout"), this._hoveredLayer = null)
  4231. },
  4232. _handleMouseHover: function(t, i) {
  4233. for (var e, n, o = this._drawFirst; o; o = o.next)(e = o.layer).options.interactive && e._containsPoint(i) && (n = e);
  4234. n !== this._hoveredLayer && (this._handleMouseOut(t), n && (pt(this._container, "leaflet-interactive"), this._fireEvent([n], t, "mouseover"), this._hoveredLayer = n)), this._hoveredLayer && this._fireEvent([this._hoveredLayer], t)
  4235. },
  4236. _fireEvent: function(t, i, e) {
  4237. this._map._fireDOMEvent(i, e || i.type, t)
  4238. },
  4239. _bringToFront: function(t) {
  4240. var i = t._order,
  4241. e = i.next,
  4242. n = i.prev;
  4243. e && (e.prev = n, n ? n.next = e : e && (this._drawFirst = e), i.prev = this._drawLast, this._drawLast.next = i, i.next = null, this._drawLast = i, this._requestRedraw(t))
  4244. },
  4245. _bringToBack: function(t) {
  4246. var i = t._order,
  4247. e = i.next,
  4248. n = i.prev;
  4249. n && (n.next = e, e ? e.prev = n : n && (this._drawLast = n), i.prev = null, i.next = this._drawFirst, this._drawFirst.prev = i, this._drawFirst = i, this._requestRedraw(t))
  4250. }
  4251. }),
  4252. gn = function() {
  4253. try {
  4254. return document.namespaces.add("lvml", "urn:schemas-microsoft-com:vml"),
  4255. function(t) {
  4256. return document.createElement("<lvml:" + t + ' class="lvml">')
  4257. }
  4258. } catch (t) {
  4259. return function(t) {
  4260. return document.createElement("<" + t + ' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')
  4261. }
  4262. }
  4263. }(),
  4264. vn = {
  4265. _initContainer: function() {
  4266. this._container = ht("div", "leaflet-vml-container")
  4267. },
  4268. _update: function() {
  4269. this._map._animatingZoom || (mn.prototype._update.call(this), this.fire("update"))
  4270. },
  4271. _initPath: function(t) {
  4272. var i = t._container = gn("shape");
  4273. pt(i, "leaflet-vml-shape " + (this.options.className || "")), i.coordsize = "1 1", t._path = gn("path"), i.appendChild(t._path), this._updateStyle(t), this._layers[n(t)] = t
  4274. },
  4275. _addPath: function(t) {
  4276. var i = t._container;
  4277. this._container.appendChild(i), t.options.interactive && t.addInteractiveTarget(i)
  4278. },
  4279. _removePath: function(t) {
  4280. var i = t._container;
  4281. ut(i), t.removeInteractiveTarget(i), delete this._layers[n(t)]
  4282. },
  4283. _updateStyle: function(t) {
  4284. var i = t._stroke,
  4285. e = t._fill,
  4286. n = t.options,
  4287. o = t._container;
  4288. o.stroked = !!n.stroke, o.filled = !!n.fill, n.stroke ? (i || (i = t._stroke = gn("stroke")), o.appendChild(i), i.weight = n.weight + "px", i.color = n.color, i.opacity = n.opacity, n.dashArray ? i.dashStyle = ei(n.dashArray) ? n.dashArray.join(" ") : n.dashArray.replace(/( *, *)/g, " ") : i.dashStyle = "", i.endcap = n.lineCap.replace("butt", "flat"), i.joinstyle = n.lineJoin) : i && (o.removeChild(i), t._stroke = null), n.fill ? (e || (e = t._fill = gn("fill")), o.appendChild(e), e.color = n.fillColor || n.color, e.opacity = n.fillOpacity) : e && (o.removeChild(e), t._fill = null)
  4289. },
  4290. _updateCircle: function(t) {
  4291. var i = t._point.round(),
  4292. e = Math.round(t._radius),
  4293. n = Math.round(t._radiusY || e);
  4294. this._setPath(t, t._empty() ? "M0 0" : "AL " + i.x + "," + i.y + " " + e + "," + n + " 0,23592600")
  4295. },
  4296. _setPath: function(t, i) {
  4297. t._path.v = i
  4298. },
  4299. _bringToFront: function(t) {
  4300. ct(t._container)
  4301. },
  4302. _bringToBack: function(t) {
  4303. _t(t._container)
  4304. }
  4305. },
  4306. yn = Ji ? gn : E,
  4307. xn = mn.extend({
  4308. getEvents: function() {
  4309. var t = mn.prototype.getEvents.call(this);
  4310. return t.zoomstart = this._onZoomStart, t
  4311. },
  4312. _initContainer: function() {
  4313. this._container = yn("svg"), this._container.setAttribute("pointer-events", "none"), this._rootGroup = yn("g"), this._container.appendChild(this._rootGroup)
  4314. },
  4315. _destroyContainer: function() {
  4316. ut(this._container), q(this._container), delete this._container, delete this._rootGroup, delete this._svgSize
  4317. },
  4318. _onZoomStart: function() {
  4319. this._update()
  4320. },
  4321. _update: function() {
  4322. if (!this._map._animatingZoom || !this._bounds) {
  4323. mn.prototype._update.call(this);
  4324. var t = this._bounds,
  4325. i = t.getSize(),
  4326. e = this._container;
  4327. this._svgSize && this._svgSize.equals(i) || (this._svgSize = i, e.setAttribute("width", i.x), e.setAttribute("height", i.y)), Lt(e, t.min), e.setAttribute("viewBox", [t.min.x, t.min.y, i.x, i.y].join(" ")), this.fire("update")
  4328. }
  4329. },
  4330. _initPath: function(t) {
  4331. var i = t._path = yn("path");
  4332. t.options.className && pt(i, t.options.className), t.options.interactive && pt(i, "leaflet-interactive"), this._updateStyle(t), this._layers[n(t)] = t
  4333. },
  4334. _addPath: function(t) {
  4335. this._rootGroup || this._initContainer(), this._rootGroup.appendChild(t._path), t.addInteractiveTarget(t._path)
  4336. },
  4337. _removePath: function(t) {
  4338. ut(t._path), t.removeInteractiveTarget(t._path), delete this._layers[n(t)]
  4339. },
  4340. _updatePath: function(t) {
  4341. t._project(), t._update()
  4342. },
  4343. _updateStyle: function(t) {
  4344. var i = t._path,
  4345. e = t.options;
  4346. i && (e.stroke ? (i.setAttribute("stroke", e.color), i.setAttribute("stroke-opacity", e.opacity), i.setAttribute("stroke-width", e.weight), i.setAttribute("stroke-linecap", e.lineCap), i.setAttribute("stroke-linejoin", e.lineJoin), e.dashArray ? i.setAttribute("stroke-dasharray", e.dashArray) : i.removeAttribute("stroke-dasharray"), e.dashOffset ? i.setAttribute("stroke-dashoffset", e.dashOffset) : i.removeAttribute("stroke-dashoffset")) : i.setAttribute("stroke", "none"), e.fill ? (i.setAttribute("fill", e.fillColor || e.color), i.setAttribute("fill-opacity", e.fillOpacity), i.setAttribute("fill-rule", e.fillRule || "evenodd")) : i.setAttribute("fill", "none"))
  4347. },
  4348. _updatePoly: function(t, i) {
  4349. this._setPath(t, k(t._parts, i))
  4350. },
  4351. _updateCircle: function(t) {
  4352. var i = t._point,
  4353. e = Math.max(Math.round(t._radius), 1),
  4354. n = "a" + e + "," + (Math.max(Math.round(t._radiusY), 1) || e) + " 0 1,0 ",
  4355. o = t._empty() ? "M0 0" : "M" + (i.x - e) + "," + i.y + n + 2 * e + ",0 " + n + 2 * -e + ",0 ";
  4356. this._setPath(t, o)
  4357. },
  4358. _setPath: function(t, i) {
  4359. t._path.setAttribute("d", i)
  4360. },
  4361. _bringToFront: function(t) {
  4362. ct(t._path)
  4363. },
  4364. _bringToBack: function(t) {
  4365. _t(t._path)
  4366. }
  4367. });
  4368. Ji && xn.include(vn), Le.include({
  4369. getRenderer: function(t) {
  4370. var i = t.options.renderer || this._getPaneRenderer(t.options.pane) || this.options.renderer || this._renderer;
  4371. return i || (i = this._renderer = this.options.preferCanvas && Xt() || Jt()), this.hasLayer(i) || this.addLayer(i), i
  4372. },
  4373. _getPaneRenderer: function(t) {
  4374. if ("overlayPane" === t || void 0 === t) return !1;
  4375. var i = this._paneRenderers[t];
  4376. return void 0 === i && (i = xn && Jt({
  4377. pane: t
  4378. }) || fn && Xt({
  4379. pane: t
  4380. }), this._paneRenderers[t] = i), i
  4381. }
  4382. });
  4383. var wn = en.extend({
  4384. initialize: function(t, i) {
  4385. en.prototype.initialize.call(this, this._boundsToLatLngs(t), i)
  4386. },
  4387. setBounds: function(t) {
  4388. return this.setLatLngs(this._boundsToLatLngs(t))
  4389. },
  4390. _boundsToLatLngs: function(t) {
  4391. return t = z(t), [t.getSouthWest(), t.getNorthWest(), t.getNorthEast(), t.getSouthEast()]
  4392. }
  4393. });
  4394. xn.create = yn, xn.pointsToPath = k, nn.geometryToLayer = Wt, nn.coordsToLatLng = Ht, nn.coordsToLatLngs = Ft, nn.latLngToCoords = Ut, nn.latLngsToCoords = Vt, nn.getFeature = qt, nn.asFeature = Gt, Le.mergeOptions({
  4395. boxZoom: !0
  4396. });
  4397. var Ln = Ze.extend({
  4398. initialize: function(t) {
  4399. this._map = t, this._container = t._container, this._pane = t._panes.overlayPane, this._resetStateTimeout = 0, t.on("unload", this._destroy, this)
  4400. },
  4401. addHooks: function() {
  4402. V(this._container, "mousedown", this._onMouseDown, this)
  4403. },
  4404. removeHooks: function() {
  4405. q(this._container, "mousedown", this._onMouseDown, this)
  4406. },
  4407. moved: function() {
  4408. return this._moved
  4409. },
  4410. _destroy: function() {
  4411. ut(this._pane), delete this._pane
  4412. },
  4413. _resetState: function() {
  4414. this._resetStateTimeout = 0, this._moved = !1
  4415. },
  4416. _clearDeferredResetState: function() {
  4417. 0 !== this._resetStateTimeout && (clearTimeout(this._resetStateTimeout), this._resetStateTimeout = 0)
  4418. },
  4419. _onMouseDown: function(t) {
  4420. if (!t.shiftKey || 1 !== t.which && 1 !== t.button) return !1;
  4421. this._clearDeferredResetState(), this._resetState(), mi(), bt(), this._startPoint = this._map.mouseEventToContainerPoint(t), V(document, {
  4422. contextmenu: Q,
  4423. mousemove: this._onMouseMove,
  4424. mouseup: this._onMouseUp,
  4425. keydown: this._onKeyDown
  4426. }, this)
  4427. },
  4428. _onMouseMove: function(t) {
  4429. this._moved || (this._moved = !0, this._box = ht("div", "leaflet-zoom-box", this._container), pt(this._container, "leaflet-crosshair"), this._map.fire("boxzoomstart")), this._point = this._map.mouseEventToContainerPoint(t);
  4430. var i = new P(this._point, this._startPoint),
  4431. e = i.getSize();
  4432. Lt(this._box, i.min), this._box.style.width = e.x + "px", this._box.style.height = e.y + "px"
  4433. },
  4434. _finish: function() {
  4435. this._moved && (ut(this._box), mt(this._container, "leaflet-crosshair")), fi(), Tt(), q(document, {
  4436. contextmenu: Q,
  4437. mousemove: this._onMouseMove,
  4438. mouseup: this._onMouseUp,
  4439. keydown: this._onKeyDown
  4440. }, this)
  4441. },
  4442. _onMouseUp: function(t) {
  4443. if ((1 === t.which || 1 === t.button) && (this._finish(), this._moved)) {
  4444. this._clearDeferredResetState(), this._resetStateTimeout = setTimeout(e(this._resetState, this), 0);
  4445. var i = new T(this._map.containerPointToLatLng(this._startPoint), this._map.containerPointToLatLng(this._point));
  4446. this._map.fitBounds(i).fire("boxzoomend", {
  4447. boxZoomBounds: i
  4448. })
  4449. }
  4450. },
  4451. _onKeyDown: function(t) {
  4452. 27 === t.keyCode && this._finish()
  4453. }
  4454. });
  4455. Le.addInitHook("addHandler", "boxZoom", Ln), Le.mergeOptions({
  4456. doubleClickZoom: !0
  4457. });
  4458. var Pn = Ze.extend({
  4459. addHooks: function() {
  4460. this._map.on("dblclick", this._onDoubleClick, this)
  4461. },
  4462. removeHooks: function() {
  4463. this._map.off("dblclick", this._onDoubleClick, this)
  4464. },
  4465. _onDoubleClick: function(t) {
  4466. var i = this._map,
  4467. e = i.getZoom(),
  4468. n = i.options.zoomDelta,
  4469. o = t.originalEvent.shiftKey ? e - n : e + n;
  4470. "center" === i.options.doubleClickZoom ? i.setZoom(o) : i.setZoomAround(t.containerPoint, o)
  4471. }
  4472. });
  4473. Le.addInitHook("addHandler", "doubleClickZoom", Pn), Le.mergeOptions({
  4474. dragging: !0,
  4475. inertia: !zi,
  4476. inertiaDeceleration: 3400,
  4477. inertiaMaxSpeed: 1 / 0,
  4478. easeLinearity: .2,
  4479. worldCopyJump: !1,
  4480. maxBoundsViscosity: 0
  4481. });
  4482. var bn = Ze.extend({
  4483. addHooks: function() {
  4484. if (!this._draggable) {
  4485. var t = this._map;
  4486. this._draggable = new Be(t._mapPane, t._container), this._draggable.on({
  4487. dragstart: this._onDragStart,
  4488. drag: this._onDrag,
  4489. dragend: this._onDragEnd
  4490. }, this), this._draggable.on("predrag", this._onPreDragLimit, this), t.options.worldCopyJump && (this._draggable.on("predrag", this._onPreDragWrap, this), t.on("zoomend", this._onZoomEnd, this), t.whenReady(this._onZoomEnd, this))
  4491. }
  4492. pt(this._map._container, "leaflet-grab leaflet-touch-drag"), this._draggable.enable(), this._positions = [], this._times = []
  4493. },
  4494. removeHooks: function() {
  4495. mt(this._map._container, "leaflet-grab"), mt(this._map._container, "leaflet-touch-drag"), this._draggable.disable()
  4496. },
  4497. moved: function() {
  4498. return this._draggable && this._draggable._moved
  4499. },
  4500. moving: function() {
  4501. return this._draggable && this._draggable._moving
  4502. },
  4503. _onDragStart: function() {
  4504. var t = this._map;
  4505. if (t._stop(), this._map.options.maxBounds && this._map.options.maxBoundsViscosity) {
  4506. var i = z(this._map.options.maxBounds);
  4507. this._offsetLimit = b(this._map.latLngToContainerPoint(i.getNorthWest()).multiplyBy(-1), this._map.latLngToContainerPoint(i.getSouthEast()).multiplyBy(-1).add(this._map.getSize())), this._viscosity = Math.min(1, Math.max(0, this._map.options.maxBoundsViscosity))
  4508. } else this._offsetLimit = null;
  4509. t.fire("movestart").fire("dragstart"), t.options.inertia && (this._positions = [], this._times = [])
  4510. },
  4511. _onDrag: function(t) {
  4512. if (this._map.options.inertia) {
  4513. var i = this._lastTime = +new Date,
  4514. e = this._lastPos = this._draggable._absPos || this._draggable._newPos;
  4515. this._positions.push(e), this._times.push(i), this._prunePositions(i)
  4516. }
  4517. this._map.fire("move", t).fire("drag", t)
  4518. },
  4519. _prunePositions: function(t) {
  4520. for (; this._positions.length > 1 && t - this._times[0] > 50;) this._positions.shift(), this._times.shift()
  4521. },
  4522. _onZoomEnd: function() {
  4523. var t = this._map.getSize().divideBy(2),
  4524. i = this._map.latLngToLayerPoint([0, 0]);
  4525. this._initialWorldOffset = i.subtract(t).x, this._worldWidth = this._map.getPixelWorldBounds().getSize().x
  4526. },
  4527. _viscousLimit: function(t, i) {
  4528. return t - (t - i) * this._viscosity
  4529. },
  4530. _onPreDragLimit: function() {
  4531. if (this._viscosity && this._offsetLimit) {
  4532. var t = this._draggable._newPos.subtract(this._draggable._startPos),
  4533. i = this._offsetLimit;
  4534. t.x < i.min.x && (t.x = this._viscousLimit(t.x, i.min.x)), t.y < i.min.y && (t.y = this._viscousLimit(t.y, i.min.y)), t.x > i.max.x && (t.x = this._viscousLimit(t.x, i.max.x)), t.y > i.max.y && (t.y = this._viscousLimit(t.y, i.max.y)), this._draggable._newPos = this._draggable._startPos.add(t)
  4535. }
  4536. },
  4537. _onPreDragWrap: function() {
  4538. var t = this._worldWidth,
  4539. i = Math.round(t / 2),
  4540. e = this._initialWorldOffset,
  4541. n = this._draggable._newPos.x,
  4542. o = (n - i + e) % t + i - e,
  4543. s = (n + i + e) % t - i - e,
  4544. r = Math.abs(o + e) < Math.abs(s + e) ? o : s;
  4545. this._draggable._absPos = this._draggable._newPos.clone(), this._draggable._newPos.x = r
  4546. },
  4547. _onDragEnd: function(t) {
  4548. var i = this._map,
  4549. e = i.options,
  4550. n = !e.inertia || this._times.length < 2;
  4551. if (i.fire("dragend", t), n) i.fire("moveend");
  4552. else {
  4553. this._prunePositions(+new Date);
  4554. var o = this._lastPos.subtract(this._positions[0]),
  4555. s = (this._lastTime - this._times[0]) / 1e3,
  4556. r = e.easeLinearity,
  4557. a = o.multiplyBy(r / s),
  4558. h = a.distanceTo([0, 0]),
  4559. u = Math.min(e.inertiaMaxSpeed, h),
  4560. l = a.multiplyBy(u / h),
  4561. c = u / (e.inertiaDeceleration * r),
  4562. _ = l.multiplyBy(-c / 2).round();
  4563. _.x || _.y ? (_ = i._limitOffset(_, i.options.maxBounds), f(function() {
  4564. i.panBy(_, {
  4565. duration: c,
  4566. easeLinearity: r,
  4567. noMoveStart: !0,
  4568. animate: !0
  4569. })
  4570. })) : i.fire("moveend")
  4571. }
  4572. }
  4573. });
  4574. Le.addInitHook("addHandler", "dragging", bn), Le.mergeOptions({
  4575. keyboard: !0,
  4576. keyboardPanDelta: 80
  4577. });
  4578. var Tn = Ze.extend({
  4579. keyCodes: {
  4580. left: [37],
  4581. right: [39],
  4582. down: [40],
  4583. up: [38],
  4584. zoomIn: [187, 107, 61, 171],
  4585. zoomOut: [189, 109, 54, 173]
  4586. },
  4587. initialize: function(t) {
  4588. this._map = t, this._setPanDelta(t.options.keyboardPanDelta), this._setZoomDelta(t.options.zoomDelta)
  4589. },
  4590. addHooks: function() {
  4591. var t = this._map._container;
  4592. t.tabIndex <= 0 && (t.tabIndex = "0"), V(t, {
  4593. focus: this._onFocus,
  4594. blur: this._onBlur,
  4595. mousedown: this._onMouseDown
  4596. }, this), this._map.on({
  4597. focus: this._addHooks,
  4598. blur: this._removeHooks
  4599. }, this)
  4600. },
  4601. removeHooks: function() {
  4602. this._removeHooks(), q(this._map._container, {
  4603. focus: this._onFocus,
  4604. blur: this._onBlur,
  4605. mousedown: this._onMouseDown
  4606. }, this), this._map.off({
  4607. focus: this._addHooks,
  4608. blur: this._removeHooks
  4609. }, this)
  4610. },
  4611. _onMouseDown: function() {
  4612. if (!this._focused) {
  4613. var t = document.body,
  4614. i = document.documentElement,
  4615. e = t.scrollTop || i.scrollTop,
  4616. n = t.scrollLeft || i.scrollLeft;
  4617. this._map._container.focus(), window.scrollTo(n, e)
  4618. }
  4619. },
  4620. _onFocus: function() {
  4621. this._focused = !0, this._map.fire("focus")
  4622. },
  4623. _onBlur: function() {
  4624. this._focused = !1, this._map.fire("blur")
  4625. },
  4626. _setPanDelta: function(t) {
  4627. var i, e, n = this._panKeys = {},
  4628. o = this.keyCodes;
  4629. for (i = 0, e = o.left.length; i < e; i++) n[o.left[i]] = [-1 * t, 0];
  4630. for (i = 0, e = o.right.length; i < e; i++) n[o.right[i]] = [t, 0];
  4631. for (i = 0, e = o.down.length; i < e; i++) n[o.down[i]] = [0, t];
  4632. for (i = 0, e = o.up.length; i < e; i++) n[o.up[i]] = [0, -1 * t]
  4633. },
  4634. _setZoomDelta: function(t) {
  4635. var i, e, n = this._zoomKeys = {},
  4636. o = this.keyCodes;
  4637. for (i = 0, e = o.zoomIn.length; i < e; i++) n[o.zoomIn[i]] = t;
  4638. for (i = 0, e = o.zoomOut.length; i < e; i++) n[o.zoomOut[i]] = -t
  4639. },
  4640. _addHooks: function() {
  4641. V(document, "keydown", this._onKeyDown, this)
  4642. },
  4643. _removeHooks: function() {
  4644. q(document, "keydown", this._onKeyDown, this)
  4645. },
  4646. _onKeyDown: function(t) {
  4647. if (!(t.altKey || t.ctrlKey || t.metaKey)) {
  4648. var i, e = t.keyCode,
  4649. n = this._map;
  4650. if (e in this._panKeys) {
  4651. if (n._panAnim && n._panAnim._inProgress) return;
  4652. i = this._panKeys[e], t.shiftKey && (i = w(i).multiplyBy(3)), n.panBy(i), n.options.maxBounds && n.panInsideBounds(n.options.maxBounds)
  4653. } else if (e in this._zoomKeys) n.setZoom(n.getZoom() + (t.shiftKey ? 3 : 1) * this._zoomKeys[e]);
  4654. else {
  4655. if (27 !== e || !n._popup || !n._popup.options.closeOnEscapeKey) return;
  4656. n.closePopup()
  4657. }
  4658. Q(t)
  4659. }
  4660. }
  4661. });
  4662. Le.addInitHook("addHandler", "keyboard", Tn), Le.mergeOptions({
  4663. scrollWheelZoom: !0,
  4664. wheelDebounceTime: 40,
  4665. wheelPxPerZoomLevel: 60
  4666. });
  4667. var zn = Ze.extend({
  4668. addHooks: function() {
  4669. V(this._map._container, "mousewheel", this._onWheelScroll, this), this._delta = 0
  4670. },
  4671. removeHooks: function() {
  4672. q(this._map._container, "mousewheel", this._onWheelScroll, this)
  4673. },
  4674. _onWheelScroll: function(t) {
  4675. var i = it(t),
  4676. n = this._map.options.wheelDebounceTime;
  4677. this._delta += i, this._lastMousePos = this._map.mouseEventToContainerPoint(t), this._startTime || (this._startTime = +new Date);
  4678. var o = Math.max(n - (+new Date - this._startTime), 0);
  4679. clearTimeout(this._timer), this._timer = setTimeout(e(this._performZoom, this), o), Q(t)
  4680. },
  4681. _performZoom: function() {
  4682. var t = this._map,
  4683. i = t.getZoom(),
  4684. e = this._map.options.zoomSnap || 0;
  4685. t._stop();
  4686. var n = this._delta / (4 * this._map.options.wheelPxPerZoomLevel),
  4687. o = 4 * Math.log(2 / (1 + Math.exp(-Math.abs(n)))) / Math.LN2,
  4688. s = e ? Math.ceil(o / e) * e : o,
  4689. r = t._limitZoom(i + (this._delta > 0 ? s : -s)) - i;
  4690. this._delta = 0, this._startTime = null, r && ("center" === t.options.scrollWheelZoom ? t.setZoom(i + r) : t.setZoomAround(this._lastMousePos, i + r))
  4691. }
  4692. });
  4693. Le.addInitHook("addHandler", "scrollWheelZoom", zn), Le.mergeOptions({
  4694. tap: !0,
  4695. tapTolerance: 15
  4696. });
  4697. var Mn = Ze.extend({
  4698. addHooks: function() {
  4699. V(this._map._container, "touchstart", this._onDown, this)
  4700. },
  4701. removeHooks: function() {
  4702. q(this._map._container, "touchstart", this._onDown, this)
  4703. },
  4704. _onDown: function(t) {
  4705. if (t.touches) {
  4706. if ($(t), this._fireClick = !0, t.touches.length > 1) return this._fireClick = !1, void clearTimeout(this._holdTimeout);
  4707. var i = t.touches[0],
  4708. n = i.target;
  4709. this._startPos = this._newPos = new x(i.clientX, i.clientY), n.tagName && "a" === n.tagName.toLowerCase() && pt(n, "leaflet-active"), this._holdTimeout = setTimeout(e(function() {
  4710. this._isTapValid() && (this._fireClick = !1, this._onUp(), this._simulateEvent("contextmenu", i))
  4711. }, this), 1e3), this._simulateEvent("mousedown", i), V(document, {
  4712. touchmove: this._onMove,
  4713. touchend: this._onUp
  4714. }, this)
  4715. }
  4716. },
  4717. _onUp: function(t) {
  4718. if (clearTimeout(this._holdTimeout), q(document, {
  4719. touchmove: this._onMove,
  4720. touchend: this._onUp
  4721. }, this), this._fireClick && t && t.changedTouches) {
  4722. var i = t.changedTouches[0],
  4723. e = i.target;
  4724. e && e.tagName && "a" === e.tagName.toLowerCase() && mt(e, "leaflet-active"), this._simulateEvent("mouseup", i), this._isTapValid() && this._simulateEvent("click", i)
  4725. }
  4726. },
  4727. _isTapValid: function() {
  4728. return this._newPos.distanceTo(this._startPos) <= this._map.options.tapTolerance
  4729. },
  4730. _onMove: function(t) {
  4731. var i = t.touches[0];
  4732. this._newPos = new x(i.clientX, i.clientY), this._simulateEvent("mousemove", i)
  4733. },
  4734. _simulateEvent: function(t, i) {
  4735. var e = document.createEvent("MouseEvents");
  4736. e._simulated = !0, i.target._simulatedClick = !0, e.initMouseEvent(t, !0, !0, window, 1, i.screenX, i.screenY, i.clientX, i.clientY, !1, !1, !1, !1, 0, null), i.target.dispatchEvent(e)
  4737. }
  4738. });
  4739. Vi && !Ui && Le.addInitHook("addHandler", "tap", Mn), Le.mergeOptions({
  4740. touchZoom: Vi && !zi,
  4741. bounceAtZoomLimits: !0
  4742. });
  4743. var Cn = Ze.extend({
  4744. addHooks: function() {
  4745. pt(this._map._container, "leaflet-touch-zoom"), V(this._map._container, "touchstart", this._onTouchStart, this)
  4746. },
  4747. removeHooks: function() {
  4748. mt(this._map._container, "leaflet-touch-zoom"), q(this._map._container, "touchstart", this._onTouchStart, this)
  4749. },
  4750. _onTouchStart: function(t) {
  4751. var i = this._map;
  4752. if (t.touches && 2 === t.touches.length && !i._animatingZoom && !this._zooming) {
  4753. var e = i.mouseEventToContainerPoint(t.touches[0]),
  4754. n = i.mouseEventToContainerPoint(t.touches[1]);
  4755. this._centerPoint = i.getSize()._divideBy(2), this._startLatLng = i.containerPointToLatLng(this._centerPoint), "center" !== i.options.touchZoom && (this._pinchStartLatLng = i.containerPointToLatLng(e.add(n)._divideBy(2))), this._startDist = e.distanceTo(n), this._startZoom = i.getZoom(), this._moved = !1, this._zooming = !0, i._stop(), V(document, "touchmove", this._onTouchMove, this), V(document, "touchend", this._onTouchEnd, this), $(t)
  4756. }
  4757. },
  4758. _onTouchMove: function(t) {
  4759. if (t.touches && 2 === t.touches.length && this._zooming) {
  4760. var i = this._map,
  4761. n = i.mouseEventToContainerPoint(t.touches[0]),
  4762. o = i.mouseEventToContainerPoint(t.touches[1]),
  4763. s = n.distanceTo(o) / this._startDist;
  4764. if (this._zoom = i.getScaleZoom(s, this._startZoom), !i.options.bounceAtZoomLimits && (this._zoom < i.getMinZoom() && s < 1 || this._zoom > i.getMaxZoom() && s > 1) && (this._zoom = i._limitZoom(this._zoom)), "center" === i.options.touchZoom) {
  4765. if (this._center = this._startLatLng, 1 === s) return
  4766. } else {
  4767. var r = n._add(o)._divideBy(2)._subtract(this._centerPoint);
  4768. if (1 === s && 0 === r.x && 0 === r.y) return;
  4769. this._center = i.unproject(i.project(this._pinchStartLatLng, this._zoom).subtract(r), this._zoom)
  4770. }
  4771. this._moved || (i._moveStart(!0, !1), this._moved = !0), g(this._animRequest);
  4772. var a = e(i._move, i, this._center, this._zoom, {
  4773. pinch: !0,
  4774. round: !1
  4775. });
  4776. this._animRequest = f(a, this, !0), $(t)
  4777. }
  4778. },
  4779. _onTouchEnd: function() {
  4780. this._moved && this._zooming ? (this._zooming = !1, g(this._animRequest), q(document, "touchmove", this._onTouchMove), q(document, "touchend", this._onTouchEnd), this._map.options.zoomAnimation ? this._map._animateZoom(this._center, this._map._limitZoom(this._zoom), !0, this._map.options.zoomSnap) : this._map._resetView(this._center, this._map._limitZoom(this._zoom))) : this._zooming = !1
  4781. }
  4782. });
  4783. Le.addInitHook("addHandler", "touchZoom", Cn), Le.BoxZoom = Ln, Le.DoubleClickZoom = Pn, Le.Drag = bn, Le.Keyboard = Tn, Le.ScrollWheelZoom = zn, Le.Tap = Mn, Le.TouchZoom = Cn;
  4784. var Zn = window.L;
  4785. window.L = t, Object.freeze = $t, t.version = "1.3.1", t.noConflict = function() {
  4786. return window.L = Zn, this
  4787. }, t.Control = Pe, t.control = be, t.Browser = $i, t.Evented = ui, t.Mixin = Ee, t.Util = ai, t.Class = v, t.Handler = Ze, t.extend = i, t.bind = e, t.stamp = n, t.setOptions = l, t.DomEvent = de, t.DomUtil = xe, t.PosAnimation = we, t.Draggable = Be, t.LineUtil = Oe, t.PolyUtil = Re, t.Point = x, t.point = w, t.Bounds = P, t.bounds = b, t.Transformation = Z, t.transformation = S, t.Projection = je, t.LatLng = M, t.latLng = C, t.LatLngBounds = T, t.latLngBounds = z, t.CRS = ci, t.GeoJSON = nn, t.geoJSON = Kt, t.geoJson = sn, t.Layer = Ue, t.LayerGroup = Ve, t.layerGroup = function(t, i) {
  4788. return new Ve(t, i)
  4789. }, t.FeatureGroup = qe, t.featureGroup = function(t) {
  4790. return new qe(t)
  4791. }, t.ImageOverlay = rn, t.imageOverlay = function(t, i, e) {
  4792. return new rn(t, i, e)
  4793. }, t.VideoOverlay = an, t.videoOverlay = function(t, i, e) {
  4794. return new an(t, i, e)
  4795. }, t.DivOverlay = hn, t.Popup = un, t.popup = function(t, i) {
  4796. return new un(t, i)
  4797. }, t.Tooltip = ln, t.tooltip = function(t, i) {
  4798. return new ln(t, i)
  4799. }, t.Icon = Ge, t.icon = function(t) {
  4800. return new Ge(t)
  4801. }, t.DivIcon = cn, t.divIcon = function(t) {
  4802. return new cn(t)
  4803. }, t.Marker = Xe, t.marker = function(t, i) {
  4804. return new Xe(t, i)
  4805. }, t.TileLayer = dn, t.tileLayer = Yt, t.GridLayer = _n, t.gridLayer = function(t) {
  4806. return new _n(t)
  4807. }, t.SVG = xn, t.svg = Jt, t.Renderer = mn, t.Canvas = fn, t.canvas = Xt, t.Path = Je, t.CircleMarker = $e, t.circleMarker = function(t, i) {
  4808. return new $e(t, i)
  4809. }, t.Circle = Qe, t.circle = function(t, i, e) {
  4810. return new Qe(t, i, e)
  4811. }, t.Polyline = tn, t.polyline = function(t, i) {
  4812. return new tn(t, i)
  4813. }, t.Polygon = en, t.polygon = function(t, i) {
  4814. return new en(t, i)
  4815. }, t.Rectangle = wn, t.rectangle = function(t, i) {
  4816. return new wn(t, i)
  4817. }, t.Map = Le, t.map = function(t, i) {
  4818. return new Le(t, i)
  4819. }
  4820. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement