Leaflet

一个开源并且对移动端友好的 交互式地图 JavaScript 库

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/483765/1413252/Leaflet.js

  1. /* @preserve
  2. * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
  3. * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
  4. */
  5. !(function (global, factory) {
  6. /**
  7. * 不使用define
  8. * typeof define === "function" && define.amd
  9. * define(factory)
  10. */
  11. if (typeof exports === "object" && typeof module !== "undefined") {
  12. /* 适用于NodeJs或typeScript */
  13. module.exports = factory();
  14. } else {
  15. global = typeof globalThis !== "undefined" ? globalThis : global || self;
  16. /* 适用于浏览器中,且this对象是window,如果this是其它,那么会在其它对象下注册(不可用)对象 */
  17. global.leaflet = factory(global);
  18. }
  19. })(this, function (t) {
  20. "use strict";
  21. function l(t) {
  22. for (var e, i, n = 1, o = arguments.length; n < o; n++)
  23. for (e in (i = arguments[n])) t[e] = i[e];
  24. return t;
  25. }
  26. var R =
  27. Object.create ||
  28. function (t) {
  29. return (N.prototype = t), new N();
  30. };
  31. function N() {}
  32. function a(t, e) {
  33. var i,
  34. n = Array.prototype.slice;
  35. return t.bind
  36. ? t.bind.apply(t, n.call(arguments, 1))
  37. : ((i = n.call(arguments, 2)),
  38. function () {
  39. return t.apply(e, i.length ? i.concat(n.call(arguments)) : arguments);
  40. });
  41. }
  42. var D = 0;
  43. function h(t) {
  44. return "_leaflet_id" in t || (t._leaflet_id = ++D), t._leaflet_id;
  45. }
  46. function j(t, e, i) {
  47. var n,
  48. o,
  49. s = function () {
  50. (n = !1), o && (r.apply(i, o), (o = !1));
  51. },
  52. r = function () {
  53. n
  54. ? (o = arguments)
  55. : (t.apply(i, arguments), setTimeout(s, e), (n = !0));
  56. };
  57. return r;
  58. }
  59. function H(t, e, i) {
  60. var n = e[1],
  61. e = e[0],
  62. o = n - e;
  63. return t === n && i ? t : ((((t - e) % o) + o) % o) + e;
  64. }
  65. function u() {
  66. return !1;
  67. }
  68. function i(t, e) {
  69. return !1 === e
  70. ? t
  71. : ((e = Math.pow(10, void 0 === e ? 6 : e)), Math.round(t * e) / e);
  72. }
  73. function W(t) {
  74. return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "");
  75. }
  76. function F(t) {
  77. return W(t).split(/\s+/);
  78. }
  79. function c(t, e) {
  80. for (var i in (Object.prototype.hasOwnProperty.call(t, "options") ||
  81. (t.options = t.options ? R(t.options) : {}),
  82. e))
  83. t.options[i] = e[i];
  84. return t.options;
  85. }
  86. function U(t, e, i) {
  87. var n,
  88. o = [];
  89. for (n in t)
  90. o.push(
  91. encodeURIComponent(i ? n.toUpperCase() : n) +
  92. "=" +
  93. encodeURIComponent(t[n])
  94. );
  95. return (e && -1 !== e.indexOf("?") ? "&" : "?") + o.join("&");
  96. }
  97. var V = /\{ *([\w_ -]+) *\}/g;
  98. function q(t, i) {
  99. return t.replace(V, function (t, e) {
  100. e = i[e];
  101. if (void 0 === e) throw new Error("No value provided for variable " + t);
  102. return (e = "function" == typeof e ? e(i) : e);
  103. });
  104. }
  105. var d =
  106. Array.isArray ||
  107. function (t) {
  108. return "[object Array]" === Object.prototype.toString.call(t);
  109. };
  110. function G(t, e) {
  111. for (var i = 0; i < t.length; i++) if (t[i] === e) return i;
  112. return -1;
  113. }
  114. var K = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";
  115. function Y(t) {
  116. return window["webkit" + t] || window["moz" + t] || window["ms" + t];
  117. }
  118. var X = 0;
  119. function J(t) {
  120. var e = +new Date(),
  121. i = Math.max(0, 16 - (e - X));
  122. return (X = e + i), window.setTimeout(t, i);
  123. }
  124. var $ = window.requestAnimationFrame || Y("RequestAnimationFrame") || J,
  125. Q =
  126. window.cancelAnimationFrame ||
  127. Y("CancelAnimationFrame") ||
  128. Y("CancelRequestAnimationFrame") ||
  129. function (t) {
  130. window.clearTimeout(t);
  131. };
  132. function x(t, e, i) {
  133. if (!i || $ !== J) return $.call(window, a(t, e));
  134. t.call(e);
  135. }
  136. function r(t) {
  137. t && Q.call(window, t);
  138. }
  139. var tt = {
  140. __proto__: null,
  141. extend: l,
  142. create: R,
  143. bind: a,
  144. get lastId() {
  145. return D;
  146. },
  147. stamp: h,
  148. throttle: j,
  149. wrapNum: H,
  150. falseFn: u,
  151. formatNum: i,
  152. trim: W,
  153. splitWords: F,
  154. setOptions: c,
  155. getParamString: U,
  156. template: q,
  157. isArray: d,
  158. indexOf: G,
  159. emptyImageUrl: K,
  160. requestFn: $,
  161. cancelFn: Q,
  162. requestAnimFrame: x,
  163. cancelAnimFrame: r,
  164. };
  165. function et() {}
  166. (et.extend = function (t) {
  167. function e() {
  168. c(this),
  169. this.initialize && this.initialize.apply(this, arguments),
  170. this.callInitHooks();
  171. }
  172. var i,
  173. n = (e.__super__ = this.prototype),
  174. o = R(n);
  175. for (i in (((o.constructor = e).prototype = o), this))
  176. Object.prototype.hasOwnProperty.call(this, i) &&
  177. "prototype" !== i &&
  178. "__super__" !== i &&
  179. (e[i] = this[i]);
  180. if ((t.statics && l(e, t.statics), t.includes)) {
  181. var s = t.includes;
  182. if ("undefined" != typeof L && L && L.Mixin) {
  183. s = d(s) ? s : [s];
  184. for (var r = 0; r < s.length; r++)
  185. s[r] === L.Mixin.Events &&
  186. console.warn(
  187. "Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",
  188. new Error().stack
  189. );
  190. }
  191. l.apply(null, [o].concat(t.includes));
  192. }
  193. return (
  194. l(o, t),
  195. delete o.statics,
  196. delete o.includes,
  197. o.options &&
  198. ((o.options = n.options ? R(n.options) : {}), l(o.options, t.options)),
  199. (o._initHooks = []),
  200. (o.callInitHooks = function () {
  201. if (!this._initHooksCalled) {
  202. n.callInitHooks && n.callInitHooks.call(this),
  203. (this._initHooksCalled = !0);
  204. for (var t = 0, e = o._initHooks.length; t < e; t++)
  205. o._initHooks[t].call(this);
  206. }
  207. }),
  208. e
  209. );
  210. }),
  211. (et.include = function (t) {
  212. var e = this.prototype.options;
  213. return (
  214. l(this.prototype, t),
  215. t.options &&
  216. ((this.prototype.options = e), this.mergeOptions(t.options)),
  217. this
  218. );
  219. }),
  220. (et.mergeOptions = function (t) {
  221. return l(this.prototype.options, t), this;
  222. }),
  223. (et.addInitHook = function (t) {
  224. var e = Array.prototype.slice.call(arguments, 1),
  225. i =
  226. "function" == typeof t
  227. ? t
  228. : function () {
  229. this[t].apply(this, e);
  230. };
  231. return (
  232. (this.prototype._initHooks = this.prototype._initHooks || []),
  233. this.prototype._initHooks.push(i),
  234. this
  235. );
  236. });
  237. var e = {
  238. on: function (t, e, i) {
  239. if ("object" == typeof t) for (var n in t) this._on(n, t[n], e);
  240. else
  241. for (var o = 0, s = (t = F(t)).length; o < s; o++)
  242. this._on(t[o], e, i);
  243. return this;
  244. },
  245. off: function (t, e, i) {
  246. if (arguments.length)
  247. if ("object" == typeof t) for (var n in t) this._off(n, t[n], e);
  248. else {
  249. t = F(t);
  250. for (
  251. var o = 1 === arguments.length, s = 0, r = t.length;
  252. s < r;
  253. s++
  254. )
  255. o ? this._off(t[s]) : this._off(t[s], e, i);
  256. }
  257. else delete this._events;
  258. return this;
  259. },
  260. _on: function (t, e, i, n) {
  261. "function" != typeof e
  262. ? console.warn("wrong listener type: " + typeof e)
  263. : !1 === this._listens(t, e, i) &&
  264. ((e = { fn: e, ctx: (i = i === this ? void 0 : i) }),
  265. n && (e.once = !0),
  266. (this._events = this._events || {}),
  267. (this._events[t] = this._events[t] || []),
  268. this._events[t].push(e));
  269. },
  270. _off: function (t, e, i) {
  271. var n, o, s;
  272. if (this._events && (n = this._events[t]))
  273. if (1 === arguments.length) {
  274. if (this._firingCount)
  275. for (o = 0, s = n.length; o < s; o++) n[o].fn = u;
  276. delete this._events[t];
  277. } else
  278. "function" != typeof e
  279. ? console.warn("wrong listener type: " + typeof e)
  280. : !1 !== (e = this._listens(t, e, i)) &&
  281. ((i = n[e]),
  282. this._firingCount &&
  283. ((i.fn = u), (this._events[t] = n = n.slice())),
  284. n.splice(e, 1));
  285. },
  286. fire: function (t, e, i) {
  287. if (this.listens(t, i)) {
  288. var n = l({}, e, {
  289. type: t,
  290. target: this,
  291. sourceTarget: (e && e.sourceTarget) || this,
  292. });
  293. if (this._events) {
  294. var o = this._events[t];
  295. if (o) {
  296. this._firingCount = this._firingCount + 1 || 1;
  297. for (var s = 0, r = o.length; s < r; s++) {
  298. var a = o[s],
  299. h = a.fn;
  300. a.once && this.off(t, h, a.ctx), h.call(a.ctx || this, n);
  301. }
  302. this._firingCount--;
  303. }
  304. }
  305. i && this._propagateEvent(n);
  306. }
  307. return this;
  308. },
  309. listens: function (t, e, i, n) {
  310. "string" != typeof t && console.warn('"string" type argument expected');
  311. var o = e,
  312. s =
  313. ("function" != typeof e && ((n = !!e), (i = o = void 0)),
  314. this._events && this._events[t]);
  315. if (s && s.length && !1 !== this._listens(t, o, i)) return !0;
  316. if (n)
  317. for (var r in this._eventParents)
  318. if (this._eventParents[r].listens(t, e, i, n)) return !0;
  319. return !1;
  320. },
  321. _listens: function (t, e, i) {
  322. if (this._events) {
  323. var n = this._events[t] || [];
  324. if (!e) return !!n.length;
  325. i === this && (i = void 0);
  326. for (var o = 0, s = n.length; o < s; o++)
  327. if (n[o].fn === e && n[o].ctx === i) return o;
  328. }
  329. return !1;
  330. },
  331. once: function (t, e, i) {
  332. if ("object" == typeof t) for (var n in t) this._on(n, t[n], e, !0);
  333. else
  334. for (var o = 0, s = (t = F(t)).length; o < s; o++)
  335. this._on(t[o], e, i, !0);
  336. return this;
  337. },
  338. addEventParent: function (t) {
  339. return (
  340. (this._eventParents = this._eventParents || {}),
  341. (this._eventParents[h(t)] = t),
  342. this
  343. );
  344. },
  345. removeEventParent: function (t) {
  346. return this._eventParents && delete this._eventParents[h(t)], this;
  347. },
  348. _propagateEvent: function (t) {
  349. for (var e in this._eventParents)
  350. this._eventParents[e].fire(
  351. t.type,
  352. l({ layer: t.target, propagatedFrom: t.target }, t),
  353. !0
  354. );
  355. },
  356. },
  357. it =
  358. ((e.addEventListener = e.on),
  359. (e.removeEventListener = e.clearAllEventListeners = e.off),
  360. (e.addOneTimeEventListener = e.once),
  361. (e.fireEvent = e.fire),
  362. (e.hasEventListeners = e.listens),
  363. et.extend(e));
  364. function p(t, e, i) {
  365. (this.x = i ? Math.round(t) : t), (this.y = i ? Math.round(e) : e);
  366. }
  367. var nt =
  368. Math.trunc ||
  369. function (t) {
  370. return 0 < t ? Math.floor(t) : Math.ceil(t);
  371. };
  372. function m(t, e, i) {
  373. return t instanceof p
  374. ? t
  375. : d(t)
  376. ? new p(t[0], t[1])
  377. : null == t
  378. ? t
  379. : "object" == typeof t && "x" in t && "y" in t
  380. ? new p(t.x, t.y)
  381. : new p(t, e, i);
  382. }
  383. function f(t, e) {
  384. if (t)
  385. for (var i = e ? [t, e] : t, n = 0, o = i.length; n < o; n++)
  386. this.extend(i[n]);
  387. }
  388. function _(t, e) {
  389. return !t || t instanceof f ? t : new f(t, e);
  390. }
  391. function s(t, e) {
  392. if (t)
  393. for (var i = e ? [t, e] : t, n = 0, o = i.length; n < o; n++)
  394. this.extend(i[n]);
  395. }
  396. function g(t, e) {
  397. return t instanceof s ? t : new s(t, e);
  398. }
  399. function v(t, e, i) {
  400. if (isNaN(t) || isNaN(e))
  401. throw new Error("Invalid LatLng object: (" + t + ", " + e + ")");
  402. (this.lat = +t), (this.lng = +e), void 0 !== i && (this.alt = +i);
  403. }
  404. function w(t, e, i) {
  405. return t instanceof v
  406. ? t
  407. : d(t) && "object" != typeof t[0]
  408. ? 3 === t.length
  409. ? new v(t[0], t[1], t[2])
  410. : 2 === t.length
  411. ? new v(t[0], t[1])
  412. : null
  413. : null == t
  414. ? t
  415. : "object" == typeof t && "lat" in t
  416. ? new v(t.lat, "lng" in t ? t.lng : t.lon, t.alt)
  417. : void 0 === e
  418. ? null
  419. : new v(t, e, i);
  420. }
  421. (p.prototype = {
  422. clone: function () {
  423. return new p(this.x, this.y);
  424. },
  425. add: function (t) {
  426. return this.clone()._add(m(t));
  427. },
  428. _add: function (t) {
  429. return (this.x += t.x), (this.y += t.y), this;
  430. },
  431. subtract: function (t) {
  432. return this.clone()._subtract(m(t));
  433. },
  434. _subtract: function (t) {
  435. return (this.x -= t.x), (this.y -= t.y), this;
  436. },
  437. divideBy: function (t) {
  438. return this.clone()._divideBy(t);
  439. },
  440. _divideBy: function (t) {
  441. return (this.x /= t), (this.y /= t), this;
  442. },
  443. multiplyBy: function (t) {
  444. return this.clone()._multiplyBy(t);
  445. },
  446. _multiplyBy: function (t) {
  447. return (this.x *= t), (this.y *= t), this;
  448. },
  449. scaleBy: function (t) {
  450. return new p(this.x * t.x, this.y * t.y);
  451. },
  452. unscaleBy: function (t) {
  453. return new p(this.x / t.x, this.y / t.y);
  454. },
  455. round: function () {
  456. return this.clone()._round();
  457. },
  458. _round: function () {
  459. return (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), this;
  460. },
  461. floor: function () {
  462. return this.clone()._floor();
  463. },
  464. _floor: function () {
  465. return (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), this;
  466. },
  467. ceil: function () {
  468. return this.clone()._ceil();
  469. },
  470. _ceil: function () {
  471. return (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), this;
  472. },
  473. trunc: function () {
  474. return this.clone()._trunc();
  475. },
  476. _trunc: function () {
  477. return (this.x = nt(this.x)), (this.y = nt(this.y)), this;
  478. },
  479. distanceTo: function (t) {
  480. var e = (t = m(t)).x - this.x,
  481. t = t.y - this.y;
  482. return Math.sqrt(e * e + t * t);
  483. },
  484. equals: function (t) {
  485. return (t = m(t)).x === this.x && t.y === this.y;
  486. },
  487. contains: function (t) {
  488. return (
  489. (t = m(t)),
  490. Math.abs(t.x) <= Math.abs(this.x) && Math.abs(t.y) <= Math.abs(this.y)
  491. );
  492. },
  493. toString: function () {
  494. return "Point(" + i(this.x) + ", " + i(this.y) + ")";
  495. },
  496. }),
  497. (f.prototype = {
  498. extend: function (t) {
  499. var e, i;
  500. if (t) {
  501. if (t instanceof p || "number" == typeof t[0] || "x" in t)
  502. e = i = m(t);
  503. else if (((e = (t = _(t)).min), (i = t.max), !e || !i)) return this;
  504. this.min || this.max
  505. ? ((this.min.x = Math.min(e.x, this.min.x)),
  506. (this.max.x = Math.max(i.x, this.max.x)),
  507. (this.min.y = Math.min(e.y, this.min.y)),
  508. (this.max.y = Math.max(i.y, this.max.y)))
  509. : ((this.min = e.clone()), (this.max = i.clone()));
  510. }
  511. return this;
  512. },
  513. getCenter: function (t) {
  514. return m(
  515. (this.min.x + this.max.x) / 2,
  516. (this.min.y + this.max.y) / 2,
  517. t
  518. );
  519. },
  520. getBottomLeft: function () {
  521. return m(this.min.x, this.max.y);
  522. },
  523. getTopRight: function () {
  524. return m(this.max.x, this.min.y);
  525. },
  526. getTopLeft: function () {
  527. return this.min;
  528. },
  529. getBottomRight: function () {
  530. return this.max;
  531. },
  532. getSize: function () {
  533. return this.max.subtract(this.min);
  534. },
  535. contains: function (t) {
  536. var e, i;
  537. return (
  538. (t = ("number" == typeof t[0] || t instanceof p ? m : _)(
  539. t
  540. )) instanceof f
  541. ? ((e = t.min), (i = t.max))
  542. : (e = i = t),
  543. e.x >= this.min.x &&
  544. i.x <= this.max.x &&
  545. e.y >= this.min.y &&
  546. i.y <= this.max.y
  547. );
  548. },
  549. intersects: function (t) {
  550. t = _(t);
  551. var e = this.min,
  552. i = this.max,
  553. n = t.min,
  554. t = t.max,
  555. o = t.x >= e.x && n.x <= i.x,
  556. t = t.y >= e.y && n.y <= i.y;
  557. return o && t;
  558. },
  559. overlaps: function (t) {
  560. t = _(t);
  561. var e = this.min,
  562. i = this.max,
  563. n = t.min,
  564. t = t.max,
  565. o = t.x > e.x && n.x < i.x,
  566. t = t.y > e.y && n.y < i.y;
  567. return o && t;
  568. },
  569. isValid: function () {
  570. return !(!this.min || !this.max);
  571. },
  572. pad: function (t) {
  573. var e = this.min,
  574. i = this.max,
  575. n = Math.abs(e.x - i.x) * t,
  576. t = Math.abs(e.y - i.y) * t;
  577. return _(m(e.x - n, e.y - t), m(i.x + n, i.y + t));
  578. },
  579. equals: function (t) {
  580. return (
  581. !!t &&
  582. ((t = _(t)),
  583. this.min.equals(t.getTopLeft()) &&
  584. this.max.equals(t.getBottomRight()))
  585. );
  586. },
  587. }),
  588. (s.prototype = {
  589. extend: function (t) {
  590. var e,
  591. i,
  592. n = this._southWest,
  593. o = this._northEast;
  594. if (t instanceof v) i = e = t;
  595. else {
  596. if (!(t instanceof s)) return t ? this.extend(w(t) || g(t)) : this;
  597. if (((e = t._southWest), (i = t._northEast), !e || !i)) return this;
  598. }
  599. return (
  600. n || o
  601. ? ((n.lat = Math.min(e.lat, n.lat)),
  602. (n.lng = Math.min(e.lng, n.lng)),
  603. (o.lat = Math.max(i.lat, o.lat)),
  604. (o.lng = Math.max(i.lng, o.lng)))
  605. : ((this._southWest = new v(e.lat, e.lng)),
  606. (this._northEast = new v(i.lat, i.lng))),
  607. this
  608. );
  609. },
  610. pad: function (t) {
  611. var e = this._southWest,
  612. i = this._northEast,
  613. n = Math.abs(e.lat - i.lat) * t,
  614. t = Math.abs(e.lng - i.lng) * t;
  615. return new s(new v(e.lat - n, e.lng - t), new v(i.lat + n, i.lng + t));
  616. },
  617. getCenter: function () {
  618. return new v(
  619. (this._southWest.lat + this._northEast.lat) / 2,
  620. (this._southWest.lng + this._northEast.lng) / 2
  621. );
  622. },
  623. getSouthWest: function () {
  624. return this._southWest;
  625. },
  626. getNorthEast: function () {
  627. return this._northEast;
  628. },
  629. getNorthWest: function () {
  630. return new v(this.getNorth(), this.getWest());
  631. },
  632. getSouthEast: function () {
  633. return new v(this.getSouth(), this.getEast());
  634. },
  635. getWest: function () {
  636. return this._southWest.lng;
  637. },
  638. getSouth: function () {
  639. return this._southWest.lat;
  640. },
  641. getEast: function () {
  642. return this._northEast.lng;
  643. },
  644. getNorth: function () {
  645. return this._northEast.lat;
  646. },
  647. contains: function (t) {
  648. t = ("number" == typeof t[0] || t instanceof v || "lat" in t ? w : g)(
  649. t
  650. );
  651. var e,
  652. i,
  653. n = this._southWest,
  654. o = this._northEast;
  655. return (
  656. t instanceof s
  657. ? ((e = t.getSouthWest()), (i = t.getNorthEast()))
  658. : (e = i = t),
  659. e.lat >= n.lat && i.lat <= o.lat && e.lng >= n.lng && i.lng <= o.lng
  660. );
  661. },
  662. intersects: function (t) {
  663. t = g(t);
  664. var e = this._southWest,
  665. i = this._northEast,
  666. n = t.getSouthWest(),
  667. t = t.getNorthEast(),
  668. o = t.lat >= e.lat && n.lat <= i.lat,
  669. t = t.lng >= e.lng && n.lng <= i.lng;
  670. return o && t;
  671. },
  672. overlaps: function (t) {
  673. t = g(t);
  674. var e = this._southWest,
  675. i = this._northEast,
  676. n = t.getSouthWest(),
  677. t = t.getNorthEast(),
  678. o = t.lat > e.lat && n.lat < i.lat,
  679. t = t.lng > e.lng && n.lng < i.lng;
  680. return o && t;
  681. },
  682. toBBoxString: function () {
  683. return [
  684. this.getWest(),
  685. this.getSouth(),
  686. this.getEast(),
  687. this.getNorth(),
  688. ].join(",");
  689. },
  690. equals: function (t, e) {
  691. return (
  692. !!t &&
  693. ((t = g(t)),
  694. this._southWest.equals(t.getSouthWest(), e) &&
  695. this._northEast.equals(t.getNorthEast(), e))
  696. );
  697. },
  698. isValid: function () {
  699. return !(!this._southWest || !this._northEast);
  700. },
  701. });
  702. var ot = {
  703. latLngToPoint: function (t, e) {
  704. (t = this.projection.project(t)), (e = this.scale(e));
  705. return this.transformation._transform(t, e);
  706. },
  707. pointToLatLng: function (t, e) {
  708. (e = this.scale(e)), (t = this.transformation.untransform(t, e));
  709. return this.projection.unproject(t);
  710. },
  711. project: function (t) {
  712. return this.projection.project(t);
  713. },
  714. unproject: function (t) {
  715. return this.projection.unproject(t);
  716. },
  717. scale: function (t) {
  718. return 256 * Math.pow(2, t);
  719. },
  720. zoom: function (t) {
  721. return Math.log(t / 256) / Math.LN2;
  722. },
  723. getProjectedBounds: function (t) {
  724. var e;
  725. return this.infinite
  726. ? null
  727. : ((e = this.projection.bounds),
  728. (t = this.scale(t)),
  729. new f(
  730. this.transformation.transform(e.min, t),
  731. this.transformation.transform(e.max, t)
  732. ));
  733. },
  734. infinite: !(v.prototype = {
  735. equals: function (t, e) {
  736. return (
  737. !!t &&
  738. ((t = w(t)),
  739. Math.max(Math.abs(this.lat - t.lat), Math.abs(this.lng - t.lng)) <=
  740. (void 0 === e ? 1e-9 : e))
  741. );
  742. },
  743. toString: function (t) {
  744. return "LatLng(" + i(this.lat, t) + ", " + i(this.lng, t) + ")";
  745. },
  746. distanceTo: function (t) {
  747. return st.distance(this, w(t));
  748. },
  749. wrap: function () {
  750. return st.wrapLatLng(this);
  751. },
  752. toBounds: function (t) {
  753. var t = (180 * t) / 40075017,
  754. e = t / Math.cos((Math.PI / 180) * this.lat);
  755. return g([this.lat - t, this.lng - e], [this.lat + t, this.lng + e]);
  756. },
  757. clone: function () {
  758. return new v(this.lat, this.lng, this.alt);
  759. },
  760. }),
  761. wrapLatLng: function (t) {
  762. var e = this.wrapLng ? H(t.lng, this.wrapLng, !0) : t.lng;
  763. return new v(
  764. this.wrapLat ? H(t.lat, this.wrapLat, !0) : t.lat,
  765. e,
  766. t.alt
  767. );
  768. },
  769. wrapLatLngBounds: function (t) {
  770. var e = t.getCenter(),
  771. i = this.wrapLatLng(e),
  772. n = e.lat - i.lat,
  773. e = e.lng - i.lng;
  774. return 0 == n && 0 == e
  775. ? t
  776. : ((i = t.getSouthWest()),
  777. (t = t.getNorthEast()),
  778. new s(new v(i.lat - n, i.lng - e), new v(t.lat - n, t.lng - e)));
  779. },
  780. },
  781. st = l({}, ot, {
  782. wrapLng: [-180, 180],
  783. R: 6371e3,
  784. distance: function (t, e) {
  785. var i = Math.PI / 180,
  786. n = t.lat * i,
  787. o = e.lat * i,
  788. s = Math.sin(((e.lat - t.lat) * i) / 2),
  789. e = Math.sin(((e.lng - t.lng) * i) / 2),
  790. t = s * s + Math.cos(n) * Math.cos(o) * e * e,
  791. i = 2 * Math.atan2(Math.sqrt(t), Math.sqrt(1 - t));
  792. return this.R * i;
  793. },
  794. }),
  795. rt = 6378137,
  796. rt = {
  797. R: rt,
  798. MAX_LATITUDE: 85.0511287798,
  799. project: function (t) {
  800. var e = Math.PI / 180,
  801. i = this.MAX_LATITUDE,
  802. i = Math.max(Math.min(i, t.lat), -i),
  803. i = Math.sin(i * e);
  804. return new p(
  805. this.R * t.lng * e,
  806. (this.R * Math.log((1 + i) / (1 - i))) / 2
  807. );
  808. },
  809. unproject: function (t) {
  810. var e = 180 / Math.PI;
  811. return new v(
  812. (2 * Math.atan(Math.exp(t.y / this.R)) - Math.PI / 2) * e,
  813. (t.x * e) / this.R
  814. );
  815. },
  816. bounds: new f([-(rt = rt * Math.PI), -rt], [rt, rt]),
  817. };
  818. function at(t, e, i, n) {
  819. d(t)
  820. ? ((this._a = t[0]), (this._b = t[1]), (this._c = t[2]), (this._d = t[3]))
  821. : ((this._a = t), (this._b = e), (this._c = i), (this._d = n));
  822. }
  823. function ht(t, e, i, n) {
  824. return new at(t, e, i, n);
  825. }
  826. at.prototype = {
  827. transform: function (t, e) {
  828. return this._transform(t.clone(), e);
  829. },
  830. _transform: function (t, e) {
  831. return (
  832. (t.x = (e = e || 1) * (this._a * t.x + this._b)),
  833. (t.y = e * (this._c * t.y + this._d)),
  834. t
  835. );
  836. },
  837. untransform: function (t, e) {
  838. return new p(
  839. (t.x / (e = e || 1) - this._b) / this._a,
  840. (t.y / e - this._d) / this._c
  841. );
  842. },
  843. };
  844. var lt = l({}, st, {
  845. code: "EPSG:3857",
  846. projection: rt,
  847. transformation: ht((lt = 0.5 / (Math.PI * rt.R)), 0.5, -lt, 0.5),
  848. }),
  849. ut = l({}, lt, { code: "EPSG:900913" });
  850. function ct(t) {
  851. return document.createElementNS("http://www.w3.org/2000/svg", t);
  852. }
  853. function dt(t, e) {
  854. for (var i, n, o, s, r = "", a = 0, h = t.length; a < h; a++) {
  855. for (i = 0, n = (o = t[a]).length; i < n; i++)
  856. r += (i ? "L" : "M") + (s = o[i]).x + " " + s.y;
  857. r += e ? (b.svg ? "z" : "x") : "";
  858. }
  859. return r || "M0 0";
  860. }
  861. var _t = document.documentElement.style,
  862. pt = "ActiveXObject" in window,
  863. mt = pt && !document.addEventListener,
  864. n = "msLaunchUri" in navigator && !("documentMode" in document),
  865. ft = y("webkit"),
  866. gt = y("android"),
  867. vt = y("android 2") || y("android 3"),
  868. yt = parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1], 10),
  869. yt = gt && y("Google") && yt < 537 && !("AudioNode" in window),
  870. xt = !!window.opera,
  871. wt = !n && y("chrome"),
  872. bt = y("gecko") && !ft && !xt && !pt,
  873. Pt = !wt && y("safari"),
  874. Lt = y("phantom"),
  875. o = "OTransition" in _t,
  876. Tt = 0 === navigator.platform.indexOf("Win"),
  877. Mt = pt && "transition" in _t,
  878. zt =
  879. "WebKitCSSMatrix" in window &&
  880. "m11" in new window.WebKitCSSMatrix() &&
  881. !vt,
  882. _t = "MozPerspective" in _t,
  883. Ct = !window.L_DISABLE_3D && (Mt || zt || _t) && !o && !Lt,
  884. Zt = "undefined" != typeof orientation || y("mobile"),
  885. St = Zt && ft,
  886. Et = Zt && zt,
  887. kt = !window.PointerEvent && window.MSPointerEvent,
  888. Ot = !(!window.PointerEvent && !kt),
  889. At = "ontouchstart" in window || !!window.TouchEvent,
  890. Bt = !window.L_NO_TOUCH && (At || Ot),
  891. It = Zt && xt,
  892. Rt = Zt && bt,
  893. Nt =
  894. 1 <
  895. (window.devicePixelRatio ||
  896. window.screen.deviceXDPI / window.screen.logicalXDPI),
  897. Dt = (function () {
  898. var t = !1;
  899. try {
  900. var e = Object.defineProperty({}, "passive", {
  901. get: function () {
  902. t = !0;
  903. },
  904. });
  905. window.addEventListener("testPassiveEventSupport", u, e),
  906. window.removeEventListener("testPassiveEventSupport", u, e);
  907. } catch (t) {}
  908. return t;
  909. })(),
  910. jt = !!document.createElement("canvas").getContext,
  911. Ht = !(!document.createElementNS || !ct("svg").createSVGRect),
  912. Wt =
  913. !!Ht &&
  914. (((Wt = document.createElement("div")).innerHTML = "<svg/>"),
  915. "http://www.w3.org/2000/svg" ===
  916. (Wt.firstChild && Wt.firstChild.namespaceURI));
  917. function y(t) {
  918. return 0 <= navigator.userAgent.toLowerCase().indexOf(t);
  919. }
  920. var b = {
  921. ie: pt,
  922. ielt9: mt,
  923. edge: n,
  924. webkit: ft,
  925. android: gt,
  926. android23: vt,
  927. androidStock: yt,
  928. opera: xt,
  929. chrome: wt,
  930. gecko: bt,
  931. safari: Pt,
  932. phantom: Lt,
  933. opera12: o,
  934. win: Tt,
  935. ie3d: Mt,
  936. webkit3d: zt,
  937. gecko3d: _t,
  938. any3d: Ct,
  939. mobile: Zt,
  940. mobileWebkit: St,
  941. mobileWebkit3d: Et,
  942. msPointer: kt,
  943. pointer: Ot,
  944. touch: Bt,
  945. touchNative: At,
  946. mobileOpera: It,
  947. mobileGecko: Rt,
  948. retina: Nt,
  949. passiveEvents: Dt,
  950. canvas: jt,
  951. svg: Ht,
  952. vml:
  953. !Ht &&
  954. (function () {
  955. try {
  956. var t = document.createElement("div"),
  957. e = ((t.innerHTML = '<v:shape adj="1"/>'), t.firstChild);
  958. return (
  959. (e.style.behavior = "url(#default#VML)"),
  960. e && "object" == typeof e.adj
  961. );
  962. } catch (t) {
  963. return !1;
  964. }
  965. })(),
  966. inlineSvg: Wt,
  967. mac: 0 === navigator.platform.indexOf("Mac"),
  968. linux: 0 === navigator.platform.indexOf("Linux"),
  969. },
  970. Ft = b.msPointer ? "MSPointerDown" : "pointerdown",
  971. Ut = b.msPointer ? "MSPointerMove" : "pointermove",
  972. Vt = b.msPointer ? "MSPointerUp" : "pointerup",
  973. qt = b.msPointer ? "MSPointerCancel" : "pointercancel",
  974. Gt = { touchstart: Ft, touchmove: Ut, touchend: Vt, touchcancel: qt },
  975. Kt = {
  976. touchstart: function (t, e) {
  977. e.MSPOINTER_TYPE_TOUCH &&
  978. e.pointerType === e.MSPOINTER_TYPE_TOUCH &&
  979. O(e);
  980. ee(t, e);
  981. },
  982. touchmove: ee,
  983. touchend: ee,
  984. touchcancel: ee,
  985. },
  986. Yt = {},
  987. Xt = !1;
  988. function Jt(t, e, i) {
  989. return (
  990. "touchstart" !== e ||
  991. Xt ||
  992. (document.addEventListener(Ft, $t, !0),
  993. document.addEventListener(Ut, Qt, !0),
  994. document.addEventListener(Vt, te, !0),
  995. document.addEventListener(qt, te, !0),
  996. (Xt = !0)),
  997. Kt[e]
  998. ? ((i = Kt[e].bind(this, i)), t.addEventListener(Gt[e], i, !1), i)
  999. : (console.warn("wrong event specified:", e), u)
  1000. );
  1001. }
  1002. function $t(t) {
  1003. Yt[t.pointerId] = t;
  1004. }
  1005. function Qt(t) {
  1006. Yt[t.pointerId] && (Yt[t.pointerId] = t);
  1007. }
  1008. function te(t) {
  1009. delete Yt[t.pointerId];
  1010. }
  1011. function ee(t, e) {
  1012. if (e.pointerType !== (e.MSPOINTER_TYPE_MOUSE || "mouse")) {
  1013. for (var i in ((e.touches = []), Yt)) e.touches.push(Yt[i]);
  1014. (e.changedTouches = [e]), t(e);
  1015. }
  1016. }
  1017. var ie = 200;
  1018. function ne(t, i) {
  1019. t.addEventListener("dblclick", i);
  1020. var n,
  1021. o = 0;
  1022. function e(t) {
  1023. var e;
  1024. 1 !== t.detail
  1025. ? (n = t.detail)
  1026. : "mouse" === t.pointerType ||
  1027. (t.sourceCapabilities && !t.sourceCapabilities.firesTouchEvents) ||
  1028. ((e = Ne(t)).some(function (t) {
  1029. return t instanceof HTMLLabelElement && t.attributes.for;
  1030. }) &&
  1031. !e.some(function (t) {
  1032. return (
  1033. t instanceof HTMLInputElement || t instanceof HTMLSelectElement
  1034. );
  1035. })) ||
  1036. ((e = Date.now()) - o <= ie
  1037. ? 2 === ++n &&
  1038. i(
  1039. (function (t) {
  1040. var e,
  1041. i,
  1042. n = {};
  1043. for (i in t) (e = t[i]), (n[i] = e && e.bind ? e.bind(t) : e);
  1044. return (
  1045. ((t = n).type = "dblclick"),
  1046. (n.detail = 2),
  1047. (n.isTrusted = !1),
  1048. (n._simulated = !0),
  1049. n
  1050. );
  1051. })(t)
  1052. )
  1053. : (n = 1),
  1054. (o = e));
  1055. }
  1056. return t.addEventListener("click", e), { dblclick: i, simDblclick: e };
  1057. }
  1058. var oe,
  1059. se,
  1060. re,
  1061. ae,
  1062. he,
  1063. le,
  1064. ue = we([
  1065. "transform",
  1066. "webkitTransform",
  1067. "OTransform",
  1068. "MozTransform",
  1069. "msTransform",
  1070. ]),
  1071. ce = we([
  1072. "webkitTransition",
  1073. "transition",
  1074. "OTransition",
  1075. "MozTransition",
  1076. "msTransition",
  1077. ]),
  1078. de =
  1079. "webkitTransition" === ce || "OTransition" === ce
  1080. ? ce + "End"
  1081. : "transitionend";
  1082. function _e(t) {
  1083. return "string" == typeof t ? document.getElementById(t) : t;
  1084. }
  1085. function pe(t, e) {
  1086. var i = t.style[e] || (t.currentStyle && t.currentStyle[e]);
  1087. return "auto" ===
  1088. (i =
  1089. (i && "auto" !== i) || !document.defaultView
  1090. ? i
  1091. : (t = document.defaultView.getComputedStyle(t, null))
  1092. ? t[e]
  1093. : null)
  1094. ? null
  1095. : i;
  1096. }
  1097. function P(t, e, i) {
  1098. t = document.createElement(t);
  1099. return (t.className = e || ""), i && i.appendChild(t), t;
  1100. }
  1101. function T(t) {
  1102. var e = t.parentNode;
  1103. e && e.removeChild(t);
  1104. }
  1105. function me(t) {
  1106. for (; t.firstChild; ) t.removeChild(t.firstChild);
  1107. }
  1108. function fe(t) {
  1109. var e = t.parentNode;
  1110. e && e.lastChild !== t && e.appendChild(t);
  1111. }
  1112. function ge(t) {
  1113. var e = t.parentNode;
  1114. e && e.firstChild !== t && e.insertBefore(t, e.firstChild);
  1115. }
  1116. function ve(t, e) {
  1117. return void 0 !== t.classList
  1118. ? t.classList.contains(e)
  1119. : 0 < (t = xe(t)).length && new RegExp("(^|\\s)" + e + "(\\s|$)").test(t);
  1120. }
  1121. function M(t, e) {
  1122. var i;
  1123. if (void 0 !== t.classList)
  1124. for (var n = F(e), o = 0, s = n.length; o < s; o++) t.classList.add(n[o]);
  1125. else ve(t, e) || ye(t, ((i = xe(t)) ? i + " " : "") + e);
  1126. }
  1127. function z(t, e) {
  1128. void 0 !== t.classList
  1129. ? t.classList.remove(e)
  1130. : ye(t, W((" " + xe(t) + " ").replace(" " + e + " ", " ")));
  1131. }
  1132. function ye(t, e) {
  1133. void 0 === t.className.baseVal
  1134. ? (t.className = e)
  1135. : (t.className.baseVal = e);
  1136. }
  1137. function xe(t) {
  1138. return void 0 ===
  1139. (t = t.correspondingElement ? t.correspondingElement : t).className
  1140. .baseVal
  1141. ? t.className
  1142. : t.className.baseVal;
  1143. }
  1144. function C(t, e) {
  1145. if ("opacity" in t.style) t.style.opacity = e;
  1146. else if ("filter" in t.style) {
  1147. var i = !1,
  1148. n = "DXImageTransform.Microsoft.Alpha";
  1149. try {
  1150. i = t.filters.item(n);
  1151. } catch (t) {
  1152. if (1 === e) return;
  1153. }
  1154. (e = Math.round(100 * e)),
  1155. i
  1156. ? ((i.Enabled = 100 !== e), (i.Opacity = e))
  1157. : (t.style.filter += " progid:" + n + "(opacity=" + e + ")");
  1158. }
  1159. }
  1160. function we(t) {
  1161. for (var e = document.documentElement.style, i = 0; i < t.length; i++)
  1162. if (t[i] in e) return t[i];
  1163. return !1;
  1164. }
  1165. function be(t, e, i) {
  1166. e = e || new p(0, 0);
  1167. t.style[ue] =
  1168. (b.ie3d
  1169. ? "translate(" + e.x + "px," + e.y + "px)"
  1170. : "translate3d(" + e.x + "px," + e.y + "px,0)") +
  1171. (i ? " scale(" + i + ")" : "");
  1172. }
  1173. function Z(t, e) {
  1174. (t._leaflet_pos = e),
  1175. b.any3d
  1176. ? be(t, e)
  1177. : ((t.style.left = e.x + "px"), (t.style.top = e.y + "px"));
  1178. }
  1179. function Pe(t) {
  1180. return t._leaflet_pos || new p(0, 0);
  1181. }
  1182. function Le() {
  1183. S(window, "dragstart", O);
  1184. }
  1185. function Te() {
  1186. k(window, "dragstart", O);
  1187. }
  1188. function Me(t) {
  1189. for (; -1 === t.tabIndex; ) t = t.parentNode;
  1190. t.style &&
  1191. (ze(),
  1192. (le = (he = t).style.outlineStyle),
  1193. (t.style.outlineStyle = "none"),
  1194. S(window, "keydown", ze));
  1195. }
  1196. function ze() {
  1197. he &&
  1198. ((he.style.outlineStyle = le),
  1199. (le = he = void 0),
  1200. k(window, "keydown", ze));
  1201. }
  1202. function Ce(t) {
  1203. for (
  1204. ;
  1205. !(
  1206. ((t = t.parentNode).offsetWidth && t.offsetHeight) ||
  1207. t === document.body
  1208. );
  1209.  
  1210. );
  1211. return t;
  1212. }
  1213. function Ze(t) {
  1214. var e = t.getBoundingClientRect();
  1215. return {
  1216. x: e.width / t.offsetWidth || 1,
  1217. y: e.height / t.offsetHeight || 1,
  1218. boundingClientRect: e,
  1219. };
  1220. }
  1221. ae =
  1222. "onselectstart" in document
  1223. ? ((re = function () {
  1224. S(window, "selectstart", O);
  1225. }),
  1226. function () {
  1227. k(window, "selectstart", O);
  1228. })
  1229. : ((se = we([
  1230. "userSelect",
  1231. "WebkitUserSelect",
  1232. "OUserSelect",
  1233. "MozUserSelect",
  1234. "msUserSelect",
  1235. ])),
  1236. (re = function () {
  1237. var t;
  1238. se &&
  1239. ((t = document.documentElement.style),
  1240. (oe = t[se]),
  1241. (t[se] = "none"));
  1242. }),
  1243. function () {
  1244. se && ((document.documentElement.style[se] = oe), (oe = void 0));
  1245. });
  1246. pt = {
  1247. __proto__: null,
  1248. TRANSFORM: ue,
  1249. TRANSITION: ce,
  1250. TRANSITION_END: de,
  1251. get: _e,
  1252. getStyle: pe,
  1253. create: P,
  1254. remove: T,
  1255. empty: me,
  1256. toFront: fe,
  1257. toBack: ge,
  1258. hasClass: ve,
  1259. addClass: M,
  1260. removeClass: z,
  1261. setClass: ye,
  1262. getClass: xe,
  1263. setOpacity: C,
  1264. testProp: we,
  1265. setTransform: be,
  1266. setPosition: Z,
  1267. getPosition: Pe,
  1268. get disableTextSelection() {
  1269. return re;
  1270. },
  1271. get enableTextSelection() {
  1272. return ae;
  1273. },
  1274. disableImageDrag: Le,
  1275. enableImageDrag: Te,
  1276. preventOutline: Me,
  1277. restoreOutline: ze,
  1278. getSizedParentNode: Ce,
  1279. getScale: Ze,
  1280. };
  1281. function S(t, e, i, n) {
  1282. if (e && "object" == typeof e) for (var o in e) ke(t, o, e[o], i);
  1283. else for (var s = 0, r = (e = F(e)).length; s < r; s++) ke(t, e[s], i, n);
  1284. return this;
  1285. }
  1286. var E = "_leaflet_events";
  1287. function k(t, e, i, n) {
  1288. if (1 === arguments.length) Se(t), delete t[E];
  1289. else if (e && "object" == typeof e) for (var o in e) Oe(t, o, e[o], i);
  1290. else if (((e = F(e)), 2 === arguments.length))
  1291. Se(t, function (t) {
  1292. return -1 !== G(e, t);
  1293. });
  1294. else for (var s = 0, r = e.length; s < r; s++) Oe(t, e[s], i, n);
  1295. return this;
  1296. }
  1297. function Se(t, e) {
  1298. for (var i in t[E]) {
  1299. var n = i.split(/\d/)[0];
  1300. (e && !e(n)) || Oe(t, n, null, null, i);
  1301. }
  1302. }
  1303. var Ee = {
  1304. mouseenter: "mouseover",
  1305. mouseleave: "mouseout",
  1306. wheel: !("onwheel" in window) && "mousewheel",
  1307. };
  1308. function ke(e, t, i, n) {
  1309. var o,
  1310. s,
  1311. r = t + h(i) + (n ? "_" + h(n) : "");
  1312. (e[E] && e[E][r]) ||
  1313. ((s = o =
  1314. function (t) {
  1315. return i.call(n || e, t || window.event);
  1316. }),
  1317. !b.touchNative && b.pointer && 0 === t.indexOf("touch")
  1318. ? (o = Jt(e, t, o))
  1319. : b.touch && "dblclick" === t
  1320. ? (o = ne(e, o))
  1321. : "addEventListener" in e
  1322. ? "touchstart" === t ||
  1323. "touchmove" === t ||
  1324. "wheel" === t ||
  1325. "mousewheel" === t
  1326. ? e.addEventListener(
  1327. Ee[t] || t,
  1328. o,
  1329. !!b.passiveEvents && { passive: !1 }
  1330. )
  1331. : "mouseenter" === t || "mouseleave" === t
  1332. ? e.addEventListener(
  1333. Ee[t],
  1334. (o = function (t) {
  1335. (t = t || window.event), We(e, t) && s(t);
  1336. }),
  1337. !1
  1338. )
  1339. : e.addEventListener(t, s, !1)
  1340. : e.attachEvent("on" + t, o),
  1341. (e[E] = e[E] || {}),
  1342. (e[E][r] = o));
  1343. }
  1344. function Oe(t, e, i, n, o) {
  1345. o = o || e + h(i) + (n ? "_" + h(n) : "");
  1346. var s,
  1347. r,
  1348. i = t[E] && t[E][o];
  1349. i &&
  1350. (!b.touchNative && b.pointer && 0 === e.indexOf("touch")
  1351. ? ((n = t),
  1352. (r = i),
  1353. Gt[(s = e)]
  1354. ? n.removeEventListener(Gt[s], r, !1)
  1355. : console.warn("wrong event specified:", s))
  1356. : b.touch && "dblclick" === e
  1357. ? ((n = i),
  1358. (r = t).removeEventListener("dblclick", n.dblclick),
  1359. r.removeEventListener("click", n.simDblclick))
  1360. : "removeEventListener" in t
  1361. ? t.removeEventListener(Ee[e] || e, i, !1)
  1362. : t.detachEvent("on" + e, i),
  1363. (t[E][o] = null));
  1364. }
  1365. function Ae(t) {
  1366. return (
  1367. t.stopPropagation
  1368. ? t.stopPropagation()
  1369. : t.originalEvent
  1370. ? (t.originalEvent._stopped = !0)
  1371. : (t.cancelBubble = !0),
  1372. this
  1373. );
  1374. }
  1375. function Be(t) {
  1376. return ke(t, "wheel", Ae), this;
  1377. }
  1378. function Ie(t) {
  1379. return (
  1380. S(t, "mousedown touchstart dblclick contextmenu", Ae),
  1381. (t._leaflet_disable_click = !0),
  1382. this
  1383. );
  1384. }
  1385. function O(t) {
  1386. return t.preventDefault ? t.preventDefault() : (t.returnValue = !1), this;
  1387. }
  1388. function Re(t) {
  1389. return O(t), Ae(t), this;
  1390. }
  1391. function Ne(t) {
  1392. if (t.composedPath) return t.composedPath();
  1393. for (var e = [], i = t.target; i; ) e.push(i), (i = i.parentNode);
  1394. return e;
  1395. }
  1396. function De(t, e) {
  1397. var i, n;
  1398. return e
  1399. ? ((n = (i = Ze(e)).boundingClientRect),
  1400. new p(
  1401. (t.clientX - n.left) / i.x - e.clientLeft,
  1402. (t.clientY - n.top) / i.y - e.clientTop
  1403. ))
  1404. : new p(t.clientX, t.clientY);
  1405. }
  1406. var je =
  1407. b.linux && b.chrome
  1408. ? window.devicePixelRatio
  1409. : b.mac
  1410. ? 3 * window.devicePixelRatio
  1411. : 0 < window.devicePixelRatio
  1412. ? 2 * window.devicePixelRatio
  1413. : 1;
  1414. function He(t) {
  1415. return b.edge
  1416. ? t.wheelDeltaY / 2
  1417. : t.deltaY && 0 === t.deltaMode
  1418. ? -t.deltaY / je
  1419. : t.deltaY && 1 === t.deltaMode
  1420. ? 20 * -t.deltaY
  1421. : t.deltaY && 2 === t.deltaMode
  1422. ? 60 * -t.deltaY
  1423. : t.deltaX || t.deltaZ
  1424. ? 0
  1425. : t.wheelDelta
  1426. ? (t.wheelDeltaY || t.wheelDelta) / 2
  1427. : t.detail && Math.abs(t.detail) < 32765
  1428. ? 20 * -t.detail
  1429. : t.detail
  1430. ? (t.detail / -32765) * 60
  1431. : 0;
  1432. }
  1433. function We(t, e) {
  1434. var i = e.relatedTarget;
  1435. if (!i) return !0;
  1436. try {
  1437. for (; i && i !== t; ) i = i.parentNode;
  1438. } catch (t) {
  1439. return !1;
  1440. }
  1441. return i !== t;
  1442. }
  1443. var mt = {
  1444. __proto__: null,
  1445. on: S,
  1446. off: k,
  1447. stopPropagation: Ae,
  1448. disableScrollPropagation: Be,
  1449. disableClickPropagation: Ie,
  1450. preventDefault: O,
  1451. stop: Re,
  1452. getPropagationPath: Ne,
  1453. getMousePosition: De,
  1454. getWheelDelta: He,
  1455. isExternalTarget: We,
  1456. addListener: S,
  1457. removeListener: k,
  1458. },
  1459. Fe = it.extend({
  1460. run: function (t, e, i, n) {
  1461. this.stop(),
  1462. (this._el = t),
  1463. (this._inProgress = !0),
  1464. (this._duration = i || 0.25),
  1465. (this._easeOutPower = 1 / Math.max(n || 0.5, 0.2)),
  1466. (this._startPos = Pe(t)),
  1467. (this._offset = e.subtract(this._startPos)),
  1468. (this._startTime = +new Date()),
  1469. this.fire("start"),
  1470. this._animate();
  1471. },
  1472. stop: function () {
  1473. this._inProgress && (this._step(!0), this._complete());
  1474. },
  1475. _animate: function () {
  1476. (this._animId = x(this._animate, this)), this._step();
  1477. },
  1478. _step: function (t) {
  1479. var e = +new Date() - this._startTime,
  1480. i = 1e3 * this._duration;
  1481. e < i
  1482. ? this._runFrame(this._easeOut(e / i), t)
  1483. : (this._runFrame(1), this._complete());
  1484. },
  1485. _runFrame: function (t, e) {
  1486. t = this._startPos.add(this._offset.multiplyBy(t));
  1487. e && t._round(), Z(this._el, t), this.fire("step");
  1488. },
  1489. _complete: function () {
  1490. r(this._animId), (this._inProgress = !1), this.fire("end");
  1491. },
  1492. _easeOut: function (t) {
  1493. return 1 - Math.pow(1 - t, this._easeOutPower);
  1494. },
  1495. }),
  1496. A = it.extend({
  1497. options: {
  1498. crs: lt,
  1499. center: void 0,
  1500. zoom: void 0,
  1501. minZoom: void 0,
  1502. maxZoom: void 0,
  1503. layers: [],
  1504. maxBounds: void 0,
  1505. renderer: void 0,
  1506. zoomAnimation: !0,
  1507. zoomAnimationThreshold: 4,
  1508. fadeAnimation: !0,
  1509. markerZoomAnimation: !0,
  1510. transform3DLimit: 8388608,
  1511. zoomSnap: 1,
  1512. zoomDelta: 1,
  1513. trackResize: !0,
  1514. },
  1515. initialize: function (t, e) {
  1516. (e = c(this, e)),
  1517. (this._handlers = []),
  1518. (this._layers = {}),
  1519. (this._zoomBoundLayers = {}),
  1520. (this._sizeChanged = !0),
  1521. this._initContainer(t),
  1522. this._initLayout(),
  1523. (this._onResize = a(this._onResize, this)),
  1524. this._initEvents(),
  1525. e.maxBounds && this.setMaxBounds(e.maxBounds),
  1526. void 0 !== e.zoom && (this._zoom = this._limitZoom(e.zoom)),
  1527. e.center &&
  1528. void 0 !== e.zoom &&
  1529. this.setView(w(e.center), e.zoom, { reset: !0 }),
  1530. this.callInitHooks(),
  1531. (this._zoomAnimated =
  1532. ce && b.any3d && !b.mobileOpera && this.options.zoomAnimation),
  1533. this._zoomAnimated &&
  1534. (this._createAnimProxy(),
  1535. S(this._proxy, de, this._catchTransitionEnd, this)),
  1536. this._addLayers(this.options.layers);
  1537. },
  1538. setView: function (t, e, i) {
  1539. if (
  1540. ((e = void 0 === e ? this._zoom : this._limitZoom(e)),
  1541. (t = this._limitCenter(w(t), e, this.options.maxBounds)),
  1542. (i = i || {}),
  1543. this._stop(),
  1544. this._loaded && !i.reset && !0 !== i) &&
  1545. (void 0 !== i.animate &&
  1546. ((i.zoom = l({ animate: i.animate }, i.zoom)),
  1547. (i.pan = l({ animate: i.animate, duration: i.duration }, i.pan))),
  1548. this._zoom !== e
  1549. ? this._tryAnimatedZoom && this._tryAnimatedZoom(t, e, i.zoom)
  1550. : this._tryAnimatedPan(t, i.pan))
  1551. )
  1552. return clearTimeout(this._sizeTimer), this;
  1553. return this._resetView(t, e, i.pan && i.pan.noMoveStart), this;
  1554. },
  1555. setZoom: function (t, e) {
  1556. return this._loaded
  1557. ? this.setView(this.getCenter(), t, { zoom: e })
  1558. : ((this._zoom = t), this);
  1559. },
  1560. zoomIn: function (t, e) {
  1561. return (
  1562. (t = t || (b.any3d ? this.options.zoomDelta : 1)),
  1563. this.setZoom(this._zoom + t, e)
  1564. );
  1565. },
  1566. zoomOut: function (t, e) {
  1567. return (
  1568. (t = t || (b.any3d ? this.options.zoomDelta : 1)),
  1569. this.setZoom(this._zoom - t, e)
  1570. );
  1571. },
  1572. setZoomAround: function (t, e, i) {
  1573. var n = this.getZoomScale(e),
  1574. o = this.getSize().divideBy(2),
  1575. t = (t instanceof p ? t : this.latLngToContainerPoint(t))
  1576. .subtract(o)
  1577. .multiplyBy(1 - 1 / n),
  1578. n = this.containerPointToLatLng(o.add(t));
  1579. return this.setView(n, e, { zoom: i });
  1580. },
  1581. _getBoundsCenterZoom: function (t, e) {
  1582. (e = e || {}), (t = t.getBounds ? t.getBounds() : g(t));
  1583. var i = m(e.paddingTopLeft || e.padding || [0, 0]),
  1584. n = m(e.paddingBottomRight || e.padding || [0, 0]),
  1585. o = this.getBoundsZoom(t, !1, i.add(n));
  1586. return (o =
  1587. "number" == typeof e.maxZoom ? Math.min(e.maxZoom, o) : o) ===
  1588. 1 / 0
  1589. ? { center: t.getCenter(), zoom: o }
  1590. : ((e = n.subtract(i).divideBy(2)),
  1591. (n = this.project(t.getSouthWest(), o)),
  1592. (i = this.project(t.getNorthEast(), o)),
  1593. {
  1594. center: this.unproject(n.add(i).divideBy(2).add(e), o),
  1595. zoom: o,
  1596. });
  1597. },
  1598. fitBounds: function (t, e) {
  1599. if ((t = g(t)).isValid())
  1600. return (
  1601. (t = this._getBoundsCenterZoom(t, e)),
  1602. this.setView(t.center, t.zoom, e)
  1603. );
  1604. throw new Error("Bounds are not valid.");
  1605. },
  1606. fitWorld: function (t) {
  1607. return this.fitBounds(
  1608. [
  1609. [-90, -180],
  1610. [90, 180],
  1611. ],
  1612. t
  1613. );
  1614. },
  1615. panTo: function (t, e) {
  1616. return this.setView(t, this._zoom, { pan: e });
  1617. },
  1618. panBy: function (t, e) {
  1619. var i;
  1620. return (
  1621. (e = e || {}),
  1622. (t = m(t).round()).x || t.y
  1623. ? (!0 === e.animate || this.getSize().contains(t)
  1624. ? (this._panAnim ||
  1625. ((this._panAnim = new Fe()),
  1626. this._panAnim.on(
  1627. {
  1628. step: this._onPanTransitionStep,
  1629. end: this._onPanTransitionEnd,
  1630. },
  1631. this
  1632. )),
  1633. e.noMoveStart || this.fire("movestart"),
  1634. !1 !== e.animate
  1635. ? (M(this._mapPane, "leaflet-pan-anim"),
  1636. (i = this._getMapPanePos().subtract(t).round()),
  1637. this._panAnim.run(
  1638. this._mapPane,
  1639. i,
  1640. e.duration || 0.25,
  1641. e.easeLinearity
  1642. ))
  1643. : (this._rawPanBy(t), this.fire("move").fire("moveend")))
  1644. : this._resetView(
  1645. this.unproject(this.project(this.getCenter()).add(t)),
  1646. this.getZoom()
  1647. ),
  1648. this)
  1649. : this.fire("moveend")
  1650. );
  1651. },
  1652. flyTo: function (n, o, t) {
  1653. if (!1 === (t = t || {}).animate || !b.any3d)
  1654. return this.setView(n, o, t);
  1655. this._stop();
  1656. var s = this.project(this.getCenter()),
  1657. r = this.project(n),
  1658. e = this.getSize(),
  1659. a = this._zoom,
  1660. h = ((n = w(n)), (o = void 0 === o ? a : o), Math.max(e.x, e.y)),
  1661. i = h * this.getZoomScale(a, o),
  1662. l = r.distanceTo(s) || 1,
  1663. u = 1.42,
  1664. c = u * u;
  1665. function d(t) {
  1666. (t =
  1667. (i * i - h * h + (t ? -1 : 1) * c * c * l * l) /
  1668. (2 * (t ? i : h) * c * l)),
  1669. (t = Math.sqrt(t * t + 1) - t);
  1670. return t < 1e-9 ? -18 : Math.log(t);
  1671. }
  1672. function _(t) {
  1673. return (Math.exp(t) - Math.exp(-t)) / 2;
  1674. }
  1675. function p(t) {
  1676. return (Math.exp(t) + Math.exp(-t)) / 2;
  1677. }
  1678. var m = d(0);
  1679. function f(t) {
  1680. return (h * (p(m) * (_((t = m + u * t)) / p(t)) - _(m))) / c;
  1681. }
  1682. var g = Date.now(),
  1683. v = (d(1) - m) / u,
  1684. y = t.duration ? 1e3 * t.duration : 1e3 * v * 0.8;
  1685. return (
  1686. this._moveStart(!0, t.noMoveStart),
  1687. function t() {
  1688. var e = (Date.now() - g) / y,
  1689. i = (1 - Math.pow(1 - e, 1.5)) * v;
  1690. e <= 1
  1691. ? ((this._flyToFrame = x(t, this)),
  1692. this._move(
  1693. this.unproject(s.add(r.subtract(s).multiplyBy(f(i) / l)), a),
  1694. this.getScaleZoom(
  1695. h / ((e = i), h * (p(m) / p(m + u * e))),
  1696. a
  1697. ),
  1698. { flyTo: !0 }
  1699. ))
  1700. : this._move(n, o)._moveEnd(!0);
  1701. }.call(this),
  1702. this
  1703. );
  1704. },
  1705. flyToBounds: function (t, e) {
  1706. t = this._getBoundsCenterZoom(t, e);
  1707. return this.flyTo(t.center, t.zoom, e);
  1708. },
  1709. setMaxBounds: function (t) {
  1710. return (
  1711. (t = g(t)),
  1712. this.listens("moveend", this._panInsideMaxBounds) &&
  1713. this.off("moveend", this._panInsideMaxBounds),
  1714. t.isValid()
  1715. ? ((this.options.maxBounds = t),
  1716. this._loaded && this._panInsideMaxBounds(),
  1717. this.on("moveend", this._panInsideMaxBounds))
  1718. : ((this.options.maxBounds = null), this)
  1719. );
  1720. },
  1721. setMinZoom: function (t) {
  1722. var e = this.options.minZoom;
  1723. return (
  1724. (this.options.minZoom = t),
  1725. this._loaded &&
  1726. e !== t &&
  1727. (this.fire("zoomlevelschange"), this.getZoom() < this.options.minZoom)
  1728. ? this.setZoom(t)
  1729. : this
  1730. );
  1731. },
  1732. setMaxZoom: function (t) {
  1733. var e = this.options.maxZoom;
  1734. return (
  1735. (this.options.maxZoom = t),
  1736. this._loaded &&
  1737. e !== t &&
  1738. (this.fire("zoomlevelschange"), this.getZoom() > this.options.maxZoom)
  1739. ? this.setZoom(t)
  1740. : this
  1741. );
  1742. },
  1743. panInsideBounds: function (t, e) {
  1744. this._enforcingBounds = !0;
  1745. var i = this.getCenter(),
  1746. t = this._limitCenter(i, this._zoom, g(t));
  1747. return (
  1748. i.equals(t) || this.panTo(t, e), (this._enforcingBounds = !1), this
  1749. );
  1750. },
  1751. panInside: function (t, e) {
  1752. var i = m((e = e || {}).paddingTopLeft || e.padding || [0, 0]),
  1753. n = m(e.paddingBottomRight || e.padding || [0, 0]),
  1754. o = this.project(this.getCenter()),
  1755. t = this.project(t),
  1756. s = this.getPixelBounds(),
  1757. i = _([s.min.add(i), s.max.subtract(n)]),
  1758. s = i.getSize();
  1759. return (
  1760. i.contains(t) ||
  1761. ((this._enforcingBounds = !0),
  1762. (n = t.subtract(i.getCenter())),
  1763. (i = i.extend(t).getSize().subtract(s)),
  1764. (o.x += n.x < 0 ? -i.x : i.x),
  1765. (o.y += n.y < 0 ? -i.y : i.y),
  1766. this.panTo(this.unproject(o), e),
  1767. (this._enforcingBounds = !1)),
  1768. this
  1769. );
  1770. },
  1771. invalidateSize: function (t) {
  1772. if (!this._loaded) return this;
  1773. t = l({ animate: !1, pan: !0 }, !0 === t ? { animate: !0 } : t);
  1774. var e = this.getSize(),
  1775. i =
  1776. ((this._sizeChanged = !0),
  1777. (this._lastCenter = null),
  1778. this.getSize()),
  1779. n = e.divideBy(2).round(),
  1780. o = i.divideBy(2).round(),
  1781. n = n.subtract(o);
  1782. return n.x || n.y
  1783. ? (t.animate && t.pan
  1784. ? this.panBy(n)
  1785. : (t.pan && this._rawPanBy(n),
  1786. this.fire("move"),
  1787. t.debounceMoveend
  1788. ? (clearTimeout(this._sizeTimer),
  1789. (this._sizeTimer = setTimeout(
  1790. a(this.fire, this, "moveend"),
  1791. 200
  1792. )))
  1793. : this.fire("moveend")),
  1794. this.fire("resize", { oldSize: e, newSize: i }))
  1795. : this;
  1796. },
  1797. stop: function () {
  1798. return (
  1799. this.setZoom(this._limitZoom(this._zoom)),
  1800. this.options.zoomSnap || this.fire("viewreset"),
  1801. this._stop()
  1802. );
  1803. },
  1804. locate: function (t) {
  1805. var e, i;
  1806. return (
  1807. (t = this._locateOptions = l({ timeout: 1e4, watch: !1 }, t)),
  1808. "geolocation" in navigator
  1809. ? ((e = a(this._handleGeolocationResponse, this)),
  1810. (i = a(this._handleGeolocationError, this)),
  1811. t.watch
  1812. ? (this._locationWatchId = navigator.geolocation.watchPosition(
  1813. e,
  1814. i,
  1815. t
  1816. ))
  1817. : navigator.geolocation.getCurrentPosition(e, i, t))
  1818. : this._handleGeolocationError({
  1819. code: 0,
  1820. message: "Geolocation not supported.",
  1821. }),
  1822. this
  1823. );
  1824. },
  1825. stopLocate: function () {
  1826. return (
  1827. navigator.geolocation &&
  1828. navigator.geolocation.clearWatch &&
  1829. navigator.geolocation.clearWatch(this._locationWatchId),
  1830. this._locateOptions && (this._locateOptions.setView = !1),
  1831. this
  1832. );
  1833. },
  1834. _handleGeolocationError: function (t) {
  1835. var e;
  1836. this._container._leaflet_id &&
  1837. ((e = t.code),
  1838. (t =
  1839. t.message ||
  1840. (1 === e
  1841. ? "permission denied"
  1842. : 2 === e
  1843. ? "position unavailable"
  1844. : "timeout")),
  1845. this._locateOptions.setView && !this._loaded && this.fitWorld(),
  1846. this.fire("locationerror", {
  1847. code: e,
  1848. message: "Geolocation error: " + t + ".",
  1849. }));
  1850. },
  1851. _handleGeolocationResponse: function (t) {
  1852. if (this._container._leaflet_id) {
  1853. var e,
  1854. i,
  1855. n = new v(t.coords.latitude, t.coords.longitude),
  1856. o = n.toBounds(2 * t.coords.accuracy),
  1857. s = this._locateOptions,
  1858. r =
  1859. (s.setView &&
  1860. ((e = this.getBoundsZoom(o)),
  1861. this.setView(n, s.maxZoom ? Math.min(e, s.maxZoom) : e)),
  1862. { latlng: n, bounds: o, timestamp: t.timestamp });
  1863. for (i in t.coords)
  1864. "number" == typeof t.coords[i] && (r[i] = t.coords[i]);
  1865. this.fire("locationfound", r);
  1866. }
  1867. },
  1868. addHandler: function (t, e) {
  1869. return (
  1870. e &&
  1871. ((e = this[t] = new e(this)),
  1872. this._handlers.push(e),
  1873. this.options[t] && e.enable()),
  1874. this
  1875. );
  1876. },
  1877. remove: function () {
  1878. if (
  1879. (this._initEvents(!0),
  1880. this.options.maxBounds &&
  1881. this.off("moveend", this._panInsideMaxBounds),
  1882. this._containerId !== this._container._leaflet_id)
  1883. )
  1884. throw new Error("Map container is being reused by another instance");
  1885. try {
  1886. delete this._container._leaflet_id, delete this._containerId;
  1887. } catch (t) {
  1888. (this._container._leaflet_id = void 0), (this._containerId = void 0);
  1889. }
  1890. for (var t in (void 0 !== this._locationWatchId && this.stopLocate(),
  1891. this._stop(),
  1892. T(this._mapPane),
  1893. this._clearControlPos && this._clearControlPos(),
  1894. this._resizeRequest &&
  1895. (r(this._resizeRequest), (this._resizeRequest = null)),
  1896. this._clearHandlers(),
  1897. this._loaded && this.fire("unload"),
  1898. this._layers))
  1899. this._layers[t].remove();
  1900. for (t in this._panes) T(this._panes[t]);
  1901. return (
  1902. (this._layers = []),
  1903. (this._panes = []),
  1904. delete this._mapPane,
  1905. delete this._renderer,
  1906. this
  1907. );
  1908. },
  1909. createPane: function (t, e) {
  1910. e = P(
  1911. "div",
  1912. "leaflet-pane" +
  1913. (t ? " leaflet-" + t.replace("Pane", "") + "-pane" : ""),
  1914. e || this._mapPane
  1915. );
  1916. return t && (this._panes[t] = e), e;
  1917. },
  1918. getCenter: function () {
  1919. return (
  1920. this._checkIfLoaded(),
  1921. this._lastCenter && !this._moved()
  1922. ? this._lastCenter.clone()
  1923. : this.layerPointToLatLng(this._getCenterLayerPoint())
  1924. );
  1925. },
  1926. getZoom: function () {
  1927. return this._zoom;
  1928. },
  1929. getBounds: function () {
  1930. var t = this.getPixelBounds();
  1931. return new s(
  1932. this.unproject(t.getBottomLeft()),
  1933. this.unproject(t.getTopRight())
  1934. );
  1935. },
  1936. getMinZoom: function () {
  1937. return void 0 === this.options.minZoom
  1938. ? this._layersMinZoom || 0
  1939. : this.options.minZoom;
  1940. },
  1941. getMaxZoom: function () {
  1942. return void 0 === this.options.maxZoom
  1943. ? void 0 === this._layersMaxZoom
  1944. ? 1 / 0
  1945. : this._layersMaxZoom
  1946. : this.options.maxZoom;
  1947. },
  1948. getBoundsZoom: function (t, e, i) {
  1949. (t = g(t)), (i = m(i || [0, 0]));
  1950. var n = this.getZoom() || 0,
  1951. o = this.getMinZoom(),
  1952. s = this.getMaxZoom(),
  1953. r = t.getNorthWest(),
  1954. t = t.getSouthEast(),
  1955. i = this.getSize().subtract(i),
  1956. t = _(this.project(t, n), this.project(r, n)).getSize(),
  1957. r = b.any3d ? this.options.zoomSnap : 1,
  1958. a = i.x / t.x,
  1959. i = i.y / t.y,
  1960. t = e ? Math.max(a, i) : Math.min(a, i),
  1961. n = this.getScaleZoom(t, n);
  1962. return (
  1963. r &&
  1964. ((n = Math.round(n / (r / 100)) * (r / 100)),
  1965. (n = e ? Math.ceil(n / r) * r : Math.floor(n / r) * r)),
  1966. Math.max(o, Math.min(s, n))
  1967. );
  1968. },
  1969. getSize: function () {
  1970. return (
  1971. (this._size && !this._sizeChanged) ||
  1972. ((this._size = new p(
  1973. this._container.clientWidth || 0,
  1974. this._container.clientHeight || 0
  1975. )),
  1976. (this._sizeChanged = !1)),
  1977. this._size.clone()
  1978. );
  1979. },
  1980. getPixelBounds: function (t, e) {
  1981. t = this._getTopLeftPoint(t, e);
  1982. return new f(t, t.add(this.getSize()));
  1983. },
  1984. getPixelOrigin: function () {
  1985. return this._checkIfLoaded(), this._pixelOrigin;
  1986. },
  1987. getPixelWorldBounds: function (t) {
  1988. return this.options.crs.getProjectedBounds(
  1989. void 0 === t ? this.getZoom() : t
  1990. );
  1991. },
  1992. getPane: function (t) {
  1993. return "string" == typeof t ? this._panes[t] : t;
  1994. },
  1995. getPanes: function () {
  1996. return this._panes;
  1997. },
  1998. getContainer: function () {
  1999. return this._container;
  2000. },
  2001. getZoomScale: function (t, e) {
  2002. var i = this.options.crs;
  2003. return (e = void 0 === e ? this._zoom : e), i.scale(t) / i.scale(e);
  2004. },
  2005. getScaleZoom: function (t, e) {
  2006. var i = this.options.crs,
  2007. t = ((e = void 0 === e ? this._zoom : e), i.zoom(t * i.scale(e)));
  2008. return isNaN(t) ? 1 / 0 : t;
  2009. },
  2010. project: function (t, e) {
  2011. return (
  2012. (e = void 0 === e ? this._zoom : e),
  2013. this.options.crs.latLngToPoint(w(t), e)
  2014. );
  2015. },
  2016. unproject: function (t, e) {
  2017. return (
  2018. (e = void 0 === e ? this._zoom : e),
  2019. this.options.crs.pointToLatLng(m(t), e)
  2020. );
  2021. },
  2022. layerPointToLatLng: function (t) {
  2023. t = m(t).add(this.getPixelOrigin());
  2024. return this.unproject(t);
  2025. },
  2026. latLngToLayerPoint: function (t) {
  2027. return this.project(w(t))._round()._subtract(this.getPixelOrigin());
  2028. },
  2029. wrapLatLng: function (t) {
  2030. return this.options.crs.wrapLatLng(w(t));
  2031. },
  2032. wrapLatLngBounds: function (t) {
  2033. return this.options.crs.wrapLatLngBounds(g(t));
  2034. },
  2035. distance: function (t, e) {
  2036. return this.options.crs.distance(w(t), w(e));
  2037. },
  2038. containerPointToLayerPoint: function (t) {
  2039. return m(t).subtract(this._getMapPanePos());
  2040. },
  2041. layerPointToContainerPoint: function (t) {
  2042. return m(t).add(this._getMapPanePos());
  2043. },
  2044. containerPointToLatLng: function (t) {
  2045. t = this.containerPointToLayerPoint(m(t));
  2046. return this.layerPointToLatLng(t);
  2047. },
  2048. latLngToContainerPoint: function (t) {
  2049. return this.layerPointToContainerPoint(this.latLngToLayerPoint(w(t)));
  2050. },
  2051. mouseEventToContainerPoint: function (t) {
  2052. return De(t, this._container);
  2053. },
  2054. mouseEventToLayerPoint: function (t) {
  2055. return this.containerPointToLayerPoint(
  2056. this.mouseEventToContainerPoint(t)
  2057. );
  2058. },
  2059. mouseEventToLatLng: function (t) {
  2060. return this.layerPointToLatLng(this.mouseEventToLayerPoint(t));
  2061. },
  2062. _initContainer: function (t) {
  2063. t = this._container = _e(t);
  2064. if (!t) throw new Error("Map container not found.");
  2065. if (t._leaflet_id)
  2066. throw new Error("Map container is already initialized.");
  2067. S(t, "scroll", this._onScroll, this), (this._containerId = h(t));
  2068. },
  2069. _initLayout: function () {
  2070. var t = this._container,
  2071. e =
  2072. ((this._fadeAnimated = this.options.fadeAnimation && b.any3d),
  2073. M(
  2074. t,
  2075. "leaflet-container" +
  2076. (b.touch ? " leaflet-touch" : "") +
  2077. (b.retina ? " leaflet-retina" : "") +
  2078. (b.ielt9 ? " leaflet-oldie" : "") +
  2079. (b.safari ? " leaflet-safari" : "") +
  2080. (this._fadeAnimated ? " leaflet-fade-anim" : "")
  2081. ),
  2082. pe(t, "position"));
  2083. "absolute" !== e &&
  2084. "relative" !== e &&
  2085. "fixed" !== e &&
  2086. "sticky" !== e &&
  2087. (t.style.position = "relative"),
  2088. this._initPanes(),
  2089. this._initControlPos && this._initControlPos();
  2090. },
  2091. _initPanes: function () {
  2092. var t = (this._panes = {});
  2093. (this._paneRenderers = {}),
  2094. (this._mapPane = this.createPane("mapPane", this._container)),
  2095. Z(this._mapPane, new p(0, 0)),
  2096. this.createPane("tilePane"),
  2097. this.createPane("overlayPane"),
  2098. this.createPane("shadowPane"),
  2099. this.createPane("markerPane"),
  2100. this.createPane("tooltipPane"),
  2101. this.createPane("popupPane"),
  2102. this.options.markerZoomAnimation ||
  2103. (M(t.markerPane, "leaflet-zoom-hide"),
  2104. M(t.shadowPane, "leaflet-zoom-hide"));
  2105. },
  2106. _resetView: function (t, e, i) {
  2107. Z(this._mapPane, new p(0, 0));
  2108. var n = !this._loaded,
  2109. o =
  2110. ((this._loaded = !0),
  2111. (e = this._limitZoom(e)),
  2112. this.fire("viewprereset"),
  2113. this._zoom !== e);
  2114. this._moveStart(o, i)._move(t, e)._moveEnd(o),
  2115. this.fire("viewreset"),
  2116. n && this.fire("load");
  2117. },
  2118. _moveStart: function (t, e) {
  2119. return t && this.fire("zoomstart"), e || this.fire("movestart"), this;
  2120. },
  2121. _move: function (t, e, i, n) {
  2122. void 0 === e && (e = this._zoom);
  2123. var o = this._zoom !== e;
  2124. return (
  2125. (this._zoom = e),
  2126. (this._lastCenter = t),
  2127. (this._pixelOrigin = this._getNewPixelOrigin(t)),
  2128. n
  2129. ? i && i.pinch && this.fire("zoom", i)
  2130. : ((o || (i && i.pinch)) && this.fire("zoom", i),
  2131. this.fire("move", i)),
  2132. this
  2133. );
  2134. },
  2135. _moveEnd: function (t) {
  2136. return t && this.fire("zoomend"), this.fire("moveend");
  2137. },
  2138. _stop: function () {
  2139. return r(this._flyToFrame), this._panAnim && this._panAnim.stop(), this;
  2140. },
  2141. _rawPanBy: function (t) {
  2142. Z(this._mapPane, this._getMapPanePos().subtract(t));
  2143. },
  2144. _getZoomSpan: function () {
  2145. return this.getMaxZoom() - this.getMinZoom();
  2146. },
  2147. _panInsideMaxBounds: function () {
  2148. this._enforcingBounds || this.panInsideBounds(this.options.maxBounds);
  2149. },
  2150. _checkIfLoaded: function () {
  2151. if (!this._loaded) throw new Error("Set map center and zoom first.");
  2152. },
  2153. _initEvents: function (t) {
  2154. this._targets = {};
  2155. var e = t ? k : S;
  2156. e(
  2157. (this._targets[h(this._container)] = this)._container,
  2158. "click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",
  2159. this._handleDOMEvent,
  2160. this
  2161. ),
  2162. this.options.trackResize && e(window, "resize", this._onResize, this),
  2163. b.any3d &&
  2164. this.options.transform3DLimit &&
  2165. (t ? this.off : this.on).call(this, "moveend", this._onMoveEnd);
  2166. },
  2167. _onResize: function () {
  2168. r(this._resizeRequest),
  2169. (this._resizeRequest = x(function () {
  2170. this.invalidateSize({ debounceMoveend: !0 });
  2171. }, this));
  2172. },
  2173. _onScroll: function () {
  2174. (this._container.scrollTop = 0), (this._container.scrollLeft = 0);
  2175. },
  2176. _onMoveEnd: function () {
  2177. var t = this._getMapPanePos();
  2178. Math.max(Math.abs(t.x), Math.abs(t.y)) >=
  2179. this.options.transform3DLimit &&
  2180. this._resetView(this.getCenter(), this.getZoom());
  2181. },
  2182. _findEventTargets: function (t, e) {
  2183. for (
  2184. var i,
  2185. n = [],
  2186. o = "mouseout" === e || "mouseover" === e,
  2187. s = t.target || t.srcElement,
  2188. r = !1;
  2189. s;
  2190.  
  2191. ) {
  2192. if (
  2193. (i = this._targets[h(s)]) &&
  2194. ("click" === e || "preclick" === e) &&
  2195. this._draggableMoved(i)
  2196. ) {
  2197. r = !0;
  2198. break;
  2199. }
  2200. if (i && i.listens(e, !0)) {
  2201. if (o && !We(s, t)) break;
  2202. if ((n.push(i), o)) break;
  2203. }
  2204. if (s === this._container) break;
  2205. s = s.parentNode;
  2206. }
  2207. return (n = n.length || r || o || !this.listens(e, !0) ? n : [this]);
  2208. },
  2209. _isClickDisabled: function (t) {
  2210. for (; t && t !== this._container; ) {
  2211. if (t._leaflet_disable_click) return !0;
  2212. t = t.parentNode;
  2213. }
  2214. },
  2215. _handleDOMEvent: function (t) {
  2216. var e,
  2217. i = t.target || t.srcElement;
  2218. !this._loaded ||
  2219. i._leaflet_disable_events ||
  2220. ("click" === t.type && this._isClickDisabled(i)) ||
  2221. ("mousedown" === (e = t.type) && Me(i), this._fireDOMEvent(t, e));
  2222. },
  2223. _mouseEvents: [
  2224. "click",
  2225. "dblclick",
  2226. "mouseover",
  2227. "mouseout",
  2228. "contextmenu",
  2229. ],
  2230. _fireDOMEvent: function (t, e, i) {
  2231. "click" === t.type &&
  2232. (((a = l({}, t)).type = "preclick"),
  2233. this._fireDOMEvent(a, a.type, i));
  2234. var n = this._findEventTargets(t, e);
  2235. if (i) {
  2236. for (var o = [], s = 0; s < i.length; s++)
  2237. i[s].listens(e, !0) && o.push(i[s]);
  2238. n = o.concat(n);
  2239. }
  2240. if (n.length) {
  2241. "contextmenu" === e && O(t);
  2242. var r,
  2243. a = n[0],
  2244. h = { originalEvent: t };
  2245. for (
  2246. "keypress" !== t.type &&
  2247. "keydown" !== t.type &&
  2248. "keyup" !== t.type &&
  2249. ((r = a.getLatLng && (!a._radius || a._radius <= 10)),
  2250. (h.containerPoint = r
  2251. ? this.latLngToContainerPoint(a.getLatLng())
  2252. : this.mouseEventToContainerPoint(t)),
  2253. (h.layerPoint = this.containerPointToLayerPoint(
  2254. h.containerPoint
  2255. )),
  2256. (h.latlng = r
  2257. ? a.getLatLng()
  2258. : this.layerPointToLatLng(h.layerPoint))),
  2259. s = 0;
  2260. s < n.length;
  2261. s++
  2262. )
  2263. if (
  2264. (n[s].fire(e, h, !0),
  2265. h.originalEvent._stopped ||
  2266. (!1 === n[s].options.bubblingMouseEvents &&
  2267. -1 !== G(this._mouseEvents, e)))
  2268. )
  2269. return;
  2270. }
  2271. },
  2272. _draggableMoved: function (t) {
  2273. return (
  2274. ((t = t.dragging && t.dragging.enabled() ? t : this).dragging &&
  2275. t.dragging.moved()) ||
  2276. (this.boxZoom && this.boxZoom.moved())
  2277. );
  2278. },
  2279. _clearHandlers: function () {
  2280. for (var t = 0, e = this._handlers.length; t < e; t++)
  2281. this._handlers[t].disable();
  2282. },
  2283. whenReady: function (t, e) {
  2284. return (
  2285. this._loaded
  2286. ? t.call(e || this, { target: this })
  2287. : this.on("load", t, e),
  2288. this
  2289. );
  2290. },
  2291. _getMapPanePos: function () {
  2292. return Pe(this._mapPane) || new p(0, 0);
  2293. },
  2294. _moved: function () {
  2295. var t = this._getMapPanePos();
  2296. return t && !t.equals([0, 0]);
  2297. },
  2298. _getTopLeftPoint: function (t, e) {
  2299. return (
  2300. t && void 0 !== e
  2301. ? this._getNewPixelOrigin(t, e)
  2302. : this.getPixelOrigin()
  2303. ).subtract(this._getMapPanePos());
  2304. },
  2305. _getNewPixelOrigin: function (t, e) {
  2306. var i = this.getSize()._divideBy(2);
  2307. return this.project(t, e)
  2308. ._subtract(i)
  2309. ._add(this._getMapPanePos())
  2310. ._round();
  2311. },
  2312. _latLngToNewLayerPoint: function (t, e, i) {
  2313. i = this._getNewPixelOrigin(i, e);
  2314. return this.project(t, e)._subtract(i);
  2315. },
  2316. _latLngBoundsToNewLayerBounds: function (t, e, i) {
  2317. i = this._getNewPixelOrigin(i, e);
  2318. return _([
  2319. this.project(t.getSouthWest(), e)._subtract(i),
  2320. this.project(t.getNorthWest(), e)._subtract(i),
  2321. this.project(t.getSouthEast(), e)._subtract(i),
  2322. this.project(t.getNorthEast(), e)._subtract(i),
  2323. ]);
  2324. },
  2325. _getCenterLayerPoint: function () {
  2326. return this.containerPointToLayerPoint(this.getSize()._divideBy(2));
  2327. },
  2328. _getCenterOffset: function (t) {
  2329. return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint());
  2330. },
  2331. _limitCenter: function (t, e, i) {
  2332. var n, o;
  2333. return !i ||
  2334. ((n = this.project(t, e)),
  2335. (o = this.getSize().divideBy(2)),
  2336. (o = new f(n.subtract(o), n.add(o))),
  2337. (o = this._getBoundsOffset(o, i, e)),
  2338. Math.abs(o.x) <= 1 && Math.abs(o.y) <= 1)
  2339. ? t
  2340. : this.unproject(n.add(o), e);
  2341. },
  2342. _limitOffset: function (t, e) {
  2343. var i;
  2344. return e
  2345. ? ((i = new f((i = this.getPixelBounds()).min.add(t), i.max.add(t))),
  2346. t.add(this._getBoundsOffset(i, e)))
  2347. : t;
  2348. },
  2349. _getBoundsOffset: function (t, e, i) {
  2350. (e = _(
  2351. this.project(e.getNorthEast(), i),
  2352. this.project(e.getSouthWest(), i)
  2353. )),
  2354. (i = e.min.subtract(t.min)),
  2355. (e = e.max.subtract(t.max));
  2356. return new p(this._rebound(i.x, -e.x), this._rebound(i.y, -e.y));
  2357. },
  2358. _rebound: function (t, e) {
  2359. return 0 < t + e
  2360. ? Math.round(t - e) / 2
  2361. : Math.max(0, Math.ceil(t)) - Math.max(0, Math.floor(e));
  2362. },
  2363. _limitZoom: function (t) {
  2364. var e = this.getMinZoom(),
  2365. i = this.getMaxZoom(),
  2366. n = b.any3d ? this.options.zoomSnap : 1;
  2367. return n && (t = Math.round(t / n) * n), Math.max(e, Math.min(i, t));
  2368. },
  2369. _onPanTransitionStep: function () {
  2370. this.fire("move");
  2371. },
  2372. _onPanTransitionEnd: function () {
  2373. z(this._mapPane, "leaflet-pan-anim"), this.fire("moveend");
  2374. },
  2375. _tryAnimatedPan: function (t, e) {
  2376. t = this._getCenterOffset(t)._trunc();
  2377. return (
  2378. !(!0 !== (e && e.animate) && !this.getSize().contains(t)) &&
  2379. (this.panBy(t, e), !0)
  2380. );
  2381. },
  2382. _createAnimProxy: function () {
  2383. var t = (this._proxy = P("div", "leaflet-proxy leaflet-zoom-animated"));
  2384. this._panes.mapPane.appendChild(t),
  2385. this.on(
  2386. "zoomanim",
  2387. function (t) {
  2388. var e = ue,
  2389. i = this._proxy.style[e];
  2390. be(
  2391. this._proxy,
  2392. this.project(t.center, t.zoom),
  2393. this.getZoomScale(t.zoom, 1)
  2394. ),
  2395. i === this._proxy.style[e] &&
  2396. this._animatingZoom &&
  2397. this._onZoomTransitionEnd();
  2398. },
  2399. this
  2400. ),
  2401. this.on("load moveend", this._animMoveEnd, this),
  2402. this._on("unload", this._destroyAnimProxy, this);
  2403. },
  2404. _destroyAnimProxy: function () {
  2405. T(this._proxy),
  2406. this.off("load moveend", this._animMoveEnd, this),
  2407. delete this._proxy;
  2408. },
  2409. _animMoveEnd: function () {
  2410. var t = this.getCenter(),
  2411. e = this.getZoom();
  2412. be(this._proxy, this.project(t, e), this.getZoomScale(e, 1));
  2413. },
  2414. _catchTransitionEnd: function (t) {
  2415. this._animatingZoom &&
  2416. 0 <= t.propertyName.indexOf("transform") &&
  2417. this._onZoomTransitionEnd();
  2418. },
  2419. _nothingToAnimate: function () {
  2420. return !this._container.getElementsByClassName("leaflet-zoom-animated")
  2421. .length;
  2422. },
  2423. _tryAnimatedZoom: function (t, e, i) {
  2424. if (!this._animatingZoom) {
  2425. if (
  2426. ((i = i || {}),
  2427. !this._zoomAnimated ||
  2428. !1 === i.animate ||
  2429. this._nothingToAnimate() ||
  2430. Math.abs(e - this._zoom) > this.options.zoomAnimationThreshold)
  2431. )
  2432. return !1;
  2433. var n = this.getZoomScale(e),
  2434. n = this._getCenterOffset(t)._divideBy(1 - 1 / n);
  2435. if (!0 !== i.animate && !this.getSize().contains(n)) return !1;
  2436. x(function () {
  2437. this._moveStart(!0, i.noMoveStart || !1)._animateZoom(t, e, !0);
  2438. }, this);
  2439. }
  2440. return !0;
  2441. },
  2442. _animateZoom: function (t, e, i, n) {
  2443. this._mapPane &&
  2444. (i &&
  2445. ((this._animatingZoom = !0),
  2446. (this._animateToCenter = t),
  2447. (this._animateToZoom = e),
  2448. M(this._mapPane, "leaflet-zoom-anim")),
  2449. this.fire("zoomanim", { center: t, zoom: e, noUpdate: n }),
  2450. this._tempFireZoomEvent ||
  2451. (this._tempFireZoomEvent = this._zoom !== this._animateToZoom),
  2452. this._move(this._animateToCenter, this._animateToZoom, void 0, !0),
  2453. setTimeout(a(this._onZoomTransitionEnd, this), 250));
  2454. },
  2455. _onZoomTransitionEnd: function () {
  2456. this._animatingZoom &&
  2457. (this._mapPane && z(this._mapPane, "leaflet-zoom-anim"),
  2458. (this._animatingZoom = !1),
  2459. this._move(this._animateToCenter, this._animateToZoom, void 0, !0),
  2460. this._tempFireZoomEvent && this.fire("zoom"),
  2461. delete this._tempFireZoomEvent,
  2462. this.fire("move"),
  2463. this._moveEnd(!0));
  2464. },
  2465. });
  2466. function Ue(t) {
  2467. return new B(t);
  2468. }
  2469. var B = et.extend({
  2470. options: { position: "topright" },
  2471. initialize: function (t) {
  2472. c(this, t);
  2473. },
  2474. getPosition: function () {
  2475. return this.options.position;
  2476. },
  2477. setPosition: function (t) {
  2478. var e = this._map;
  2479. return (
  2480. e && e.removeControl(this),
  2481. (this.options.position = t),
  2482. e && e.addControl(this),
  2483. this
  2484. );
  2485. },
  2486. getContainer: function () {
  2487. return this._container;
  2488. },
  2489. addTo: function (t) {
  2490. this.remove(), (this._map = t);
  2491. var e = (this._container = this.onAdd(t)),
  2492. i = this.getPosition(),
  2493. t = t._controlCorners[i];
  2494. return (
  2495. M(e, "leaflet-control"),
  2496. -1 !== i.indexOf("bottom")
  2497. ? t.insertBefore(e, t.firstChild)
  2498. : t.appendChild(e),
  2499. this._map.on("unload", this.remove, this),
  2500. this
  2501. );
  2502. },
  2503. remove: function () {
  2504. return (
  2505. this._map &&
  2506. (T(this._container),
  2507. this.onRemove && this.onRemove(this._map),
  2508. this._map.off("unload", this.remove, this),
  2509. (this._map = null)),
  2510. this
  2511. );
  2512. },
  2513. _refocusOnMap: function (t) {
  2514. this._map &&
  2515. t &&
  2516. 0 < t.screenX &&
  2517. 0 < t.screenY &&
  2518. this._map.getContainer().focus();
  2519. },
  2520. }),
  2521. Ve =
  2522. (A.include({
  2523. addControl: function (t) {
  2524. return t.addTo(this), this;
  2525. },
  2526. removeControl: function (t) {
  2527. return t.remove(), this;
  2528. },
  2529. _initControlPos: function () {
  2530. var i = (this._controlCorners = {}),
  2531. n = "leaflet-",
  2532. o = (this._controlContainer = P(
  2533. "div",
  2534. n + "control-container",
  2535. this._container
  2536. ));
  2537. function t(t, e) {
  2538. i[t + e] = P("div", n + t + " " + n + e, o);
  2539. }
  2540. t("top", "left"),
  2541. t("top", "right"),
  2542. t("bottom", "left"),
  2543. t("bottom", "right");
  2544. },
  2545. _clearControlPos: function () {
  2546. for (var t in this._controlCorners) T(this._controlCorners[t]);
  2547. T(this._controlContainer),
  2548. delete this._controlCorners,
  2549. delete this._controlContainer;
  2550. },
  2551. }),
  2552. B.extend({
  2553. options: {
  2554. collapsed: !0,
  2555. position: "topright",
  2556. autoZIndex: !0,
  2557. hideSingleBase: !1,
  2558. sortLayers: !1,
  2559. sortFunction: function (t, e, i, n) {
  2560. return i < n ? -1 : n < i ? 1 : 0;
  2561. },
  2562. },
  2563. initialize: function (t, e, i) {
  2564. for (var n in (c(this, i),
  2565. (this._layerControlInputs = []),
  2566. (this._layers = []),
  2567. (this._lastZIndex = 0),
  2568. (this._handlingClick = !1),
  2569. (this._preventClick = !1),
  2570. t))
  2571. this._addLayer(t[n], n);
  2572. for (n in e) this._addLayer(e[n], n, !0);
  2573. },
  2574. onAdd: function (t) {
  2575. this._initLayout(),
  2576. this._update(),
  2577. (this._map = t).on("zoomend", this._checkDisabledLayers, this);
  2578. for (var e = 0; e < this._layers.length; e++)
  2579. this._layers[e].layer.on("add remove", this._onLayerChange, this);
  2580. return this._container;
  2581. },
  2582. addTo: function (t) {
  2583. return B.prototype.addTo.call(this, t), this._expandIfNotCollapsed();
  2584. },
  2585. onRemove: function () {
  2586. this._map.off("zoomend", this._checkDisabledLayers, this);
  2587. for (var t = 0; t < this._layers.length; t++)
  2588. this._layers[t].layer.off("add remove", this._onLayerChange, this);
  2589. },
  2590. addBaseLayer: function (t, e) {
  2591. return this._addLayer(t, e), this._map ? this._update() : this;
  2592. },
  2593. addOverlay: function (t, e) {
  2594. return this._addLayer(t, e, !0), this._map ? this._update() : this;
  2595. },
  2596. removeLayer: function (t) {
  2597. t.off("add remove", this._onLayerChange, this);
  2598. t = this._getLayer(h(t));
  2599. return (
  2600. t && this._layers.splice(this._layers.indexOf(t), 1),
  2601. this._map ? this._update() : this
  2602. );
  2603. },
  2604. expand: function () {
  2605. M(this._container, "leaflet-control-layers-expanded"),
  2606. (this._section.style.height = null);
  2607. var t = this._map.getSize().y - (this._container.offsetTop + 50);
  2608. return (
  2609. t < this._section.clientHeight
  2610. ? (M(this._section, "leaflet-control-layers-scrollbar"),
  2611. (this._section.style.height = t + "px"))
  2612. : z(this._section, "leaflet-control-layers-scrollbar"),
  2613. this._checkDisabledLayers(),
  2614. this
  2615. );
  2616. },
  2617. collapse: function () {
  2618. return z(this._container, "leaflet-control-layers-expanded"), this;
  2619. },
  2620. _initLayout: function () {
  2621. var t = "leaflet-control-layers",
  2622. e = (this._container = P("div", t)),
  2623. i = this.options.collapsed,
  2624. n =
  2625. (e.setAttribute("aria-haspopup", !0),
  2626. Ie(e),
  2627. Be(e),
  2628. (this._section = P("section", t + "-list"))),
  2629. o =
  2630. (i &&
  2631. (this._map.on("click", this.collapse, this),
  2632. S(
  2633. e,
  2634. { mouseenter: this._expandSafely, mouseleave: this.collapse },
  2635. this
  2636. )),
  2637. (this._layersLink = P("a", t + "-toggle", e)));
  2638. (o.href = "#"),
  2639. (o.title = "Layers"),
  2640. o.setAttribute("role", "button"),
  2641. S(
  2642. o,
  2643. {
  2644. keydown: function (t) {
  2645. 13 === t.keyCode && this._expandSafely();
  2646. },
  2647. click: function (t) {
  2648. O(t), this._expandSafely();
  2649. },
  2650. },
  2651. this
  2652. ),
  2653. i || this.expand(),
  2654. (this._baseLayersList = P("div", t + "-base", n)),
  2655. (this._separator = P("div", t + "-separator", n)),
  2656. (this._overlaysList = P("div", t + "-overlays", n)),
  2657. e.appendChild(n);
  2658. },
  2659. _getLayer: function (t) {
  2660. for (var e = 0; e < this._layers.length; e++)
  2661. if (this._layers[e] && h(this._layers[e].layer) === t)
  2662. return this._layers[e];
  2663. },
  2664. _addLayer: function (t, e, i) {
  2665. this._map && t.on("add remove", this._onLayerChange, this),
  2666. this._layers.push({ layer: t, name: e, overlay: i }),
  2667. this.options.sortLayers &&
  2668. this._layers.sort(
  2669. a(function (t, e) {
  2670. return this.options.sortFunction(
  2671. t.layer,
  2672. e.layer,
  2673. t.name,
  2674. e.name
  2675. );
  2676. }, this)
  2677. ),
  2678. this.options.autoZIndex &&
  2679. t.setZIndex &&
  2680. (this._lastZIndex++, t.setZIndex(this._lastZIndex)),
  2681. this._expandIfNotCollapsed();
  2682. },
  2683. _update: function () {
  2684. if (this._container) {
  2685. me(this._baseLayersList),
  2686. me(this._overlaysList),
  2687. (this._layerControlInputs = []);
  2688. for (var t, e, i, n = 0, o = 0; o < this._layers.length; o++)
  2689. (i = this._layers[o]),
  2690. this._addItem(i),
  2691. (e = e || i.overlay),
  2692. (t = t || !i.overlay),
  2693. (n += i.overlay ? 0 : 1);
  2694. this.options.hideSingleBase &&
  2695. (this._baseLayersList.style.display = (t = t && 1 < n)
  2696. ? ""
  2697. : "none"),
  2698. (this._separator.style.display = e && t ? "" : "none");
  2699. }
  2700. return this;
  2701. },
  2702. _onLayerChange: function (t) {
  2703. this._handlingClick || this._update();
  2704. var e = this._getLayer(h(t.target)),
  2705. t = e.overlay
  2706. ? "add" === t.type
  2707. ? "overlayadd"
  2708. : "overlayremove"
  2709. : "add" === t.type
  2710. ? "baselayerchange"
  2711. : null;
  2712. t && this._map.fire(t, e);
  2713. },
  2714. _createRadioElement: function (t, e) {
  2715. (t =
  2716. '<input type="radio" class="leaflet-control-layers-selector" name="' +
  2717. t +
  2718. '"' +
  2719. (e ? ' checked="checked"' : "") +
  2720. "/>"),
  2721. (e = document.createElement("div"));
  2722. return (e.innerHTML = t), e.firstChild;
  2723. },
  2724. _addItem: function (t) {
  2725. var e,
  2726. i = document.createElement("label"),
  2727. n = this._map.hasLayer(t.layer),
  2728. n =
  2729. (t.overlay
  2730. ? (((e = document.createElement("input")).type = "checkbox"),
  2731. (e.className = "leaflet-control-layers-selector"),
  2732. (e.defaultChecked = n))
  2733. : (e = this._createRadioElement(
  2734. "leaflet-base-layers_" + h(this),
  2735. n
  2736. )),
  2737. this._layerControlInputs.push(e),
  2738. (e.layerId = h(t.layer)),
  2739. S(e, "click", this._onInputClick, this),
  2740. document.createElement("span")),
  2741. o = ((n.innerHTML = " " + t.name), document.createElement("span"));
  2742. return (
  2743. i.appendChild(o),
  2744. o.appendChild(e),
  2745. o.appendChild(n),
  2746. (t.overlay ? this._overlaysList : this._baseLayersList).appendChild(
  2747. i
  2748. ),
  2749. this._checkDisabledLayers(),
  2750. i
  2751. );
  2752. },
  2753. _onInputClick: function () {
  2754. if (!this._preventClick) {
  2755. var t,
  2756. e,
  2757. i = this._layerControlInputs,
  2758. n = [],
  2759. o = [];
  2760. this._handlingClick = !0;
  2761. for (var s = i.length - 1; 0 <= s; s--)
  2762. (t = i[s]),
  2763. (e = this._getLayer(t.layerId).layer),
  2764. t.checked ? n.push(e) : t.checked || o.push(e);
  2765. for (s = 0; s < o.length; s++)
  2766. this._map.hasLayer(o[s]) && this._map.removeLayer(o[s]);
  2767. for (s = 0; s < n.length; s++)
  2768. this._map.hasLayer(n[s]) || this._map.addLayer(n[s]);
  2769. (this._handlingClick = !1), this._refocusOnMap();
  2770. }
  2771. },
  2772. _checkDisabledLayers: function () {
  2773. for (
  2774. var t,
  2775. e,
  2776. i = this._layerControlInputs,
  2777. n = this._map.getZoom(),
  2778. o = i.length - 1;
  2779. 0 <= o;
  2780. o--
  2781. )
  2782. (t = i[o]),
  2783. (e = this._getLayer(t.layerId).layer),
  2784. (t.disabled =
  2785. (void 0 !== e.options.minZoom && n < e.options.minZoom) ||
  2786. (void 0 !== e.options.maxZoom && n > e.options.maxZoom));
  2787. },
  2788. _expandIfNotCollapsed: function () {
  2789. return this._map && !this.options.collapsed && this.expand(), this;
  2790. },
  2791. _expandSafely: function () {
  2792. var t = this._section,
  2793. e =
  2794. ((this._preventClick = !0),
  2795. S(t, "click", O),
  2796. this.expand(),
  2797. this);
  2798. setTimeout(function () {
  2799. k(t, "click", O), (e._preventClick = !1);
  2800. });
  2801. },
  2802. })),
  2803. qe = B.extend({
  2804. options: {
  2805. position: "topleft",
  2806. zoomInText: '<span aria-hidden="true">+</span>',
  2807. zoomInTitle: "Zoom in",
  2808. zoomOutText: '<span aria-hidden="true">&#x2212;</span>',
  2809. zoomOutTitle: "Zoom out",
  2810. },
  2811. onAdd: function (t) {
  2812. var e = "leaflet-control-zoom",
  2813. i = P("div", e + " leaflet-bar"),
  2814. n = this.options;
  2815. return (
  2816. (this._zoomInButton = this._createButton(
  2817. n.zoomInText,
  2818. n.zoomInTitle,
  2819. e + "-in",
  2820. i,
  2821. this._zoomIn
  2822. )),
  2823. (this._zoomOutButton = this._createButton(
  2824. n.zoomOutText,
  2825. n.zoomOutTitle,
  2826. e + "-out",
  2827. i,
  2828. this._zoomOut
  2829. )),
  2830. this._updateDisabled(),
  2831. t.on("zoomend zoomlevelschange", this._updateDisabled, this),
  2832. i
  2833. );
  2834. },
  2835. onRemove: function (t) {
  2836. t.off("zoomend zoomlevelschange", this._updateDisabled, this);
  2837. },
  2838. disable: function () {
  2839. return (this._disabled = !0), this._updateDisabled(), this;
  2840. },
  2841. enable: function () {
  2842. return (this._disabled = !1), this._updateDisabled(), this;
  2843. },
  2844. _zoomIn: function (t) {
  2845. !this._disabled &&
  2846. this._map._zoom < this._map.getMaxZoom() &&
  2847. this._map.zoomIn(this._map.options.zoomDelta * (t.shiftKey ? 3 : 1));
  2848. },
  2849. _zoomOut: function (t) {
  2850. !this._disabled &&
  2851. this._map._zoom > this._map.getMinZoom() &&
  2852. this._map.zoomOut(this._map.options.zoomDelta * (t.shiftKey ? 3 : 1));
  2853. },
  2854. _createButton: function (t, e, i, n, o) {
  2855. i = P("a", i, n);
  2856. return (
  2857. (i.innerHTML = t),
  2858. (i.href = "#"),
  2859. (i.title = e),
  2860. i.setAttribute("role", "button"),
  2861. i.setAttribute("aria-label", e),
  2862. Ie(i),
  2863. S(i, "click", Re),
  2864. S(i, "click", o, this),
  2865. S(i, "click", this._refocusOnMap, this),
  2866. i
  2867. );
  2868. },
  2869. _updateDisabled: function () {
  2870. var t = this._map,
  2871. e = "leaflet-disabled";
  2872. z(this._zoomInButton, e),
  2873. z(this._zoomOutButton, e),
  2874. this._zoomInButton.setAttribute("aria-disabled", "false"),
  2875. this._zoomOutButton.setAttribute("aria-disabled", "false"),
  2876. (!this._disabled && t._zoom !== t.getMinZoom()) ||
  2877. (M(this._zoomOutButton, e),
  2878. this._zoomOutButton.setAttribute("aria-disabled", "true")),
  2879. (!this._disabled && t._zoom !== t.getMaxZoom()) ||
  2880. (M(this._zoomInButton, e),
  2881. this._zoomInButton.setAttribute("aria-disabled", "true"));
  2882. },
  2883. }),
  2884. Ge =
  2885. (A.mergeOptions({ zoomControl: !0 }),
  2886. A.addInitHook(function () {
  2887. this.options.zoomControl &&
  2888. ((this.zoomControl = new qe()), this.addControl(this.zoomControl));
  2889. }),
  2890. B.extend({
  2891. options: {
  2892. position: "bottomleft",
  2893. maxWidth: 100,
  2894. metric: !0,
  2895. imperial: !0,
  2896. },
  2897. onAdd: function (t) {
  2898. var e = "leaflet-control-scale",
  2899. i = P("div", e),
  2900. n = this.options;
  2901. return (
  2902. this._addScales(n, e + "-line", i),
  2903. t.on(n.updateWhenIdle ? "moveend" : "move", this._update, this),
  2904. t.whenReady(this._update, this),
  2905. i
  2906. );
  2907. },
  2908. onRemove: function (t) {
  2909. t.off(
  2910. this.options.updateWhenIdle ? "moveend" : "move",
  2911. this._update,
  2912. this
  2913. );
  2914. },
  2915. _addScales: function (t, e, i) {
  2916. t.metric && (this._mScale = P("div", e, i)),
  2917. t.imperial && (this._iScale = P("div", e, i));
  2918. },
  2919. _update: function () {
  2920. var t = this._map,
  2921. e = t.getSize().y / 2,
  2922. t = t.distance(
  2923. t.containerPointToLatLng([0, e]),
  2924. t.containerPointToLatLng([this.options.maxWidth, e])
  2925. );
  2926. this._updateScales(t);
  2927. },
  2928. _updateScales: function (t) {
  2929. this.options.metric && t && this._updateMetric(t),
  2930. this.options.imperial && t && this._updateImperial(t);
  2931. },
  2932. _updateMetric: function (t) {
  2933. var e = this._getRoundNum(t);
  2934. this._updateScale(
  2935. this._mScale,
  2936. e < 1e3 ? e + " m" : e / 1e3 + " km",
  2937. e / t
  2938. );
  2939. },
  2940. _updateImperial: function (t) {
  2941. var e,
  2942. i,
  2943. t = 3.2808399 * t;
  2944. 5280 < t
  2945. ? ((i = this._getRoundNum((e = t / 5280))),
  2946. this._updateScale(this._iScale, i + " mi", i / e))
  2947. : ((i = this._getRoundNum(t)),
  2948. this._updateScale(this._iScale, i + " ft", i / t));
  2949. },
  2950. _updateScale: function (t, e, i) {
  2951. (t.style.width = Math.round(this.options.maxWidth * i) + "px"),
  2952. (t.innerHTML = e);
  2953. },
  2954. _getRoundNum: function (t) {
  2955. var e = Math.pow(10, (Math.floor(t) + "").length - 1),
  2956. t = t / e;
  2957. return (
  2958. e * (t = 10 <= t ? 10 : 5 <= t ? 5 : 3 <= t ? 3 : 2 <= t ? 2 : 1)
  2959. );
  2960. },
  2961. })),
  2962. Ke = B.extend({
  2963. options: {
  2964. position: "bottomright",
  2965. prefix:
  2966. '<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">' +
  2967. (b.inlineSvg
  2968. ? '<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg> '
  2969. : "") +
  2970. "Leaflet</a>",
  2971. },
  2972. initialize: function (t) {
  2973. c(this, t), (this._attributions = {});
  2974. },
  2975. onAdd: function (t) {
  2976. for (var e in (((t.attributionControl = this)._container = P(
  2977. "div",
  2978. "leaflet-control-attribution"
  2979. )),
  2980. Ie(this._container),
  2981. t._layers))
  2982. t._layers[e].getAttribution &&
  2983. this.addAttribution(t._layers[e].getAttribution());
  2984. return (
  2985. this._update(),
  2986. t.on("layeradd", this._addAttribution, this),
  2987. this._container
  2988. );
  2989. },
  2990. onRemove: function (t) {
  2991. t.off("layeradd", this._addAttribution, this);
  2992. },
  2993. _addAttribution: function (t) {
  2994. t.layer.getAttribution &&
  2995. (this.addAttribution(t.layer.getAttribution()),
  2996. t.layer.once(
  2997. "remove",
  2998. function () {
  2999. this.removeAttribution(t.layer.getAttribution());
  3000. },
  3001. this
  3002. ));
  3003. },
  3004. setPrefix: function (t) {
  3005. return (this.options.prefix = t), this._update(), this;
  3006. },
  3007. addAttribution: function (t) {
  3008. return (
  3009. t &&
  3010. (this._attributions[t] || (this._attributions[t] = 0),
  3011. this._attributions[t]++,
  3012. this._update()),
  3013. this
  3014. );
  3015. },
  3016. removeAttribution: function (t) {
  3017. return (
  3018. t &&
  3019. this._attributions[t] &&
  3020. (this._attributions[t]--, this._update()),
  3021. this
  3022. );
  3023. },
  3024. _update: function () {
  3025. if (this._map) {
  3026. var t,
  3027. e = [];
  3028. for (t in this._attributions) this._attributions[t] && e.push(t);
  3029. var i = [];
  3030. this.options.prefix && i.push(this.options.prefix),
  3031. e.length && i.push(e.join(", ")),
  3032. (this._container.innerHTML = i.join(
  3033. ' <span aria-hidden="true">|</span> '
  3034. ));
  3035. }
  3036. },
  3037. }),
  3038. n =
  3039. (A.mergeOptions({ attributionControl: !0 }),
  3040. A.addInitHook(function () {
  3041. this.options.attributionControl && new Ke().addTo(this);
  3042. }),
  3043. (B.Layers = Ve),
  3044. (B.Zoom = qe),
  3045. (B.Scale = Ge),
  3046. (B.Attribution = Ke),
  3047. (Ue.layers = function (t, e, i) {
  3048. return new Ve(t, e, i);
  3049. }),
  3050. (Ue.zoom = function (t) {
  3051. return new qe(t);
  3052. }),
  3053. (Ue.scale = function (t) {
  3054. return new Ge(t);
  3055. }),
  3056. (Ue.attribution = function (t) {
  3057. return new Ke(t);
  3058. }),
  3059. et.extend({
  3060. initialize: function (t) {
  3061. this._map = t;
  3062. },
  3063. enable: function () {
  3064. return this._enabled || ((this._enabled = !0), this.addHooks()), this;
  3065. },
  3066. disable: function () {
  3067. return (
  3068. this._enabled && ((this._enabled = !1), this.removeHooks()), this
  3069. );
  3070. },
  3071. enabled: function () {
  3072. return !!this._enabled;
  3073. },
  3074. })),
  3075. ft =
  3076. ((n.addTo = function (t, e) {
  3077. return t.addHandler(e, this), this;
  3078. }),
  3079. { Events: e }),
  3080. Ye = b.touch ? "touchstart mousedown" : "mousedown",
  3081. Xe = it.extend({
  3082. options: { clickTolerance: 3 },
  3083. initialize: function (t, e, i, n) {
  3084. c(this, n),
  3085. (this._element = t),
  3086. (this._dragStartTarget = e || t),
  3087. (this._preventOutline = i);
  3088. },
  3089. enable: function () {
  3090. this._enabled ||
  3091. (S(this._dragStartTarget, Ye, this._onDown, this),
  3092. (this._enabled = !0));
  3093. },
  3094. disable: function () {
  3095. this._enabled &&
  3096. (Xe._dragging === this && this.finishDrag(!0),
  3097. k(this._dragStartTarget, Ye, this._onDown, this),
  3098. (this._enabled = !1),
  3099. (this._moved = !1));
  3100. },
  3101. _onDown: function (t) {
  3102. var e, i;
  3103. this._enabled &&
  3104. ((this._moved = !1),
  3105. ve(this._element, "leaflet-zoom-anim") ||
  3106. (t.touches && 1 !== t.touches.length
  3107. ? Xe._dragging === this && this.finishDrag()
  3108. : Xe._dragging ||
  3109. t.shiftKey ||
  3110. (1 !== t.which && 1 !== t.button && !t.touches) ||
  3111. ((Xe._dragging = this)._preventOutline && Me(this._element),
  3112. Le(),
  3113. re(),
  3114. this._moving ||
  3115. (this.fire("down"),
  3116. (i = t.touches ? t.touches[0] : t),
  3117. (e = Ce(this._element)),
  3118. (this._startPoint = new p(i.clientX, i.clientY)),
  3119. (this._startPos = Pe(this._element)),
  3120. (this._parentScale = Ze(e)),
  3121. (i = "mousedown" === t.type),
  3122. S(
  3123. document,
  3124. i ? "mousemove" : "touchmove",
  3125. this._onMove,
  3126. this
  3127. ),
  3128. S(
  3129. document,
  3130. i ? "mouseup" : "touchend touchcancel",
  3131. this._onUp,
  3132. this
  3133. )))));
  3134. },
  3135. _onMove: function (t) {
  3136. var e;
  3137. this._enabled &&
  3138. (t.touches && 1 < t.touches.length
  3139. ? (this._moved = !0)
  3140. : (!(e = new p(
  3141. (e =
  3142. t.touches && 1 === t.touches.length
  3143. ? t.touches[0]
  3144. : t).clientX,
  3145. e.clientY
  3146. )._subtract(this._startPoint)).x &&
  3147. !e.y) ||
  3148. Math.abs(e.x) + Math.abs(e.y) < this.options.clickTolerance ||
  3149. ((e.x /= this._parentScale.x),
  3150. (e.y /= this._parentScale.y),
  3151. O(t),
  3152. this._moved ||
  3153. (this.fire("dragstart"),
  3154. (this._moved = !0),
  3155. M(document.body, "leaflet-dragging"),
  3156. (this._lastTarget = t.target || t.srcElement),
  3157. window.SVGElementInstance &&
  3158. this._lastTarget instanceof window.SVGElementInstance &&
  3159. (this._lastTarget = this._lastTarget.correspondingUseElement),
  3160. M(this._lastTarget, "leaflet-drag-target")),
  3161. (this._newPos = this._startPos.add(e)),
  3162. (this._moving = !0),
  3163. (this._lastEvent = t),
  3164. this._updatePosition()));
  3165. },
  3166. _updatePosition: function () {
  3167. var t = { originalEvent: this._lastEvent };
  3168. this.fire("predrag", t),
  3169. Z(this._element, this._newPos),
  3170. this.fire("drag", t);
  3171. },
  3172. _onUp: function () {
  3173. this._enabled && this.finishDrag();
  3174. },
  3175. finishDrag: function (t) {
  3176. z(document.body, "leaflet-dragging"),
  3177. this._lastTarget &&
  3178. (z(this._lastTarget, "leaflet-drag-target"),
  3179. (this._lastTarget = null)),
  3180. k(document, "mousemove touchmove", this._onMove, this),
  3181. k(document, "mouseup touchend touchcancel", this._onUp, this),
  3182. Te(),
  3183. ae();
  3184. var e = this._moved && this._moving;
  3185. (this._moving = !1),
  3186. (Xe._dragging = !1),
  3187. e &&
  3188. this.fire("dragend", {
  3189. noInertia: t,
  3190. distance: this._newPos.distanceTo(this._startPos),
  3191. });
  3192. },
  3193. });
  3194. function Je(t, e, i) {
  3195. for (
  3196. var n, o, s, r, a, h, l, u = [1, 4, 2, 8], c = 0, d = t.length;
  3197. c < d;
  3198. c++
  3199. )
  3200. t[c]._code = si(t[c], e);
  3201. for (s = 0; s < 4; s++) {
  3202. for (h = u[s], n = [], c = 0, o = (d = t.length) - 1; c < d; o = c++)
  3203. (r = t[c]),
  3204. (a = t[o]),
  3205. r._code & h
  3206. ? a._code & h ||
  3207. (((l = oi(a, r, h, e, i))._code = si(l, e)), n.push(l))
  3208. : (a._code & h &&
  3209. (((l = oi(a, r, h, e, i))._code = si(l, e)), n.push(l)),
  3210. n.push(r));
  3211. t = n;
  3212. }
  3213. return t;
  3214. }
  3215. function $e(t, e) {
  3216. var i, n, o, s, r, a, h;
  3217. if (!t || 0 === t.length) throw new Error("latlngs not passed");
  3218. I(t) ||
  3219. (console.warn("latlngs are not flat! Only the first ring will be used"),
  3220. (t = t[0]));
  3221. for (
  3222. var l = w([0, 0]),
  3223. u = g(t),
  3224. c =
  3225. (u.getNorthWest().distanceTo(u.getSouthWest()) *
  3226. u.getNorthEast().distanceTo(u.getNorthWest()) <
  3227. 1700 && (l = Qe(t)),
  3228. t.length),
  3229. d = [],
  3230. _ = 0;
  3231. _ < c;
  3232. _++
  3233. ) {
  3234. var p = w(t[_]);
  3235. d.push(e.project(w([p.lat - l.lat, p.lng - l.lng])));
  3236. }
  3237. for (_ = r = a = h = 0, i = c - 1; _ < c; i = _++)
  3238. (n = d[_]),
  3239. (o = d[i]),
  3240. (s = n.y * o.x - o.y * n.x),
  3241. (a += (n.x + o.x) * s),
  3242. (h += (n.y + o.y) * s),
  3243. (r += 3 * s);
  3244. (u = 0 === r ? d[0] : [a / r, h / r]), (u = e.unproject(m(u)));
  3245. return w([u.lat + l.lat, u.lng + l.lng]);
  3246. }
  3247. function Qe(t) {
  3248. for (var e = 0, i = 0, n = 0, o = 0; o < t.length; o++) {
  3249. var s = w(t[o]);
  3250. (e += s.lat), (i += s.lng), n++;
  3251. }
  3252. return w([e / n, i / n]);
  3253. }
  3254. var ti,
  3255. gt = { __proto__: null, clipPolygon: Je, polygonCenter: $e, centroid: Qe };
  3256. function ei(t, e) {
  3257. if (e && t.length) {
  3258. var i = (t = (function (t, e) {
  3259. for (var i = [t[0]], n = 1, o = 0, s = t.length; n < s; n++)
  3260. (function (t, e) {
  3261. var i = e.x - t.x,
  3262. e = e.y - t.y;
  3263. return i * i + e * e;
  3264. })(t[n], t[o]) > e && (i.push(t[n]), (o = n));
  3265. o < s - 1 && i.push(t[s - 1]);
  3266. return i;
  3267. })(t, (e = e * e))),
  3268. n = i.length,
  3269. o = new (typeof Uint8Array != void 0 + "" ? Uint8Array : Array)(n);
  3270. (o[0] = o[n - 1] = 1),
  3271. (function t(e, i, n, o, s) {
  3272. var r,
  3273. a,
  3274. h,
  3275. l = 0;
  3276. for (a = o + 1; a <= s - 1; a++)
  3277. (h = ri(e[a], e[o], e[s], !0)), l < h && ((r = a), (l = h));
  3278. n < l && ((i[r] = 1), t(e, i, n, o, r), t(e, i, n, r, s));
  3279. })(i, o, e, 0, n - 1);
  3280. var s,
  3281. r = [];
  3282. for (s = 0; s < n; s++) o[s] && r.push(i[s]);
  3283. return r;
  3284. }
  3285. return t.slice();
  3286. }
  3287. function ii(t, e, i) {
  3288. return Math.sqrt(ri(t, e, i, !0));
  3289. }
  3290. function ni(t, e, i, n, o) {
  3291. var s,
  3292. r,
  3293. a,
  3294. h = n ? ti : si(t, i),
  3295. l = si(e, i);
  3296. for (ti = l; ; ) {
  3297. if (!(h | l)) return [t, e];
  3298. if (h & l) return !1;
  3299. (a = si((r = oi(t, e, (s = h || l), i, o)), i)),
  3300. s === h ? ((t = r), (h = a)) : ((e = r), (l = a));
  3301. }
  3302. }
  3303. function oi(t, e, i, n, o) {
  3304. var s,
  3305. r,
  3306. a = e.x - t.x,
  3307. e = e.y - t.y,
  3308. h = n.min,
  3309. n = n.max;
  3310. return (
  3311. 8 & i
  3312. ? ((s = t.x + (a * (n.y - t.y)) / e), (r = n.y))
  3313. : 4 & i
  3314. ? ((s = t.x + (a * (h.y - t.y)) / e), (r = h.y))
  3315. : 2 & i
  3316. ? ((s = n.x), (r = t.y + (e * (n.x - t.x)) / a))
  3317. : 1 & i && ((s = h.x), (r = t.y + (e * (h.x - t.x)) / a)),
  3318. new p(s, r, o)
  3319. );
  3320. }
  3321. function si(t, e) {
  3322. var i = 0;
  3323. return (
  3324. t.x < e.min.x ? (i |= 1) : t.x > e.max.x && (i |= 2),
  3325. t.y < e.min.y ? (i |= 4) : t.y > e.max.y && (i |= 8),
  3326. i
  3327. );
  3328. }
  3329. function ri(t, e, i, n) {
  3330. var o = e.x,
  3331. e = e.y,
  3332. s = i.x - o,
  3333. r = i.y - e,
  3334. a = s * s + r * r;
  3335. return (
  3336. 0 < a &&
  3337. (1 < (a = ((t.x - o) * s + (t.y - e) * r) / a)
  3338. ? ((o = i.x), (e = i.y))
  3339. : 0 < a && ((o += s * a), (e += r * a))),
  3340. (s = t.x - o),
  3341. (r = t.y - e),
  3342. n ? s * s + r * r : new p(o, e)
  3343. );
  3344. }
  3345. function I(t) {
  3346. return !d(t[0]) || ("object" != typeof t[0][0] && void 0 !== t[0][0]);
  3347. }
  3348. function ai(t) {
  3349. return (
  3350. console.warn(
  3351. "Deprecated use of _flat, please use L.LineUtil.isFlat instead."
  3352. ),
  3353. I(t)
  3354. );
  3355. }
  3356. function hi(t, e) {
  3357. var i, n, o, s, r, a;
  3358. if (!t || 0 === t.length) throw new Error("latlngs not passed");
  3359. I(t) ||
  3360. (console.warn("latlngs are not flat! Only the first ring will be used"),
  3361. (t = t[0]));
  3362. for (
  3363. var h = w([0, 0]),
  3364. l = g(t),
  3365. u =
  3366. (l.getNorthWest().distanceTo(l.getSouthWest()) *
  3367. l.getNorthEast().distanceTo(l.getNorthWest()) <
  3368. 1700 && (h = Qe(t)),
  3369. t.length),
  3370. c = [],
  3371. d = 0;
  3372. d < u;
  3373. d++
  3374. ) {
  3375. var _ = w(t[d]);
  3376. c.push(e.project(w([_.lat - h.lat, _.lng - h.lng])));
  3377. }
  3378. for (i = d = 0; d < u - 1; d++) i += c[d].distanceTo(c[d + 1]) / 2;
  3379. if (0 === i) a = c[0];
  3380. else
  3381. for (n = d = 0; d < u - 1; d++)
  3382. if (((o = c[d]), (s = c[d + 1]), i < (n += r = o.distanceTo(s)))) {
  3383. a = [s.x - (r = (n - i) / r) * (s.x - o.x), s.y - r * (s.y - o.y)];
  3384. break;
  3385. }
  3386. l = e.unproject(m(a));
  3387. return w([l.lat + h.lat, l.lng + h.lng]);
  3388. }
  3389. var vt = {
  3390. __proto__: null,
  3391. simplify: ei,
  3392. pointToSegmentDistance: ii,
  3393. closestPointOnSegment: function (t, e, i) {
  3394. return ri(t, e, i);
  3395. },
  3396. clipSegment: ni,
  3397. _getEdgeIntersection: oi,
  3398. _getBitCode: si,
  3399. _sqClosestPointOnSegment: ri,
  3400. isFlat: I,
  3401. _flat: ai,
  3402. polylineCenter: hi,
  3403. },
  3404. yt = {
  3405. project: function (t) {
  3406. return new p(t.lng, t.lat);
  3407. },
  3408. unproject: function (t) {
  3409. return new v(t.y, t.x);
  3410. },
  3411. bounds: new f([-180, -90], [180, 90]),
  3412. },
  3413. xt = {
  3414. R: 6378137,
  3415. R_MINOR: 6356752.314245179,
  3416. bounds: new f(
  3417. [-20037508.34279, -15496570.73972],
  3418. [20037508.34279, 18764656.23138]
  3419. ),
  3420. project: function (t) {
  3421. var e = Math.PI / 180,
  3422. i = this.R,
  3423. n = t.lat * e,
  3424. o = this.R_MINOR / i,
  3425. o = Math.sqrt(1 - o * o),
  3426. s = o * Math.sin(n),
  3427. s =
  3428. Math.tan(Math.PI / 4 - n / 2) / Math.pow((1 - s) / (1 + s), o / 2),
  3429. n = -i * Math.log(Math.max(s, 1e-10));
  3430. return new p(t.lng * e * i, n);
  3431. },
  3432. unproject: function (t) {
  3433. for (
  3434. var e,
  3435. i = 180 / Math.PI,
  3436. n = this.R,
  3437. o = this.R_MINOR / n,
  3438. s = Math.sqrt(1 - o * o),
  3439. r = Math.exp(-t.y / n),
  3440. a = Math.PI / 2 - 2 * Math.atan(r),
  3441. h = 0,
  3442. l = 0.1;
  3443. h < 15 && 1e-7 < Math.abs(l);
  3444. h++
  3445. )
  3446. (e = s * Math.sin(a)),
  3447. (e = Math.pow((1 - e) / (1 + e), s / 2)),
  3448. (a += l = Math.PI / 2 - 2 * Math.atan(r * e) - a);
  3449. return new v(a * i, (t.x * i) / n);
  3450. },
  3451. },
  3452. wt = { __proto__: null, LonLat: yt, Mercator: xt, SphericalMercator: rt },
  3453. Pt = l({}, st, {
  3454. code: "EPSG:3395",
  3455. projection: xt,
  3456. transformation: ht((bt = 0.5 / (Math.PI * xt.R)), 0.5, -bt, 0.5),
  3457. }),
  3458. li = l({}, st, {
  3459. code: "EPSG:4326",
  3460. projection: yt,
  3461. transformation: ht(1 / 180, 1, -1 / 180, 0.5),
  3462. }),
  3463. Lt = l({}, ot, {
  3464. projection: yt,
  3465. transformation: ht(1, 0, -1, 0),
  3466. scale: function (t) {
  3467. return Math.pow(2, t);
  3468. },
  3469. zoom: function (t) {
  3470. return Math.log(t) / Math.LN2;
  3471. },
  3472. distance: function (t, e) {
  3473. var i = e.lng - t.lng,
  3474. e = e.lat - t.lat;
  3475. return Math.sqrt(i * i + e * e);
  3476. },
  3477. infinite: !0,
  3478. }),
  3479. o =
  3480. ((ot.Earth = st),
  3481. (ot.EPSG3395 = Pt),
  3482. (ot.EPSG3857 = lt),
  3483. (ot.EPSG900913 = ut),
  3484. (ot.EPSG4326 = li),
  3485. (ot.Simple = Lt),
  3486. it.extend({
  3487. options: {
  3488. pane: "overlayPane",
  3489. attribution: null,
  3490. bubblingMouseEvents: !0,
  3491. },
  3492. addTo: function (t) {
  3493. return t.addLayer(this), this;
  3494. },
  3495. remove: function () {
  3496. return this.removeFrom(this._map || this._mapToAdd);
  3497. },
  3498. removeFrom: function (t) {
  3499. return t && t.removeLayer(this), this;
  3500. },
  3501. getPane: function (t) {
  3502. return this._map.getPane(
  3503. t ? this.options[t] || t : this.options.pane
  3504. );
  3505. },
  3506. addInteractiveTarget: function (t) {
  3507. return (this._map._targets[h(t)] = this);
  3508. },
  3509. removeInteractiveTarget: function (t) {
  3510. return delete this._map._targets[h(t)], this;
  3511. },
  3512. getAttribution: function () {
  3513. return this.options.attribution;
  3514. },
  3515. _layerAdd: function (t) {
  3516. var e,
  3517. i = t.target;
  3518. i.hasLayer(this) &&
  3519. ((this._map = i),
  3520. (this._zoomAnimated = i._zoomAnimated),
  3521. this.getEvents &&
  3522. ((e = this.getEvents()),
  3523. i.on(e, this),
  3524. this.once(
  3525. "remove",
  3526. function () {
  3527. i.off(e, this);
  3528. },
  3529. this
  3530. )),
  3531. this.onAdd(i),
  3532. this.fire("add"),
  3533. i.fire("layeradd", { layer: this }));
  3534. },
  3535. })),
  3536. ui =
  3537. (A.include({
  3538. addLayer: function (t) {
  3539. var e;
  3540. if (t._layerAdd)
  3541. return (
  3542. (e = h(t)),
  3543. this._layers[e] ||
  3544. (((this._layers[e] = t)._mapToAdd = this),
  3545. t.beforeAdd && t.beforeAdd(this),
  3546. this.whenReady(t._layerAdd, t)),
  3547. this
  3548. );
  3549. throw new Error("The provided object is not a Layer.");
  3550. },
  3551. removeLayer: function (t) {
  3552. var e = h(t);
  3553. return (
  3554. this._layers[e] &&
  3555. (this._loaded && t.onRemove(this),
  3556. delete this._layers[e],
  3557. this._loaded &&
  3558. (this.fire("layerremove", { layer: t }), t.fire("remove")),
  3559. (t._map = t._mapToAdd = null)),
  3560. this
  3561. );
  3562. },
  3563. hasLayer: function (t) {
  3564. return h(t) in this._layers;
  3565. },
  3566. eachLayer: function (t, e) {
  3567. for (var i in this._layers) t.call(e, this._layers[i]);
  3568. return this;
  3569. },
  3570. _addLayers: function (t) {
  3571. for (
  3572. var e = 0, i = (t = t ? (d(t) ? t : [t]) : []).length;
  3573. e < i;
  3574. e++
  3575. )
  3576. this.addLayer(t[e]);
  3577. },
  3578. _addZoomLimit: function (t) {
  3579. (isNaN(t.options.maxZoom) && isNaN(t.options.minZoom)) ||
  3580. ((this._zoomBoundLayers[h(t)] = t), this._updateZoomLevels());
  3581. },
  3582. _removeZoomLimit: function (t) {
  3583. t = h(t);
  3584. this._zoomBoundLayers[t] &&
  3585. (delete this._zoomBoundLayers[t], this._updateZoomLevels());
  3586. },
  3587. _updateZoomLevels: function () {
  3588. var t,
  3589. e = 1 / 0,
  3590. i = -1 / 0,
  3591. n = this._getZoomSpan();
  3592. for (t in this._zoomBoundLayers)
  3593. var o = this._zoomBoundLayers[t].options,
  3594. e = void 0 === o.minZoom ? e : Math.min(e, o.minZoom),
  3595. i = void 0 === o.maxZoom ? i : Math.max(i, o.maxZoom);
  3596. (this._layersMaxZoom = i === -1 / 0 ? void 0 : i),
  3597. (this._layersMinZoom = e === 1 / 0 ? void 0 : e),
  3598. n !== this._getZoomSpan() && this.fire("zoomlevelschange"),
  3599. void 0 === this.options.maxZoom &&
  3600. this._layersMaxZoom &&
  3601. this.getZoom() > this._layersMaxZoom &&
  3602. this.setZoom(this._layersMaxZoom),
  3603. void 0 === this.options.minZoom &&
  3604. this._layersMinZoom &&
  3605. this.getZoom() < this._layersMinZoom &&
  3606. this.setZoom(this._layersMinZoom);
  3607. },
  3608. }),
  3609. o.extend({
  3610. initialize: function (t, e) {
  3611. var i, n;
  3612. if ((c(this, e), (this._layers = {}), t))
  3613. for (i = 0, n = t.length; i < n; i++) this.addLayer(t[i]);
  3614. },
  3615. addLayer: function (t) {
  3616. var e = this.getLayerId(t);
  3617. return (
  3618. (this._layers[e] = t), this._map && this._map.addLayer(t), this
  3619. );
  3620. },
  3621. removeLayer: function (t) {
  3622. t = t in this._layers ? t : this.getLayerId(t);
  3623. return (
  3624. this._map &&
  3625. this._layers[t] &&
  3626. this._map.removeLayer(this._layers[t]),
  3627. delete this._layers[t],
  3628. this
  3629. );
  3630. },
  3631. hasLayer: function (t) {
  3632. return (
  3633. ("number" == typeof t ? t : this.getLayerId(t)) in this._layers
  3634. );
  3635. },
  3636. clearLayers: function () {
  3637. return this.eachLayer(this.removeLayer, this);
  3638. },
  3639. invoke: function (t) {
  3640. var e,
  3641. i,
  3642. n = Array.prototype.slice.call(arguments, 1);
  3643. for (e in this._layers) (i = this._layers[e])[t] && i[t].apply(i, n);
  3644. return this;
  3645. },
  3646. onAdd: function (t) {
  3647. this.eachLayer(t.addLayer, t);
  3648. },
  3649. onRemove: function (t) {
  3650. this.eachLayer(t.removeLayer, t);
  3651. },
  3652. eachLayer: function (t, e) {
  3653. for (var i in this._layers) t.call(e, this._layers[i]);
  3654. return this;
  3655. },
  3656. getLayer: function (t) {
  3657. return this._layers[t];
  3658. },
  3659. getLayers: function () {
  3660. var t = [];
  3661. return this.eachLayer(t.push, t), t;
  3662. },
  3663. setZIndex: function (t) {
  3664. return this.invoke("setZIndex", t);
  3665. },
  3666. getLayerId: h,
  3667. })),
  3668. ci = ui.extend({
  3669. addLayer: function (t) {
  3670. return this.hasLayer(t)
  3671. ? this
  3672. : (t.addEventParent(this),
  3673. ui.prototype.addLayer.call(this, t),
  3674. this.fire("layeradd", { layer: t }));
  3675. },
  3676. removeLayer: function (t) {
  3677. return this.hasLayer(t)
  3678. ? ((t = t in this._layers ? this._layers[t] : t).removeEventParent(
  3679. this
  3680. ),
  3681. ui.prototype.removeLayer.call(this, t),
  3682. this.fire("layerremove", { layer: t }))
  3683. : this;
  3684. },
  3685. setStyle: function (t) {
  3686. return this.invoke("setStyle", t);
  3687. },
  3688. bringToFront: function () {
  3689. return this.invoke("bringToFront");
  3690. },
  3691. bringToBack: function () {
  3692. return this.invoke("bringToBack");
  3693. },
  3694. getBounds: function () {
  3695. var t,
  3696. e = new s();
  3697. for (t in this._layers) {
  3698. var i = this._layers[t];
  3699. e.extend(i.getBounds ? i.getBounds() : i.getLatLng());
  3700. }
  3701. return e;
  3702. },
  3703. }),
  3704. di = et.extend({
  3705. options: { popupAnchor: [0, 0], tooltipAnchor: [0, 0], crossOrigin: !1 },
  3706. initialize: function (t) {
  3707. c(this, t);
  3708. },
  3709. createIcon: function (t) {
  3710. return this._createIcon("icon", t);
  3711. },
  3712. createShadow: function (t) {
  3713. return this._createIcon("shadow", t);
  3714. },
  3715. _createIcon: function (t, e) {
  3716. var i = this._getIconUrl(t);
  3717. if (i)
  3718. return (
  3719. (i = this._createImg(i, e && "IMG" === e.tagName ? e : null)),
  3720. this._setIconStyles(i, t),
  3721. (!this.options.crossOrigin && "" !== this.options.crossOrigin) ||
  3722. (i.crossOrigin =
  3723. !0 === this.options.crossOrigin
  3724. ? ""
  3725. : this.options.crossOrigin),
  3726. i
  3727. );
  3728. if ("icon" === t)
  3729. throw new Error("iconUrl not set in Icon options (see the docs).");
  3730. return null;
  3731. },
  3732. _setIconStyles: function (t, e) {
  3733. var i = this.options,
  3734. n = i[e + "Size"],
  3735. n = m((n = "number" == typeof n ? [n, n] : n)),
  3736. o = m(
  3737. ("shadow" === e && i.shadowAnchor) ||
  3738. i.iconAnchor ||
  3739. (n && n.divideBy(2, !0))
  3740. );
  3741. (t.className = "leaflet-marker-" + e + " " + (i.className || "")),
  3742. o &&
  3743. ((t.style.marginLeft = -o.x + "px"),
  3744. (t.style.marginTop = -o.y + "px")),
  3745. n && ((t.style.width = n.x + "px"), (t.style.height = n.y + "px"));
  3746. },
  3747. _createImg: function (t, e) {
  3748. return ((e = e || document.createElement("img")).src = t), e;
  3749. },
  3750. _getIconUrl: function (t) {
  3751. return (
  3752. (b.retina && this.options[t + "RetinaUrl"]) || this.options[t + "Url"]
  3753. );
  3754. },
  3755. });
  3756. var _i = di.extend({
  3757. options: {
  3758. iconUrl: "marker-icon.png",
  3759. iconRetinaUrl: "marker-icon-2x.png",
  3760. shadowUrl: "marker-shadow.png",
  3761. iconSize: [25, 41],
  3762. iconAnchor: [12, 41],
  3763. popupAnchor: [1, -34],
  3764. tooltipAnchor: [16, -28],
  3765. shadowSize: [41, 41],
  3766. },
  3767. _getIconUrl: function (t) {
  3768. return (
  3769. "string" != typeof _i.imagePath &&
  3770. (_i.imagePath = this._detectIconPath()),
  3771. (this.options.imagePath || _i.imagePath) +
  3772. di.prototype._getIconUrl.call(this, t)
  3773. );
  3774. },
  3775. _stripUrl: function (t) {
  3776. function e(t, e, i) {
  3777. return (e = e.exec(t)) && e[i];
  3778. }
  3779. return (
  3780. (t = e(t, /^url\((['"])?(.+)\1\)$/, 2)) &&
  3781. e(t, /^(.*)marker-icon\.png$/, 1)
  3782. );
  3783. },
  3784. _detectIconPath: function () {
  3785. var t = P("div", "leaflet-default-icon-path", document.body),
  3786. e = pe(t, "background-image") || pe(t, "backgroundImage");
  3787. return (
  3788. document.body.removeChild(t),
  3789. (e = this._stripUrl(e))
  3790. ? e
  3791. : (t = document.querySelector('link[href$="leaflet.css"]'))
  3792. ? t.href.substring(0, t.href.length - "leaflet.css".length - 1)
  3793. : ""
  3794. );
  3795. },
  3796. }),
  3797. pi = n.extend({
  3798. initialize: function (t) {
  3799. this._marker = t;
  3800. },
  3801. addHooks: function () {
  3802. var t = this._marker._icon;
  3803. this._draggable || (this._draggable = new Xe(t, t, !0)),
  3804. this._draggable
  3805. .on(
  3806. {
  3807. dragstart: this._onDragStart,
  3808. predrag: this._onPreDrag,
  3809. drag: this._onDrag,
  3810. dragend: this._onDragEnd,
  3811. },
  3812. this
  3813. )
  3814. .enable(),
  3815. M(t, "leaflet-marker-draggable");
  3816. },
  3817. removeHooks: function () {
  3818. this._draggable
  3819. .off(
  3820. {
  3821. dragstart: this._onDragStart,
  3822. predrag: this._onPreDrag,
  3823. drag: this._onDrag,
  3824. dragend: this._onDragEnd,
  3825. },
  3826. this
  3827. )
  3828. .disable(),
  3829. this._marker._icon &&
  3830. z(this._marker._icon, "leaflet-marker-draggable");
  3831. },
  3832. moved: function () {
  3833. return this._draggable && this._draggable._moved;
  3834. },
  3835. _adjustPan: function (t) {
  3836. var e = this._marker,
  3837. i = e._map,
  3838. n = this._marker.options.autoPanSpeed,
  3839. o = this._marker.options.autoPanPadding,
  3840. s = Pe(e._icon),
  3841. r = i.getPixelBounds(),
  3842. a = i.getPixelOrigin(),
  3843. a = _(r.min._subtract(a).add(o), r.max._subtract(a).subtract(o));
  3844. a.contains(s) ||
  3845. ((o = m(
  3846. (Math.max(a.max.x, s.x) - a.max.x) / (r.max.x - a.max.x) -
  3847. (Math.min(a.min.x, s.x) - a.min.x) / (r.min.x - a.min.x),
  3848. (Math.max(a.max.y, s.y) - a.max.y) / (r.max.y - a.max.y) -
  3849. (Math.min(a.min.y, s.y) - a.min.y) / (r.min.y - a.min.y)
  3850. ).multiplyBy(n)),
  3851. i.panBy(o, { animate: !1 }),
  3852. this._draggable._newPos._add(o),
  3853. this._draggable._startPos._add(o),
  3854. Z(e._icon, this._draggable._newPos),
  3855. this._onDrag(t),
  3856. (this._panRequest = x(this._adjustPan.bind(this, t))));
  3857. },
  3858. _onDragStart: function () {
  3859. (this._oldLatLng = this._marker.getLatLng()),
  3860. this._marker.closePopup && this._marker.closePopup(),
  3861. this._marker.fire("movestart").fire("dragstart");
  3862. },
  3863. _onPreDrag: function (t) {
  3864. this._marker.options.autoPan &&
  3865. (r(this._panRequest),
  3866. (this._panRequest = x(this._adjustPan.bind(this, t))));
  3867. },
  3868. _onDrag: function (t) {
  3869. var e = this._marker,
  3870. i = e._shadow,
  3871. n = Pe(e._icon),
  3872. o = e._map.layerPointToLatLng(n);
  3873. i && Z(i, n),
  3874. (e._latlng = o),
  3875. (t.latlng = o),
  3876. (t.oldLatLng = this._oldLatLng),
  3877. e.fire("move", t).fire("drag", t);
  3878. },
  3879. _onDragEnd: function (t) {
  3880. r(this._panRequest),
  3881. delete this._oldLatLng,
  3882. this._marker.fire("moveend").fire("dragend", t);
  3883. },
  3884. }),
  3885. mi = o.extend({
  3886. options: {
  3887. icon: new _i(),
  3888. interactive: !0,
  3889. keyboard: !0,
  3890. title: "",
  3891. alt: "Marker",
  3892. zIndexOffset: 0,
  3893. opacity: 1,
  3894. riseOnHover: !1,
  3895. riseOffset: 250,
  3896. pane: "markerPane",
  3897. shadowPane: "shadowPane",
  3898. bubblingMouseEvents: !1,
  3899. autoPanOnFocus: !0,
  3900. draggable: !1,
  3901. autoPan: !1,
  3902. autoPanPadding: [50, 50],
  3903. autoPanSpeed: 10,
  3904. },
  3905. initialize: function (t, e) {
  3906. c(this, e), (this._latlng = w(t));
  3907. },
  3908. onAdd: function (t) {
  3909. (this._zoomAnimated =
  3910. this._zoomAnimated && t.options.markerZoomAnimation),
  3911. this._zoomAnimated && t.on("zoomanim", this._animateZoom, this),
  3912. this._initIcon(),
  3913. this.update();
  3914. },
  3915. onRemove: function (t) {
  3916. this.dragging &&
  3917. this.dragging.enabled() &&
  3918. ((this.options.draggable = !0), this.dragging.removeHooks()),
  3919. delete this.dragging,
  3920. this._zoomAnimated && t.off("zoomanim", this._animateZoom, this),
  3921. this._removeIcon(),
  3922. this._removeShadow();
  3923. },
  3924. getEvents: function () {
  3925. return { zoom: this.update, viewreset: this.update };
  3926. },
  3927. getLatLng: function () {
  3928. return this._latlng;
  3929. },
  3930. setLatLng: function (t) {
  3931. var e = this._latlng;
  3932. return (
  3933. (this._latlng = w(t)),
  3934. this.update(),
  3935. this.fire("move", { oldLatLng: e, latlng: this._latlng })
  3936. );
  3937. },
  3938. setZIndexOffset: function (t) {
  3939. return (this.options.zIndexOffset = t), this.update();
  3940. },
  3941. getIcon: function () {
  3942. return this.options.icon;
  3943. },
  3944. setIcon: function (t) {
  3945. return (
  3946. (this.options.icon = t),
  3947. this._map && (this._initIcon(), this.update()),
  3948. this._popup && this.bindPopup(this._popup, this._popup.options),
  3949. this
  3950. );
  3951. },
  3952. getElement: function () {
  3953. return this._icon;
  3954. },
  3955. update: function () {
  3956. var t;
  3957. return (
  3958. this._icon &&
  3959. this._map &&
  3960. ((t = this._map.latLngToLayerPoint(this._latlng).round()),
  3961. this._setPos(t)),
  3962. this
  3963. );
  3964. },
  3965. _initIcon: function () {
  3966. var t = this.options,
  3967. e = "leaflet-zoom-" + (this._zoomAnimated ? "animated" : "hide"),
  3968. i = t.icon.createIcon(this._icon),
  3969. n = !1,
  3970. i =
  3971. (i !== this._icon &&
  3972. (this._icon && this._removeIcon(),
  3973. (n = !0),
  3974. t.title && (i.title = t.title),
  3975. "IMG" === i.tagName && (i.alt = t.alt || "")),
  3976. M(i, e),
  3977. t.keyboard &&
  3978. ((i.tabIndex = "0"), i.setAttribute("role", "button")),
  3979. (this._icon = i),
  3980. t.riseOnHover &&
  3981. this.on({
  3982. mouseover: this._bringToFront,
  3983. mouseout: this._resetZIndex,
  3984. }),
  3985. this.options.autoPanOnFocus &&
  3986. S(i, "focus", this._panOnFocus, this),
  3987. t.icon.createShadow(this._shadow)),
  3988. o = !1;
  3989. i !== this._shadow && (this._removeShadow(), (o = !0)),
  3990. i && (M(i, e), (i.alt = "")),
  3991. (this._shadow = i),
  3992. t.opacity < 1 && this._updateOpacity(),
  3993. n && this.getPane().appendChild(this._icon),
  3994. this._initInteraction(),
  3995. i && o && this.getPane(t.shadowPane).appendChild(this._shadow);
  3996. },
  3997. _removeIcon: function () {
  3998. this.options.riseOnHover &&
  3999. this.off({
  4000. mouseover: this._bringToFront,
  4001. mouseout: this._resetZIndex,
  4002. }),
  4003. this.options.autoPanOnFocus &&
  4004. k(this._icon, "focus", this._panOnFocus, this),
  4005. T(this._icon),
  4006. this.removeInteractiveTarget(this._icon),
  4007. (this._icon = null);
  4008. },
  4009. _removeShadow: function () {
  4010. this._shadow && T(this._shadow), (this._shadow = null);
  4011. },
  4012. _setPos: function (t) {
  4013. this._icon && Z(this._icon, t),
  4014. this._shadow && Z(this._shadow, t),
  4015. (this._zIndex = t.y + this.options.zIndexOffset),
  4016. this._resetZIndex();
  4017. },
  4018. _updateZIndex: function (t) {
  4019. this._icon && (this._icon.style.zIndex = this._zIndex + t);
  4020. },
  4021. _animateZoom: function (t) {
  4022. t = this._map
  4023. ._latLngToNewLayerPoint(this._latlng, t.zoom, t.center)
  4024. .round();
  4025. this._setPos(t);
  4026. },
  4027. _initInteraction: function () {
  4028. var t;
  4029. this.options.interactive &&
  4030. (M(this._icon, "leaflet-interactive"),
  4031. this.addInteractiveTarget(this._icon),
  4032. pi &&
  4033. ((t = this.options.draggable),
  4034. this.dragging &&
  4035. ((t = this.dragging.enabled()), this.dragging.disable()),
  4036. (this.dragging = new pi(this)),
  4037. t && this.dragging.enable()));
  4038. },
  4039. setOpacity: function (t) {
  4040. return (
  4041. (this.options.opacity = t), this._map && this._updateOpacity(), this
  4042. );
  4043. },
  4044. _updateOpacity: function () {
  4045. var t = this.options.opacity;
  4046. this._icon && C(this._icon, t), this._shadow && C(this._shadow, t);
  4047. },
  4048. _bringToFront: function () {
  4049. this._updateZIndex(this.options.riseOffset);
  4050. },
  4051. _resetZIndex: function () {
  4052. this._updateZIndex(0);
  4053. },
  4054. _panOnFocus: function () {
  4055. var t,
  4056. e,
  4057. i = this._map;
  4058. i &&
  4059. ((t = (e = this.options.icon.options).iconSize
  4060. ? m(e.iconSize)
  4061. : m(0, 0)),
  4062. (e = e.iconAnchor ? m(e.iconAnchor) : m(0, 0)),
  4063. i.panInside(this._latlng, {
  4064. paddingTopLeft: e,
  4065. paddingBottomRight: t.subtract(e),
  4066. }));
  4067. },
  4068. _getPopupAnchor: function () {
  4069. return this.options.icon.options.popupAnchor;
  4070. },
  4071. _getTooltipAnchor: function () {
  4072. return this.options.icon.options.tooltipAnchor;
  4073. },
  4074. });
  4075. var fi = o.extend({
  4076. options: {
  4077. stroke: !0,
  4078. color: "#3388ff",
  4079. weight: 3,
  4080. opacity: 1,
  4081. lineCap: "round",
  4082. lineJoin: "round",
  4083. dashArray: null,
  4084. dashOffset: null,
  4085. fill: !1,
  4086. fillColor: null,
  4087. fillOpacity: 0.2,
  4088. fillRule: "evenodd",
  4089. interactive: !0,
  4090. bubblingMouseEvents: !0,
  4091. },
  4092. beforeAdd: function (t) {
  4093. this._renderer = t.getRenderer(this);
  4094. },
  4095. onAdd: function () {
  4096. this._renderer._initPath(this),
  4097. this._reset(),
  4098. this._renderer._addPath(this);
  4099. },
  4100. onRemove: function () {
  4101. this._renderer._removePath(this);
  4102. },
  4103. redraw: function () {
  4104. return this._map && this._renderer._updatePath(this), this;
  4105. },
  4106. setStyle: function (t) {
  4107. return (
  4108. c(this, t),
  4109. this._renderer &&
  4110. (this._renderer._updateStyle(this),
  4111. this.options.stroke &&
  4112. t &&
  4113. Object.prototype.hasOwnProperty.call(t, "weight") &&
  4114. this._updateBounds()),
  4115. this
  4116. );
  4117. },
  4118. bringToFront: function () {
  4119. return this._renderer && this._renderer._bringToFront(this), this;
  4120. },
  4121. bringToBack: function () {
  4122. return this._renderer && this._renderer._bringToBack(this), this;
  4123. },
  4124. getElement: function () {
  4125. return this._path;
  4126. },
  4127. _reset: function () {
  4128. this._project(), this._update();
  4129. },
  4130. _clickTolerance: function () {
  4131. return (
  4132. (this.options.stroke ? this.options.weight / 2 : 0) +
  4133. (this._renderer.options.tolerance || 0)
  4134. );
  4135. },
  4136. }),
  4137. gi = fi.extend({
  4138. options: { fill: !0, radius: 10 },
  4139. initialize: function (t, e) {
  4140. c(this, e), (this._latlng = w(t)), (this._radius = this.options.radius);
  4141. },
  4142. setLatLng: function (t) {
  4143. var e = this._latlng;
  4144. return (
  4145. (this._latlng = w(t)),
  4146. this.redraw(),
  4147. this.fire("move", { oldLatLng: e, latlng: this._latlng })
  4148. );
  4149. },
  4150. getLatLng: function () {
  4151. return this._latlng;
  4152. },
  4153. setRadius: function (t) {
  4154. return (this.options.radius = this._radius = t), this.redraw();
  4155. },
  4156. getRadius: function () {
  4157. return this._radius;
  4158. },
  4159. setStyle: function (t) {
  4160. var e = (t && t.radius) || this._radius;
  4161. return fi.prototype.setStyle.call(this, t), this.setRadius(e), this;
  4162. },
  4163. _project: function () {
  4164. (this._point = this._map.latLngToLayerPoint(this._latlng)),
  4165. this._updateBounds();
  4166. },
  4167. _updateBounds: function () {
  4168. var t = this._radius,
  4169. e = this._radiusY || t,
  4170. i = this._clickTolerance(),
  4171. t = [t + i, e + i];
  4172. this._pxBounds = new f(this._point.subtract(t), this._point.add(t));
  4173. },
  4174. _update: function () {
  4175. this._map && this._updatePath();
  4176. },
  4177. _updatePath: function () {
  4178. this._renderer._updateCircle(this);
  4179. },
  4180. _empty: function () {
  4181. return (
  4182. this._radius && !this._renderer._bounds.intersects(this._pxBounds)
  4183. );
  4184. },
  4185. _containsPoint: function (t) {
  4186. return (
  4187. t.distanceTo(this._point) <= this._radius + this._clickTolerance()
  4188. );
  4189. },
  4190. });
  4191. var vi = gi.extend({
  4192. initialize: function (t, e, i) {
  4193. if (
  4194. (c(this, (e = "number" == typeof e ? l({}, i, { radius: e }) : e)),
  4195. (this._latlng = w(t)),
  4196. isNaN(this.options.radius))
  4197. )
  4198. throw new Error("Circle radius cannot be NaN");
  4199. this._mRadius = this.options.radius;
  4200. },
  4201. setRadius: function (t) {
  4202. return (this._mRadius = t), this.redraw();
  4203. },
  4204. getRadius: function () {
  4205. return this._mRadius;
  4206. },
  4207. getBounds: function () {
  4208. var t = [this._radius, this._radiusY || this._radius];
  4209. return new s(
  4210. this._map.layerPointToLatLng(this._point.subtract(t)),
  4211. this._map.layerPointToLatLng(this._point.add(t))
  4212. );
  4213. },
  4214. setStyle: fi.prototype.setStyle,
  4215. _project: function () {
  4216. var t,
  4217. e,
  4218. i,
  4219. n,
  4220. o,
  4221. s = this._latlng.lng,
  4222. r = this._latlng.lat,
  4223. a = this._map,
  4224. h = a.options.crs;
  4225. h.distance === st.distance
  4226. ? ((n = Math.PI / 180),
  4227. (o = this._mRadius / st.R / n),
  4228. (t = a.project([r + o, s])),
  4229. (e = a.project([r - o, s])),
  4230. (e = t.add(e).divideBy(2)),
  4231. (i = a.unproject(e).lat),
  4232. (n =
  4233. Math.acos(
  4234. (Math.cos(o * n) - Math.sin(r * n) * Math.sin(i * n)) /
  4235. (Math.cos(r * n) * Math.cos(i * n))
  4236. ) / n),
  4237. (!isNaN(n) && 0 !== n) || (n = o / Math.cos((Math.PI / 180) * r)),
  4238. (this._point = e.subtract(a.getPixelOrigin())),
  4239. (this._radius = isNaN(n) ? 0 : e.x - a.project([i, s - n]).x),
  4240. (this._radiusY = e.y - t.y))
  4241. : ((o = h.unproject(
  4242. h.project(this._latlng).subtract([this._mRadius, 0])
  4243. )),
  4244. (this._point = a.latLngToLayerPoint(this._latlng)),
  4245. (this._radius = this._point.x - a.latLngToLayerPoint(o).x)),
  4246. this._updateBounds();
  4247. },
  4248. });
  4249. var yi = fi.extend({
  4250. options: { smoothFactor: 1, noClip: !1 },
  4251. initialize: function (t, e) {
  4252. c(this, e), this._setLatLngs(t);
  4253. },
  4254. getLatLngs: function () {
  4255. return this._latlngs;
  4256. },
  4257. setLatLngs: function (t) {
  4258. return this._setLatLngs(t), this.redraw();
  4259. },
  4260. isEmpty: function () {
  4261. return !this._latlngs.length;
  4262. },
  4263. closestLayerPoint: function (t) {
  4264. for (
  4265. var e = 1 / 0, i = null, n = ri, o = 0, s = this._parts.length;
  4266. o < s;
  4267. o++
  4268. )
  4269. for (var r = this._parts[o], a = 1, h = r.length; a < h; a++) {
  4270. var l,
  4271. u,
  4272. c = n(t, (l = r[a - 1]), (u = r[a]), !0);
  4273. c < e && ((e = c), (i = n(t, l, u)));
  4274. }
  4275. return i && (i.distance = Math.sqrt(e)), i;
  4276. },
  4277. getCenter: function () {
  4278. if (this._map) return hi(this._defaultShape(), this._map.options.crs);
  4279. throw new Error("Must add layer to map before using getCenter()");
  4280. },
  4281. getBounds: function () {
  4282. return this._bounds;
  4283. },
  4284. addLatLng: function (t, e) {
  4285. return (
  4286. (e = e || this._defaultShape()),
  4287. (t = w(t)),
  4288. e.push(t),
  4289. this._bounds.extend(t),
  4290. this.redraw()
  4291. );
  4292. },
  4293. _setLatLngs: function (t) {
  4294. (this._bounds = new s()), (this._latlngs = this._convertLatLngs(t));
  4295. },
  4296. _defaultShape: function () {
  4297. return I(this._latlngs) ? this._latlngs : this._latlngs[0];
  4298. },
  4299. _convertLatLngs: function (t) {
  4300. for (var e = [], i = I(t), n = 0, o = t.length; n < o; n++)
  4301. i
  4302. ? ((e[n] = w(t[n])), this._bounds.extend(e[n]))
  4303. : (e[n] = this._convertLatLngs(t[n]));
  4304. return e;
  4305. },
  4306. _project: function () {
  4307. var t = new f();
  4308. (this._rings = []),
  4309. this._projectLatlngs(this._latlngs, this._rings, t),
  4310. this._bounds.isValid() &&
  4311. t.isValid() &&
  4312. ((this._rawPxBounds = t), this._updateBounds());
  4313. },
  4314. _updateBounds: function () {
  4315. var t = this._clickTolerance(),
  4316. t = new p(t, t);
  4317. this._rawPxBounds &&
  4318. (this._pxBounds = new f([
  4319. this._rawPxBounds.min.subtract(t),
  4320. this._rawPxBounds.max.add(t),
  4321. ]));
  4322. },
  4323. _projectLatlngs: function (t, e, i) {
  4324. var n,
  4325. o,
  4326. s = t[0] instanceof v,
  4327. r = t.length;
  4328. if (s) {
  4329. for (o = [], n = 0; n < r; n++)
  4330. (o[n] = this._map.latLngToLayerPoint(t[n])), i.extend(o[n]);
  4331. e.push(o);
  4332. } else for (n = 0; n < r; n++) this._projectLatlngs(t[n], e, i);
  4333. },
  4334. _clipPoints: function () {
  4335. var t = this._renderer._bounds;
  4336. if (((this._parts = []), this._pxBounds && this._pxBounds.intersects(t)))
  4337. if (this.options.noClip) this._parts = this._rings;
  4338. else
  4339. for (
  4340. var e,
  4341. i,
  4342. n,
  4343. o,
  4344. s = this._parts,
  4345. r = 0,
  4346. a = 0,
  4347. h = this._rings.length;
  4348. r < h;
  4349. r++
  4350. )
  4351. for (e = 0, i = (o = this._rings[r]).length; e < i - 1; e++)
  4352. (n = ni(o[e], o[e + 1], t, e, !0)) &&
  4353. ((s[a] = s[a] || []),
  4354. s[a].push(n[0]),
  4355. (n[1] === o[e + 1] && e !== i - 2) || (s[a].push(n[1]), a++));
  4356. },
  4357. _simplifyPoints: function () {
  4358. for (
  4359. var t = this._parts, e = this.options.smoothFactor, i = 0, n = t.length;
  4360. i < n;
  4361. i++
  4362. )
  4363. t[i] = ei(t[i], e);
  4364. },
  4365. _update: function () {
  4366. this._map &&
  4367. (this._clipPoints(), this._simplifyPoints(), this._updatePath());
  4368. },
  4369. _updatePath: function () {
  4370. this._renderer._updatePoly(this);
  4371. },
  4372. _containsPoint: function (t, e) {
  4373. var i,
  4374. n,
  4375. o,
  4376. s,
  4377. r,
  4378. a,
  4379. h = this._clickTolerance();
  4380. if (this._pxBounds && this._pxBounds.contains(t))
  4381. for (i = 0, s = this._parts.length; i < s; i++)
  4382. for (n = 0, o = (r = (a = this._parts[i]).length) - 1; n < r; o = n++)
  4383. if ((e || 0 !== n) && ii(t, a[o], a[n]) <= h) return !0;
  4384. return !1;
  4385. },
  4386. });
  4387. yi._flat = ai;
  4388. var xi = yi.extend({
  4389. options: { fill: !0 },
  4390. isEmpty: function () {
  4391. return !this._latlngs.length || !this._latlngs[0].length;
  4392. },
  4393. getCenter: function () {
  4394. if (this._map) return $e(this._defaultShape(), this._map.options.crs);
  4395. throw new Error("Must add layer to map before using getCenter()");
  4396. },
  4397. _convertLatLngs: function (t) {
  4398. var t = yi.prototype._convertLatLngs.call(this, t),
  4399. e = t.length;
  4400. return 2 <= e && t[0] instanceof v && t[0].equals(t[e - 1]) && t.pop(), t;
  4401. },
  4402. _setLatLngs: function (t) {
  4403. yi.prototype._setLatLngs.call(this, t),
  4404. I(this._latlngs) && (this._latlngs = [this._latlngs]);
  4405. },
  4406. _defaultShape: function () {
  4407. return (I(this._latlngs[0]) ? this._latlngs : this._latlngs[0])[0];
  4408. },
  4409. _clipPoints: function () {
  4410. var t = this._renderer._bounds,
  4411. e = this.options.weight,
  4412. e = new p(e, e),
  4413. t = new f(t.min.subtract(e), t.max.add(e));
  4414. if (((this._parts = []), this._pxBounds && this._pxBounds.intersects(t)))
  4415. if (this.options.noClip) this._parts = this._rings;
  4416. else
  4417. for (var i, n = 0, o = this._rings.length; n < o; n++)
  4418. (i = Je(this._rings[n], t, !0)).length && this._parts.push(i);
  4419. },
  4420. _updatePath: function () {
  4421. this._renderer._updatePoly(this, !0);
  4422. },
  4423. _containsPoint: function (t) {
  4424. var e,
  4425. i,
  4426. n,
  4427. o,
  4428. s,
  4429. r,
  4430. a,
  4431. h,
  4432. l = !1;
  4433. if (!this._pxBounds || !this._pxBounds.contains(t)) return !1;
  4434. for (o = 0, a = this._parts.length; o < a; o++)
  4435. for (s = 0, r = (h = (e = this._parts[o]).length) - 1; s < h; r = s++)
  4436. (i = e[s]),
  4437. (n = e[r]),
  4438. i.y > t.y != n.y > t.y &&
  4439. t.x < ((n.x - i.x) * (t.y - i.y)) / (n.y - i.y) + i.x &&
  4440. (l = !l);
  4441. return l || yi.prototype._containsPoint.call(this, t, !0);
  4442. },
  4443. });
  4444. var wi = ci.extend({
  4445. initialize: function (t, e) {
  4446. c(this, e), (this._layers = {}), t && this.addData(t);
  4447. },
  4448. addData: function (t) {
  4449. var e,
  4450. i,
  4451. n,
  4452. o = d(t) ? t : t.features;
  4453. if (o) {
  4454. for (e = 0, i = o.length; e < i; e++)
  4455. ((n = o[e]).geometries ||
  4456. n.geometry ||
  4457. n.features ||
  4458. n.coordinates) &&
  4459. this.addData(n);
  4460. return this;
  4461. }
  4462. var s,
  4463. r = this.options;
  4464. return (!r.filter || r.filter(t)) && (s = bi(t, r))
  4465. ? ((s.feature = Zi(t)),
  4466. (s.defaultOptions = s.options),
  4467. this.resetStyle(s),
  4468. r.onEachFeature && r.onEachFeature(t, s),
  4469. this.addLayer(s))
  4470. : this;
  4471. },
  4472. resetStyle: function (t) {
  4473. return void 0 === t
  4474. ? this.eachLayer(this.resetStyle, this)
  4475. : ((t.options = l({}, t.defaultOptions)),
  4476. this._setLayerStyle(t, this.options.style),
  4477. this);
  4478. },
  4479. setStyle: function (e) {
  4480. return this.eachLayer(function (t) {
  4481. this._setLayerStyle(t, e);
  4482. }, this);
  4483. },
  4484. _setLayerStyle: function (t, e) {
  4485. t.setStyle &&
  4486. ("function" == typeof e && (e = e(t.feature)), t.setStyle(e));
  4487. },
  4488. });
  4489. function bi(t, e) {
  4490. var i,
  4491. n,
  4492. o,
  4493. s,
  4494. r = "Feature" === t.type ? t.geometry : t,
  4495. a = r ? r.coordinates : null,
  4496. h = [],
  4497. l = e && e.pointToLayer,
  4498. u = (e && e.coordsToLatLng) || Li;
  4499. if (!a && !r) return null;
  4500. switch (r.type) {
  4501. case "Point":
  4502. return Pi(l, t, (i = u(a)), e);
  4503. case "MultiPoint":
  4504. for (o = 0, s = a.length; o < s; o++)
  4505. (i = u(a[o])), h.push(Pi(l, t, i, e));
  4506. return new ci(h);
  4507. case "LineString":
  4508. case "MultiLineString":
  4509. return (n = Ti(a, "LineString" === r.type ? 0 : 1, u)), new yi(n, e);
  4510. case "Polygon":
  4511. case "MultiPolygon":
  4512. return (n = Ti(a, "Polygon" === r.type ? 1 : 2, u)), new xi(n, e);
  4513. case "GeometryCollection":
  4514. for (o = 0, s = r.geometries.length; o < s; o++) {
  4515. var c = bi(
  4516. {
  4517. geometry: r.geometries[o],
  4518. type: "Feature",
  4519. properties: t.properties,
  4520. },
  4521. e
  4522. );
  4523. c && h.push(c);
  4524. }
  4525. return new ci(h);
  4526. case "FeatureCollection":
  4527. for (o = 0, s = r.features.length; o < s; o++) {
  4528. var d = bi(r.features[o], e);
  4529. d && h.push(d);
  4530. }
  4531. return new ci(h);
  4532. default:
  4533. throw new Error("Invalid GeoJSON object.");
  4534. }
  4535. }
  4536. function Pi(t, e, i, n) {
  4537. return t ? t(e, i) : new mi(i, n && n.markersInheritOptions && n);
  4538. }
  4539. function Li(t) {
  4540. return new v(t[1], t[0], t[2]);
  4541. }
  4542. function Ti(t, e, i) {
  4543. for (var n, o = [], s = 0, r = t.length; s < r; s++)
  4544. (n = e ? Ti(t[s], e - 1, i) : (i || Li)(t[s])), o.push(n);
  4545. return o;
  4546. }
  4547. function Mi(t, e) {
  4548. return void 0 !== (t = w(t)).alt
  4549. ? [i(t.lng, e), i(t.lat, e), i(t.alt, e)]
  4550. : [i(t.lng, e), i(t.lat, e)];
  4551. }
  4552. function zi(t, e, i, n) {
  4553. for (var o = [], s = 0, r = t.length; s < r; s++)
  4554. o.push(e ? zi(t[s], I(t[s]) ? 0 : e - 1, i, n) : Mi(t[s], n));
  4555. return !e && i && 0 < o.length && o.push(o[0].slice()), o;
  4556. }
  4557. function Ci(t, e) {
  4558. return t.feature ? l({}, t.feature, { geometry: e }) : Zi(e);
  4559. }
  4560. function Zi(t) {
  4561. return "Feature" === t.type || "FeatureCollection" === t.type
  4562. ? t
  4563. : { type: "Feature", properties: {}, geometry: t };
  4564. }
  4565. Tt = {
  4566. toGeoJSON: function (t) {
  4567. return Ci(this, { type: "Point", coordinates: Mi(this.getLatLng(), t) });
  4568. },
  4569. };
  4570. function Si(t, e) {
  4571. return new wi(t, e);
  4572. }
  4573. mi.include(Tt),
  4574. vi.include(Tt),
  4575. gi.include(Tt),
  4576. yi.include({
  4577. toGeoJSON: function (t) {
  4578. var e = !I(this._latlngs);
  4579. return Ci(this, {
  4580. type: (e ? "Multi" : "") + "LineString",
  4581. coordinates: zi(this._latlngs, e ? 1 : 0, !1, t),
  4582. });
  4583. },
  4584. }),
  4585. xi.include({
  4586. toGeoJSON: function (t) {
  4587. var e = !I(this._latlngs),
  4588. i = e && !I(this._latlngs[0]),
  4589. t = zi(this._latlngs, i ? 2 : e ? 1 : 0, !0, t);
  4590. return Ci(this, {
  4591. type: (i ? "Multi" : "") + "Polygon",
  4592. coordinates: (t = e ? t : [t]),
  4593. });
  4594. },
  4595. }),
  4596. ui.include({
  4597. toMultiPoint: function (e) {
  4598. var i = [];
  4599. return (
  4600. this.eachLayer(function (t) {
  4601. i.push(t.toGeoJSON(e).geometry.coordinates);
  4602. }),
  4603. Ci(this, { type: "MultiPoint", coordinates: i })
  4604. );
  4605. },
  4606. toGeoJSON: function (e) {
  4607. var i,
  4608. n,
  4609. t =
  4610. this.feature && this.feature.geometry && this.feature.geometry.type;
  4611. return "MultiPoint" === t
  4612. ? this.toMultiPoint(e)
  4613. : ((i = "GeometryCollection" === t),
  4614. (n = []),
  4615. this.eachLayer(function (t) {
  4616. t.toGeoJSON &&
  4617. ((t = t.toGeoJSON(e)),
  4618. i
  4619. ? n.push(t.geometry)
  4620. : "FeatureCollection" === (t = Zi(t)).type
  4621. ? n.push.apply(n, t.features)
  4622. : n.push(t));
  4623. }),
  4624. i
  4625. ? Ci(this, { geometries: n, type: "GeometryCollection" })
  4626. : { type: "FeatureCollection", features: n });
  4627. },
  4628. });
  4629. var Mt = Si,
  4630. Ei = o.extend({
  4631. options: {
  4632. opacity: 1,
  4633. alt: "",
  4634. interactive: !1,
  4635. crossOrigin: !1,
  4636. errorOverlayUrl: "",
  4637. zIndex: 1,
  4638. className: "",
  4639. },
  4640. initialize: function (t, e, i) {
  4641. (this._url = t), (this._bounds = g(e)), c(this, i);
  4642. },
  4643. onAdd: function () {
  4644. this._image ||
  4645. (this._initImage(),
  4646. this.options.opacity < 1 && this._updateOpacity()),
  4647. this.options.interactive &&
  4648. (M(this._image, "leaflet-interactive"),
  4649. this.addInteractiveTarget(this._image)),
  4650. this.getPane().appendChild(this._image),
  4651. this._reset();
  4652. },
  4653. onRemove: function () {
  4654. T(this._image),
  4655. this.options.interactive && this.removeInteractiveTarget(this._image);
  4656. },
  4657. setOpacity: function (t) {
  4658. return (
  4659. (this.options.opacity = t), this._image && this._updateOpacity(), this
  4660. );
  4661. },
  4662. setStyle: function (t) {
  4663. return t.opacity && this.setOpacity(t.opacity), this;
  4664. },
  4665. bringToFront: function () {
  4666. return this._map && fe(this._image), this;
  4667. },
  4668. bringToBack: function () {
  4669. return this._map && ge(this._image), this;
  4670. },
  4671. setUrl: function (t) {
  4672. return (this._url = t), this._image && (this._image.src = t), this;
  4673. },
  4674. setBounds: function (t) {
  4675. return (this._bounds = g(t)), this._map && this._reset(), this;
  4676. },
  4677. getEvents: function () {
  4678. var t = { zoom: this._reset, viewreset: this._reset };
  4679. return this._zoomAnimated && (t.zoomanim = this._animateZoom), t;
  4680. },
  4681. setZIndex: function (t) {
  4682. return (this.options.zIndex = t), this._updateZIndex(), this;
  4683. },
  4684. getBounds: function () {
  4685. return this._bounds;
  4686. },
  4687. getElement: function () {
  4688. return this._image;
  4689. },
  4690. _initImage: function () {
  4691. var t = "IMG" === this._url.tagName,
  4692. e = (this._image = t ? this._url : P("img"));
  4693. M(e, "leaflet-image-layer"),
  4694. this._zoomAnimated && M(e, "leaflet-zoom-animated"),
  4695. this.options.className && M(e, this.options.className),
  4696. (e.onselectstart = u),
  4697. (e.onmousemove = u),
  4698. (e.onload = a(this.fire, this, "load")),
  4699. (e.onerror = a(this._overlayOnError, this, "error")),
  4700. (!this.options.crossOrigin && "" !== this.options.crossOrigin) ||
  4701. (e.crossOrigin =
  4702. !0 === this.options.crossOrigin ? "" : this.options.crossOrigin),
  4703. this.options.zIndex && this._updateZIndex(),
  4704. t
  4705. ? (this._url = e.src)
  4706. : ((e.src = this._url), (e.alt = this.options.alt));
  4707. },
  4708. _animateZoom: function (t) {
  4709. var e = this._map.getZoomScale(t.zoom),
  4710. t = this._map._latLngBoundsToNewLayerBounds(
  4711. this._bounds,
  4712. t.zoom,
  4713. t.center
  4714. ).min;
  4715. be(this._image, t, e);
  4716. },
  4717. _reset: function () {
  4718. var t = this._image,
  4719. e = new f(
  4720. this._map.latLngToLayerPoint(this._bounds.getNorthWest()),
  4721. this._map.latLngToLayerPoint(this._bounds.getSouthEast())
  4722. ),
  4723. i = e.getSize();
  4724. Z(t, e.min),
  4725. (t.style.width = i.x + "px"),
  4726. (t.style.height = i.y + "px");
  4727. },
  4728. _updateOpacity: function () {
  4729. C(this._image, this.options.opacity);
  4730. },
  4731. _updateZIndex: function () {
  4732. this._image &&
  4733. void 0 !== this.options.zIndex &&
  4734. null !== this.options.zIndex &&
  4735. (this._image.style.zIndex = this.options.zIndex);
  4736. },
  4737. _overlayOnError: function () {
  4738. this.fire("error");
  4739. var t = this.options.errorOverlayUrl;
  4740. t && this._url !== t && ((this._url = t), (this._image.src = t));
  4741. },
  4742. getCenter: function () {
  4743. return this._bounds.getCenter();
  4744. },
  4745. }),
  4746. ki = Ei.extend({
  4747. options: {
  4748. autoplay: !0,
  4749. loop: !0,
  4750. keepAspectRatio: !0,
  4751. muted: !1,
  4752. playsInline: !0,
  4753. },
  4754. _initImage: function () {
  4755. var t = "VIDEO" === this._url.tagName,
  4756. e = (this._image = t ? this._url : P("video"));
  4757. if (
  4758. (M(e, "leaflet-image-layer"),
  4759. this._zoomAnimated && M(e, "leaflet-zoom-animated"),
  4760. this.options.className && M(e, this.options.className),
  4761. (e.onselectstart = u),
  4762. (e.onmousemove = u),
  4763. (e.onloadeddata = a(this.fire, this, "load")),
  4764. t)
  4765. ) {
  4766. for (
  4767. var i = e.getElementsByTagName("source"), n = [], o = 0;
  4768. o < i.length;
  4769. o++
  4770. )
  4771. n.push(i[o].src);
  4772. this._url = 0 < i.length ? n : [e.src];
  4773. } else {
  4774. d(this._url) || (this._url = [this._url]),
  4775. !this.options.keepAspectRatio &&
  4776. Object.prototype.hasOwnProperty.call(e.style, "objectFit") &&
  4777. (e.style.objectFit = "fill"),
  4778. (e.autoplay = !!this.options.autoplay),
  4779. (e.loop = !!this.options.loop),
  4780. (e.muted = !!this.options.muted),
  4781. (e.playsInline = !!this.options.playsInline);
  4782. for (var s = 0; s < this._url.length; s++) {
  4783. var r = P("source");
  4784. (r.src = this._url[s]), e.appendChild(r);
  4785. }
  4786. }
  4787. },
  4788. });
  4789. var Oi = Ei.extend({
  4790. _initImage: function () {
  4791. var t = (this._image = this._url);
  4792. M(t, "leaflet-image-layer"),
  4793. this._zoomAnimated && M(t, "leaflet-zoom-animated"),
  4794. this.options.className && M(t, this.options.className),
  4795. (t.onselectstart = u),
  4796. (t.onmousemove = u);
  4797. },
  4798. });
  4799. var Ai = o.extend({
  4800. options: {
  4801. interactive: !1,
  4802. offset: [0, 0],
  4803. className: "",
  4804. pane: void 0,
  4805. content: "",
  4806. },
  4807. initialize: function (t, e) {
  4808. t && (t instanceof v || d(t))
  4809. ? ((this._latlng = w(t)), c(this, e))
  4810. : (c(this, t), (this._source = e)),
  4811. this.options.content && (this._content = this.options.content);
  4812. },
  4813. openOn: function (t) {
  4814. return (
  4815. (t = arguments.length ? t : this._source._map).hasLayer(this) ||
  4816. t.addLayer(this),
  4817. this
  4818. );
  4819. },
  4820. close: function () {
  4821. return this._map && this._map.removeLayer(this), this;
  4822. },
  4823. toggle: function (t) {
  4824. return (
  4825. this._map
  4826. ? this.close()
  4827. : (arguments.length ? (this._source = t) : (t = this._source),
  4828. this._prepareOpen(),
  4829. this.openOn(t._map)),
  4830. this
  4831. );
  4832. },
  4833. onAdd: function (t) {
  4834. (this._zoomAnimated = t._zoomAnimated),
  4835. this._container || this._initLayout(),
  4836. t._fadeAnimated && C(this._container, 0),
  4837. clearTimeout(this._removeTimeout),
  4838. this.getPane().appendChild(this._container),
  4839. this.update(),
  4840. t._fadeAnimated && C(this._container, 1),
  4841. this.bringToFront(),
  4842. this.options.interactive &&
  4843. (M(this._container, "leaflet-interactive"),
  4844. this.addInteractiveTarget(this._container));
  4845. },
  4846. onRemove: function (t) {
  4847. t._fadeAnimated
  4848. ? (C(this._container, 0),
  4849. (this._removeTimeout = setTimeout(
  4850. a(T, void 0, this._container),
  4851. 200
  4852. )))
  4853. : T(this._container),
  4854. this.options.interactive &&
  4855. (z(this._container, "leaflet-interactive"),
  4856. this.removeInteractiveTarget(this._container));
  4857. },
  4858. getLatLng: function () {
  4859. return this._latlng;
  4860. },
  4861. setLatLng: function (t) {
  4862. return (
  4863. (this._latlng = w(t)),
  4864. this._map && (this._updatePosition(), this._adjustPan()),
  4865. this
  4866. );
  4867. },
  4868. getContent: function () {
  4869. return this._content;
  4870. },
  4871. setContent: function (t) {
  4872. return (this._content = t), this.update(), this;
  4873. },
  4874. getElement: function () {
  4875. return this._container;
  4876. },
  4877. update: function () {
  4878. this._map &&
  4879. ((this._container.style.visibility = "hidden"),
  4880. this._updateContent(),
  4881. this._updateLayout(),
  4882. this._updatePosition(),
  4883. (this._container.style.visibility = ""),
  4884. this._adjustPan());
  4885. },
  4886. getEvents: function () {
  4887. var t = { zoom: this._updatePosition, viewreset: this._updatePosition };
  4888. return this._zoomAnimated && (t.zoomanim = this._animateZoom), t;
  4889. },
  4890. isOpen: function () {
  4891. return !!this._map && this._map.hasLayer(this);
  4892. },
  4893. bringToFront: function () {
  4894. return this._map && fe(this._container), this;
  4895. },
  4896. bringToBack: function () {
  4897. return this._map && ge(this._container), this;
  4898. },
  4899. _prepareOpen: function (t) {
  4900. if (!(i = this._source)._map) return !1;
  4901. if (i instanceof ci) {
  4902. var e,
  4903. i = null,
  4904. n = this._source._layers;
  4905. for (e in n)
  4906. if (n[e]._map) {
  4907. i = n[e];
  4908. break;
  4909. }
  4910. if (!i) return !1;
  4911. this._source = i;
  4912. }
  4913. if (!t)
  4914. if (i.getCenter) t = i.getCenter();
  4915. else if (i.getLatLng) t = i.getLatLng();
  4916. else {
  4917. if (!i.getBounds)
  4918. throw new Error("Unable to get source layer LatLng.");
  4919. t = i.getBounds().getCenter();
  4920. }
  4921. return this.setLatLng(t), this._map && this.update(), !0;
  4922. },
  4923. _updateContent: function () {
  4924. if (this._content) {
  4925. var t = this._contentNode,
  4926. e =
  4927. "function" == typeof this._content
  4928. ? this._content(this._source || this)
  4929. : this._content;
  4930. if ("string" == typeof e) t.innerHTML = e;
  4931. else {
  4932. for (; t.hasChildNodes(); ) t.removeChild(t.firstChild);
  4933. t.appendChild(e);
  4934. }
  4935. this.fire("contentupdate");
  4936. }
  4937. },
  4938. _updatePosition: function () {
  4939. var t, e, i;
  4940. this._map &&
  4941. ((e = this._map.latLngToLayerPoint(this._latlng)),
  4942. (t = m(this.options.offset)),
  4943. (i = this._getAnchor()),
  4944. this._zoomAnimated
  4945. ? Z(this._container, e.add(i))
  4946. : (t = t.add(e).add(i)),
  4947. (e = this._containerBottom = -t.y),
  4948. (i = this._containerLeft =
  4949. -Math.round(this._containerWidth / 2) + t.x),
  4950. (this._container.style.bottom = e + "px"),
  4951. (this._container.style.left = i + "px"));
  4952. },
  4953. _getAnchor: function () {
  4954. return [0, 0];
  4955. },
  4956. }),
  4957. Bi =
  4958. (A.include({
  4959. _initOverlay: function (t, e, i, n) {
  4960. var o = e;
  4961. return (
  4962. o instanceof t || (o = new t(n).setContent(e)),
  4963. i && o.setLatLng(i),
  4964. o
  4965. );
  4966. },
  4967. }),
  4968. o.include({
  4969. _initOverlay: function (t, e, i, n) {
  4970. var o = i;
  4971. return (
  4972. o instanceof t
  4973. ? (c(o, n), (o._source = this))
  4974. : (o = e && !n ? e : new t(n, this)).setContent(i),
  4975. o
  4976. );
  4977. },
  4978. }),
  4979. Ai.extend({
  4980. options: {
  4981. pane: "popupPane",
  4982. offset: [0, 7],
  4983. maxWidth: 300,
  4984. minWidth: 50,
  4985. maxHeight: null,
  4986. autoPan: !0,
  4987. autoPanPaddingTopLeft: null,
  4988. autoPanPaddingBottomRight: null,
  4989. autoPanPadding: [5, 5],
  4990. keepInView: !1,
  4991. closeButton: !0,
  4992. autoClose: !0,
  4993. closeOnEscapeKey: !0,
  4994. className: "",
  4995. },
  4996. openOn: function (t) {
  4997. return (
  4998. !(t = arguments.length ? t : this._source._map).hasLayer(this) &&
  4999. t._popup &&
  5000. t._popup.options.autoClose &&
  5001. t.removeLayer(t._popup),
  5002. (t._popup = this),
  5003. Ai.prototype.openOn.call(this, t)
  5004. );
  5005. },
  5006. onAdd: function (t) {
  5007. Ai.prototype.onAdd.call(this, t),
  5008. t.fire("popupopen", { popup: this }),
  5009. this._source &&
  5010. (this._source.fire("popupopen", { popup: this }, !0),
  5011. this._source instanceof fi || this._source.on("preclick", Ae));
  5012. },
  5013. onRemove: function (t) {
  5014. Ai.prototype.onRemove.call(this, t),
  5015. t.fire("popupclose", { popup: this }),
  5016. this._source &&
  5017. (this._source.fire("popupclose", { popup: this }, !0),
  5018. this._source instanceof fi || this._source.off("preclick", Ae));
  5019. },
  5020. getEvents: function () {
  5021. var t = Ai.prototype.getEvents.call(this);
  5022. return (
  5023. (void 0 !== this.options.closeOnClick
  5024. ? this.options.closeOnClick
  5025. : this._map.options.closePopupOnClick) &&
  5026. (t.preclick = this.close),
  5027. this.options.keepInView && (t.moveend = this._adjustPan),
  5028. t
  5029. );
  5030. },
  5031. _initLayout: function () {
  5032. var t = "leaflet-popup",
  5033. e = (this._container = P(
  5034. "div",
  5035. t +
  5036. " " +
  5037. (this.options.className || "") +
  5038. " leaflet-zoom-animated"
  5039. )),
  5040. i = (this._wrapper = P("div", t + "-content-wrapper", e));
  5041. (this._contentNode = P("div", t + "-content", i)),
  5042. Ie(e),
  5043. Be(this._contentNode),
  5044. S(e, "contextmenu", Ae),
  5045. (this._tipContainer = P("div", t + "-tip-container", e)),
  5046. (this._tip = P("div", t + "-tip", this._tipContainer)),
  5047. this.options.closeButton &&
  5048. ((i = this._closeButton =
  5049. P("a", t + "-close-button", e)).setAttribute("role", "button"),
  5050. i.setAttribute("aria-label", "Close popup"),
  5051. (i.href = "#close"),
  5052. (i.innerHTML = '<span aria-hidden="true">&#215;</span>'),
  5053. S(
  5054. i,
  5055. "click",
  5056. function (t) {
  5057. O(t), this.close();
  5058. },
  5059. this
  5060. ));
  5061. },
  5062. _updateLayout: function () {
  5063. var t = this._contentNode,
  5064. e = t.style,
  5065. i = ((e.width = ""), (e.whiteSpace = "nowrap"), t.offsetWidth),
  5066. i = Math.min(i, this.options.maxWidth),
  5067. i =
  5068. ((i = Math.max(i, this.options.minWidth)),
  5069. (e.width = i + 1 + "px"),
  5070. (e.whiteSpace = ""),
  5071. (e.height = ""),
  5072. t.offsetHeight),
  5073. n = this.options.maxHeight,
  5074. o = "leaflet-popup-scrolled";
  5075. (n && n < i ? ((e.height = n + "px"), M) : z)(t, o),
  5076. (this._containerWidth = this._container.offsetWidth);
  5077. },
  5078. _animateZoom: function (t) {
  5079. var t = this._map._latLngToNewLayerPoint(
  5080. this._latlng,
  5081. t.zoom,
  5082. t.center
  5083. ),
  5084. e = this._getAnchor();
  5085. Z(this._container, t.add(e));
  5086. },
  5087. _adjustPan: function () {
  5088. var t, e, i, n, o, s, r, a;
  5089. this.options.autoPan &&
  5090. (this._map._panAnim && this._map._panAnim.stop(),
  5091. this._autopanning
  5092. ? (this._autopanning = !1)
  5093. : ((t = this._map),
  5094. (e = parseInt(pe(this._container, "marginBottom"), 10) || 0),
  5095. (e = this._container.offsetHeight + e),
  5096. (a = this._containerWidth),
  5097. (i = new p(
  5098. this._containerLeft,
  5099. -e - this._containerBottom
  5100. ))._add(Pe(this._container)),
  5101. (i = t.layerPointToContainerPoint(i)),
  5102. (o = m(this.options.autoPanPadding)),
  5103. (n = m(this.options.autoPanPaddingTopLeft || o)),
  5104. (o = m(this.options.autoPanPaddingBottomRight || o)),
  5105. (s = t.getSize()),
  5106. (r = 0),
  5107. i.x + a + o.x > s.x && (r = i.x + a - s.x + o.x),
  5108. i.x - r - n.x < (a = 0) && (r = i.x - n.x),
  5109. i.y + e + o.y > s.y && (a = i.y + e - s.y + o.y),
  5110. i.y - a - n.y < 0 && (a = i.y - n.y),
  5111. (r || a) &&
  5112. (this.options.keepInView && (this._autopanning = !0),
  5113. t.fire("autopanstart").panBy([r, a]))));
  5114. },
  5115. _getAnchor: function () {
  5116. return m(
  5117. this._source && this._source._getPopupAnchor
  5118. ? this._source._getPopupAnchor()
  5119. : [0, 0]
  5120. );
  5121. },
  5122. })),
  5123. Ii =
  5124. (A.mergeOptions({ closePopupOnClick: !0 }),
  5125. A.include({
  5126. openPopup: function (t, e, i) {
  5127. return this._initOverlay(Bi, t, e, i).openOn(this), this;
  5128. },
  5129. closePopup: function (t) {
  5130. return (t = arguments.length ? t : this._popup) && t.close(), this;
  5131. },
  5132. }),
  5133. o.include({
  5134. bindPopup: function (t, e) {
  5135. return (
  5136. (this._popup = this._initOverlay(Bi, this._popup, t, e)),
  5137. this._popupHandlersAdded ||
  5138. (this.on({
  5139. click: this._openPopup,
  5140. keypress: this._onKeyPress,
  5141. remove: this.closePopup,
  5142. move: this._movePopup,
  5143. }),
  5144. (this._popupHandlersAdded = !0)),
  5145. this
  5146. );
  5147. },
  5148. unbindPopup: function () {
  5149. return (
  5150. this._popup &&
  5151. (this.off({
  5152. click: this._openPopup,
  5153. keypress: this._onKeyPress,
  5154. remove: this.closePopup,
  5155. move: this._movePopup,
  5156. }),
  5157. (this._popupHandlersAdded = !1),
  5158. (this._popup = null)),
  5159. this
  5160. );
  5161. },
  5162. openPopup: function (t) {
  5163. return (
  5164. this._popup &&
  5165. (this instanceof ci || (this._popup._source = this),
  5166. this._popup._prepareOpen(t || this._latlng) &&
  5167. this._popup.openOn(this._map)),
  5168. this
  5169. );
  5170. },
  5171. closePopup: function () {
  5172. return this._popup && this._popup.close(), this;
  5173. },
  5174. togglePopup: function () {
  5175. return this._popup && this._popup.toggle(this), this;
  5176. },
  5177. isPopupOpen: function () {
  5178. return !!this._popup && this._popup.isOpen();
  5179. },
  5180. setPopupContent: function (t) {
  5181. return this._popup && this._popup.setContent(t), this;
  5182. },
  5183. getPopup: function () {
  5184. return this._popup;
  5185. },
  5186. _openPopup: function (t) {
  5187. var e;
  5188. this._popup &&
  5189. this._map &&
  5190. (Re(t),
  5191. (e = t.layer || t.target),
  5192. this._popup._source !== e || e instanceof fi
  5193. ? ((this._popup._source = e), this.openPopup(t.latlng))
  5194. : this._map.hasLayer(this._popup)
  5195. ? this.closePopup()
  5196. : this.openPopup(t.latlng));
  5197. },
  5198. _movePopup: function (t) {
  5199. this._popup.setLatLng(t.latlng);
  5200. },
  5201. _onKeyPress: function (t) {
  5202. 13 === t.originalEvent.keyCode && this._openPopup(t);
  5203. },
  5204. }),
  5205. Ai.extend({
  5206. options: {
  5207. pane: "tooltipPane",
  5208. offset: [0, 0],
  5209. direction: "auto",
  5210. permanent: !1,
  5211. sticky: !1,
  5212. opacity: 0.9,
  5213. },
  5214. onAdd: function (t) {
  5215. Ai.prototype.onAdd.call(this, t),
  5216. this.setOpacity(this.options.opacity),
  5217. t.fire("tooltipopen", { tooltip: this }),
  5218. this._source &&
  5219. (this.addEventParent(this._source),
  5220. this._source.fire("tooltipopen", { tooltip: this }, !0));
  5221. },
  5222. onRemove: function (t) {
  5223. Ai.prototype.onRemove.call(this, t),
  5224. t.fire("tooltipclose", { tooltip: this }),
  5225. this._source &&
  5226. (this.removeEventParent(this._source),
  5227. this._source.fire("tooltipclose", { tooltip: this }, !0));
  5228. },
  5229. getEvents: function () {
  5230. var t = Ai.prototype.getEvents.call(this);
  5231. return this.options.permanent || (t.preclick = this.close), t;
  5232. },
  5233. _initLayout: function () {
  5234. var t =
  5235. "leaflet-tooltip " +
  5236. (this.options.className || "") +
  5237. " leaflet-zoom-" +
  5238. (this._zoomAnimated ? "animated" : "hide");
  5239. (this._contentNode = this._container = P("div", t)),
  5240. this._container.setAttribute("role", "tooltip"),
  5241. this._container.setAttribute("id", "leaflet-tooltip-" + h(this));
  5242. },
  5243. _updateLayout: function () {},
  5244. _adjustPan: function () {},
  5245. _setPosition: function (t) {
  5246. var e,
  5247. i = this._map,
  5248. n = this._container,
  5249. o = i.latLngToContainerPoint(i.getCenter()),
  5250. i = i.layerPointToContainerPoint(t),
  5251. s = this.options.direction,
  5252. r = n.offsetWidth,
  5253. a = n.offsetHeight,
  5254. h = m(this.options.offset),
  5255. l = this._getAnchor(),
  5256. i =
  5257. "top" === s
  5258. ? ((e = r / 2), a)
  5259. : "bottom" === s
  5260. ? ((e = r / 2), 0)
  5261. : ((e =
  5262. "center" === s
  5263. ? r / 2
  5264. : "right" === s
  5265. ? 0
  5266. : "left" === s
  5267. ? r
  5268. : i.x < o.x
  5269. ? ((s = "right"), 0)
  5270. : ((s = "left"), r + 2 * (h.x + l.x))),
  5271. a / 2);
  5272. (t = t.subtract(m(e, i, !0)).add(h).add(l)),
  5273. z(n, "leaflet-tooltip-right"),
  5274. z(n, "leaflet-tooltip-left"),
  5275. z(n, "leaflet-tooltip-top"),
  5276. z(n, "leaflet-tooltip-bottom"),
  5277. M(n, "leaflet-tooltip-" + s),
  5278. Z(n, t);
  5279. },
  5280. _updatePosition: function () {
  5281. var t = this._map.latLngToLayerPoint(this._latlng);
  5282. this._setPosition(t);
  5283. },
  5284. setOpacity: function (t) {
  5285. (this.options.opacity = t), this._container && C(this._container, t);
  5286. },
  5287. _animateZoom: function (t) {
  5288. t = this._map._latLngToNewLayerPoint(this._latlng, t.zoom, t.center);
  5289. this._setPosition(t);
  5290. },
  5291. _getAnchor: function () {
  5292. return m(
  5293. this._source &&
  5294. this._source._getTooltipAnchor &&
  5295. !this.options.sticky
  5296. ? this._source._getTooltipAnchor()
  5297. : [0, 0]
  5298. );
  5299. },
  5300. })),
  5301. Ri =
  5302. (A.include({
  5303. openTooltip: function (t, e, i) {
  5304. return this._initOverlay(Ii, t, e, i).openOn(this), this;
  5305. },
  5306. closeTooltip: function (t) {
  5307. return t.close(), this;
  5308. },
  5309. }),
  5310. o.include({
  5311. bindTooltip: function (t, e) {
  5312. return (
  5313. this._tooltip && this.isTooltipOpen() && this.unbindTooltip(),
  5314. (this._tooltip = this._initOverlay(Ii, this._tooltip, t, e)),
  5315. this._initTooltipInteractions(),
  5316. this._tooltip.options.permanent &&
  5317. this._map &&
  5318. this._map.hasLayer(this) &&
  5319. this.openTooltip(),
  5320. this
  5321. );
  5322. },
  5323. unbindTooltip: function () {
  5324. return (
  5325. this._tooltip &&
  5326. (this._initTooltipInteractions(!0),
  5327. this.closeTooltip(),
  5328. (this._tooltip = null)),
  5329. this
  5330. );
  5331. },
  5332. _initTooltipInteractions: function (t) {
  5333. var e, i;
  5334. (!t && this._tooltipHandlersAdded) ||
  5335. ((e = t ? "off" : "on"),
  5336. (i = { remove: this.closeTooltip, move: this._moveTooltip }),
  5337. this._tooltip.options.permanent
  5338. ? (i.add = this._openTooltip)
  5339. : ((i.mouseover = this._openTooltip),
  5340. (i.mouseout = this.closeTooltip),
  5341. (i.click = this._openTooltip),
  5342. this._map
  5343. ? this._addFocusListeners()
  5344. : (i.add = this._addFocusListeners)),
  5345. this._tooltip.options.sticky && (i.mousemove = this._moveTooltip),
  5346. this[e](i),
  5347. (this._tooltipHandlersAdded = !t));
  5348. },
  5349. openTooltip: function (t) {
  5350. return (
  5351. this._tooltip &&
  5352. (this instanceof ci || (this._tooltip._source = this),
  5353. this._tooltip._prepareOpen(t) &&
  5354. (this._tooltip.openOn(this._map),
  5355. this.getElement
  5356. ? this._setAriaDescribedByOnLayer(this)
  5357. : this.eachLayer &&
  5358. this.eachLayer(this._setAriaDescribedByOnLayer, this))),
  5359. this
  5360. );
  5361. },
  5362. closeTooltip: function () {
  5363. if (this._tooltip) return this._tooltip.close();
  5364. },
  5365. toggleTooltip: function () {
  5366. return this._tooltip && this._tooltip.toggle(this), this;
  5367. },
  5368. isTooltipOpen: function () {
  5369. return this._tooltip.isOpen();
  5370. },
  5371. setTooltipContent: function (t) {
  5372. return this._tooltip && this._tooltip.setContent(t), this;
  5373. },
  5374. getTooltip: function () {
  5375. return this._tooltip;
  5376. },
  5377. _addFocusListeners: function () {
  5378. this.getElement
  5379. ? this._addFocusListenersOnLayer(this)
  5380. : this.eachLayer &&
  5381. this.eachLayer(this._addFocusListenersOnLayer, this);
  5382. },
  5383. _addFocusListenersOnLayer: function (t) {
  5384. var e = "function" == typeof t.getElement && t.getElement();
  5385. e &&
  5386. (S(
  5387. e,
  5388. "focus",
  5389. function () {
  5390. (this._tooltip._source = t), this.openTooltip();
  5391. },
  5392. this
  5393. ),
  5394. S(e, "blur", this.closeTooltip, this));
  5395. },
  5396. _setAriaDescribedByOnLayer: function (t) {
  5397. t = "function" == typeof t.getElement && t.getElement();
  5398. t && t.setAttribute("aria-describedby", this._tooltip._container.id);
  5399. },
  5400. _openTooltip: function (t) {
  5401. var e;
  5402. this._tooltip &&
  5403. this._map &&
  5404. (this._map.dragging &&
  5405. this._map.dragging.moving() &&
  5406. !this._openOnceFlag
  5407. ? ((this._openOnceFlag = !0),
  5408. (e = this)._map.once("moveend", function () {
  5409. (e._openOnceFlag = !1), e._openTooltip(t);
  5410. }))
  5411. : ((this._tooltip._source = t.layer || t.target),
  5412. this.openTooltip(
  5413. this._tooltip.options.sticky ? t.latlng : void 0
  5414. )));
  5415. },
  5416. _moveTooltip: function (t) {
  5417. var e = t.latlng;
  5418. this._tooltip.options.sticky &&
  5419. t.originalEvent &&
  5420. ((t = this._map.mouseEventToContainerPoint(t.originalEvent)),
  5421. (t = this._map.containerPointToLayerPoint(t)),
  5422. (e = this._map.layerPointToLatLng(t))),
  5423. this._tooltip.setLatLng(e);
  5424. },
  5425. }),
  5426. di.extend({
  5427. options: {
  5428. iconSize: [12, 12],
  5429. html: !1,
  5430. bgPos: null,
  5431. className: "leaflet-div-icon",
  5432. },
  5433. createIcon: function (t) {
  5434. var t = t && "DIV" === t.tagName ? t : document.createElement("div"),
  5435. e = this.options;
  5436. return (
  5437. e.html instanceof Element
  5438. ? (me(t), t.appendChild(e.html))
  5439. : (t.innerHTML = !1 !== e.html ? e.html : ""),
  5440. e.bgPos &&
  5441. ((e = m(e.bgPos)),
  5442. (t.style.backgroundPosition = -e.x + "px " + -e.y + "px")),
  5443. this._setIconStyles(t, "icon"),
  5444. t
  5445. );
  5446. },
  5447. createShadow: function () {
  5448. return null;
  5449. },
  5450. }));
  5451. di.Default = _i;
  5452. var Ni = o.extend({
  5453. options: {
  5454. tileSize: 256,
  5455. opacity: 1,
  5456. updateWhenIdle: b.mobile,
  5457. updateWhenZooming: !0,
  5458. updateInterval: 200,
  5459. zIndex: 1,
  5460. bounds: null,
  5461. minZoom: 0,
  5462. maxZoom: void 0,
  5463. maxNativeZoom: void 0,
  5464. minNativeZoom: void 0,
  5465. noWrap: !1,
  5466. pane: "tilePane",
  5467. className: "",
  5468. keepBuffer: 2,
  5469. },
  5470. initialize: function (t) {
  5471. c(this, t);
  5472. },
  5473. onAdd: function () {
  5474. this._initContainer(),
  5475. (this._levels = {}),
  5476. (this._tiles = {}),
  5477. this._resetView();
  5478. },
  5479. beforeAdd: function (t) {
  5480. t._addZoomLimit(this);
  5481. },
  5482. onRemove: function (t) {
  5483. this._removeAllTiles(),
  5484. T(this._container),
  5485. t._removeZoomLimit(this),
  5486. (this._container = null),
  5487. (this._tileZoom = void 0);
  5488. },
  5489. bringToFront: function () {
  5490. return (
  5491. this._map && (fe(this._container), this._setAutoZIndex(Math.max)), this
  5492. );
  5493. },
  5494. bringToBack: function () {
  5495. return (
  5496. this._map && (ge(this._container), this._setAutoZIndex(Math.min)), this
  5497. );
  5498. },
  5499. getContainer: function () {
  5500. return this._container;
  5501. },
  5502. setOpacity: function (t) {
  5503. return (this.options.opacity = t), this._updateOpacity(), this;
  5504. },
  5505. setZIndex: function (t) {
  5506. return (this.options.zIndex = t), this._updateZIndex(), this;
  5507. },
  5508. isLoading: function () {
  5509. return this._loading;
  5510. },
  5511. redraw: function () {
  5512. var t;
  5513. return (
  5514. this._map &&
  5515. (this._removeAllTiles(),
  5516. (t = this._clampZoom(this._map.getZoom())) !== this._tileZoom &&
  5517. ((this._tileZoom = t), this._updateLevels()),
  5518. this._update()),
  5519. this
  5520. );
  5521. },
  5522. getEvents: function () {
  5523. var t = {
  5524. viewprereset: this._invalidateAll,
  5525. viewreset: this._resetView,
  5526. zoom: this._resetView,
  5527. moveend: this._onMoveEnd,
  5528. };
  5529. return (
  5530. this.options.updateWhenIdle ||
  5531. (this._onMove ||
  5532. (this._onMove = j(
  5533. this._onMoveEnd,
  5534. this.options.updateInterval,
  5535. this
  5536. )),
  5537. (t.move = this._onMove)),
  5538. this._zoomAnimated && (t.zoomanim = this._animateZoom),
  5539. t
  5540. );
  5541. },
  5542. createTile: function () {
  5543. return document.createElement("div");
  5544. },
  5545. getTileSize: function () {
  5546. var t = this.options.tileSize;
  5547. return t instanceof p ? t : new p(t, t);
  5548. },
  5549. _updateZIndex: function () {
  5550. this._container &&
  5551. void 0 !== this.options.zIndex &&
  5552. null !== this.options.zIndex &&
  5553. (this._container.style.zIndex = this.options.zIndex);
  5554. },
  5555. _setAutoZIndex: function (t) {
  5556. for (
  5557. var e,
  5558. i = this.getPane().children,
  5559. n = -t(-1 / 0, 1 / 0),
  5560. o = 0,
  5561. s = i.length;
  5562. o < s;
  5563. o++
  5564. )
  5565. (e = i[o].style.zIndex),
  5566. i[o] !== this._container && e && (n = t(n, +e));
  5567. isFinite(n) &&
  5568. ((this.options.zIndex = n + t(-1, 1)), this._updateZIndex());
  5569. },
  5570. _updateOpacity: function () {
  5571. if (this._map && !b.ielt9) {
  5572. C(this._container, this.options.opacity);
  5573. var t,
  5574. e = +new Date(),
  5575. i = !1,
  5576. n = !1;
  5577. for (t in this._tiles) {
  5578. var o,
  5579. s = this._tiles[t];
  5580. s.current &&
  5581. s.loaded &&
  5582. ((o = Math.min(1, (e - s.loaded) / 200)),
  5583. C(s.el, o),
  5584. o < 1
  5585. ? (i = !0)
  5586. : (s.active ? (n = !0) : this._onOpaqueTile(s), (s.active = !0)));
  5587. }
  5588. n && !this._noPrune && this._pruneTiles(),
  5589. i &&
  5590. (r(this._fadeFrame),
  5591. (this._fadeFrame = x(this._updateOpacity, this)));
  5592. }
  5593. },
  5594. _onOpaqueTile: u,
  5595. _initContainer: function () {
  5596. this._container ||
  5597. ((this._container = P(
  5598. "div",
  5599. "leaflet-layer " + (this.options.className || "")
  5600. )),
  5601. this._updateZIndex(),
  5602. this.options.opacity < 1 && this._updateOpacity(),
  5603. this.getPane().appendChild(this._container));
  5604. },
  5605. _updateLevels: function () {
  5606. var t = this._tileZoom,
  5607. e = this.options.maxZoom;
  5608. if (void 0 !== t) {
  5609. for (var i in this._levels)
  5610. (i = Number(i)),
  5611. this._levels[i].el.children.length || i === t
  5612. ? ((this._levels[i].el.style.zIndex = e - Math.abs(t - i)),
  5613. this._onUpdateLevel(i))
  5614. : (T(this._levels[i].el),
  5615. this._removeTilesAtZoom(i),
  5616. this._onRemoveLevel(i),
  5617. delete this._levels[i]);
  5618. var n = this._levels[t],
  5619. o = this._map;
  5620. return (
  5621. n ||
  5622. (((n = this._levels[t] = {}).el = P(
  5623. "div",
  5624. "leaflet-tile-container leaflet-zoom-animated",
  5625. this._container
  5626. )),
  5627. (n.el.style.zIndex = e),
  5628. (n.origin = o.project(o.unproject(o.getPixelOrigin()), t).round()),
  5629. (n.zoom = t),
  5630. this._setZoomTransform(n, o.getCenter(), o.getZoom()),
  5631. u(n.el.offsetWidth),
  5632. this._onCreateLevel(n)),
  5633. (this._level = n)
  5634. );
  5635. }
  5636. },
  5637. _onUpdateLevel: u,
  5638. _onRemoveLevel: u,
  5639. _onCreateLevel: u,
  5640. _pruneTiles: function () {
  5641. if (this._map) {
  5642. var t,
  5643. e,
  5644. i,
  5645. n = this._map.getZoom();
  5646. if (n > this.options.maxZoom || n < this.options.minZoom)
  5647. this._removeAllTiles();
  5648. else {
  5649. for (t in this._tiles) (i = this._tiles[t]).retain = i.current;
  5650. for (t in this._tiles)
  5651. (i = this._tiles[t]).current &&
  5652. !i.active &&
  5653. ((e = i.coords),
  5654. this._retainParent(e.x, e.y, e.z, e.z - 5) ||
  5655. this._retainChildren(e.x, e.y, e.z, e.z + 2));
  5656. for (t in this._tiles) this._tiles[t].retain || this._removeTile(t);
  5657. }
  5658. }
  5659. },
  5660. _removeTilesAtZoom: function (t) {
  5661. for (var e in this._tiles)
  5662. this._tiles[e].coords.z === t && this._removeTile(e);
  5663. },
  5664. _removeAllTiles: function () {
  5665. for (var t in this._tiles) this._removeTile(t);
  5666. },
  5667. _invalidateAll: function () {
  5668. for (var t in this._levels)
  5669. T(this._levels[t].el),
  5670. this._onRemoveLevel(Number(t)),
  5671. delete this._levels[t];
  5672. this._removeAllTiles(), (this._tileZoom = void 0);
  5673. },
  5674. _retainParent: function (t, e, i, n) {
  5675. var t = Math.floor(t / 2),
  5676. e = Math.floor(e / 2),
  5677. i = i - 1,
  5678. o = new p(+t, +e),
  5679. o = ((o.z = i), this._tileCoordsToKey(o)),
  5680. o = this._tiles[o];
  5681. return o && o.active
  5682. ? (o.retain = !0)
  5683. : (o && o.loaded && (o.retain = !0),
  5684. n < i && this._retainParent(t, e, i, n));
  5685. },
  5686. _retainChildren: function (t, e, i, n) {
  5687. for (var o = 2 * t; o < 2 * t + 2; o++)
  5688. for (var s = 2 * e; s < 2 * e + 2; s++) {
  5689. var r = new p(o, s),
  5690. r = ((r.z = i + 1), this._tileCoordsToKey(r)),
  5691. r = this._tiles[r];
  5692. r && r.active
  5693. ? (r.retain = !0)
  5694. : (r && r.loaded && (r.retain = !0),
  5695. i + 1 < n && this._retainChildren(o, s, i + 1, n));
  5696. }
  5697. },
  5698. _resetView: function (t) {
  5699. t = t && (t.pinch || t.flyTo);
  5700. this._setView(this._map.getCenter(), this._map.getZoom(), t, t);
  5701. },
  5702. _animateZoom: function (t) {
  5703. this._setView(t.center, t.zoom, !0, t.noUpdate);
  5704. },
  5705. _clampZoom: function (t) {
  5706. var e = this.options;
  5707. return void 0 !== e.minNativeZoom && t < e.minNativeZoom
  5708. ? e.minNativeZoom
  5709. : void 0 !== e.maxNativeZoom && e.maxNativeZoom < t
  5710. ? e.maxNativeZoom
  5711. : t;
  5712. },
  5713. _setView: function (t, e, i, n) {
  5714. var o = Math.round(e),
  5715. o =
  5716. (void 0 !== this.options.maxZoom && o > this.options.maxZoom) ||
  5717. (void 0 !== this.options.minZoom && o < this.options.minZoom)
  5718. ? void 0
  5719. : this._clampZoom(o),
  5720. s = this.options.updateWhenZooming && o !== this._tileZoom;
  5721. (n && !s) ||
  5722. ((this._tileZoom = o),
  5723. this._abortLoading && this._abortLoading(),
  5724. this._updateLevels(),
  5725. this._resetGrid(),
  5726. void 0 !== o && this._update(t),
  5727. i || this._pruneTiles(),
  5728. (this._noPrune = !!i)),
  5729. this._setZoomTransforms(t, e);
  5730. },
  5731. _setZoomTransforms: function (t, e) {
  5732. for (var i in this._levels) this._setZoomTransform(this._levels[i], t, e);
  5733. },
  5734. _setZoomTransform: function (t, e, i) {
  5735. var n = this._map.getZoomScale(i, t.zoom),
  5736. e = t.origin
  5737. .multiplyBy(n)
  5738. .subtract(this._map._getNewPixelOrigin(e, i))
  5739. .round();
  5740. b.any3d ? be(t.el, e, n) : Z(t.el, e);
  5741. },
  5742. _resetGrid: function () {
  5743. var t = this._map,
  5744. e = t.options.crs,
  5745. i = (this._tileSize = this.getTileSize()),
  5746. n = this._tileZoom,
  5747. o = this._map.getPixelWorldBounds(this._tileZoom);
  5748. o && (this._globalTileRange = this._pxBoundsToTileRange(o)),
  5749. (this._wrapX = e.wrapLng &&
  5750. !this.options.noWrap && [
  5751. Math.floor(t.project([0, e.wrapLng[0]], n).x / i.x),
  5752. Math.ceil(t.project([0, e.wrapLng[1]], n).x / i.y),
  5753. ]),
  5754. (this._wrapY = e.wrapLat &&
  5755. !this.options.noWrap && [
  5756. Math.floor(t.project([e.wrapLat[0], 0], n).y / i.x),
  5757. Math.ceil(t.project([e.wrapLat[1], 0], n).y / i.y),
  5758. ]);
  5759. },
  5760. _onMoveEnd: function () {
  5761. this._map && !this._map._animatingZoom && this._update();
  5762. },
  5763. _getTiledPixelBounds: function (t) {
  5764. var e = this._map,
  5765. i = e._animatingZoom
  5766. ? Math.max(e._animateToZoom, e.getZoom())
  5767. : e.getZoom(),
  5768. i = e.getZoomScale(i, this._tileZoom),
  5769. t = e.project(t, this._tileZoom).floor(),
  5770. e = e.getSize().divideBy(2 * i);
  5771. return new f(t.subtract(e), t.add(e));
  5772. },
  5773. _update: function (t) {
  5774. var e = this._map;
  5775. if (e) {
  5776. var i = this._clampZoom(e.getZoom());
  5777. if ((void 0 === t && (t = e.getCenter()), void 0 !== this._tileZoom)) {
  5778. var n,
  5779. e = this._getTiledPixelBounds(t),
  5780. o = this._pxBoundsToTileRange(e),
  5781. s = o.getCenter(),
  5782. r = [],
  5783. e = this.options.keepBuffer,
  5784. a = new f(
  5785. o.getBottomLeft().subtract([e, -e]),
  5786. o.getTopRight().add([e, -e])
  5787. );
  5788. if (
  5789. !(
  5790. isFinite(o.min.x) &&
  5791. isFinite(o.min.y) &&
  5792. isFinite(o.max.x) &&
  5793. isFinite(o.max.y)
  5794. )
  5795. )
  5796. throw new Error("Attempted to load an infinite number of tiles");
  5797. for (n in this._tiles) {
  5798. var h = this._tiles[n].coords;
  5799. (h.z === this._tileZoom && a.contains(new p(h.x, h.y))) ||
  5800. (this._tiles[n].current = !1);
  5801. }
  5802. if (1 < Math.abs(i - this._tileZoom)) this._setView(t, i);
  5803. else {
  5804. for (var l = o.min.y; l <= o.max.y; l++)
  5805. for (var u = o.min.x; u <= o.max.x; u++) {
  5806. var c,
  5807. d = new p(u, l);
  5808. (d.z = this._tileZoom),
  5809. this._isValidTile(d) &&
  5810. ((c = this._tiles[this._tileCoordsToKey(d)])
  5811. ? (c.current = !0)
  5812. : r.push(d));
  5813. }
  5814. if (
  5815. (r.sort(function (t, e) {
  5816. return t.distanceTo(s) - e.distanceTo(s);
  5817. }),
  5818. 0 !== r.length)
  5819. ) {
  5820. this._loading || ((this._loading = !0), this.fire("loading"));
  5821. for (
  5822. var _ = document.createDocumentFragment(), u = 0;
  5823. u < r.length;
  5824. u++
  5825. )
  5826. this._addTile(r[u], _);
  5827. this._level.el.appendChild(_);
  5828. }
  5829. }
  5830. }
  5831. }
  5832. },
  5833. _isValidTile: function (t) {
  5834. var e = this._map.options.crs;
  5835. if (!e.infinite) {
  5836. var i = this._globalTileRange;
  5837. if (
  5838. (!e.wrapLng && (t.x < i.min.x || t.x > i.max.x)) ||
  5839. (!e.wrapLat && (t.y < i.min.y || t.y > i.max.y))
  5840. )
  5841. return !1;
  5842. }
  5843. return (
  5844. !this.options.bounds ||
  5845. ((e = this._tileCoordsToBounds(t)), g(this.options.bounds).overlaps(e))
  5846. );
  5847. },
  5848. _keyToBounds: function (t) {
  5849. return this._tileCoordsToBounds(this._keyToTileCoords(t));
  5850. },
  5851. _tileCoordsToNwSe: function (t) {
  5852. var e = this._map,
  5853. i = this.getTileSize(),
  5854. n = t.scaleBy(i),
  5855. i = n.add(i);
  5856. return [e.unproject(n, t.z), e.unproject(i, t.z)];
  5857. },
  5858. _tileCoordsToBounds: function (t) {
  5859. (t = this._tileCoordsToNwSe(t)), (t = new s(t[0], t[1]));
  5860. return (t = this.options.noWrap ? t : this._map.wrapLatLngBounds(t));
  5861. },
  5862. _tileCoordsToKey: function (t) {
  5863. return t.x + ":" + t.y + ":" + t.z;
  5864. },
  5865. _keyToTileCoords: function (t) {
  5866. var t = t.split(":"),
  5867. e = new p(+t[0], +t[1]);
  5868. return (e.z = +t[2]), e;
  5869. },
  5870. _removeTile: function (t) {
  5871. var e = this._tiles[t];
  5872. e &&
  5873. (T(e.el),
  5874. delete this._tiles[t],
  5875. this.fire("tileunload", {
  5876. tile: e.el,
  5877. coords: this._keyToTileCoords(t),
  5878. }));
  5879. },
  5880. _initTile: function (t) {
  5881. M(t, "leaflet-tile");
  5882. var e = this.getTileSize();
  5883. (t.style.width = e.x + "px"),
  5884. (t.style.height = e.y + "px"),
  5885. (t.onselectstart = u),
  5886. (t.onmousemove = u),
  5887. b.ielt9 && this.options.opacity < 1 && C(t, this.options.opacity);
  5888. },
  5889. _addTile: function (t, e) {
  5890. var i = this._getTilePos(t),
  5891. n = this._tileCoordsToKey(t),
  5892. o = this.createTile(this._wrapCoords(t), a(this._tileReady, this, t));
  5893. this._initTile(o),
  5894. this.createTile.length < 2 && x(a(this._tileReady, this, t, null, o)),
  5895. Z(o, i),
  5896. (this._tiles[n] = { el: o, coords: t, current: !0 }),
  5897. e.appendChild(o),
  5898. this.fire("tileloadstart", { tile: o, coords: t });
  5899. },
  5900. _tileReady: function (t, e, i) {
  5901. e && this.fire("tileerror", { error: e, tile: i, coords: t });
  5902. var n = this._tileCoordsToKey(t);
  5903. (i = this._tiles[n]) &&
  5904. ((i.loaded = +new Date()),
  5905. this._map._fadeAnimated
  5906. ? (C(i.el, 0),
  5907. r(this._fadeFrame),
  5908. (this._fadeFrame = x(this._updateOpacity, this)))
  5909. : ((i.active = !0), this._pruneTiles()),
  5910. e ||
  5911. (M(i.el, "leaflet-tile-loaded"),
  5912. this.fire("tileload", { tile: i.el, coords: t })),
  5913. this._noTilesToLoad() &&
  5914. ((this._loading = !1),
  5915. this.fire("load"),
  5916. b.ielt9 || !this._map._fadeAnimated
  5917. ? x(this._pruneTiles, this)
  5918. : setTimeout(a(this._pruneTiles, this), 250)));
  5919. },
  5920. _getTilePos: function (t) {
  5921. return t.scaleBy(this.getTileSize()).subtract(this._level.origin);
  5922. },
  5923. _wrapCoords: function (t) {
  5924. var e = new p(
  5925. this._wrapX ? H(t.x, this._wrapX) : t.x,
  5926. this._wrapY ? H(t.y, this._wrapY) : t.y
  5927. );
  5928. return (e.z = t.z), e;
  5929. },
  5930. _pxBoundsToTileRange: function (t) {
  5931. var e = this.getTileSize();
  5932. return new f(
  5933. t.min.unscaleBy(e).floor(),
  5934. t.max.unscaleBy(e).ceil().subtract([1, 1])
  5935. );
  5936. },
  5937. _noTilesToLoad: function () {
  5938. for (var t in this._tiles) if (!this._tiles[t].loaded) return !1;
  5939. return !0;
  5940. },
  5941. });
  5942. var Di = Ni.extend({
  5943. options: {
  5944. minZoom: 0,
  5945. maxZoom: 18,
  5946. subdomains: "abc",
  5947. errorTileUrl: "",
  5948. zoomOffset: 0,
  5949. tms: !1,
  5950. zoomReverse: !1,
  5951. detectRetina: !1,
  5952. crossOrigin: !1,
  5953. referrerPolicy: !1,
  5954. },
  5955. initialize: function (t, e) {
  5956. (this._url = t),
  5957. (e = c(this, e)).detectRetina && b.retina && 0 < e.maxZoom
  5958. ? ((e.tileSize = Math.floor(e.tileSize / 2)),
  5959. e.zoomReverse
  5960. ? (e.zoomOffset--,
  5961. (e.minZoom = Math.min(e.maxZoom, e.minZoom + 1)))
  5962. : (e.zoomOffset++,
  5963. (e.maxZoom = Math.max(e.minZoom, e.maxZoom - 1))),
  5964. (e.minZoom = Math.max(0, e.minZoom)))
  5965. : e.zoomReverse
  5966. ? (e.minZoom = Math.min(e.maxZoom, e.minZoom))
  5967. : (e.maxZoom = Math.max(e.minZoom, e.maxZoom)),
  5968. "string" == typeof e.subdomains &&
  5969. (e.subdomains = e.subdomains.split("")),
  5970. this.on("tileunload", this._onTileRemove);
  5971. },
  5972. setUrl: function (t, e) {
  5973. return (
  5974. this._url === t && void 0 === e && (e = !0),
  5975. (this._url = t),
  5976. e || this.redraw(),
  5977. this
  5978. );
  5979. },
  5980. createTile: function (t, e) {
  5981. var i = document.createElement("img");
  5982. return (
  5983. S(i, "load", a(this._tileOnLoad, this, e, i)),
  5984. S(i, "error", a(this._tileOnError, this, e, i)),
  5985. (!this.options.crossOrigin && "" !== this.options.crossOrigin) ||
  5986. (i.crossOrigin =
  5987. !0 === this.options.crossOrigin ? "" : this.options.crossOrigin),
  5988. "string" == typeof this.options.referrerPolicy &&
  5989. (i.referrerPolicy = this.options.referrerPolicy),
  5990. (i.alt = ""),
  5991. (i.src = this.getTileUrl(t)),
  5992. i
  5993. );
  5994. },
  5995. getTileUrl: function (t) {
  5996. var e = {
  5997. r: b.retina ? "@2x" : "",
  5998. s: this._getSubdomain(t),
  5999. x: t.x,
  6000. y: t.y,
  6001. z: this._getZoomForUrl(),
  6002. };
  6003. return (
  6004. this._map &&
  6005. !this._map.options.crs.infinite &&
  6006. ((t = this._globalTileRange.max.y - t.y),
  6007. this.options.tms && (e.y = t),
  6008. (e["-y"] = t)),
  6009. q(this._url, l(e, this.options))
  6010. );
  6011. },
  6012. _tileOnLoad: function (t, e) {
  6013. b.ielt9 ? setTimeout(a(t, this, null, e), 0) : t(null, e);
  6014. },
  6015. _tileOnError: function (t, e, i) {
  6016. var n = this.options.errorTileUrl;
  6017. n && e.getAttribute("src") !== n && (e.src = n), t(i, e);
  6018. },
  6019. _onTileRemove: function (t) {
  6020. t.tile.onload = null;
  6021. },
  6022. _getZoomForUrl: function () {
  6023. var t = this._tileZoom,
  6024. e = this.options.maxZoom;
  6025. return (
  6026. (t = this.options.zoomReverse ? e - t : t) + this.options.zoomOffset
  6027. );
  6028. },
  6029. _getSubdomain: function (t) {
  6030. t = Math.abs(t.x + t.y) % this.options.subdomains.length;
  6031. return this.options.subdomains[t];
  6032. },
  6033. _abortLoading: function () {
  6034. var t, e, i;
  6035. for (t in this._tiles)
  6036. this._tiles[t].coords.z !== this._tileZoom &&
  6037. (((i = this._tiles[t].el).onload = u),
  6038. (i.onerror = u),
  6039. i.complete ||
  6040. ((i.src = K),
  6041. (e = this._tiles[t].coords),
  6042. T(i),
  6043. delete this._tiles[t],
  6044. this.fire("tileabort", { tile: i, coords: e })));
  6045. },
  6046. _removeTile: function (t) {
  6047. var e = this._tiles[t];
  6048. if (e)
  6049. return (
  6050. e.el.setAttribute("src", K), Ni.prototype._removeTile.call(this, t)
  6051. );
  6052. },
  6053. _tileReady: function (t, e, i) {
  6054. if (this._map && (!i || i.getAttribute("src") !== K))
  6055. return Ni.prototype._tileReady.call(this, t, e, i);
  6056. },
  6057. });
  6058. function ji(t, e) {
  6059. return new Di(t, e);
  6060. }
  6061. var Hi = Di.extend({
  6062. defaultWmsParams: {
  6063. service: "WMS",
  6064. request: "GetMap",
  6065. layers: "",
  6066. styles: "",
  6067. format: "image/jpeg",
  6068. transparent: !1,
  6069. version: "1.1.1",
  6070. },
  6071. options: { crs: null, uppercase: !1 },
  6072. initialize: function (t, e) {
  6073. this._url = t;
  6074. var i,
  6075. n = l({}, this.defaultWmsParams);
  6076. for (i in e) i in this.options || (n[i] = e[i]);
  6077. var t = (e = c(this, e)).detectRetina && b.retina ? 2 : 1,
  6078. o = this.getTileSize();
  6079. (n.width = o.x * t), (n.height = o.y * t), (this.wmsParams = n);
  6080. },
  6081. onAdd: function (t) {
  6082. (this._crs = this.options.crs || t.options.crs),
  6083. (this._wmsVersion = parseFloat(this.wmsParams.version));
  6084. var e = 1.3 <= this._wmsVersion ? "crs" : "srs";
  6085. (this.wmsParams[e] = this._crs.code), Di.prototype.onAdd.call(this, t);
  6086. },
  6087. getTileUrl: function (t) {
  6088. var e = this._tileCoordsToNwSe(t),
  6089. i = this._crs,
  6090. i = _(i.project(e[0]), i.project(e[1])),
  6091. e = i.min,
  6092. i = i.max,
  6093. e = (
  6094. 1.3 <= this._wmsVersion && this._crs === li
  6095. ? [e.y, e.x, i.y, i.x]
  6096. : [e.x, e.y, i.x, i.y]
  6097. ).join(","),
  6098. i = Di.prototype.getTileUrl.call(this, t);
  6099. return (
  6100. i +
  6101. U(this.wmsParams, i, this.options.uppercase) +
  6102. (this.options.uppercase ? "&BBOX=" : "&bbox=") +
  6103. e
  6104. );
  6105. },
  6106. setParams: function (t, e) {
  6107. return l(this.wmsParams, t), e || this.redraw(), this;
  6108. },
  6109. });
  6110. (Di.WMS = Hi),
  6111. (ji.wms = function (t, e) {
  6112. return new Hi(t, e);
  6113. });
  6114. var Wi = o.extend({
  6115. options: { padding: 0.1 },
  6116. initialize: function (t) {
  6117. c(this, t), h(this), (this._layers = this._layers || {});
  6118. },
  6119. onAdd: function () {
  6120. this._container ||
  6121. (this._initContainer(), M(this._container, "leaflet-zoom-animated")),
  6122. this.getPane().appendChild(this._container),
  6123. this._update(),
  6124. this.on("update", this._updatePaths, this);
  6125. },
  6126. onRemove: function () {
  6127. this.off("update", this._updatePaths, this), this._destroyContainer();
  6128. },
  6129. getEvents: function () {
  6130. var t = {
  6131. viewreset: this._reset,
  6132. zoom: this._onZoom,
  6133. moveend: this._update,
  6134. zoomend: this._onZoomEnd,
  6135. };
  6136. return this._zoomAnimated && (t.zoomanim = this._onAnimZoom), t;
  6137. },
  6138. _onAnimZoom: function (t) {
  6139. this._updateTransform(t.center, t.zoom);
  6140. },
  6141. _onZoom: function () {
  6142. this._updateTransform(this._map.getCenter(), this._map.getZoom());
  6143. },
  6144. _updateTransform: function (t, e) {
  6145. var i = this._map.getZoomScale(e, this._zoom),
  6146. n = this._map.getSize().multiplyBy(0.5 + this.options.padding),
  6147. o = this._map.project(this._center, e),
  6148. n = n
  6149. .multiplyBy(-i)
  6150. .add(o)
  6151. .subtract(this._map._getNewPixelOrigin(t, e));
  6152. b.any3d ? be(this._container, n, i) : Z(this._container, n);
  6153. },
  6154. _reset: function () {
  6155. for (var t in (this._update(),
  6156. this._updateTransform(this._center, this._zoom),
  6157. this._layers))
  6158. this._layers[t]._reset();
  6159. },
  6160. _onZoomEnd: function () {
  6161. for (var t in this._layers) this._layers[t]._project();
  6162. },
  6163. _updatePaths: function () {
  6164. for (var t in this._layers) this._layers[t]._update();
  6165. },
  6166. _update: function () {
  6167. var t = this.options.padding,
  6168. e = this._map.getSize(),
  6169. i = this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();
  6170. (this._bounds = new f(i, i.add(e.multiplyBy(1 + 2 * t)).round())),
  6171. (this._center = this._map.getCenter()),
  6172. (this._zoom = this._map.getZoom());
  6173. },
  6174. }),
  6175. Fi = Wi.extend({
  6176. options: { tolerance: 0 },
  6177. getEvents: function () {
  6178. var t = Wi.prototype.getEvents.call(this);
  6179. return (t.viewprereset = this._onViewPreReset), t;
  6180. },
  6181. _onViewPreReset: function () {
  6182. this._postponeUpdatePaths = !0;
  6183. },
  6184. onAdd: function () {
  6185. Wi.prototype.onAdd.call(this), this._draw();
  6186. },
  6187. _initContainer: function () {
  6188. var t = (this._container = document.createElement("canvas"));
  6189. S(t, "mousemove", this._onMouseMove, this),
  6190. S(
  6191. t,
  6192. "click dblclick mousedown mouseup contextmenu",
  6193. this._onClick,
  6194. this
  6195. ),
  6196. S(t, "mouseout", this._handleMouseOut, this),
  6197. (t._leaflet_disable_events = !0),
  6198. (this._ctx = t.getContext("2d"));
  6199. },
  6200. _destroyContainer: function () {
  6201. r(this._redrawRequest),
  6202. delete this._ctx,
  6203. T(this._container),
  6204. k(this._container),
  6205. delete this._container;
  6206. },
  6207. _updatePaths: function () {
  6208. if (!this._postponeUpdatePaths) {
  6209. for (var t in ((this._redrawBounds = null), this._layers))
  6210. this._layers[t]._update();
  6211. this._redraw();
  6212. }
  6213. },
  6214. _update: function () {
  6215. var t, e, i, n;
  6216. (this._map._animatingZoom && this._bounds) ||
  6217. (Wi.prototype._update.call(this),
  6218. (t = this._bounds),
  6219. (e = this._container),
  6220. (i = t.getSize()),
  6221. (n = b.retina ? 2 : 1),
  6222. Z(e, t.min),
  6223. (e.width = n * i.x),
  6224. (e.height = n * i.y),
  6225. (e.style.width = i.x + "px"),
  6226. (e.style.height = i.y + "px"),
  6227. b.retina && this._ctx.scale(2, 2),
  6228. this._ctx.translate(-t.min.x, -t.min.y),
  6229. this.fire("update"));
  6230. },
  6231. _reset: function () {
  6232. Wi.prototype._reset.call(this),
  6233. this._postponeUpdatePaths &&
  6234. ((this._postponeUpdatePaths = !1), this._updatePaths());
  6235. },
  6236. _initPath: function (t) {
  6237. this._updateDashArray(t);
  6238. t = (this._layers[h(t)] = t)._order = {
  6239. layer: t,
  6240. prev: this._drawLast,
  6241. next: null,
  6242. };
  6243. this._drawLast && (this._drawLast.next = t),
  6244. (this._drawLast = t),
  6245. (this._drawFirst = this._drawFirst || this._drawLast);
  6246. },
  6247. _addPath: function (t) {
  6248. this._requestRedraw(t);
  6249. },
  6250. _removePath: function (t) {
  6251. var e = t._order,
  6252. i = e.next,
  6253. e = e.prev;
  6254. i ? (i.prev = e) : (this._drawLast = e),
  6255. e ? (e.next = i) : (this._drawFirst = i),
  6256. delete t._order,
  6257. delete this._layers[h(t)],
  6258. this._requestRedraw(t);
  6259. },
  6260. _updatePath: function (t) {
  6261. this._extendRedrawBounds(t),
  6262. t._project(),
  6263. t._update(),
  6264. this._requestRedraw(t);
  6265. },
  6266. _updateStyle: function (t) {
  6267. this._updateDashArray(t), this._requestRedraw(t);
  6268. },
  6269. _updateDashArray: function (t) {
  6270. if ("string" == typeof t.options.dashArray) {
  6271. for (
  6272. var e, i = t.options.dashArray.split(/[, ]+/), n = [], o = 0;
  6273. o < i.length;
  6274. o++
  6275. ) {
  6276. if (((e = Number(i[o])), isNaN(e))) return;
  6277. n.push(e);
  6278. }
  6279. t.options._dashArray = n;
  6280. } else t.options._dashArray = t.options.dashArray;
  6281. },
  6282. _requestRedraw: function (t) {
  6283. this._map &&
  6284. (this._extendRedrawBounds(t),
  6285. (this._redrawRequest = this._redrawRequest || x(this._redraw, this)));
  6286. },
  6287. _extendRedrawBounds: function (t) {
  6288. var e;
  6289. t._pxBounds &&
  6290. ((e = (t.options.weight || 0) + 1),
  6291. (this._redrawBounds = this._redrawBounds || new f()),
  6292. this._redrawBounds.extend(t._pxBounds.min.subtract([e, e])),
  6293. this._redrawBounds.extend(t._pxBounds.max.add([e, e])));
  6294. },
  6295. _redraw: function () {
  6296. (this._redrawRequest = null),
  6297. this._redrawBounds &&
  6298. (this._redrawBounds.min._floor(), this._redrawBounds.max._ceil()),
  6299. this._clear(),
  6300. this._draw(),
  6301. (this._redrawBounds = null);
  6302. },
  6303. _clear: function () {
  6304. var t,
  6305. e = this._redrawBounds;
  6306. e
  6307. ? ((t = e.getSize()), this._ctx.clearRect(e.min.x, e.min.y, t.x, t.y))
  6308. : (this._ctx.save(),
  6309. this._ctx.setTransform(1, 0, 0, 1, 0, 0),
  6310. this._ctx.clearRect(
  6311. 0,
  6312. 0,
  6313. this._container.width,
  6314. this._container.height
  6315. ),
  6316. this._ctx.restore());
  6317. },
  6318. _draw: function () {
  6319. var t,
  6320. e,
  6321. i = this._redrawBounds;
  6322. this._ctx.save(),
  6323. i &&
  6324. ((e = i.getSize()),
  6325. this._ctx.beginPath(),
  6326. this._ctx.rect(i.min.x, i.min.y, e.x, e.y),
  6327. this._ctx.clip()),
  6328. (this._drawing = !0);
  6329. for (var n = this._drawFirst; n; n = n.next)
  6330. (t = n.layer),
  6331. (!i || (t._pxBounds && t._pxBounds.intersects(i))) &&
  6332. t._updatePath();
  6333. (this._drawing = !1), this._ctx.restore();
  6334. },
  6335. _updatePoly: function (t, e) {
  6336. if (this._drawing) {
  6337. var i,
  6338. n,
  6339. o,
  6340. s,
  6341. r = t._parts,
  6342. a = r.length,
  6343. h = this._ctx;
  6344. if (a) {
  6345. for (h.beginPath(), i = 0; i < a; i++) {
  6346. for (n = 0, o = r[i].length; n < o; n++)
  6347. (s = r[i][n]), h[n ? "lineTo" : "moveTo"](s.x, s.y);
  6348. e && h.closePath();
  6349. }
  6350. this._fillStroke(h, t);
  6351. }
  6352. }
  6353. },
  6354. _updateCircle: function (t) {
  6355. var e, i, n, o;
  6356. this._drawing &&
  6357. !t._empty() &&
  6358. ((e = t._point),
  6359. (i = this._ctx),
  6360. (n = Math.max(Math.round(t._radius), 1)),
  6361. 1 != (o = (Math.max(Math.round(t._radiusY), 1) || n) / n) &&
  6362. (i.save(), i.scale(1, o)),
  6363. i.beginPath(),
  6364. i.arc(e.x, e.y / o, n, 0, 2 * Math.PI, !1),
  6365. 1 != o && i.restore(),
  6366. this._fillStroke(i, t));
  6367. },
  6368. _fillStroke: function (t, e) {
  6369. var i = e.options;
  6370. i.fill &&
  6371. ((t.globalAlpha = i.fillOpacity),
  6372. (t.fillStyle = i.fillColor || i.color),
  6373. t.fill(i.fillRule || "evenodd")),
  6374. i.stroke &&
  6375. 0 !== i.weight &&
  6376. (t.setLineDash &&
  6377. t.setLineDash((e.options && e.options._dashArray) || []),
  6378. (t.globalAlpha = i.opacity),
  6379. (t.lineWidth = i.weight),
  6380. (t.strokeStyle = i.color),
  6381. (t.lineCap = i.lineCap),
  6382. (t.lineJoin = i.lineJoin),
  6383. t.stroke());
  6384. },
  6385. _onClick: function (t) {
  6386. for (
  6387. var e,
  6388. i,
  6389. n = this._map.mouseEventToLayerPoint(t),
  6390. o = this._drawFirst;
  6391. o;
  6392. o = o.next
  6393. )
  6394. (e = o.layer).options.interactive &&
  6395. e._containsPoint(n) &&
  6396. ((("click" === t.type || "preclick" === t.type) &&
  6397. this._map._draggableMoved(e)) ||
  6398. (i = e));
  6399. this._fireEvent(!!i && [i], t);
  6400. },
  6401. _onMouseMove: function (t) {
  6402. var e;
  6403. !this._map ||
  6404. this._map.dragging.moving() ||
  6405. this._map._animatingZoom ||
  6406. ((e = this._map.mouseEventToLayerPoint(t)),
  6407. this._handleMouseHover(t, e));
  6408. },
  6409. _handleMouseOut: function (t) {
  6410. var e = this._hoveredLayer;
  6411. e &&
  6412. (z(this._container, "leaflet-interactive"),
  6413. this._fireEvent([e], t, "mouseout"),
  6414. (this._hoveredLayer = null),
  6415. (this._mouseHoverThrottled = !1));
  6416. },
  6417. _handleMouseHover: function (t, e) {
  6418. if (!this._mouseHoverThrottled) {
  6419. for (var i, n, o = this._drawFirst; o; o = o.next)
  6420. (i = o.layer).options.interactive && i._containsPoint(e) && (n = i);
  6421. n !== this._hoveredLayer &&
  6422. (this._handleMouseOut(t),
  6423. n &&
  6424. (M(this._container, "leaflet-interactive"),
  6425. this._fireEvent([n], t, "mouseover"),
  6426. (this._hoveredLayer = n))),
  6427. this._fireEvent(!!this._hoveredLayer && [this._hoveredLayer], t),
  6428. (this._mouseHoverThrottled = !0),
  6429. setTimeout(
  6430. a(function () {
  6431. this._mouseHoverThrottled = !1;
  6432. }, this),
  6433. 32
  6434. );
  6435. }
  6436. },
  6437. _fireEvent: function (t, e, i) {
  6438. this._map._fireDOMEvent(e, i || e.type, t);
  6439. },
  6440. _bringToFront: function (t) {
  6441. var e,
  6442. i,
  6443. n = t._order;
  6444. n &&
  6445. ((e = n.next),
  6446. (i = n.prev),
  6447. e &&
  6448. ((e.prev = i) ? (i.next = e) : e && (this._drawFirst = e),
  6449. (n.prev = this._drawLast),
  6450. ((this._drawLast.next = n).next = null),
  6451. (this._drawLast = n),
  6452. this._requestRedraw(t)));
  6453. },
  6454. _bringToBack: function (t) {
  6455. var e,
  6456. i,
  6457. n = t._order;
  6458. n &&
  6459. ((e = n.next),
  6460. (i = n.prev) &&
  6461. ((i.next = e) ? (e.prev = i) : i && (this._drawLast = i),
  6462. (n.prev = null),
  6463. (n.next = this._drawFirst),
  6464. (this._drawFirst.prev = n),
  6465. (this._drawFirst = n),
  6466. this._requestRedraw(t)));
  6467. },
  6468. });
  6469. function Ui(t) {
  6470. return b.canvas ? new Fi(t) : null;
  6471. }
  6472. var Vi = (function () {
  6473. try {
  6474. return (
  6475. document.namespaces.add("lvml", "urn:schemas-microsoft-com:vml"),
  6476. function (t) {
  6477. return document.createElement("<lvml:" + t + ' class="lvml">');
  6478. }
  6479. );
  6480. } catch (t) {}
  6481. return function (t) {
  6482. return document.createElement(
  6483. "<" + t + ' xmlns="urn:schemas-microsoft.com:vml" class="lvml">'
  6484. );
  6485. };
  6486. })(),
  6487. zt = {
  6488. _initContainer: function () {
  6489. this._container = P("div", "leaflet-vml-container");
  6490. },
  6491. _update: function () {
  6492. this._map._animatingZoom ||
  6493. (Wi.prototype._update.call(this), this.fire("update"));
  6494. },
  6495. _initPath: function (t) {
  6496. var e = (t._container = Vi("shape"));
  6497. M(e, "leaflet-vml-shape " + (this.options.className || "")),
  6498. (e.coordsize = "1 1"),
  6499. (t._path = Vi("path")),
  6500. e.appendChild(t._path),
  6501. this._updateStyle(t),
  6502. (this._layers[h(t)] = t);
  6503. },
  6504. _addPath: function (t) {
  6505. var e = t._container;
  6506. this._container.appendChild(e),
  6507. t.options.interactive && t.addInteractiveTarget(e);
  6508. },
  6509. _removePath: function (t) {
  6510. var e = t._container;
  6511. T(e), t.removeInteractiveTarget(e), delete this._layers[h(t)];
  6512. },
  6513. _updateStyle: function (t) {
  6514. var e = t._stroke,
  6515. i = t._fill,
  6516. n = t.options,
  6517. o = t._container;
  6518. (o.stroked = !!n.stroke),
  6519. (o.filled = !!n.fill),
  6520. n.stroke
  6521. ? ((e = e || (t._stroke = Vi("stroke"))),
  6522. o.appendChild(e),
  6523. (e.weight = n.weight + "px"),
  6524. (e.color = n.color),
  6525. (e.opacity = n.opacity),
  6526. n.dashArray
  6527. ? (e.dashStyle = d(n.dashArray)
  6528. ? n.dashArray.join(" ")
  6529. : n.dashArray.replace(/( *, *)/g, " "))
  6530. : (e.dashStyle = ""),
  6531. (e.endcap = n.lineCap.replace("butt", "flat")),
  6532. (e.joinstyle = n.lineJoin))
  6533. : e && (o.removeChild(e), (t._stroke = null)),
  6534. n.fill
  6535. ? ((i = i || (t._fill = Vi("fill"))),
  6536. o.appendChild(i),
  6537. (i.color = n.fillColor || n.color),
  6538. (i.opacity = n.fillOpacity))
  6539. : i && (o.removeChild(i), (t._fill = null));
  6540. },
  6541. _updateCircle: function (t) {
  6542. var e = t._point.round(),
  6543. i = Math.round(t._radius),
  6544. n = Math.round(t._radiusY || i);
  6545. this._setPath(
  6546. t,
  6547. t._empty()
  6548. ? "M0 0"
  6549. : "AL " + e.x + "," + e.y + " " + i + "," + n + " 0,23592600"
  6550. );
  6551. },
  6552. _setPath: function (t, e) {
  6553. t._path.v = e;
  6554. },
  6555. _bringToFront: function (t) {
  6556. fe(t._container);
  6557. },
  6558. _bringToBack: function (t) {
  6559. ge(t._container);
  6560. },
  6561. },
  6562. qi = b.vml ? Vi : ct,
  6563. Gi = Wi.extend({
  6564. _initContainer: function () {
  6565. (this._container = qi("svg")),
  6566. this._container.setAttribute("pointer-events", "none"),
  6567. (this._rootGroup = qi("g")),
  6568. this._container.appendChild(this._rootGroup);
  6569. },
  6570. _destroyContainer: function () {
  6571. T(this._container),
  6572. k(this._container),
  6573. delete this._container,
  6574. delete this._rootGroup,
  6575. delete this._svgSize;
  6576. },
  6577. _update: function () {
  6578. var t, e, i;
  6579. (this._map._animatingZoom && this._bounds) ||
  6580. (Wi.prototype._update.call(this),
  6581. (e = (t = this._bounds).getSize()),
  6582. (i = this._container),
  6583. (this._svgSize && this._svgSize.equals(e)) ||
  6584. ((this._svgSize = e),
  6585. i.setAttribute("width", e.x),
  6586. i.setAttribute("height", e.y)),
  6587. Z(i, t.min),
  6588. i.setAttribute("viewBox", [t.min.x, t.min.y, e.x, e.y].join(" ")),
  6589. this.fire("update"));
  6590. },
  6591. _initPath: function (t) {
  6592. var e = (t._path = qi("path"));
  6593. t.options.className && M(e, t.options.className),
  6594. t.options.interactive && M(e, "leaflet-interactive"),
  6595. this._updateStyle(t),
  6596. (this._layers[h(t)] = t);
  6597. },
  6598. _addPath: function (t) {
  6599. this._rootGroup || this._initContainer(),
  6600. this._rootGroup.appendChild(t._path),
  6601. t.addInteractiveTarget(t._path);
  6602. },
  6603. _removePath: function (t) {
  6604. T(t._path),
  6605. t.removeInteractiveTarget(t._path),
  6606. delete this._layers[h(t)];
  6607. },
  6608. _updatePath: function (t) {
  6609. t._project(), t._update();
  6610. },
  6611. _updateStyle: function (t) {
  6612. var e = t._path,
  6613. t = t.options;
  6614. e &&
  6615. (t.stroke
  6616. ? (e.setAttribute("stroke", t.color),
  6617. e.setAttribute("stroke-opacity", t.opacity),
  6618. e.setAttribute("stroke-width", t.weight),
  6619. e.setAttribute("stroke-linecap", t.lineCap),
  6620. e.setAttribute("stroke-linejoin", t.lineJoin),
  6621. t.dashArray
  6622. ? e.setAttribute("stroke-dasharray", t.dashArray)
  6623. : e.removeAttribute("stroke-dasharray"),
  6624. t.dashOffset
  6625. ? e.setAttribute("stroke-dashoffset", t.dashOffset)
  6626. : e.removeAttribute("stroke-dashoffset"))
  6627. : e.setAttribute("stroke", "none"),
  6628. t.fill
  6629. ? (e.setAttribute("fill", t.fillColor || t.color),
  6630. e.setAttribute("fill-opacity", t.fillOpacity),
  6631. e.setAttribute("fill-rule", t.fillRule || "evenodd"))
  6632. : e.setAttribute("fill", "none"));
  6633. },
  6634. _updatePoly: function (t, e) {
  6635. this._setPath(t, dt(t._parts, e));
  6636. },
  6637. _updateCircle: function (t) {
  6638. var e = t._point,
  6639. i = Math.max(Math.round(t._radius), 1),
  6640. n =
  6641. "a" +
  6642. i +
  6643. "," +
  6644. (Math.max(Math.round(t._radiusY), 1) || i) +
  6645. " 0 1,0 ",
  6646. e = t._empty()
  6647. ? "M0 0"
  6648. : "M" +
  6649. (e.x - i) +
  6650. "," +
  6651. e.y +
  6652. n +
  6653. 2 * i +
  6654. ",0 " +
  6655. n +
  6656. 2 * -i +
  6657. ",0 ";
  6658. this._setPath(t, e);
  6659. },
  6660. _setPath: function (t, e) {
  6661. t._path.setAttribute("d", e);
  6662. },
  6663. _bringToFront: function (t) {
  6664. fe(t._path);
  6665. },
  6666. _bringToBack: function (t) {
  6667. ge(t._path);
  6668. },
  6669. });
  6670. function Ki(t) {
  6671. return b.svg || b.vml ? new Gi(t) : null;
  6672. }
  6673. b.vml && Gi.include(zt),
  6674. A.include({
  6675. getRenderer: function (t) {
  6676. t =
  6677. (t =
  6678. t.options.renderer ||
  6679. this._getPaneRenderer(t.options.pane) ||
  6680. this.options.renderer ||
  6681. this._renderer) || (this._renderer = this._createRenderer());
  6682. return this.hasLayer(t) || this.addLayer(t), t;
  6683. },
  6684. _getPaneRenderer: function (t) {
  6685. var e;
  6686. return (
  6687. "overlayPane" !== t &&
  6688. void 0 !== t &&
  6689. (void 0 === (e = this._paneRenderers[t]) &&
  6690. ((e = this._createRenderer({ pane: t })),
  6691. (this._paneRenderers[t] = e)),
  6692. e)
  6693. );
  6694. },
  6695. _createRenderer: function (t) {
  6696. return (this.options.preferCanvas && Ui(t)) || Ki(t);
  6697. },
  6698. });
  6699. var Yi = xi.extend({
  6700. initialize: function (t, e) {
  6701. xi.prototype.initialize.call(this, this._boundsToLatLngs(t), e);
  6702. },
  6703. setBounds: function (t) {
  6704. return this.setLatLngs(this._boundsToLatLngs(t));
  6705. },
  6706. _boundsToLatLngs: function (t) {
  6707. return [
  6708. (t = g(t)).getSouthWest(),
  6709. t.getNorthWest(),
  6710. t.getNorthEast(),
  6711. t.getSouthEast(),
  6712. ];
  6713. },
  6714. });
  6715. (Gi.create = qi),
  6716. (Gi.pointsToPath = dt),
  6717. (wi.geometryToLayer = bi),
  6718. (wi.coordsToLatLng = Li),
  6719. (wi.coordsToLatLngs = Ti),
  6720. (wi.latLngToCoords = Mi),
  6721. (wi.latLngsToCoords = zi),
  6722. (wi.getFeature = Ci),
  6723. (wi.asFeature = Zi),
  6724. A.mergeOptions({ boxZoom: !0 });
  6725. var _t = n.extend({
  6726. initialize: function (t) {
  6727. (this._map = t),
  6728. (this._container = t._container),
  6729. (this._pane = t._panes.overlayPane),
  6730. (this._resetStateTimeout = 0),
  6731. t.on("unload", this._destroy, this);
  6732. },
  6733. addHooks: function () {
  6734. S(this._container, "mousedown", this._onMouseDown, this);
  6735. },
  6736. removeHooks: function () {
  6737. k(this._container, "mousedown", this._onMouseDown, this);
  6738. },
  6739. moved: function () {
  6740. return this._moved;
  6741. },
  6742. _destroy: function () {
  6743. T(this._pane), delete this._pane;
  6744. },
  6745. _resetState: function () {
  6746. (this._resetStateTimeout = 0), (this._moved = !1);
  6747. },
  6748. _clearDeferredResetState: function () {
  6749. 0 !== this._resetStateTimeout &&
  6750. (clearTimeout(this._resetStateTimeout),
  6751. (this._resetStateTimeout = 0));
  6752. },
  6753. _onMouseDown: function (t) {
  6754. if (!t.shiftKey || (1 !== t.which && 1 !== t.button)) return !1;
  6755. this._clearDeferredResetState(),
  6756. this._resetState(),
  6757. re(),
  6758. Le(),
  6759. (this._startPoint = this._map.mouseEventToContainerPoint(t)),
  6760. S(
  6761. document,
  6762. {
  6763. contextmenu: Re,
  6764. mousemove: this._onMouseMove,
  6765. mouseup: this._onMouseUp,
  6766. keydown: this._onKeyDown,
  6767. },
  6768. this
  6769. );
  6770. },
  6771. _onMouseMove: function (t) {
  6772. this._moved ||
  6773. ((this._moved = !0),
  6774. (this._box = P("div", "leaflet-zoom-box", this._container)),
  6775. M(this._container, "leaflet-crosshair"),
  6776. this._map.fire("boxzoomstart")),
  6777. (this._point = this._map.mouseEventToContainerPoint(t));
  6778. var t = new f(this._point, this._startPoint),
  6779. e = t.getSize();
  6780. Z(this._box, t.min),
  6781. (this._box.style.width = e.x + "px"),
  6782. (this._box.style.height = e.y + "px");
  6783. },
  6784. _finish: function () {
  6785. this._moved && (T(this._box), z(this._container, "leaflet-crosshair")),
  6786. ae(),
  6787. Te(),
  6788. k(
  6789. document,
  6790. {
  6791. contextmenu: Re,
  6792. mousemove: this._onMouseMove,
  6793. mouseup: this._onMouseUp,
  6794. keydown: this._onKeyDown,
  6795. },
  6796. this
  6797. );
  6798. },
  6799. _onMouseUp: function (t) {
  6800. (1 !== t.which && 1 !== t.button) ||
  6801. (this._finish(),
  6802. this._moved &&
  6803. (this._clearDeferredResetState(),
  6804. (this._resetStateTimeout = setTimeout(
  6805. a(this._resetState, this),
  6806. 0
  6807. )),
  6808. (t = new s(
  6809. this._map.containerPointToLatLng(this._startPoint),
  6810. this._map.containerPointToLatLng(this._point)
  6811. )),
  6812. this._map.fitBounds(t).fire("boxzoomend", { boxZoomBounds: t })));
  6813. },
  6814. _onKeyDown: function (t) {
  6815. 27 === t.keyCode &&
  6816. (this._finish(), this._clearDeferredResetState(), this._resetState());
  6817. },
  6818. }),
  6819. Ct =
  6820. (A.addInitHook("addHandler", "boxZoom", _t),
  6821. A.mergeOptions({ doubleClickZoom: !0 }),
  6822. n.extend({
  6823. addHooks: function () {
  6824. this._map.on("dblclick", this._onDoubleClick, this);
  6825. },
  6826. removeHooks: function () {
  6827. this._map.off("dblclick", this._onDoubleClick, this);
  6828. },
  6829. _onDoubleClick: function (t) {
  6830. var e = this._map,
  6831. i = e.getZoom(),
  6832. n = e.options.zoomDelta,
  6833. i = t.originalEvent.shiftKey ? i - n : i + n;
  6834. "center" === e.options.doubleClickZoom
  6835. ? e.setZoom(i)
  6836. : e.setZoomAround(t.containerPoint, i);
  6837. },
  6838. })),
  6839. Zt =
  6840. (A.addInitHook("addHandler", "doubleClickZoom", Ct),
  6841. A.mergeOptions({
  6842. dragging: !0,
  6843. inertia: !0,
  6844. inertiaDeceleration: 3400,
  6845. inertiaMaxSpeed: 1 / 0,
  6846. easeLinearity: 0.2,
  6847. worldCopyJump: !1,
  6848. maxBoundsViscosity: 0,
  6849. }),
  6850. n.extend({
  6851. addHooks: function () {
  6852. var t;
  6853. this._draggable ||
  6854. ((t = this._map),
  6855. (this._draggable = new Xe(t._mapPane, t._container)),
  6856. this._draggable.on(
  6857. {
  6858. dragstart: this._onDragStart,
  6859. drag: this._onDrag,
  6860. dragend: this._onDragEnd,
  6861. },
  6862. this
  6863. ),
  6864. this._draggable.on("predrag", this._onPreDragLimit, this),
  6865. t.options.worldCopyJump &&
  6866. (this._draggable.on("predrag", this._onPreDragWrap, this),
  6867. t.on("zoomend", this._onZoomEnd, this),
  6868. t.whenReady(this._onZoomEnd, this))),
  6869. M(this._map._container, "leaflet-grab leaflet-touch-drag"),
  6870. this._draggable.enable(),
  6871. (this._positions = []),
  6872. (this._times = []);
  6873. },
  6874. removeHooks: function () {
  6875. z(this._map._container, "leaflet-grab"),
  6876. z(this._map._container, "leaflet-touch-drag"),
  6877. this._draggable.disable();
  6878. },
  6879. moved: function () {
  6880. return this._draggable && this._draggable._moved;
  6881. },
  6882. moving: function () {
  6883. return this._draggable && this._draggable._moving;
  6884. },
  6885. _onDragStart: function () {
  6886. var t,
  6887. e = this._map;
  6888. e._stop(),
  6889. this._map.options.maxBounds && this._map.options.maxBoundsViscosity
  6890. ? ((t = g(this._map.options.maxBounds)),
  6891. (this._offsetLimit = _(
  6892. this._map
  6893. .latLngToContainerPoint(t.getNorthWest())
  6894. .multiplyBy(-1),
  6895. this._map
  6896. .latLngToContainerPoint(t.getSouthEast())
  6897. .multiplyBy(-1)
  6898. .add(this._map.getSize())
  6899. )),
  6900. (this._viscosity = Math.min(
  6901. 1,
  6902. Math.max(0, this._map.options.maxBoundsViscosity)
  6903. )))
  6904. : (this._offsetLimit = null),
  6905. e.fire("movestart").fire("dragstart"),
  6906. e.options.inertia && ((this._positions = []), (this._times = []));
  6907. },
  6908. _onDrag: function (t) {
  6909. var e, i;
  6910. this._map.options.inertia &&
  6911. ((e = this._lastTime = +new Date()),
  6912. (i = this._lastPos =
  6913. this._draggable._absPos || this._draggable._newPos),
  6914. this._positions.push(i),
  6915. this._times.push(e),
  6916. this._prunePositions(e)),
  6917. this._map.fire("move", t).fire("drag", t);
  6918. },
  6919. _prunePositions: function (t) {
  6920. for (; 1 < this._positions.length && 50 < t - this._times[0]; )
  6921. this._positions.shift(), this._times.shift();
  6922. },
  6923. _onZoomEnd: function () {
  6924. var t = this._map.getSize().divideBy(2),
  6925. e = this._map.latLngToLayerPoint([0, 0]);
  6926. (this._initialWorldOffset = e.subtract(t).x),
  6927. (this._worldWidth = this._map.getPixelWorldBounds().getSize().x);
  6928. },
  6929. _viscousLimit: function (t, e) {
  6930. return t - (t - e) * this._viscosity;
  6931. },
  6932. _onPreDragLimit: function () {
  6933. var t, e;
  6934. this._viscosity &&
  6935. this._offsetLimit &&
  6936. ((t = this._draggable._newPos.subtract(this._draggable._startPos)),
  6937. (e = this._offsetLimit),
  6938. t.x < e.min.x && (t.x = this._viscousLimit(t.x, e.min.x)),
  6939. t.y < e.min.y && (t.y = this._viscousLimit(t.y, e.min.y)),
  6940. t.x > e.max.x && (t.x = this._viscousLimit(t.x, e.max.x)),
  6941. t.y > e.max.y && (t.y = this._viscousLimit(t.y, e.max.y)),
  6942. (this._draggable._newPos = this._draggable._startPos.add(t)));
  6943. },
  6944. _onPreDragWrap: function () {
  6945. var t = this._worldWidth,
  6946. e = Math.round(t / 2),
  6947. i = this._initialWorldOffset,
  6948. n = this._draggable._newPos.x,
  6949. o = ((n - e + i) % t) + e - i,
  6950. n = ((n + e + i) % t) - e - i,
  6951. t = Math.abs(o + i) < Math.abs(n + i) ? o : n;
  6952. (this._draggable._absPos = this._draggable._newPos.clone()),
  6953. (this._draggable._newPos.x = t);
  6954. },
  6955. _onDragEnd: function (t) {
  6956. var e,
  6957. i,
  6958. n,
  6959. o,
  6960. s = this._map,
  6961. r = s.options,
  6962. a = !r.inertia || t.noInertia || this._times.length < 2;
  6963. s.fire("dragend", t),
  6964. !a &&
  6965. (this._prunePositions(+new Date()),
  6966. (t = this._lastPos.subtract(this._positions[0])),
  6967. (a = (this._lastTime - this._times[0]) / 1e3),
  6968. (e = r.easeLinearity),
  6969. (a = (t = t.multiplyBy(e / a)).distanceTo([0, 0])),
  6970. (i = Math.min(r.inertiaMaxSpeed, a)),
  6971. (t = t.multiplyBy(i / a)),
  6972. (n = i / (r.inertiaDeceleration * e)),
  6973. (o = t.multiplyBy(-n / 2).round()).x || o.y)
  6974. ? ((o = s._limitOffset(o, s.options.maxBounds)),
  6975. x(function () {
  6976. s.panBy(o, {
  6977. duration: n,
  6978. easeLinearity: e,
  6979. noMoveStart: !0,
  6980. animate: !0,
  6981. });
  6982. }))
  6983. : s.fire("moveend");
  6984. },
  6985. })),
  6986. St =
  6987. (A.addInitHook("addHandler", "dragging", Zt),
  6988. A.mergeOptions({ keyboard: !0, keyboardPanDelta: 80 }),
  6989. n.extend({
  6990. keyCodes: {
  6991. left: [37],
  6992. right: [39],
  6993. down: [40],
  6994. up: [38],
  6995. zoomIn: [187, 107, 61, 171],
  6996. zoomOut: [189, 109, 54, 173],
  6997. },
  6998. initialize: function (t) {
  6999. (this._map = t),
  7000. this._setPanDelta(t.options.keyboardPanDelta),
  7001. this._setZoomDelta(t.options.zoomDelta);
  7002. },
  7003. addHooks: function () {
  7004. var t = this._map._container;
  7005. t.tabIndex <= 0 && (t.tabIndex = "0"),
  7006. S(
  7007. t,
  7008. {
  7009. focus: this._onFocus,
  7010. blur: this._onBlur,
  7011. mousedown: this._onMouseDown,
  7012. },
  7013. this
  7014. ),
  7015. this._map.on(
  7016. { focus: this._addHooks, blur: this._removeHooks },
  7017. this
  7018. );
  7019. },
  7020. removeHooks: function () {
  7021. this._removeHooks(),
  7022. k(
  7023. this._map._container,
  7024. {
  7025. focus: this._onFocus,
  7026. blur: this._onBlur,
  7027. mousedown: this._onMouseDown,
  7028. },
  7029. this
  7030. ),
  7031. this._map.off(
  7032. { focus: this._addHooks, blur: this._removeHooks },
  7033. this
  7034. );
  7035. },
  7036. _onMouseDown: function () {
  7037. var t, e, i;
  7038. this._focused ||
  7039. ((i = document.body),
  7040. (t = document.documentElement),
  7041. (e = i.scrollTop || t.scrollTop),
  7042. (i = i.scrollLeft || t.scrollLeft),
  7043. this._map._container.focus(),
  7044. window.scrollTo(i, e));
  7045. },
  7046. _onFocus: function () {
  7047. (this._focused = !0), this._map.fire("focus");
  7048. },
  7049. _onBlur: function () {
  7050. (this._focused = !1), this._map.fire("blur");
  7051. },
  7052. _setPanDelta: function (t) {
  7053. for (
  7054. var e = (this._panKeys = {}),
  7055. i = this.keyCodes,
  7056. n = 0,
  7057. o = i.left.length;
  7058. n < o;
  7059. n++
  7060. )
  7061. e[i.left[n]] = [-1 * t, 0];
  7062. for (n = 0, o = i.right.length; n < o; n++) e[i.right[n]] = [t, 0];
  7063. for (n = 0, o = i.down.length; n < o; n++) e[i.down[n]] = [0, t];
  7064. for (n = 0, o = i.up.length; n < o; n++) e[i.up[n]] = [0, -1 * t];
  7065. },
  7066. _setZoomDelta: function (t) {
  7067. for (
  7068. var e = (this._zoomKeys = {}),
  7069. i = this.keyCodes,
  7070. n = 0,
  7071. o = i.zoomIn.length;
  7072. n < o;
  7073. n++
  7074. )
  7075. e[i.zoomIn[n]] = t;
  7076. for (n = 0, o = i.zoomOut.length; n < o; n++) e[i.zoomOut[n]] = -t;
  7077. },
  7078. _addHooks: function () {
  7079. S(document, "keydown", this._onKeyDown, this);
  7080. },
  7081. _removeHooks: function () {
  7082. k(document, "keydown", this._onKeyDown, this);
  7083. },
  7084. _onKeyDown: function (t) {
  7085. if (!(t.altKey || t.ctrlKey || t.metaKey)) {
  7086. var e,
  7087. i,
  7088. n = t.keyCode,
  7089. o = this._map;
  7090. if (n in this._panKeys)
  7091. (o._panAnim && o._panAnim._inProgress) ||
  7092. ((i = this._panKeys[n]),
  7093. t.shiftKey && (i = m(i).multiplyBy(3)),
  7094. o.options.maxBounds &&
  7095. (i = o._limitOffset(m(i), o.options.maxBounds)),
  7096. o.options.worldCopyJump
  7097. ? ((e = o.wrapLatLng(
  7098. o.unproject(o.project(o.getCenter()).add(i))
  7099. )),
  7100. o.panTo(e))
  7101. : o.panBy(i));
  7102. else if (n in this._zoomKeys)
  7103. o.setZoom(o.getZoom() + (t.shiftKey ? 3 : 1) * this._zoomKeys[n]);
  7104. else {
  7105. if (27 !== n || !o._popup || !o._popup.options.closeOnEscapeKey)
  7106. return;
  7107. o.closePopup();
  7108. }
  7109. Re(t);
  7110. }
  7111. },
  7112. })),
  7113. Et =
  7114. (A.addInitHook("addHandler", "keyboard", St),
  7115. A.mergeOptions({
  7116. scrollWheelZoom: !0,
  7117. wheelDebounceTime: 40,
  7118. wheelPxPerZoomLevel: 60,
  7119. }),
  7120. n.extend({
  7121. addHooks: function () {
  7122. S(this._map._container, "wheel", this._onWheelScroll, this),
  7123. (this._delta = 0);
  7124. },
  7125. removeHooks: function () {
  7126. k(this._map._container, "wheel", this._onWheelScroll, this);
  7127. },
  7128. _onWheelScroll: function (t) {
  7129. var e = He(t),
  7130. i = this._map.options.wheelDebounceTime,
  7131. e =
  7132. ((this._delta += e),
  7133. (this._lastMousePos = this._map.mouseEventToContainerPoint(t)),
  7134. this._startTime || (this._startTime = +new Date()),
  7135. Math.max(i - (+new Date() - this._startTime), 0));
  7136. clearTimeout(this._timer),
  7137. (this._timer = setTimeout(a(this._performZoom, this), e)),
  7138. Re(t);
  7139. },
  7140. _performZoom: function () {
  7141. var t = this._map,
  7142. e = t.getZoom(),
  7143. i = this._map.options.zoomSnap || 0,
  7144. n =
  7145. (t._stop(),
  7146. this._delta / (4 * this._map.options.wheelPxPerZoomLevel)),
  7147. n = (4 * Math.log(2 / (1 + Math.exp(-Math.abs(n))))) / Math.LN2,
  7148. i = i ? Math.ceil(n / i) * i : n,
  7149. n = t._limitZoom(e + (0 < this._delta ? i : -i)) - e;
  7150. (this._delta = 0),
  7151. (this._startTime = null),
  7152. n &&
  7153. ("center" === t.options.scrollWheelZoom
  7154. ? t.setZoom(e + n)
  7155. : t.setZoomAround(this._lastMousePos, e + n));
  7156. },
  7157. })),
  7158. kt =
  7159. (A.addInitHook("addHandler", "scrollWheelZoom", Et),
  7160. A.mergeOptions({
  7161. tapHold: b.touchNative && b.safari && b.mobile,
  7162. tapTolerance: 15,
  7163. }),
  7164. n.extend({
  7165. addHooks: function () {
  7166. S(this._map._container, "touchstart", this._onDown, this);
  7167. },
  7168. removeHooks: function () {
  7169. k(this._map._container, "touchstart", this._onDown, this);
  7170. },
  7171. _onDown: function (t) {
  7172. var e;
  7173. clearTimeout(this._holdTimeout),
  7174. 1 === t.touches.length &&
  7175. ((e = t.touches[0]),
  7176. (this._startPos = this._newPos = new p(e.clientX, e.clientY)),
  7177. (this._holdTimeout = setTimeout(
  7178. a(function () {
  7179. this._cancel(),
  7180. this._isTapValid() &&
  7181. (S(document, "touchend", O),
  7182. S(
  7183. document,
  7184. "touchend touchcancel",
  7185. this._cancelClickPrevent
  7186. ),
  7187. this._simulateEvent("contextmenu", e));
  7188. }, this),
  7189. 600
  7190. )),
  7191. S(
  7192. document,
  7193. "touchend touchcancel contextmenu",
  7194. this._cancel,
  7195. this
  7196. ),
  7197. S(document, "touchmove", this._onMove, this));
  7198. },
  7199. _cancelClickPrevent: function t() {
  7200. k(document, "touchend", O), k(document, "touchend touchcancel", t);
  7201. },
  7202. _cancel: function () {
  7203. clearTimeout(this._holdTimeout),
  7204. k(document, "touchend touchcancel contextmenu", this._cancel, this),
  7205. k(document, "touchmove", this._onMove, this);
  7206. },
  7207. _onMove: function (t) {
  7208. t = t.touches[0];
  7209. this._newPos = new p(t.clientX, t.clientY);
  7210. },
  7211. _isTapValid: function () {
  7212. return (
  7213. this._newPos.distanceTo(this._startPos) <=
  7214. this._map.options.tapTolerance
  7215. );
  7216. },
  7217. _simulateEvent: function (t, e) {
  7218. t = new MouseEvent(t, {
  7219. bubbles: !0,
  7220. cancelable: !0,
  7221. view: window,
  7222. screenX: e.screenX,
  7223. screenY: e.screenY,
  7224. clientX: e.clientX,
  7225. clientY: e.clientY,
  7226. });
  7227. (t._simulated = !0), e.target.dispatchEvent(t);
  7228. },
  7229. })),
  7230. Ot =
  7231. (A.addInitHook("addHandler", "tapHold", kt),
  7232. A.mergeOptions({ touchZoom: b.touch, bounceAtZoomLimits: !0 }),
  7233. n.extend({
  7234. addHooks: function () {
  7235. M(this._map._container, "leaflet-touch-zoom"),
  7236. S(this._map._container, "touchstart", this._onTouchStart, this);
  7237. },
  7238. removeHooks: function () {
  7239. z(this._map._container, "leaflet-touch-zoom"),
  7240. k(this._map._container, "touchstart", this._onTouchStart, this);
  7241. },
  7242. _onTouchStart: function (t) {
  7243. var e,
  7244. i,
  7245. n = this._map;
  7246. !t.touches ||
  7247. 2 !== t.touches.length ||
  7248. n._animatingZoom ||
  7249. this._zooming ||
  7250. ((e = n.mouseEventToContainerPoint(t.touches[0])),
  7251. (i = n.mouseEventToContainerPoint(t.touches[1])),
  7252. (this._centerPoint = n.getSize()._divideBy(2)),
  7253. (this._startLatLng = n.containerPointToLatLng(this._centerPoint)),
  7254. "center" !== n.options.touchZoom &&
  7255. (this._pinchStartLatLng = n.containerPointToLatLng(
  7256. e.add(i)._divideBy(2)
  7257. )),
  7258. (this._startDist = e.distanceTo(i)),
  7259. (this._startZoom = n.getZoom()),
  7260. (this._moved = !1),
  7261. (this._zooming = !0),
  7262. n._stop(),
  7263. S(document, "touchmove", this._onTouchMove, this),
  7264. S(document, "touchend touchcancel", this._onTouchEnd, this),
  7265. O(t));
  7266. },
  7267. _onTouchMove: function (t) {
  7268. if (t.touches && 2 === t.touches.length && this._zooming) {
  7269. var e = this._map,
  7270. i = e.mouseEventToContainerPoint(t.touches[0]),
  7271. n = e.mouseEventToContainerPoint(t.touches[1]),
  7272. o = i.distanceTo(n) / this._startDist;
  7273. if (
  7274. ((this._zoom = e.getScaleZoom(o, this._startZoom)),
  7275. !e.options.bounceAtZoomLimits &&
  7276. ((this._zoom < e.getMinZoom() && o < 1) ||
  7277. (this._zoom > e.getMaxZoom() && 1 < o)) &&
  7278. (this._zoom = e._limitZoom(this._zoom)),
  7279. "center" === e.options.touchZoom)
  7280. ) {
  7281. if (((this._center = this._startLatLng), 1 == o)) return;
  7282. } else {
  7283. i = i._add(n)._divideBy(2)._subtract(this._centerPoint);
  7284. if (1 == o && 0 === i.x && 0 === i.y) return;
  7285. this._center = e.unproject(
  7286. e.project(this._pinchStartLatLng, this._zoom).subtract(i),
  7287. this._zoom
  7288. );
  7289. }
  7290. this._moved || (e._moveStart(!0, !1), (this._moved = !0)),
  7291. r(this._animRequest);
  7292. n = a(
  7293. e._move,
  7294. e,
  7295. this._center,
  7296. this._zoom,
  7297. { pinch: !0, round: !1 },
  7298. void 0
  7299. );
  7300. (this._animRequest = x(n, this, !0)), O(t);
  7301. }
  7302. },
  7303. _onTouchEnd: function () {
  7304. this._moved && this._zooming
  7305. ? ((this._zooming = !1),
  7306. r(this._animRequest),
  7307. k(document, "touchmove", this._onTouchMove, this),
  7308. k(document, "touchend touchcancel", this._onTouchEnd, this),
  7309. this._map.options.zoomAnimation
  7310. ? this._map._animateZoom(
  7311. this._center,
  7312. this._map._limitZoom(this._zoom),
  7313. !0,
  7314. this._map.options.zoomSnap
  7315. )
  7316. : this._map._resetView(
  7317. this._center,
  7318. this._map._limitZoom(this._zoom)
  7319. ))
  7320. : (this._zooming = !1);
  7321. },
  7322. })),
  7323. Xi =
  7324. (A.addInitHook("addHandler", "touchZoom", Ot),
  7325. (A.BoxZoom = _t),
  7326. (A.DoubleClickZoom = Ct),
  7327. (A.Drag = Zt),
  7328. (A.Keyboard = St),
  7329. (A.ScrollWheelZoom = Et),
  7330. (A.TapHold = kt),
  7331. (A.TouchZoom = Ot),
  7332. (t.Bounds = f),
  7333. (t.Browser = b),
  7334. (t.CRS = ot),
  7335. (t.Canvas = Fi),
  7336. (t.Circle = vi),
  7337. (t.CircleMarker = gi),
  7338. (t.Class = et),
  7339. (t.Control = B),
  7340. (t.DivIcon = Ri),
  7341. (t.DivOverlay = Ai),
  7342. (t.DomEvent = mt),
  7343. (t.DomUtil = pt),
  7344. (t.Draggable = Xe),
  7345. (t.Evented = it),
  7346. (t.FeatureGroup = ci),
  7347. (t.GeoJSON = wi),
  7348. (t.GridLayer = Ni),
  7349. (t.Handler = n),
  7350. (t.Icon = di),
  7351. (t.ImageOverlay = Ei),
  7352. (t.LatLng = v),
  7353. (t.LatLngBounds = s),
  7354. (t.Layer = o),
  7355. (t.LayerGroup = ui),
  7356. (t.LineUtil = vt),
  7357. (t.Map = A),
  7358. (t.Marker = mi),
  7359. (t.Mixin = ft),
  7360. (t.Path = fi),
  7361. (t.Point = p),
  7362. (t.PolyUtil = gt),
  7363. (t.Polygon = xi),
  7364. (t.Polyline = yi),
  7365. (t.Popup = Bi),
  7366. (t.PosAnimation = Fe),
  7367. (t.Projection = wt),
  7368. (t.Rectangle = Yi),
  7369. (t.Renderer = Wi),
  7370. (t.SVG = Gi),
  7371. (t.SVGOverlay = Oi),
  7372. (t.TileLayer = Di),
  7373. (t.Tooltip = Ii),
  7374. (t.Transformation = at),
  7375. (t.Util = tt),
  7376. (t.VideoOverlay = ki),
  7377. (t.bind = a),
  7378. (t.bounds = _),
  7379. (t.canvas = Ui),
  7380. (t.circle = function (t, e, i) {
  7381. return new vi(t, e, i);
  7382. }),
  7383. (t.circleMarker = function (t, e) {
  7384. return new gi(t, e);
  7385. }),
  7386. (t.control = Ue),
  7387. (t.divIcon = function (t) {
  7388. return new Ri(t);
  7389. }),
  7390. (t.extend = l),
  7391. (t.featureGroup = function (t, e) {
  7392. return new ci(t, e);
  7393. }),
  7394. (t.geoJSON = Si),
  7395. (t.geoJson = Mt),
  7396. (t.gridLayer = function (t) {
  7397. return new Ni(t);
  7398. }),
  7399. (t.icon = function (t) {
  7400. return new di(t);
  7401. }),
  7402. (t.imageOverlay = function (t, e, i) {
  7403. return new Ei(t, e, i);
  7404. }),
  7405. (t.latLng = w),
  7406. (t.latLngBounds = g),
  7407. (t.layerGroup = function (t, e) {
  7408. return new ui(t, e);
  7409. }),
  7410. (t.map = function (t, e) {
  7411. return new A(t, e);
  7412. }),
  7413. (t.marker = function (t, e) {
  7414. return new mi(t, e);
  7415. }),
  7416. (t.point = m),
  7417. (t.polygon = function (t, e) {
  7418. return new xi(t, e);
  7419. }),
  7420. (t.polyline = function (t, e) {
  7421. return new yi(t, e);
  7422. }),
  7423. (t.popup = function (t, e) {
  7424. return new Bi(t, e);
  7425. }),
  7426. (t.rectangle = function (t, e) {
  7427. return new Yi(t, e);
  7428. }),
  7429. (t.setOptions = c),
  7430. (t.stamp = h),
  7431. (t.svg = Ki),
  7432. (t.svgOverlay = function (t, e, i) {
  7433. return new Oi(t, e, i);
  7434. }),
  7435. (t.tileLayer = ji),
  7436. (t.tooltip = function (t, e) {
  7437. return new Ii(t, e);
  7438. }),
  7439. (t.transformation = ht),
  7440. (t.version = "1.9.4"),
  7441. (t.videoOverlay = function (t, e, i) {
  7442. return new ki(t, e, i);
  7443. }),
  7444. window.L);
  7445. (t.noConflict = function () {
  7446. return (window.L = Xi), this;
  7447. }),
  7448. (window.L = t);
  7449. });
  7450. //# sourceMappingURL=leaflet.js.map

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址