node-red-contrib-snap4city-user
Version:
Nodes for Snap4city project, targeted to standard user (no developer)
1,372 lines (1,266 loc) • 223 kB
JavaScript
/* @preserve
* Leaflet 1.3.1+Detached: ba6f97fff8647e724e4dfe66d2ed7da11f908989.ba6f97f, a JS library for interactive maps. http://leafletjs.com
* (c) 2010-2017 Vladimir Agafonkin, (c) 2010-2011 CloudMade
*/
! function (t, i) {
"object" == typeof exports && "undefined" != typeof module ? i(exports) : "function" == typeof define && define.amd ? define(["exports"], i) : i(t.L = {})
}(this, function (t) {
"use strict";
function i(t) {
var i, e, n, o;
for (e = 1, n = arguments.length; e < n; e++) {
o = arguments[e];
for (i in o) t[i] = o[i]
}
return t
}
function e(t, i) {
var e = Array.prototype.slice;
if (t.bind) return t.bind.apply(t, e.call(arguments, 1));
var n = e.call(arguments, 2);
return function () {
return t.apply(i, n.length ? n.concat(e.call(arguments)) : arguments)
}
}
function n(t) {
return t._leaflet_id = t._leaflet_id || ++ti, t._leaflet_id
}
function o(t, i, e) {
var n, o, s, r;
return r = function () {
n = !1, o && (s.apply(e, o), o = !1)
}, s = function () {
n ? o = arguments : (t.apply(e, arguments), setTimeout(r, i), n = !0)
}
}
function s(t, i, e) {
var n = i[1],
o = i[0],
s = n - o;
return t === n && e ? t : ((t - o) % s + s) % s + o
}
function r() {
return !1
}
function a(t, i) {
var e = Math.pow(10, void 0 === i ? 6 : i);
return Math.round(t * e) / e
}
function h(t) {
return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "")
}
function u(t) {
return h(t).split(/\s+/)
}
function l(t, i) {
t.hasOwnProperty("options") || (t.options = t.options ? Qt(t.options) : {});
for (var e in i) t.options[e] = i[e];
return t.options
}
function c(t, i, e) {
var n = [];
for (var o in t) n.push(encodeURIComponent(e ? o.toUpperCase() : o) + "=" + encodeURIComponent(t[o]));
return (i && -1 !== i.indexOf("?") ? "&" : "?") + n.join("&")
}
function _(t, i) {
return t.replace(ii, function (t, e) {
var n = i[e];
if (void 0 === n) throw new Error("No value provided for variable " + t);
return "function" == typeof n && (n = n(i)), n
})
}
function d(t, i) {
for (var e = 0; e < t.length; e++)
if (t[e] === i) return e;
return -1
}
function p(t) {
return window["webkit" + t] || window["moz" + t] || window["ms" + t]
}
function m(t) {
var i = +new Date,
e = Math.max(0, 16 - (i - oi));
return oi = i + e, window.setTimeout(t, e)
}
function f(t, i, n) {
if (!n || si !== m) return si.call(window, e(t, i));
t.call(i)
}
function g(t) {
t && ri.call(window, t)
}
function v() {}
function y(t) {
if ("undefined" != typeof L && L && L.Mixin) {
t = ei(t) ? t : [t];
for (var i = 0; i < t.length; i++) t[i] === L.Mixin.Events && console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.", (new Error).stack)
}
}
function x(t, i, e) {
this.x = e ? Math.round(t) : t, this.y = e ? Math.round(i) : i
}
function w(t, i, e) {
return t instanceof x ? t : ei(t) ? new x(t[0], t[1]) : void 0 === t || null === t ? t : "object" == typeof t && "x" in t && "y" in t ? new x(t.x, t.y) : new x(t, i, e)
}
function P(t, i) {
if (t)
for (var e = i ? [t, i] : t, n = 0, o = e.length; n < o; n++) this.extend(e[n])
}
function b(t, i) {
return !t || t instanceof P ? t : new P(t, i)
}
function T(t, i) {
if (t)
for (var e = i ? [t, i] : t, n = 0, o = e.length; n < o; n++) this.extend(e[n])
}
function z(t, i) {
return t instanceof T ? t : new T(t, i)
}
function M(t, i, e) {
if (isNaN(t) || isNaN(i)) throw new Error("Invalid LatLng object: (" + t + ", " + i + ")");
this.lat = +t, this.lng = +i, void 0 !== e && (this.alt = +e)
}
function C(t, i, e) {
return t instanceof M ? t : ei(t) && "object" != typeof t[0] ? 3 === t.length ? new M(t[0], t[1], t[2]) : 2 === t.length ? new M(t[0], t[1]) : null : void 0 === t || null === t ? t : "object" == typeof t && "lat" in t ? new M(t.lat, "lng" in t ? t.lng : t.lon, t.alt) : void 0 === i ? null : new M(t, i, e)
}
function Z(t, i, e, n) {
if (ei(t)) return this._a = t[0], this._b = t[1], this._c = t[2], void(this._d = t[3]);
this._a = t, this._b = i, this._c = e, this._d = n
}
function S(t, i, e, n) {
return new Z(t, i, e, n)
}
function E(t) {
return document.createElementNS("http://www.w3.org/2000/svg", t)
}
function k(t, i) {
var e, n, o, s, r, a, h = "";
for (e = 0, o = t.length; e < o; e++) {
for (n = 0, s = (r = t[e]).length; n < s; n++) a = r[n], h += (n ? "L" : "M") + a.x + " " + a.y;
h += i ? Xi ? "z" : "x" : ""
}
return h || "M0 0"
}
function A(t) {
return navigator.userAgent.toLowerCase().indexOf(t) >= 0
}
function I(t, i, e, n) {
return "touchstart" === i ? O(t, e, n) : "touchmove" === i ? W(t, e, n) : "touchend" === i && H(t, e, n), this
}
function B(t, i, e) {
var n = t["_leaflet_" + i + e];
return "touchstart" === i ? t.removeEventListener(Qi, n, !1) : "touchmove" === i ? t.removeEventListener(te, n, !1) : "touchend" === i && (t.removeEventListener(ie, n, !1), t.removeEventListener(ee, n, !1)), this
}
function O(t, i, n) {
var o = e(function (t) {
if ("mouse" !== t.pointerType && t.MSPOINTER_TYPE_MOUSE && t.pointerType !== t.MSPOINTER_TYPE_MOUSE) {
if (!(ne.indexOf(t.target.tagName) < 0)) return;
$(t)
}
j(t, i)
});
t["_leaflet_touchstart" + n] = o, t.addEventListener(Qi, o, !1), se || (document.documentElement.addEventListener(Qi, R, !0), document.documentElement.addEventListener(te, D, !0), document.documentElement.addEventListener(ie, N, !0), document.documentElement.addEventListener(ee, N, !0), se = !0)
}
function R(t) {
oe[t.pointerId] = t, re++
}
function D(t) {
oe[t.pointerId] && (oe[t.pointerId] = t)
}
function N(t) {
delete oe[t.pointerId], re--
}
function j(t, i) {
t.touches = [];
for (var e in oe) t.touches.push(oe[e]);
t.changedTouches = [t], i(t)
}
function W(t, i, e) {
var n = function (t) {
(t.pointerType !== t.MSPOINTER_TYPE_MOUSE && "mouse" !== t.pointerType || 0 !== t.buttons) && j(t, i)
};
t["_leaflet_touchmove" + e] = n, t.addEventListener(te, n, !1)
}
function H(t, i, e) {
var n = function (t) {
j(t, i)
};
t["_leaflet_touchend" + e] = n, t.addEventListener(ie, n, !1), t.addEventListener(ee, n, !1)
}
function F(t, i, e) {
function n(t) {
var i;
if (Ui) {
if (!Pi || "mouse" === t.pointerType) return;
i = re
} else i = t.touches.length;
if (!(i > 1)) {
var e = Date.now(),
n = e - (s || e);
r = t.touches ? t.touches[0] : t, a = n > 0 && n <= h, s = e
}
}
function o(t) {
if (a && !r.cancelBubble) {
if (Ui) {
if (!Pi || "mouse" === t.pointerType) return;
var e, n, o = {};
for (n in r) e = r[n], o[n] = e && e.bind ? e.bind(r) : e;
r = o
}
r.type = "dblclick", i(r), s = null
}
}
var s, r, a = !1,
h = 250;
return t[ue + ae + e] = n, t[ue + he + e] = o, t[ue + "dblclick" + e] = i, t.addEventListener(ae, n, !1), t.addEventListener(he, o, !1), t.addEventListener("dblclick", i, !1), this
}
function U(t, i) {
var e = t[ue + ae + i],
n = t[ue + he + i],
o = t[ue + "dblclick" + i];
return t.removeEventListener(ae, e, !1), t.removeEventListener(he, n, !1), Pi || t.removeEventListener("dblclick", o, !1), this
}
function V(t, i, e, n) {
if ("object" == typeof i)
for (var o in i) G(t, o, i[o], e);
else
for (var s = 0, r = (i = u(i)).length; s < r; s++) G(t, i[s], e, n);
return this
}
function q(t, i, e, n) {
if ("object" == typeof i)
for (var o in i) K(t, o, i[o], e);
else if (i)
for (var s = 0, r = (i = u(i)).length; s < r; s++) K(t, i[s], e, n);
else {
for (var a in t[le]) K(t, a, t[le][a]);
delete t[le]
}
return this
}
function G(t, i, e, o) {
var s = i + n(e) + (o ? "_" + n(o) : "");
if (t[le] && t[le][s]) return this;
var r = function (i) {
return e.call(o || t, i || window.event)
},
a = r;
Ui && 0 === i.indexOf("touch") ? I(t, i, r, s) : !Vi || "dblclick" !== i || !F || Ui && Si ? "addEventListener" in t ? "mousewheel" === i ? t.addEventListener("onwheel" in t ? "wheel" : "mousewheel", r, !1) : "mouseenter" === i || "mouseleave" === i ? (r = function (i) {
i = i || window.event, ot(t, i) && a(i)
}, t.addEventListener("mouseenter" === i ? "mouseover" : "mouseout", r, !1)) : ("click" === i && Ti && (r = function (t) {
st(t, a)
}), t.addEventListener(i, r, !1)) : "attachEvent" in t && t.attachEvent("on" + i, r) : F(t, r, s), t[le] = t[le] || {}, t[le][s] = r
}
function K(t, i, e, o) {
var s = i + n(e) + (o ? "_" + n(o) : ""),
r = t[le] && t[le][s];
if (!r) return this;
Ui && 0 === i.indexOf("touch") ? B(t, i, s) : !Vi || "dblclick" !== i || !U || Ui && Si ? "removeEventListener" in t ? "mousewheel" === i ? t.removeEventListener("onwheel" in t ? "wheel" : "mousewheel", r, !1) : t.removeEventListener("mouseenter" === i ? "mouseover" : "mouseleave" === i ? "mouseout" : i, r, !1) : "detachEvent" in t && t.detachEvent("on" + i, r) : U(t, s), t[le][s] = null
}
function Y(t) {
return t.stopPropagation ? t.stopPropagation() : t.originalEvent ? t.originalEvent._stopped = !0 : t.cancelBubble = !0, nt(t), this
}
function X(t) {
return G(t, "mousewheel", Y), this
}
function J(t) {
return V(t, "mousedown touchstart dblclick", Y), G(t, "click", et), this
}
function $(t) {
return t.preventDefault ? t.preventDefault() : t.returnValue = !1, this
}
function Q(t) {
return $(t), Y(t), this
}
function tt(t, i) {
if (!i) return new x(t.clientX, t.clientY);
var e = i.getBoundingClientRect(),
n = e.width / i.offsetWidth || 1,
o = e.height / i.offsetHeight || 1;
return new x(t.clientX / n - e.left - i.clientLeft, t.clientY / o - e.top - i.clientTop)
}
function it(t) {
return Pi ? t.wheelDeltaY / 2 : t.deltaY && 0 === t.deltaMode ? -t.deltaY / ce : t.deltaY && 1 === t.deltaMode ? 20 * -t.deltaY : t.deltaY && 2 === t.deltaMode ? 60 * -t.deltaY : t.deltaX || t.deltaZ ? 0 : t.wheelDelta ? (t.wheelDeltaY || t.wheelDelta) / 2 : t.detail && Math.abs(t.detail) < 32765 ? 20 * -t.detail : t.detail ? t.detail / -32765 * 60 : 0
}
function et(t) {
_e[t.type] = !0
}
function nt(t) {
var i = _e[t.type];
return _e[t.type] = !1, i
}
function ot(t, i) {
var e = i.relatedTarget;
if (!e) return !0;
try {
for (; e && e !== t;) e = e.parentNode
} catch (t) {
return !1
}
return e !== t
}
function st(t, i) {
var e = t.timeStamp || t.originalEvent && t.originalEvent.timeStamp,
n = pi && e - pi;
n && n > 100 && n < 500 || t.target._simulatedClick && !t._simulated ? Q(t) : (pi = e, i(t))
}
function rt(t) {
return "string" == typeof t ? document.getElementById(t) : t
}
function at(t, i) {
var e = t.style[i] || t.currentStyle && t.currentStyle[i];
if ((!e || "auto" === e) && document.defaultView) {
var n = document.defaultView.getComputedStyle(t, null);
e = n ? n[i] : null
}
return "auto" === e ? null : e
}
function ht(t, i, e) {
var n = document.createElement(t);
return n.className = i || "", e && e.appendChild(n), n
}
function ut(t) {
var i = t.parentNode;
i && i.removeChild(t)
}
function lt(t) {
for (; t.firstChild;) t.removeChild(t.firstChild)
}
function ct(t) {
var i = t.parentNode;
i.lastChild !== t && i.appendChild(t)
}
function _t(t) {
var i = t.parentNode;
i.firstChild !== t && i.insertBefore(t, i.firstChild)
}
function dt(t, i) {
if (void 0 !== t.classList) return t.classList.contains(i);
var e = gt(t);
return e.length > 0 && new RegExp("(^|\\s)" + i + "(\\s|$)").test(e)
}
function pt(t, i) {
if (void 0 !== t.classList)
for (var e = u(i), n = 0, o = e.length; n < o; n++) t.classList.add(e[n]);
else if (!dt(t, i)) {
var s = gt(t);
ft(t, (s ? s + " " : "") + i)
}
}
function mt(t, i) {
void 0 !== t.classList ? t.classList.remove(i) : ft(t, h((" " + gt(t) + " ").replace(" " + i + " ", " ")))
}
function ft(t, i) {
void 0 === t.className.baseVal ? t.className = i : t.className.baseVal = i
}
function gt(t) {
return void 0 === t.className.baseVal ? t.className : t.className.baseVal
}
function vt(t, i) {
"opacity" in t.style ? t.style.opacity = i : "filter" in t.style && yt(t, i)
}
function yt(t, i) {
var e = !1,
n = "DXImageTransform.Microsoft.Alpha";
try {
e = t.filters.item(n)
} catch (t) {
if (1 === i) return
}
i = Math.round(100 * i), e ? (e.Enabled = 100 !== i, e.Opacity = i) : t.style.filter += " progid:" + n + "(opacity=" + i + ")"
}
function xt(t) {
for (var i = document.documentElement.style, e = 0; e < t.length; e++)
if (t[e] in i) return t[e];
return !1
}
function wt(t, i, e) {
var n = i || new x(0, 0);
t.style[pe] = (Oi ? "translate(" + n.x + "px," + n.y + "px)" : "translate3d(" + n.x + "px," + n.y + "px,0)") + (e ? " scale(" + e + ")" : "")
}
function Lt(t, i) {
t._leaflet_pos = i, Ni ? wt(t, i) : (t.style.left = i.x + "px", t.style.top = i.y + "px")
}
function Pt(t) {
return t._leaflet_pos || new x(0, 0)
}
function bt() {
V(window, "dragstart", $)
}
function Tt() {
q(window, "dragstart", $)
}
function zt(t) {
for (; - 1 === t.tabIndex;) t = t.parentNode;
t.style && (Mt(), ve = t, ye = t.style.outline, t.style.outline = "none", V(window, "keydown", Mt))
}
function Mt() {
ve && (ve.style.outline = ye, ve = void 0, ye = void 0, q(window, "keydown", Mt))
}
function Ct(t, i) {
if (!i || !t.length) return t.slice();
var e = i * i;
return t = kt(t, e), t = St(t, e)
}
function Zt(t, i, e) {
return Math.sqrt(Rt(t, i, e, !0))
}
function St(t, i) {
var e = t.length,
n = new(typeof Uint8Array != void 0 + "" ? Uint8Array : Array)(e);
n[0] = n[e - 1] = 1, Et(t, n, i, 0, e - 1);
var o, s = [];
for (o = 0; o < e; o++) n[o] && s.push(t[o]);
return s
}
function Et(t, i, e, n, o) {
var s, r, a, h = 0;
for (r = n + 1; r <= o - 1; r++)(a = Rt(t[r], t[n], t[o], !0)) > h && (s = r, h = a);
h > e && (i[s] = 1, Et(t, i, e, n, s), Et(t, i, e, s, o))
}
function kt(t, i) {
for (var e = [t[0]], n = 1, o = 0, s = t.length; n < s; n++) Ot(t[n], t[o]) > i && (e.push(t[n]), o = n);
return o < s - 1 && e.push(t[s - 1]), e
}
function At(t, i, e, n, o) {
var s, r, a, h = n ? Se : Bt(t, e),
u = Bt(i, e);
for (Se = u;;) {
if (!(h | u)) return [t, i];
if (h & u) return !1;
a = Bt(r = It(t, i, s = h || u, e, o), e), s === h ? (t = r, h = a) : (i = r, u = a)
}
}
function It(t, i, e, n, o) {
var s, r, a = i.x - t.x,
h = i.y - t.y,
u = n.min,
l = n.max;
return 8 & e ? (s = t.x + a * (l.y - t.y) / h, r = l.y) : 4 & e ? (s = t.x + a * (u.y - t.y) / h, r = u.y) : 2 & e ? (s = l.x, r = t.y + h * (l.x - t.x) / a) : 1 & e && (s = u.x, r = t.y + h * (u.x - t.x) / a), new x(s, r, o)
}
function Bt(t, i) {
var e = 0;
return t.x < i.min.x ? e |= 1 : t.x > i.max.x && (e |= 2), t.y < i.min.y ? e |= 4 : t.y > i.max.y && (e |= 8), e
}
function Ot(t, i) {
var e = i.x - t.x,
n = i.y - t.y;
return e * e + n * n
}
function Rt(t, i, e, n) {
var o, s = i.x,
r = i.y,
a = e.x - s,
h = e.y - r,
u = a * a + h * h;
return u > 0 && ((o = ((t.x - s) * a + (t.y - r) * h) / u) > 1 ? (s = e.x, r = e.y) : o > 0 && (s += a * o, r += h * o)), a = t.x - s, h = t.y - r, n ? a * a + h * h : new x(s, r)
}
function Dt(t) {
return !ei(t[0]) || "object" != typeof t[0][0] && void 0 !== t[0][0]
}
function Nt(t) {
return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."), Dt(t)
}
function jt(t, i, e) {
var n, o, s, r, a, h, u, l, c, _ = [1, 4, 2, 8];
for (o = 0, u = t.length; o < u; o++) t[o]._code = Bt(t[o], i);
for (r = 0; r < 4; r++) {
for (l = _[r], n = [], o = 0, s = (u = t.length) - 1; o < u; s = o++) a = t[o], h = t[s], a._code & l ? h._code & l || ((c = It(h, a, l, i, e))._code = Bt(c, i), n.push(c)) : (h._code & l && ((c = It(h, a, l, i, e))._code = Bt(c, i), n.push(c)), n.push(a));
t = n
}
return t
}
function Wt(t, i) {
var e, n, o, s, r = "Feature" === t.type ? t.geometry : t,
a = r ? r.coordinates : null,
h = [],
u = i && i.pointToLayer,
l = i && i.coordsToLatLng || Ht;
if (!a && !r) return null;
switch (r.type) {
case "Point":
return e = l(a), u ? u(t, e) : new Xe(e);
case "MultiPoint":
for (o = 0, s = a.length; o < s; o++) e = l(a[o]), h.push(u ? u(t, e) : new Xe(e));
return new qe(h);
case "LineString":
case "MultiLineString":
return n = Ft(a, "LineString" === r.type ? 0 : 1, l), new tn(n, i);
case "Polygon":
case "MultiPolygon":
return n = Ft(a, "Polygon" === r.type ? 1 : 2, l), new en(n, i);
case "GeometryCollection":
for (o = 0, s = r.geometries.length; o < s; o++) {
var c = Wt({
geometry: r.geometries[o],
type: "Feature",
properties: t.properties
}, i);
c && h.push(c)
}
return new qe(h);
default:
throw new Error("Invalid GeoJSON object.")
}
}
function Ht(t) {
return new M(t[1], t[0], t[2])
}
function Ft(t, i, e) {
for (var n, o = [], s = 0, r = t.length; s < r; s++) n = i ? Ft(t[s], i - 1, e) : (e || Ht)(t[s]), o.push(n);
return o
}
function Ut(t, i) {
return i = "number" == typeof i ? i : 6, void 0 !== t.alt ? [a(t.lng, i), a(t.lat, i), a(t.alt, i)] : [a(t.lng, i), a(t.lat, i)]
}
function Vt(t, i, e, n) {
for (var o = [], s = 0, r = t.length; s < r; s++) o.push(i ? Vt(t[s], i - 1, e, n) : Ut(t[s], n));
return !i && e && o.push(o[0]), o
}
function qt(t, e) {
return t.feature ? i({}, t.feature, {
geometry: e
}) : Gt(e)
}
function Gt(t) {
return "Feature" === t.type || "FeatureCollection" === t.type ? t : {
type: "Feature",
properties: {},
geometry: t
}
}
function Kt(t, i) {
return new nn(t, i)
}
function Yt(t, i) {
return new dn(t, i)
}
function Xt(t) {
return Yi ? new fn(t) : null
}
function Jt(t) {
return Xi || Ji ? new xn(t) : null
}
var $t = Object.freeze;
Object.freeze = function (t) {
return t
};
var Qt = Object.create || function () {
function t() {}
return function (i) {
return t.prototype = i, new t
}
}(),
ti = 0,
ii = /\{ *([\w_-]+) *\}/g,
ei = Array.isArray || function (t) {
return "[object Array]" === Object.prototype.toString.call(t)
},
ni = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",
oi = 0,
si = window.requestAnimationFrame || p("RequestAnimationFrame") || m,
ri = window.cancelAnimationFrame || p("CancelAnimationFrame") || p("CancelRequestAnimationFrame") || function (t) {
window.clearTimeout(t)
},
ai = (Object.freeze || Object)({
freeze: $t,
extend: i,
create: Qt,
bind: e,
lastId: ti,
stamp: n,
throttle: o,
wrapNum: s,
falseFn: r,
formatNum: a,
trim: h,
splitWords: u,
setOptions: l,
getParamString: c,
template: _,
isArray: ei,
indexOf: d,
emptyImageUrl: ni,
requestFn: si,
cancelFn: ri,
requestAnimFrame: f,
cancelAnimFrame: g
});
v.extend = function (t) {
var e = function () {
this.initialize && this.initialize.apply(this, arguments), this.callInitHooks()
},
n = e.__super__ = this.prototype,
o = Qt(n);
o.constructor = e, e.prototype = o;
for (var s in this) this.hasOwnProperty(s) && "prototype" !== s && "__super__" !== s && (e[s] = this[s]);
return t.statics && (i(e, t.statics), delete t.statics), t.includes && (y(t.includes), i.apply(null, [o].concat(t.includes)), delete t.includes), o.options && (t.options = i(Qt(o.options), t.options)), i(o, t), o._initHooks = [], o.callInitHooks = function () {
if (!this._initHooksCalled) {
n.callInitHooks && n.callInitHooks.call(this), this._initHooksCalled = !0;
for (var t = 0, i = o._initHooks.length; t < i; t++) o._initHooks[t].call(this)
}
}, e
}, v.include = function (t) {
return i(this.prototype, t), this
}, v.mergeOptions = function (t) {
return i(this.prototype.options, t), this
}, v.addInitHook = function (t) {
var i = Array.prototype.slice.call(arguments, 1),
e = "function" == typeof t ? t : function () {
this[t].apply(this, i)
};
return this.prototype._initHooks = this.prototype._initHooks || [], this.prototype._initHooks.push(e), this
};
var hi = {
on: function (t, i, e) {
if ("object" == typeof t)
for (var n in t) this._on(n, t[n], i);
else
for (var o = 0, s = (t = u(t)).length; o < s; o++) this._on(t[o], i, e);
return this
},
off: function (t, i, e) {
if (t)
if ("object" == typeof t)
for (var n in t) this._off(n, t[n], i);
else
for (var o = 0, s = (t = u(t)).length; o < s; o++) this._off(t[o], i, e);
else delete this._events;
return this
},
_on: function (t, i, e) {
this._events = this._events || {};
var n = this._events[t];
n || (n = [], this._events[t] = n), e === this && (e = void 0);
for (var o = {
fn: i,
ctx: e
}, s = n, r = 0, a = s.length; r < a; r++)
if (s[r].fn === i && s[r].ctx === e) return;
s.push(o)
},
_off: function (t, i, e) {
var n, o, s;
if (this._events && (n = this._events[t]))
if (i) {
if (e === this && (e = void 0), n)
for (o = 0, s = n.length; o < s; o++) {
var a = n[o];
if (a.ctx === e && a.fn === i) return a.fn = r, this._firingCount && (this._events[t] = n = n.slice()), void n.splice(o, 1)
}
} else {
for (o = 0, s = n.length; o < s; o++) n[o].fn = r;
delete this._events[t]
}
},
fire: function (t, e, n) {
if (!this.listens(t, n)) return this;
var o = i({}, e, {
type: t,
target: this,
sourceTarget: e && e.sourceTarget || this
});
if (this._events) {
var s = this._events[t];
if (s) {
this._firingCount = this._firingCount + 1 || 1;
for (var r = 0, a = s.length; r < a; r++) {
var h = s[r];
h.fn.call(h.ctx || this, o)
}
this._firingCount--
}
}
return n && this._propagateEvent(o), this
},
listens: function (t, i) {
var e = this._events && this._events[t];
if (e && e.length) return !0;
if (i)
for (var n in this._eventParents)
if (this._eventParents[n].listens(t, i)) return !0;
return !1
},
once: function (t, i, n) {
if ("object" == typeof t) {
for (var o in t) this.once(o, t[o], i);
return this
}
var s = e(function () {
this.off(t, i, n).off(t, s, n)
}, this);
return this.on(t, i, n).on(t, s, n)
},
addEventParent: function (t) {
return this._eventParents = this._eventParents || {}, this._eventParents[n(t)] = t, this
},
removeEventParent: function (t) {
return this._eventParents && delete this._eventParents[n(t)], this
},
_propagateEvent: function (t) {
for (var e in this._eventParents) this._eventParents[e].fire(t.type, i({
layer: t.target,
propagatedFrom: t.target
}, t), !0)
}
};
hi.addEventListener = hi.on, hi.removeEventListener = hi.clearAllEventListeners = hi.off, hi.addOneTimeEventListener = hi.once, hi.fireEvent = hi.fire, hi.hasEventListeners = hi.listens;
var ui = v.extend(hi),
li = Math.trunc || function (t) {
return t > 0 ? Math.floor(t) : Math.ceil(t)
};
x.prototype = {
clone: function () {
return new x(this.x, this.y)
},
add: function (t) {
return this.clone()._add(w(t))
},
_add: function (t) {
return this.x += t.x, this.y += t.y, this
},
subtract: function (t) {
return this.clone()._subtract(w(t))
},
_subtract: function (t) {
return this.x -= t.x, this.y -= t.y, this
},
divideBy: function (t) {
return this.clone()._divideBy(t)
},
_divideBy: function (t) {
return this.x /= t, this.y /= t, this
},
multiplyBy: function (t) {
return this.clone()._multiplyBy(t)
},
_multiplyBy: function (t) {
return this.x *= t, this.y *= t, this
},
scaleBy: function (t) {
return new x(this.x * t.x, this.y * t.y)
},
unscaleBy: function (t) {
return new x(this.x / t.x, this.y / t.y)
},
round: function () {
return this.clone()._round()
},
_round: function () {
return this.x = Math.round(this.x), this.y = Math.round(this.y), this
},
floor: function () {
return this.clone()._floor()
},
_floor: function () {
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this
},
ceil: function () {
return this.clone()._ceil()
},
_ceil: function () {
return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this
},
trunc: function () {
return this.clone()._trunc()
},
_trunc: function () {
return this.x = li(this.x), this.y = li(this.y), this
},
distanceTo: function (t) {
var i = (t = w(t)).x - this.x,
e = t.y - this.y;
return Math.sqrt(i * i + e * e)
},
equals: function (t) {
return (t = w(t)).x === this.x && t.y === this.y
},
contains: function (t) {
return t = w(t), Math.abs(t.x) <= Math.abs(this.x) && Math.abs(t.y) <= Math.abs(this.y)
},
toString: function () {
return "Point(" + a(this.x) + ", " + a(this.y) + ")"
}
}, P.prototype = {
extend: function (t) {
return t = w(t), this.min || this.max ? (this.min.x = Math.min(t.x, this.min.x), this.max.x = Math.max(t.x, this.max.x), this.min.y = Math.min(t.y, this.min.y), this.max.y = Math.max(t.y, this.max.y)) : (this.min = t.clone(), this.max = t.clone()), this
},
getCenter: function (t) {
return new x((this.min.x + this.max.x) / 2, (this.min.y + this.max.y) / 2, t)
},
getBottomLeft: function () {
return new x(this.min.x, this.max.y)
},
getTopRight: function () {
return new x(this.max.x, this.min.y)
},
getTopLeft: function () {
return this.min
},
getBottomRight: function () {
return this.max
},
getSize: function () {
return this.max.subtract(this.min)
},
contains: function (t) {
var i, e;
return (t = "number" == typeof t[0] || t instanceof x ? w(t) : b(t)) instanceof P ? (i = t.min, e = t.max) : i = e = t, i.x >= this.min.x && e.x <= this.max.x && i.y >= this.min.y && e.y <= this.max.y
},
intersects: function (t) {
t = b(t);
var i = this.min,
e = this.max,
n = t.min,
o = t.max,
s = o.x >= i.x && n.x <= e.x,
r = o.y >= i.y && n.y <= e.y;
return s && r
},
overlaps: function (t) {
t = b(t);
var i = this.min,
e = this.max,
n = t.min,
o = t.max,
s = o.x > i.x && n.x < e.x,
r = o.y > i.y && n.y < e.y;
return s && r
},
isValid: function () {
return !(!this.min || !this.max)
}
}, T.prototype = {
extend: function (t) {
var i, e, n = this._southWest,
o = this._northEast;
if (t instanceof M) i = t, e = t;
else {
if (!(t instanceof T)) return t ? this.extend(C(t) || z(t)) : this;
if (i = t._southWest, e = t._northEast, !i || !e) return this
}
return n || o ? (n.lat = Math.min(i.lat, n.lat), n.lng = Math.min(i.lng, n.lng), o.lat = Math.max(e.lat, o.lat), o.lng = Math.max(e.lng, o.lng)) : (this._southWest = new M(i.lat, i.lng), this._northEast = new M(e.lat, e.lng)), this
},
pad: function (t) {
var i = this._southWest,
e = this._northEast,
n = Math.abs(i.lat - e.lat) * t,
o = Math.abs(i.lng - e.lng) * t;
return new T(new M(i.lat - n, i.lng - o), new M(e.lat + n, e.lng + o))
},
getCenter: function () {
return new M((this._southWest.lat + this._northEast.lat) / 2, (this._southWest.lng + this._northEast.lng) / 2)
},
getSouthWest: function () {
return this._southWest
},
getNorthEast: function () {
return this._northEast
},
getNorthWest: function () {
return new M(this.getNorth(), this.getWest())
},
getSouthEast: function () {
return new M(this.getSouth(), this.getEast())
},
getWest: function () {
return this._southWest.lng
},
getSouth: function () {
return this._southWest.lat
},
getEast: function () {
return this._northEast.lng
},
getNorth: function () {
return this._northEast.lat
},
contains: function (t) {
t = "number" == typeof t[0] || t instanceof M || "lat" in t ? C(t) : z(t);
var i, e, n = this._southWest,
o = this._northEast;
return t instanceof T ? (i = t.getSouthWest(), e = t.getNorthEast()) : i = e = t, i.lat >= n.lat && e.lat <= o.lat && i.lng >= n.lng && e.lng <= o.lng
},
intersects: function (t) {
t = z(t);
var i = this._southWest,
e = this._northEast,
n = t.getSouthWest(),
o = t.getNorthEast(),
s = o.lat >= i.lat && n.lat <= e.lat,
r = o.lng >= i.lng && n.lng <= e.lng;
return s && r
},
overlaps: function (t) {
t = z(t);
var i = this._southWest,
e = this._northEast,
n = t.getSouthWest(),
o = t.getNorthEast(),
s = o.lat > i.lat && n.lat < e.lat,
r = o.lng > i.lng && n.lng < e.lng;
return s && r
},
toBBoxString: function () {
return [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(",")
},
equals: function (t, i) {
return !!t && (t = z(t), this._southWest.equals(t.getSouthWest(), i) && this._northEast.equals(t.getNorthEast(), i))
},
isValid: function () {
return !(!this._southWest || !this._northEast)
}
}, M.prototype = {
equals: function (t, i) {
return !!t && (t = C(t), Math.max(Math.abs(this.lat - t.lat), Math.abs(this.lng - t.lng)) <= (void 0 === i ? 1e-9 : i))
},
toString: function (t) {
return "LatLng(" + a(this.lat, t) + ", " + a(this.lng, t) + ")"
},
distanceTo: function (t) {
return _i.distance(this, C(t))
},
wrap: function () {
return _i.wrapLatLng(this)
},
toBounds: function (t) {
var i = 180 * t / 40075017,
e = i / Math.cos(Math.PI / 180 * this.lat);
return z([this.lat - i, this.lng - e], [this.lat + i, this.lng + e])
},
clone: function () {
return new M(this.lat, this.lng, this.alt)
}
};
var ci = {
latLngToPoint: function (t, i) {
var e = this.projection.project(t),
n = this.scale(i);
return this.transformation._transform(e, n)
},
pointToLatLng: function (t, i) {
var e = this.scale(i),
n = this.transformation.untransform(t, e);
return this.projection.unproject(n)
},
project: function (t) {
return this.projection.project(t)
},
unproject: function (t) {
return this.projection.unproject(t)
},
scale: function (t) {
return 256 * Math.pow(2, t)
},
zoom: function (t) {
return Math.log(t / 256) / Math.LN2
},
getProjectedBounds: function (t) {
if (this.infinite) return null;
var i = this.projection.bounds,
e = this.scale(t);
return new P(this.transformation.transform(i.min, e), this.transformation.transform(i.max, e))
},
infinite: !1,
wrapLatLng: function (t) {
var i = this.wrapLng ? s(t.lng, this.wrapLng, !0) : t.lng;
return new M(this.wrapLat ? s(t.lat, this.wrapLat, !0) : t.lat, i, t.alt)
},
wrapLatLngBounds: function (t) {
var i = t.getCenter(),
e = this.wrapLatLng(i),
n = i.lat - e.lat,
o = i.lng - e.lng;
if (0 === n && 0 === o) return t;
var s = t.getSouthWest(),
r = t.getNorthEast();
return new T(new M(s.lat - n, s.lng - o), new M(r.lat - n, r.lng - o))
}
},
_i = i({}, ci, {
wrapLng: [-180, 180],
R: 6371e3,
distance: function (t, i) {
var e = Math.PI / 180,
n = t.lat * e,
o = i.lat * e,
s = Math.sin((i.lat - t.lat) * e / 2),
r = Math.sin((i.lng - t.lng) * e / 2),
a = s * s + Math.cos(n) * Math.cos(o) * r * r,
h = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
return this.R * h
}
}),
di = {
R: 6378137,
MAX_LATITUDE: 85.0511287798,
project: function (t) {
var i = Math.PI / 180,
e = this.MAX_LATITUDE,
n = Math.max(Math.min(e, t.lat), -e),
o = Math.sin(n * i);
return new x(this.R * t.lng * i, this.R * Math.log((1 + o) / (1 - o)) / 2)
},
unproject: function (t) {
var i = 180 / Math.PI;
return new M((2 * Math.atan(Math.exp(t.y / this.R)) - Math.PI / 2) * i, t.x * i / this.R)
},
bounds: function () {
var t = 6378137 * Math.PI;
return new P([-t, -t], [t, t])
}()
};
Z.prototype = {
transform: function (t, i) {
return this._transform(t.clone(), i)
},
_transform: function (t, i) {
return i = i || 1, t.x = i * (this._a * t.x + this._b), t.y = i * (this._c * t.y + this._d), t
},
untransform: function (t, i) {
return i = i || 1, new x((t.x / i - this._b) / this._a, (t.y / i - this._d) / this._c)
}
};
var pi, mi, fi, gi, vi = i({}, _i, {
code: "EPSG:3857",
projection: di,
transformation: function () {
var t = .5 / (Math.PI * di.R);
return S(t, .5, -t, .5)
}()
}),
yi = i({}, vi, {
code: "EPSG:900913"
}),
xi = document.documentElement.style,
wi = "ActiveXObject" in window,
Li = wi && !document.addEventListener,
Pi = "msLaunchUri" in navigator && !("documentMode" in document),
bi = A("webkit"),
Ti = A("android"),
zi = A("android 2") || A("android 3"),
Mi = parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1], 10),
Ci = Ti && A("Google") && Mi < 537 && !("AudioNode" in window),
Zi = !!window.opera,
Si = A("chrome"),
Ei = A("gecko") && !bi && !Zi && !wi,
ki = !Si && A("safari"),
Ai = A("phantom"),
Ii = "OTransition" in xi,
Bi = 0 === navigator.platform.indexOf("Win"),
Oi = wi && "transition" in xi,
Ri = "WebKitCSSMatrix" in window && "m11" in new window.WebKitCSSMatrix && !zi,
Di = "MozPerspective" in xi,
Ni = !window.L_DISABLE_3D && (Oi || Ri || Di) && !Ii && !Ai,
ji = "undefined" != typeof orientation || A("mobile"),
Wi = ji && bi,
Hi = ji && Ri,
Fi = !window.PointerEvent && window.MSPointerEvent,
Ui = !(!window.PointerEvent && !Fi),
Vi = !window.L_NO_TOUCH && (Ui || "ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch),
qi = ji && Zi,
Gi = ji && Ei,
Ki = (window.devicePixelRatio || window.screen.deviceXDPI / window.screen.logicalXDPI) > 1,
Yi = !!document.createElement("canvas").getContext,
Xi = !(!document.createElementNS || !E("svg").createSVGRect),
Ji = !Xi && function () {
try {
var t = document.createElement("div");
t.innerHTML = '<v:shape adj="1"/>';
var i = t.firstChild;
return i.style.behavior = "url(#default#VML)", i && "object" == typeof i.adj
} catch (t) {
return !1
}
}(),
$i = (Object.freeze || Object)({
ie: wi,
ielt9: Li,
edge: Pi,
webkit: bi,
android: Ti,
android23: zi,
androidStock: Ci,
opera: Zi,
chrome: Si,
gecko: Ei,
safari: ki,
phantom: Ai,
opera12: Ii,
win: Bi,
ie3d: Oi,
webkit3d: Ri,
gecko3d: Di,
any3d: Ni,
mobile: ji,
mobileWebkit: Wi,
mobileWebkit3d: Hi,
msPointer: Fi,
pointer: Ui,
touch: Vi,
mobileOpera: qi,
mobileGecko: Gi,
retina: Ki,
canvas: Yi,
svg: Xi,
vml: Ji
}),
Qi = Fi ? "MSPointerDown" : "pointerdown",
te = Fi ? "MSPointerMove" : "pointermove",
ie = Fi ? "MSPointerUp" : "pointerup",
ee = Fi ? "MSPointerCancel" : "pointercancel",
ne = ["INPUT", "SELECT", "OPTION"],
oe = {},
se = !1,
re = 0,
ae = Fi ? "MSPointerDown" : Ui ? "pointerdown" : "touchstart",
he = Fi ? "MSPointerUp" : Ui ? "pointerup" : "touchend",
ue = "_leaflet_",
le = "_leaflet_events",
ce = Bi && Si ? 2 * window.devicePixelRatio : Ei ? window.devicePixelRatio : 1,
_e = {},
de = (Object.freeze || Object)({
on: V,
off: q,
stopPropagation: Y,
disableScrollPropagation: X,
disableClickPropagation: J,
preventDefault: $,
stop: Q,
getMousePosition: tt,
getWheelDelta: it,
fakeStop: et,
skipped: nt,
isExternalTarget: ot,
addListener: V,
removeListener: q
}),
pe = xt(["transform", "WebkitTransform", "OTransform", "MozTransform", "msTransform"]),
me = xt(["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition"]),
fe = "webkitTransition" === me || "OTransition" === me ? me + "End" : "transitionend";
if ("onselectstart" in document) mi = function () {
V(window, "selectstart", $)
}, fi = function () {
q(window, "selectstart", $)
};
else {
var ge = xt(["userSelect", "WebkitUserSelect", "OUserSelect", "MozUserSelect", "msUserSelect"]);
mi = function () {
if (ge) {
var t = document.documentElement.style;
gi = t[ge], t[ge] = "none"
}
}, fi = function () {
ge && (document.documentElement.style[ge] = gi, gi = void 0)
}
}
var ve, ye, xe = (Object.freeze || Object)({
TRANSFORM: pe,
TRANSITION: me,
TRANSITION_END: fe,
get: rt,
getStyle: at,
create: ht,
remove: ut,
empty: lt,
toFront: ct,
toBack: _t,
hasClass: dt,
addClass: pt,
removeClass: mt,
setClass: ft,
getClass: gt,
setOpacity: vt,
testProp: xt,
setTransform: wt,
setPosition: Lt,
getPosition: Pt,
disableTextSelection: mi,
enableTextSelection: fi,
disableImageDrag: bt,
enableImageDrag: Tt,
preventOutline: zt,
restoreOutline: Mt
}),
we = ui.extend({
run: function (t, i, e, n) {
this.stop(), this._el = t, this._inProgress = !0, this._duration = e || .25, this._easeOutPower = 1 / Math.max(n || .5, .2), this._startPos = Pt(t), this._offset = i.subtract(this._startPos), this._startTime = +new Date, this.fire("start"), this._animate()
},
stop: function () {
this._inProgress && (this._step(!0), this._complete())
},
_animate: function () {
this._animId = f(this._animate, this), this._step()
},
_step: function (t) {
var i = +new Date - this._startTime,
e = 1e3 * this._duration;
i < e ? this._runFrame(this._easeOut(i / e), t) : (this._runFrame(1), this._complete())
},
_runFrame: function (t, i) {
var e = this._startPos.add(this._offset.multiplyBy(t));
i && e._round(), Lt(this._el, e), this.fire("step")
},
_complete: function () {
g(this._animId), this._inProgress = !1, this.fire("end")
},
_easeOut: function (t) {
return 1 - Math.pow(1 - t, this._easeOutPower)
}
}),
Le = ui.extend({
options: {
crs: vi,
center: void 0,
zoom: void 0,
minZoom: void 0,
maxZoom: void 0,
layers: [],
maxBounds: void 0,
renderer: void 0,
zoomAnimation: !0,
zoomAnimationThreshold: 4,
fadeAnimation: !0,
markerZoomAnimation: !0,
transform3DLimit: 8388608,
zoomSnap: 1,
zoomDelta: 1,
trackResize: !0
},
initialize: function (t, i) {
i = l(this, i), this._initContainer(t), this._initLayout(), this._onResize = e(this._onResize, this), this._initEvents(), i.maxBounds && this.setMaxBounds(i.maxBounds), void 0 !== i.zoom && (this._zoom = this._limitZoom(i.zoom)), i.center && void 0 !== i.zoom && this.setView(C(i.center), i.zoom, {
reset: !0
}), this._handlers = [], this._layers = {}, this._zoomBoundLayers = {}, this._sizeChanged = !0, this.callInitHooks(), this._zoomAnimated = me && Ni && !qi && this.options.zoomAnimation, this._zoomAnimated && (this._createAnimProxy(), V(this._proxy, fe, this._catchTransitionEnd, this)), this._addLayers(this.options.layers)
},
setView: function (t, e, n) {
return e = void 0 === e ? this._zoom : this._limitZoom(e), t = this._limitCenter(C(t), e, this.options.maxBounds), n = n || {}, this._stop(), this._loaded && !n.reset && !0 !== n && (void 0 !== n.animate && (n.zoom = i({
animate: n.animate
}, n.zoom), n.pan = i({
animate: n.animate,
duration: n.duration
}, n.pan)), this._zoom !== e ? this._tryAnimatedZoom && this._tryAnimatedZoom(t, e, n.zoom) : this._tryAnimatedPan(t, n.pan)) ? (clearTimeout(this._sizeTimer), this) : (this._resetView(t, e), this)
},
setZoom: function (t, i) {
return this._loaded ? this.setView(this.getCenter(), t, {
zoom: i
}) : (this._zoom = t, this)
},
zoomIn: function (t, i) {
return t = t || (Ni ? this.options.zoomDelta : 1), this.setZoom(this._zoom + t, i)
},
zoomOut: function (t, i) {
return t = t || (Ni ? this.options.zoomDelta : 1), this.setZoom(this._zoom - t, i)
},
setZoomAround: function (t, i, e) {
var n = this.getZoomScale(i),
o = this.getSize().divideBy(2),
s = (t instanceof x ? t : this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1 - 1 / n),
r = this.containerPointToLatLng(o.add(s));
return this.setView(r, i, {
zoom: e
})
},
_getBoundsCenterZoom: function (t, i) {
i = i || {}, t = t.getBounds ? t.getBounds() : z(t);
var e = w(i.paddingTopLeft || i.padding || [0, 0]),