PageRenderTime 68ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/include/leaflet.js

https://gitlab.com/tutaalexandr/urthecast.local
JavaScript | 993 lines | 987 code | 1 blank | 5 comment | 294 complexity | 169255dbf8c15b2f7696207120a10f07 MD5 | raw file
  1. /*
  2. Leaflet, a JavaScript library for mobile-friendly interactive maps. http://leafletjs.com
  3. (c) 2010-2013, Vladimir Agafonkin
  4. (c) 2010-2011, CloudMade
  5. */
  6. ! function(t, e, i) {
  7. var n = t.L,
  8. o = {};
  9. o.version = "0.7.3", "object" == typeof module && "object" == typeof module.exports ? module.exports = o : "function" == typeof define && define.amd && define(o), o.noConflict = function() {
  10. return t.L = n, this
  11. }, t.L = o, o.Util = {
  12. extend: function(t) {
  13. var e, i, n, o, s = Array.prototype.slice.call(arguments, 1);
  14. for (i = 0, n = s.length; n > i; i++) {
  15. o = s[i] || {};
  16. for (e in o) o.hasOwnProperty(e) && (t[e] = o[e])
  17. }
  18. return t
  19. },
  20. bind: function(t, e) {
  21. var i = arguments.length > 2 ? Array.prototype.slice.call(arguments, 2) : null;
  22. return function() {
  23. return t.apply(e, i || arguments)
  24. }
  25. },
  26. stamp: function() {
  27. var t = 0,
  28. e = "_leaflet_id";
  29. return function(i) {
  30. return i[e] = i[e] || ++t, i[e]
  31. }
  32. }(),
  33. invokeEach: function(t, e, i) {
  34. var n, o;
  35. if ("object" == typeof t) {
  36. o = Array.prototype.slice.call(arguments, 3);
  37. for (n in t) e.apply(i, [n, t[n]].concat(o));
  38. return !0
  39. }
  40. return !1
  41. },
  42. limitExecByInterval: function(t, e, i) {
  43. var n, o;
  44. return function s() {
  45. var a = arguments;
  46. return n ? void(o = !0) : (n = !0, setTimeout(function() {
  47. n = !1, o && (s.apply(i, a), o = !1)
  48. }, e), void t.apply(i, a))
  49. }
  50. },
  51. falseFn: function() {
  52. return !1
  53. },
  54. formatNum: function(t, e) {
  55. var i = Math.pow(10, e || 5);
  56. return Math.round(t * i) / i
  57. },
  58. trim: function(t) {
  59. return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "")
  60. },
  61. splitWords: function(t) {
  62. return o.Util.trim(t).split(/\s+/)
  63. },
  64. setOptions: function(t, e) {
  65. return t.options = o.extend({}, t.options, e), t.options
  66. },
  67. getParamString: function(t, e, i) {
  68. var n = [];
  69. for (var o in t) n.push(encodeURIComponent(i ? o.toUpperCase() : o) + "=" + encodeURIComponent(t[o]));
  70. return (e && -1 !== e.indexOf("?") ? "&" : "?") + n.join("&")
  71. },
  72. template: function(t, e) {
  73. return t.replace(/\{ *([\w_]+) *\}/g, function(t, n) {
  74. var o = e[n];
  75. if (o === i) throw new Error("No value provided for variable " + t);
  76. return "function" == typeof o && (o = o(e)), o
  77. })
  78. },
  79. isArray: Array.isArray || function(t) {
  80. return "[object Array]" === Object.prototype.toString.call(t)
  81. },
  82. emptyImageUrl: "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="
  83. },
  84. function() {
  85. function e(e) {
  86. var i, n, o = ["webkit", "moz", "o", "ms"];
  87. for (i = 0; i < o.length && !n; i++) n = t[o[i] + e];
  88. return n
  89. }
  90. function i(e) {
  91. var i = +new Date,
  92. o = Math.max(0, 16 - (i - n));
  93. return n = i + o, t.setTimeout(e, o)
  94. }
  95. var n = 0,
  96. s = t.requestAnimationFrame || e("RequestAnimationFrame") || i,
  97. a = t.cancelAnimationFrame || e("CancelAnimationFrame") || e("CancelRequestAnimationFrame") || function(e) {
  98. t.clearTimeout(e)
  99. };
  100. o.Util.requestAnimFrame = function(e, n, a, r) {
  101. return e = o.bind(e, n), a && s === i ? void e() : s.call(t, e, r)
  102. }, o.Util.cancelAnimFrame = function(e) {
  103. e && a.call(t, e)
  104. }
  105. }(), o.extend = o.Util.extend, o.bind = o.Util.bind, o.stamp = o.Util.stamp, o.setOptions = o.Util.setOptions, o.Class = function() {}, o.Class.extend = function(t) {
  106. var e = function() {
  107. this.initialize && this.initialize.apply(this, arguments), this._initHooks && this.callInitHooks()
  108. },
  109. i = function() {};
  110. i.prototype = this.prototype;
  111. var n = new i;
  112. n.constructor = e, e.prototype = n;
  113. for (var s in this) this.hasOwnProperty(s) && "prototype" !== s && (e[s] = this[s]);
  114. t.statics && (o.extend(e, t.statics), delete t.statics), t.includes && (o.Util.extend.apply(null, [n].concat(t.includes)), delete t.includes), t.options && n.options && (t.options = o.extend({}, n.options, t.options)), o.extend(n, t), n._initHooks = [];
  115. var a = this;
  116. return e.__super__ = a.prototype, n.callInitHooks = function() {
  117. if (!this._initHooksCalled) {
  118. a.prototype.callInitHooks && a.prototype.callInitHooks.call(this), this._initHooksCalled = !0;
  119. for (var t = 0, e = n._initHooks.length; e > t; t++) n._initHooks[t].call(this)
  120. }
  121. }, e
  122. }, o.Class.include = function(t) {
  123. o.extend(this.prototype, t)
  124. }, o.Class.mergeOptions = function(t) {
  125. o.extend(this.prototype.options, t)
  126. }, o.Class.addInitHook = function(t) {
  127. var e = Array.prototype.slice.call(arguments, 1),
  128. i = "function" == typeof t ? t : function() {
  129. this[t].apply(this, e)
  130. };
  131. this.prototype._initHooks = this.prototype._initHooks || [], this.prototype._initHooks.push(i)
  132. };
  133. var s = "_leaflet_events";
  134. o.Mixin = {}, o.Mixin.Events = {
  135. addEventListener: function(t, e, i) {
  136. if (o.Util.invokeEach(t, this.addEventListener, this, e, i)) return this;
  137. var n, a, r, h, l, u, c, d = this[s] = this[s] || {},
  138. p = i && i !== this && o.stamp(i);
  139. for (t = o.Util.splitWords(t), n = 0, a = t.length; a > n; n++) r = {
  140. action: e,
  141. context: i || this
  142. }, h = t[n], p ? (l = h + "_idx", u = l + "_len", c = d[l] = d[l] || {}, c[p] || (c[p] = [], d[u] = (d[u] || 0) + 1), c[p].push(r)) : (d[h] = d[h] || [], d[h].push(r));
  143. return this
  144. },
  145. hasEventListeners: function(t) {
  146. var e = this[s];
  147. return !!e && (t in e && e[t].length > 0 || t + "_idx" in e && e[t + "_idx_len"] > 0)
  148. },
  149. removeEventListener: function(t, e, i) {
  150. if (!this[s]) return this;
  151. if (!t) return this.clearAllEventListeners();
  152. if (o.Util.invokeEach(t, this.removeEventListener, this, e, i)) return this;
  153. var n, a, r, h, l, u, c, d, p, _ = this[s],
  154. m = i && i !== this && o.stamp(i);
  155. for (t = o.Util.splitWords(t), n = 0, a = t.length; a > n; n++)
  156. if (r = t[n], u = r + "_idx", c = u + "_len", d = _[u], e) {
  157. if (h = m && d ? d[m] : _[r]) {
  158. for (l = h.length - 1; l >= 0; l--) h[l].action !== e || i && h[l].context !== i || (p = h.splice(l, 1), p[0].action = o.Util.falseFn);
  159. i && d && 0 === h.length && (delete d[m], _[c]--)
  160. }
  161. } else delete _[r], delete _[u], delete _[c];
  162. return this
  163. },
  164. clearAllEventListeners: function() {
  165. return delete this[s], this
  166. },
  167. fireEvent: function(t, e) {
  168. if (!this.hasEventListeners(t)) return this;
  169. var i, n, a, r, h, l = o.Util.extend({}, e, {
  170. type: t,
  171. target: this
  172. }),
  173. u = this[s];
  174. if (u[t])
  175. for (i = u[t].slice(), n = 0, a = i.length; a > n; n++) i[n].action.call(i[n].context, l);
  176. r = u[t + "_idx"];
  177. for (h in r)
  178. if (i = r[h].slice())
  179. for (n = 0, a = i.length; a > n; n++) i[n].action.call(i[n].context, l);
  180. return this
  181. },
  182. addOneTimeEventListener: function(t, e, i) {
  183. if (o.Util.invokeEach(t, this.addOneTimeEventListener, this, e, i)) return this;
  184. var n = o.bind(function() {
  185. this.removeEventListener(t, e, i).removeEventListener(t, n, i)
  186. }, this);
  187. return this.addEventListener(t, e, i).addEventListener(t, n, i)
  188. }
  189. }, o.Mixin.Events.on = o.Mixin.Events.addEventListener, o.Mixin.Events.off = o.Mixin.Events.removeEventListener, o.Mixin.Events.once = o.Mixin.Events.addOneTimeEventListener, o.Mixin.Events.fire = o.Mixin.Events.fireEvent,
  190. function() {
  191. var n = "ActiveXObject" in t,
  192. s = n && !e.addEventListener,
  193. a = navigator.userAgent.toLowerCase(),
  194. r = -1 !== a.indexOf("webkit"),
  195. h = -1 !== a.indexOf("chrome"),
  196. l = -1 !== a.indexOf("phantom"),
  197. u = -1 !== a.indexOf("android"),
  198. c = -1 !== a.search("android [23]"),
  199. d = -1 !== a.indexOf("gecko"),
  200. p = typeof orientation != i + "",
  201. _ = t.navigator && t.navigator.msPointerEnabled && t.navigator.msMaxTouchPoints && !t.PointerEvent,
  202. m = t.PointerEvent && t.navigator.pointerEnabled && t.navigator.maxTouchPoints || _,
  203. f = "devicePixelRatio" in t && t.devicePixelRatio > 1 || "matchMedia" in t && t.matchMedia("(min-resolution:144dpi)") && t.matchMedia("(min-resolution:144dpi)").matches,
  204. g = e.documentElement,
  205. v = n && "transition" in g.style,
  206. y = "WebKitCSSMatrix" in t && "m11" in new t.WebKitCSSMatrix && !c,
  207. P = "MozPerspective" in g.style,
  208. L = "OTransition" in g.style,
  209. x = !t.L_DISABLE_3D && (v || y || P || L) && !l,
  210. w = !t.L_NO_TOUCH && !l && function() {
  211. var t = "ontouchstart";
  212. if (m || t in g) return !0;
  213. var i = e.createElement("div"),
  214. n = !1;
  215. return i.setAttribute ? (i.setAttribute(t, "return;"), "function" == typeof i[t] && (n = !0), i.removeAttribute(t), i = null, n) : !1
  216. }();
  217. o.Browser = {
  218. ie: n,
  219. ielt9: s,
  220. webkit: r,
  221. gecko: d && !r && !t.opera && !n,
  222. android: u,
  223. android23: c,
  224. chrome: h,
  225. ie3d: v,
  226. webkit3d: y,
  227. gecko3d: P,
  228. opera3d: L,
  229. any3d: x,
  230. mobile: p,
  231. mobileWebkit: p && r,
  232. mobileWebkit3d: p && y,
  233. mobileOpera: p && t.opera,
  234. touch: w,
  235. msPointer: _,
  236. pointer: m,
  237. retina: f
  238. }
  239. }(), o.Point = function(t, e, i) {
  240. this.x = i ? Math.round(t) : t, this.y = i ? Math.round(e) : e
  241. }, o.Point.prototype = {
  242. clone: function() {
  243. return new o.Point(this.x, this.y)
  244. },
  245. add: function(t) {
  246. return this.clone()._add(o.point(t))
  247. },
  248. _add: function(t) {
  249. return this.x += t.x, this.y += t.y, this
  250. },
  251. subtract: function(t) {
  252. return this.clone()._subtract(o.point(t))
  253. },
  254. _subtract: function(t) {
  255. return this.x -= t.x, this.y -= t.y, this
  256. },
  257. divideBy: function(t) {
  258. return this.clone()._divideBy(t)
  259. },
  260. _divideBy: function(t) {
  261. return this.x /= t, this.y /= t, this
  262. },
  263. multiplyBy: function(t) {
  264. return this.clone()._multiplyBy(t)
  265. },
  266. _multiplyBy: function(t) {
  267. return this.x *= t, this.y *= t, this
  268. },
  269. round: function() {
  270. return this.clone()._round()
  271. },
  272. _round: function() {
  273. return this.x = Math.round(this.x), this.y = Math.round(this.y), this
  274. },
  275. floor: function() {
  276. return this.clone()._floor()
  277. },
  278. _floor: function() {
  279. return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this
  280. },
  281. distanceTo: function(t) {
  282. t = o.point(t);
  283. var e = t.x - this.x,
  284. i = t.y - this.y;
  285. return Math.sqrt(e * e + i * i)
  286. },
  287. equals: function(t) {
  288. return t = o.point(t), t.x === this.x && t.y === this.y
  289. },
  290. contains: function(t) {
  291. return t = o.point(t), Math.abs(t.x) <= Math.abs(this.x) && Math.abs(t.y) <= Math.abs(this.y)
  292. },
  293. toString: function() {
  294. return "Point(" + o.Util.formatNum(this.x) + ", " + o.Util.formatNum(this.y) + ")"
  295. }
  296. }, o.point = function(t, e, n) {
  297. return t instanceof o.Point ? t : o.Util.isArray(t) ? new o.Point(t[0], t[1]) : t === i || null === t ? t : new o.Point(t, e, n)
  298. }, o.Bounds = function(t, e) {
  299. if (t)
  300. for (var i = e ? [t, e] : t, n = 0, o = i.length; o > n; n++) this.extend(i[n])
  301. }, o.Bounds.prototype = {
  302. extend: function(t) {
  303. return t = o.point(t), this.min || this.max ? (this.min.x = Math.min(t.x, this.min.x), this.max.x = Math.max(t.x, this.max.x), this.min.y = Math.min(t.y, this.min.y), this.max.y = Math.max(t.y, this.max.y)) : (this.min = t.clone(), this.max = t.clone()), this
  304. },
  305. getCenter: function(t) {
  306. return new o.Point((this.min.x + this.max.x) / 2, (this.min.y + this.max.y) / 2, t)
  307. },
  308. getBottomLeft: function() {
  309. return new o.Point(this.min.x, this.max.y)
  310. },
  311. getTopRight: function() {
  312. return new o.Point(this.max.x, this.min.y)
  313. },
  314. getSize: function() {
  315. return this.max.subtract(this.min)
  316. },
  317. contains: function(t) {
  318. var e, i;
  319. return t = "number" == typeof t[0] || t instanceof o.Point ? o.point(t) : o.bounds(t), t instanceof o.Bounds ? (e = t.min, i = t.max) : e = i = t, e.x >= this.min.x && i.x <= this.max.x && e.y >= this.min.y && i.y <= this.max.y
  320. },
  321. intersects: function(t) {
  322. t = o.bounds(t);
  323. var e = this.min,
  324. i = this.max,
  325. n = t.min,
  326. s = t.max,
  327. a = s.x >= e.x && n.x <= i.x,
  328. r = s.y >= e.y && n.y <= i.y;
  329. return a && r
  330. },
  331. isValid: function() {
  332. return !(!this.min || !this.max)
  333. }
  334. }, o.bounds = function(t, e) {
  335. return !t || t instanceof o.Bounds ? t : new o.Bounds(t, e)
  336. }, o.Transformation = function(t, e, i, n) {
  337. this._a = t, this._b = e, this._c = i, this._d = n
  338. }, o.Transformation.prototype = {
  339. transform: function(t, e) {
  340. return this._transform(t.clone(), e)
  341. },
  342. _transform: function(t, e) {
  343. return e = e || 1, t.x = e * (this._a * t.x + this._b), t.y = e * (this._c * t.y + this._d), t
  344. },
  345. untransform: function(t, e) {
  346. return e = e || 1, new o.Point((t.x / e - this._b) / this._a, (t.y / e - this._d) / this._c)
  347. }
  348. }, o.DomUtil = {
  349. get: function(t) {
  350. return "string" == typeof t ? e.getElementById(t) : t
  351. },
  352. getStyle: function(t, i) {
  353. var n = t.style[i];
  354. if (!n && t.currentStyle && (n = t.currentStyle[i]), (!n || "auto" === n) && e.defaultView) {
  355. var o = e.defaultView.getComputedStyle(t, null);
  356. n = o ? o[i] : null
  357. }
  358. return "auto" === n ? null : n
  359. },
  360. getViewportOffset: function(t) {
  361. var i, n = 0,
  362. s = 0,
  363. a = t,
  364. r = e.body,
  365. h = e.documentElement;
  366. do {
  367. if (n += a.offsetTop || 0, s += a.offsetLeft || 0, n += parseInt(o.DomUtil.getStyle(a, "borderTopWidth"), 10) || 0, s += parseInt(o.DomUtil.getStyle(a, "borderLeftWidth"), 10) || 0, i = o.DomUtil.getStyle(a, "position"), a.offsetParent === r && "absolute" === i) break;
  368. if ("fixed" === i) {
  369. n += r.scrollTop || h.scrollTop || 0, s += r.scrollLeft || h.scrollLeft || 0;
  370. break
  371. }
  372. if ("relative" === i && !a.offsetLeft) {
  373. var l = o.DomUtil.getStyle(a, "width"),
  374. u = o.DomUtil.getStyle(a, "max-width"),
  375. c = a.getBoundingClientRect();
  376. ("none" !== l || "none" !== u) && (s += c.left + a.clientLeft), n += c.top + (r.scrollTop || h.scrollTop || 0);
  377. break
  378. }
  379. a = a.offsetParent
  380. } while (a);
  381. a = t;
  382. do {
  383. if (a === r) break;
  384. n -= a.scrollTop || 0, s -= a.scrollLeft || 0, a = a.parentNode
  385. } while (a);
  386. return new o.Point(s, n)
  387. },
  388. documentIsLtr: function() {
  389. return o.DomUtil._docIsLtrCached || (o.DomUtil._docIsLtrCached = !0, o.DomUtil._docIsLtr = "ltr" === o.DomUtil.getStyle(e.body, "direction")), o.DomUtil._docIsLtr
  390. },
  391. create: function(t, i, n) {
  392. var o = e.createElement(t);
  393. return o.className = i, n && n.appendChild(o), o
  394. },
  395. hasClass: function(t, e) {
  396. if (t.classList !== i) return t.classList.contains(e);
  397. var n = o.DomUtil._getClass(t);
  398. return n.length > 0 && new RegExp("(^|\\s)" + e + "(\\s|$)").test(n)
  399. },
  400. addClass: function(t, e) {
  401. if (t.classList !== i)
  402. for (var n = o.Util.splitWords(e), s = 0, a = n.length; a > s; s++) t.classList.add(n[s]);
  403. else if (!o.DomUtil.hasClass(t, e)) {
  404. var r = o.DomUtil._getClass(t);
  405. o.DomUtil._setClass(t, (r ? r + " " : "") + e)
  406. }
  407. },
  408. removeClass: function(t, e) {
  409. t.classList !== i ? t.classList.remove(e) : o.DomUtil._setClass(t, o.Util.trim((" " + o.DomUtil._getClass(t) + " ").replace(" " + e + " ", " ")))
  410. },
  411. _setClass: function(t, e) {
  412. t.className.baseVal === i ? t.className = e : t.className.baseVal = e
  413. },
  414. _getClass: function(t) {
  415. return t.className.baseVal === i ? t.className : t.className.baseVal
  416. },
  417. setOpacity: function(t, e) {
  418. if ("opacity" in t.style) t.style.opacity = e;
  419. else if ("filter" in t.style) {
  420. var i = !1,
  421. n = "DXImageTransform.Microsoft.Alpha";
  422. try {
  423. i = t.filters.item(n)
  424. } catch (o) {
  425. if (1 === e) return
  426. }
  427. e = Math.round(100 * e), i ? (i.Enabled = 100 !== e, i.Opacity = e) : t.style.filter += " progid:" + n + "(opacity=" + e + ")"
  428. }
  429. },
  430. testProp: function(t) {
  431. for (var i = e.documentElement.style, n = 0; n < t.length; n++)
  432. if (t[n] in i) return t[n];
  433. return !1
  434. },
  435. getTranslateString: function(t) {
  436. var e = o.Browser.webkit3d,
  437. i = "translate" + (e ? "3d" : "") + "(",
  438. n = (e ? ",0" : "") + ")";
  439. return i + t.x + "px," + t.y + "px" + n
  440. },
  441. getScaleString: function(t, e) {
  442. var i = o.DomUtil.getTranslateString(e.add(e.multiplyBy(-1 * t))),
  443. n = " scale(" + t + ") ";
  444. return i + n
  445. },
  446. setPosition: function(t, e, i) {
  447. t._leaflet_pos = e, !i && o.Browser.any3d ? t.style[o.DomUtil.TRANSFORM] = o.DomUtil.getTranslateString(e) : (t.style.left = e.x + "px", t.style.top = e.y + "px")
  448. },
  449. getPosition: function(t) {
  450. return t._leaflet_pos
  451. }
  452. }, o.DomUtil.TRANSFORM = o.DomUtil.testProp(["transform", "WebkitTransform", "OTransform", "MozTransform", "msTransform"]), o.DomUtil.TRANSITION = o.DomUtil.testProp(["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition"]), o.DomUtil.TRANSITION_END = "webkitTransition" === o.DomUtil.TRANSITION || "OTransition" === o.DomUtil.TRANSITION ? o.DomUtil.TRANSITION + "End" : "transitionend",
  453. function() {
  454. if ("onselectstart" in e) o.extend(o.DomUtil, {
  455. disableTextSelection: function() {
  456. o.DomEvent.on(t, "selectstart", o.DomEvent.preventDefault)
  457. },
  458. enableTextSelection: function() {
  459. o.DomEvent.off(t, "selectstart", o.DomEvent.preventDefault)
  460. }
  461. });
  462. else {
  463. var i = o.DomUtil.testProp(["userSelect", "WebkitUserSelect", "OUserSelect", "MozUserSelect", "msUserSelect"]);
  464. o.extend(o.DomUtil, {
  465. disableTextSelection: function() {
  466. if (i) {
  467. var t = e.documentElement.style;
  468. this._userSelect = t[i], t[i] = "none"
  469. }
  470. },
  471. enableTextSelection: function() {
  472. i && (e.documentElement.style[i] = this._userSelect, delete this._userSelect)
  473. }
  474. })
  475. }
  476. o.extend(o.DomUtil, {
  477. disableImageDrag: function() {
  478. o.DomEvent.on(t, "dragstart", o.DomEvent.preventDefault)
  479. },
  480. enableImageDrag: function() {
  481. o.DomEvent.off(t, "dragstart", o.DomEvent.preventDefault)
  482. }
  483. })
  484. }(), o.LatLng = function(t, e, n) {
  485. if (t = parseFloat(t), e = parseFloat(e), isNaN(t) || isNaN(e)) throw new Error("Invalid LatLng object: (" + t + ", " + e + ")");
  486. this.lat = t, this.lng = e, n !== i && (this.alt = parseFloat(n))
  487. }, o.extend(o.LatLng, {
  488. DEG_TO_RAD: Math.PI / 180,
  489. RAD_TO_DEG: 180 / Math.PI,
  490. MAX_MARGIN: 1e-9
  491. }), o.LatLng.prototype = {
  492. equals: function(t) {
  493. if (!t) return !1;
  494. t = o.latLng(t);
  495. var e = Math.max(Math.abs(this.lat - t.lat), Math.abs(this.lng - t.lng));
  496. return e <= o.LatLng.MAX_MARGIN
  497. },
  498. toString: function(t) {
  499. return "LatLng(" + o.Util.formatNum(this.lat, t) + ", " + o.Util.formatNum(this.lng, t) + ")"
  500. },
  501. distanceTo: function(t) {
  502. t = o.latLng(t);
  503. var e = 6378137,
  504. i = o.LatLng.DEG_TO_RAD,
  505. n = (t.lat - this.lat) * i,
  506. s = (t.lng - this.lng) * i,
  507. a = this.lat * i,
  508. r = t.lat * i,
  509. h = Math.sin(n / 2),
  510. l = Math.sin(s / 2),
  511. u = h * h + l * l * Math.cos(a) * Math.cos(r);
  512. return 2 * e * Math.atan2(Math.sqrt(u), Math.sqrt(1 - u))
  513. },
  514. wrap: function(t, e) {
  515. var i = this.lng;
  516. return t = t || -180, e = e || 180, i = (i + e) % (e - t) + (t > i || i === e ? e : t), new o.LatLng(this.lat, i)
  517. }
  518. }, o.latLng = function(t, e) {
  519. return t instanceof o.LatLng ? t : o.Util.isArray(t) ? "number" == typeof t[0] || "string" == typeof t[0] ? new o.LatLng(t[0], t[1], t[2]) : null : t === i || null === t ? t : "object" == typeof t && "lat" in t ? new o.LatLng(t.lat, "lng" in t ? t.lng : t.lon) : e === i ? null : new o.LatLng(t, e)
  520. }, o.LatLngBounds = function(t, e) {
  521. if (t)
  522. for (var i = e ? [t, e] : t, n = 0, o = i.length; o > n; n++) this.extend(i[n])
  523. }, o.LatLngBounds.prototype = {
  524. extend: function(t) {
  525. if (!t) return this;
  526. var e = o.latLng(t);
  527. return t = null !== e ? e : o.latLngBounds(t), t instanceof o.LatLng ? this._southWest || this._northEast ? (this._southWest.lat = Math.min(t.lat, this._southWest.lat), this._southWest.lng = Math.min(t.lng, this._southWest.lng), this._northEast.lat = Math.max(t.lat, this._northEast.lat), this._northEast.lng = Math.max(t.lng, this._northEast.lng)) : (this._southWest = new o.LatLng(t.lat, t.lng), this._northEast = new o.LatLng(t.lat, t.lng)) : t instanceof o.LatLngBounds && (this.extend(t._southWest), this.extend(t._northEast)), this
  528. },
  529. pad: function(t) {
  530. var e = this._southWest,
  531. i = this._northEast,
  532. n = Math.abs(e.lat - i.lat) * t,
  533. s = Math.abs(e.lng - i.lng) * t;
  534. return new o.LatLngBounds(new o.LatLng(e.lat - n, e.lng - s), new o.LatLng(i.lat + n, i.lng + s))
  535. },
  536. getCenter: function() {
  537. return new o.LatLng((this._southWest.lat + this._northEast.lat) / 2, (this._southWest.lng + this._northEast.lng) / 2)
  538. },
  539. getSouthWest: function() {
  540. return this._southWest
  541. },
  542. getNorthEast: function() {
  543. return this._northEast
  544. },
  545. getNorthWest: function() {
  546. return new o.LatLng(this.getNorth(), this.getWest())
  547. },
  548. getSouthEast: function() {
  549. return new o.LatLng(this.getSouth(), this.getEast())
  550. },
  551. getWest: function() {
  552. return this._southWest.lng
  553. },
  554. getSouth: function() {
  555. return this._southWest.lat
  556. },
  557. getEast: function() {
  558. return this._northEast.lng
  559. },
  560. getNorth: function() {
  561. return this._northEast.lat
  562. },
  563. contains: function(t) {
  564. t = "number" == typeof t[0] || t instanceof o.LatLng ? o.latLng(t) : o.latLngBounds(t);
  565. var e, i, n = this._southWest,
  566. s = this._northEast;
  567. return t instanceof o.LatLngBounds ? (e = t.getSouthWest(), i = t.getNorthEast()) : e = i = t, e.lat >= n.lat && i.lat <= s.lat && e.lng >= n.lng && i.lng <= s.lng
  568. },
  569. intersects: function(t) {
  570. t = o.latLngBounds(t);
  571. var e = this._southWest,
  572. i = this._northEast,
  573. n = t.getSouthWest(),
  574. s = t.getNorthEast(),
  575. a = s.lat >= e.lat && n.lat <= i.lat,
  576. r = s.lng >= e.lng && n.lng <= i.lng;
  577. return a && r
  578. },
  579. toBBoxString: function() {
  580. return [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(",")
  581. },
  582. equals: function(t) {
  583. return t ? (t = o.latLngBounds(t), this._southWest.equals(t.getSouthWest()) && this._northEast.equals(t.getNorthEast())) : !1
  584. },
  585. isValid: function() {
  586. return !(!this._southWest || !this._northEast)
  587. }
  588. }, o.latLngBounds = function(t, e) {
  589. return !t || t instanceof o.LatLngBounds ? t : new o.LatLngBounds(t, e)
  590. }, o.Projection = {}, o.Projection.SphericalMercator = {
  591. MAX_LATITUDE: 85.0511287798,
  592. project: function(t) {
  593. var e = o.LatLng.DEG_TO_RAD,
  594. i = this.MAX_LATITUDE,
  595. n = Math.max(Math.min(i, t.lat), -i),
  596. s = t.lng * e,
  597. a = n * e;
  598. return a = Math.log(Math.tan(Math.PI / 4 + a / 2)), new o.Point(s, a)
  599. },
  600. unproject: function(t) {
  601. var e = o.LatLng.RAD_TO_DEG,
  602. i = t.x * e,
  603. n = (2 * Math.atan(Math.exp(t.y)) - Math.PI / 2) * e;
  604. return new o.LatLng(n, i)
  605. }
  606. }, o.Projection.LonLat = {
  607. project: function(t) {
  608. return new o.Point(t.lng, t.lat)
  609. },
  610. unproject: function(t) {
  611. return new o.LatLng(t.y, t.x)
  612. }
  613. }, o.CRS = {
  614. latLngToPoint: function(t, e) {
  615. var i = this.projection.project(t),
  616. n = this.scale(e);
  617. return this.transformation._transform(i, n)
  618. },
  619. pointToLatLng: function(t, e) {
  620. var i = this.scale(e),
  621. n = this.transformation.untransform(t, i);
  622. return this.projection.unproject(n)
  623. },
  624. project: function(t) {
  625. return this.projection.project(t)
  626. },
  627. scale: function(t) {
  628. return 256 * Math.pow(2, t)
  629. },
  630. getSize: function(t) {
  631. var e = this.scale(t);
  632. return o.point(e, e)
  633. }
  634. }, o.CRS.Simple = o.extend({}, o.CRS, {
  635. projection: o.Projection.LonLat,
  636. transformation: new o.Transformation(1, 0, -1, 0),
  637. scale: function(t) {
  638. return Math.pow(2, t)
  639. }
  640. }), o.CRS.EPSG3857 = o.extend({}, o.CRS, {
  641. code: "EPSG:3857",
  642. projection: o.Projection.SphericalMercator,
  643. transformation: new o.Transformation(.5 / Math.PI, .5, -.5 / Math.PI, .5),
  644. project: function(t) {
  645. var e = this.projection.project(t),
  646. i = 6378137;
  647. return e.multiplyBy(i)
  648. }
  649. }), o.CRS.EPSG900913 = o.extend({}, o.CRS.EPSG3857, {
  650. code: "EPSG:900913"
  651. }), o.CRS.EPSG4326 = o.extend({}, o.CRS, {
  652. code: "EPSG:4326",
  653. projection: o.Projection.LonLat,
  654. transformation: new o.Transformation(1 / 360, .5, -1 / 360, .5)
  655. }), o.Map = o.Class.extend({
  656. includes: o.Mixin.Events,
  657. options: {
  658. crs: o.CRS.EPSG3857,
  659. fadeAnimation: o.DomUtil.TRANSITION && !o.Browser.android23,
  660. trackResize: !0,
  661. markerZoomAnimation: o.DomUtil.TRANSITION && o.Browser.any3d
  662. },
  663. initialize: function(t, e) {
  664. e = o.setOptions(this, e), this._initContainer(t), this._initLayout(), this._onResize = o.bind(this._onResize, this), this._initEvents(), e.maxBounds && this.setMaxBounds(e.maxBounds), e.center && e.zoom !== i && this.setView(o.latLng(e.center), e.zoom, {
  665. reset: !0
  666. }), this._handlers = [], this._layers = {}, this._zoomBoundLayers = {}, this._tileLayersNum = 0, this.callInitHooks(), this._addLayers(e.layers)
  667. },
  668. setView: function(t, e) {
  669. return e = e === i ? this.getZoom() : e, this._resetView(o.latLng(t), this._limitZoom(e)), this
  670. },
  671. setZoom: function(t, e) {
  672. return this._loaded ? this.setView(this.getCenter(), t, {
  673. zoom: e
  674. }) : (this._zoom = this._limitZoom(t), this)
  675. },
  676. zoomIn: function(t, e) {
  677. return this.setZoom(this._zoom + (t || 1), e)
  678. },
  679. zoomOut: function(t, e) {
  680. return this.setZoom(this._zoom - (t || 1), e)
  681. },
  682. setZoomAround: function(t, e, i) {
  683. var n = this.getZoomScale(e),
  684. s = this.getSize().divideBy(2),
  685. a = t instanceof o.Point ? t : this.latLngToContainerPoint(t),
  686. r = a.subtract(s).multiplyBy(1 - 1 / n),
  687. h = this.containerPointToLatLng(s.add(r));
  688. return this.setView(h, e, {
  689. zoom: i
  690. })
  691. },
  692. fitBounds: function(t, e) {
  693. e = e || {}, t = t.getBounds ? t.getBounds() : o.latLngBounds(t);
  694. var i = o.point(e.paddingTopLeft || e.padding || [0, 0]),
  695. n = o.point(e.paddingBottomRight || e.padding || [0, 0]),
  696. s = this.getBoundsZoom(t, !1, i.add(n)),
  697. a = n.subtract(i).divideBy(2),
  698. r = this.project(t.getSouthWest(), s),
  699. h = this.project(t.getNorthEast(), s),
  700. l = this.unproject(r.add(h).divideBy(2).add(a), s);
  701. return s = e && e.maxZoom ? Math.min(e.maxZoom, s) : s, this.setView(l, s, e)
  702. },
  703. fitWorld: function(t) {
  704. return this.fitBounds([
  705. [-90, -180],
  706. [90, 180]
  707. ], t)
  708. },
  709. panTo: function(t, e) {
  710. return this.setView(t, this._zoom, {
  711. pan: e
  712. })
  713. },
  714. panBy: function(t) {
  715. return this.fire("movestart"), this._rawPanBy(o.point(t)), this.fire("move"), this.fire("moveend")
  716. },
  717. setMaxBounds: function(t) {
  718. return t = o.latLngBounds(t), this.options.maxBounds = t, t ? (this._loaded && this._panInsideMaxBounds(), this.on("moveend", this._panInsideMaxBounds, this)) : this.off("moveend", this._panInsideMaxBounds, this)
  719. },
  720. panInsideBounds: function(t, e) {
  721. var i = this.getCenter(),
  722. n = this._limitCenter(i, this._zoom, t);
  723. return i.equals(n) ? this : this.panTo(n, e)
  724. },
  725. addLayer: function(t) {
  726. var e = o.stamp(t);
  727. return this._layers[e] ? this : (this._layers[e] = t, !t.options || isNaN(t.options.maxZoom) && isNaN(t.options.minZoom) || (this._zoomBoundLayers[e] = t, this._updateZoomLevels()), this.options.zoomAnimation && o.TileLayer && t instanceof o.TileLayer && (this._tileLayersNum++, this._tileLayersToLoad++, t.on("load", this._onTileLayerLoad, this)), this._loaded && this._layerAdd(t), this)
  728. },
  729. removeLayer: function(t) {
  730. var e = o.stamp(t);
  731. return this._layers[e] ? (this._loaded && t.onRemove(this), delete this._layers[e], this._loaded && this.fire("layerremove", {
  732. layer: t
  733. }), this._zoomBoundLayers[e] && (delete this._zoomBoundLayers[e], this._updateZoomLevels()), this.options.zoomAnimation && o.TileLayer && t instanceof o.TileLayer && (this._tileLayersNum--, this._tileLayersToLoad--, t.off("load", this._onTileLayerLoad, this)), this) : this
  734. },
  735. hasLayer: function(t) {
  736. return t ? o.stamp(t) in this._layers : !1
  737. },
  738. eachLayer: function(t, e) {
  739. for (var i in this._layers) t.call(e, this._layers[i]);
  740. return this
  741. },
  742. invalidateSize: function(t) {
  743. if (!this._loaded) return this;
  744. t = o.extend({
  745. animate: !1,
  746. pan: !0
  747. }, t === !0 ? {
  748. animate: !0
  749. } : t);
  750. var e = this.getSize();
  751. this._sizeChanged = !0, this._initialCenter = null;
  752. var i = this.getSize(),
  753. n = e.divideBy(2).round(),
  754. s = i.divideBy(2).round(),
  755. a = n.subtract(s);
  756. return a.x || a.y ? (t.animate && t.pan ? this.panBy(a) : (t.pan && this._rawPanBy(a), this.fire("move"), t.debounceMoveend ? (clearTimeout(this._sizeTimer), this._sizeTimer = setTimeout(o.bind(this.fire, this, "moveend"), 200)) : this.fire("moveend")), this.fire("resize", {
  757. oldSize: e,
  758. newSize: i
  759. })) : this
  760. },
  761. addHandler: function(t, e) {
  762. if (!e) return this;
  763. var i = this[t] = new e(this);
  764. return this._handlers.push(i), this.options[t] && i.enable(), this
  765. },
  766. remove: function() {
  767. this._loaded && this.fire("unload"), this._initEvents("off");
  768. try {
  769. delete this._container._leaflet
  770. } catch (t) {
  771. this._container._leaflet = i
  772. }
  773. return this._clearPanes(), this._clearControlPos && this._clearControlPos(), this._clearHandlers(), this
  774. },
  775. getCenter: function() {
  776. return this._checkIfLoaded(), this._initialCenter && !this._moved() ? this._initialCenter : this.layerPointToLatLng(this._getCenterLayerPoint())
  777. },
  778. getZoom: function() {
  779. return this._zoom
  780. },
  781. getBounds: function() {
  782. var t = this.getPixelBounds(),
  783. e = this.unproject(t.getBottomLeft()),
  784. i = this.unproject(t.getTopRight());
  785. return new o.LatLngBounds(e, i)
  786. },
  787. getMinZoom: function() {
  788. return this.options.minZoom === i ? this._layersMinZoom === i ? 0 : this._layersMinZoom : this.options.minZoom
  789. },
  790. getMaxZoom: function() {
  791. return this.options.maxZoom === i ? this._layersMaxZoom === i ? 1 / 0 : this._layersMaxZoom : this.options.maxZoom
  792. },
  793. getBoundsZoom: function(t, e, i) {
  794. t = o.latLngBounds(t);
  795. var n, s = this.getMinZoom() - (e ? 1 : 0),
  796. a = this.getMaxZoom(),
  797. r = this.getSize(),
  798. h = t.getNorthWest(),
  799. l = t.getSouthEast(),
  800. u = !0;
  801. i = o.point(i || [0, 0]);
  802. do s++, n = this.project(l, s).subtract(this.project(h, s)).add(i), u = e ? n.x < r.x || n.y < r.y : r.contains(n); while (u && a >= s);
  803. return u && e ? null : e ? s : s - 1
  804. },
  805. getSize: function() {
  806. return (!this._size || this._sizeChanged) && (this._size = new o.Point(this._container.clientWidth, this._container.clientHeight), this._sizeChanged = !1), this._size.clone()
  807. },
  808. getPixelBounds: function() {
  809. var t = this._getTopLeftPoint();
  810. return new o.Bounds(t, t.add(this.getSize()))
  811. },
  812. getPixelOrigin: function() {
  813. return this._checkIfLoaded(), this._initialTopLeftPoint
  814. },
  815. getPanes: function() {
  816. return this._panes
  817. },
  818. getContainer: function() {
  819. return this._container
  820. },
  821. getZoomScale: function(t) {
  822. var e = this.options.crs;
  823. return e.scale(t) / e.scale(this._zoom)
  824. },
  825. getScaleZoom: function(t) {
  826. return this._zoom + Math.log(t) / Math.LN2
  827. },
  828. project: function(t, e) {
  829. return e = e === i ? this._zoom : e, this.options.crs.latLngToPoint(o.latLng(t), e)
  830. },
  831. unproject: function(t, e) {
  832. return e = e === i ? this._zoom : e, this.options.crs.pointToLatLng(o.point(t), e)
  833. },
  834. layerPointToLatLng: function(t) {
  835. var e = o.point(t).add(this.getPixelOrigin());
  836. return this.unproject(e)
  837. },
  838. latLngToLayerPoint: function(t) {
  839. var e = this.project(o.latLng(t))._round();
  840. return e._subtract(this.getPixelOrigin())
  841. },
  842. containerPointToLayerPoint: function(t) {
  843. return o.point(t).subtract(this._getMapPanePos())
  844. },
  845. layerPointToContainerPoint: function(t) {
  846. return o.point(t).add(this._getMapPanePos())
  847. },
  848. containerPointToLatLng: function(t) {
  849. var e = this.containerPointToLayerPoint(o.point(t));
  850. return this.layerPointToLatLng(e)
  851. },
  852. latLngToContainerPoint: function(t) {
  853. return this.layerPointToContainerPoint(this.latLngToLayerPoint(o.latLng(t)))
  854. },
  855. mouseEventToContainerPoint: function(t) {
  856. return o.DomEvent.getMousePosition(t, this._container)
  857. },
  858. mouseEventToLayerPoint: function(t) {
  859. return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))
  860. },
  861. mouseEventToLatLng: function(t) {
  862. return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))
  863. },
  864. _initContainer: function(t) {
  865. var e = this._container = o.DomUtil.get(t);
  866. if (!e) throw new Error("Map container not found.");
  867. if (e._leaflet) throw new Error("Map container is already initialized.");
  868. e._leaflet = !0
  869. },
  870. _initLayout: function() {
  871. var t = this._container;
  872. o.DomUtil.addClass(t, "leaflet-container" + (o.Browser.touch ? " leaflet-touch" : "") + (o.Browser.retina ? " leaflet-retina" : "") + (o.Browser.ielt9 ? " leaflet-oldie" : "") + (this.options.fadeAnimation ? " leaflet-fade-anim" : ""));
  873. var e = o.DomUtil.getStyle(t, "position");
  874. "absolute" !== e && "relative" !== e && "fixed" !== e && (t.style.position = "relative"), this._initPanes(), this._initControlPos && this._initControlPos()
  875. },
  876. _initPanes: function() {
  877. var t = this._panes = {};
  878. this._mapPane = t.mapPane = this._createPane("leaflet-map-pane", this._container), this._tilePane = t.tilePane = this._createPane("leaflet-tile-pane", this._mapPane), t.objectsPane = this._createPane("leaflet-objects-pane", this._mapPane), t.shadowPane = this._createPane("leaflet-shadow-pane"), t.overlayPane = this._createPane("leaflet-overlay-pane"), t.markerPane = this._createPane("leaflet-marker-pane"), t.popupPane = this._createPane("leaflet-popup-pane");
  879. var e = " leaflet-zoom-hide";
  880. this.options.markerZoomAnimation || (o.DomUtil.addClass(t.markerPane, e), o.DomUtil.addClass(t.shadowPane, e), o.DomUtil.addClass(t.popupPane, e))
  881. },
  882. _createPane: function(t, e) {
  883. return o.DomUtil.create("div", t, e || this._panes.objectsPane)
  884. },
  885. _clearPanes: function() {
  886. this._container.removeChild(this._mapPane)
  887. },
  888. _addLayers: function(t) {
  889. t = t ? o.Util.isArray(t) ? t : [t] : [];
  890. for (var e = 0, i = t.length; i > e; e++) this.addLayer(t[e])
  891. },
  892. _resetView: function(t, e, i, n) {
  893. var s = this._zoom !== e;
  894. n || (this.fire("movestart"), s && this.fire("zoomstart")), this._zoom = e, this._initialCenter = t, this._initialTopLeftPoint = this._getNewTopLeftPoint(t), i ? this._initialTopLeftPoint._add(this._getMapPanePos()) : o.DomUtil.setPosition(this._mapPane, new o.Point(0, 0)), this._tileLayersToLoad = this._tileLayersNum;
  895. var a = !this._loaded;
  896. this._loaded = !0, this.fire("viewreset", {
  897. hard: !i
  898. }), a && (this.fire("load"), this.eachLayer(this._layerAdd, this)), this.fire("move"), (s || n) && this.fire("zoomend"), this.fire("moveend", {
  899. hard: !i
  900. })
  901. },
  902. _rawPanBy: function(t) {
  903. o.DomUtil.setPosition(this._mapPane, this._getMapPanePos().subtract(t))
  904. },
  905. _getZoomSpan: function() {
  906. return this.getMaxZoom() - this.getMinZoom()
  907. },
  908. _updateZoomLevels: function() {
  909. var t, e = 1 / 0,
  910. n = -1 / 0,
  911. o = this._getZoomSpan();
  912. for (t in this._zoomBoundLayers) {
  913. var s = this._zoomBoundLayers[t];
  914. isNaN(s.options.minZoom) || (e = Math.min(e, s.options.minZoom)), isNaN(s.options.maxZoom) || (n = Math.max(n, s.options.maxZoom))
  915. }
  916. t === i ? this._layersMaxZoom = this._layersMinZoom = i : (this._layersMaxZoom = n, this._layersMinZoom = e), o !== this._getZoomSpan() && this.fire("zoomlevelschange")
  917. },
  918. _panInsideMaxBounds: function() {
  919. this.panInsideBounds(this.options.maxBounds)
  920. },
  921. _checkIfLoaded: function() {
  922. if (!this._loaded) throw new Error("Set map center and zoom first.")
  923. },
  924. _initEvents: function(e) {
  925. if (o.DomEvent) {
  926. e = e || "on", o.DomEvent[e](this._container, "click", this._onMouseClick, this);
  927. var i, n, s = ["dblclick", "mousedown", "mouseup", "mouseenter", "mouseleave", "mousemove", "contextmenu"];
  928. for (i = 0, n = s.length; n > i; i++) o.DomEvent[e](this._container, s[i], this._fireMouseEvent, this);
  929. this.options.trackResize && o.DomEvent[e](t, "resize", this._onResize, this)
  930. }
  931. },
  932. _onResize: function() {
  933. o.Util.cancelAnimFrame(this._resizeRequest), this._resizeRequest = o.Util.requestAnimFrame(function() {
  934. this.invalidateSize({
  935. debounceMoveend: !0
  936. })
  937. }, this, !1, this._container)
  938. },
  939. _onMouseClick: function(t) {
  940. !this._loaded || !t._simulated && (this.dragging && this.dragging.moved() || this.boxZoom && this.boxZoom.moved()) || o.DomEvent._skipped(t) || (this.fire("preclick"), this._fireMouseEvent(t))
  941. },
  942. _fireMouseEvent: function(t) {
  943. if (this._loaded && !o.DomEvent._skipped(t)) {
  944. var e = t.type;
  945. if (e = "mouseenter" === e ? "mouseover" : "mouseleave" === e ? "mouseout" : e, this.hasEventListeners(e)) {
  946. "contextmenu" === e && o.DomEvent.preventDefault(t);
  947. var i = this.mouseEventToContainerPoint(t),
  948. n = this.containerPointToLayerPoint(i),
  949. s = this.layerPointToLatLng(n);
  950. this.fire(e, {
  951. latlng: s,
  952. layerPoint: n,
  953. containerPoint: i,
  954. originalEvent: t
  955. })
  956. }
  957. }
  958. },
  959. _onTileLayerLoad: function() {
  960. this._tileLayersToLoad--, this._tileLayersNum && !this._tileLayersToLoad && this.fire("tilelayersload")
  961. },
  962. _clearHandlers: function() {
  963. for (var t = 0, e = this._handlers.length; e > t; t++) this._handlers[t].disable()
  964. },
  965. whenReady: function(t, e) {
  966. return this._loaded ? t.call(e || this, this) : this.on("load", t, e), this
  967. },
  968. _layerAdd: function(t) {
  969. t.onAdd(this), this.fire("layeradd", {
  970. layer: t
  971. })
  972. },
  973. _getMapPanePos: function() {
  974. return o.DomUtil.getPosition(this._mapPane)
  975. },
  976. _moved: function() {
  977. var t = this._getMapPanePos();
  978. return t && !t.equals([0, 0])
  979. },
  980. _getTopLeftPoint: function() {
  981. return this.getPixelOrigin().subtract(this._getMapPanePos())
  982. },
  983. _getNewTopLeftPoint: function(t, e) {
  984. var i = this.getSize()._divideBy(2);
  985. return this.project(t, e)._subtract(i)._round()
  986. },
  987. _latLngToNewLayerPoint: function(t, e, i) {
  988. var n = this._getNewTopLeftPoint(i, e).add(this._getMapPanePos());
  989. return this.project(t, e)._subtract(n)
  990. },
  991. _getCenterLayerPoint: function() {
  992. return this.containerPointToLayerPoint(this.getSiz