/* 11:53:30 29/03/2017 [http://oystatic.ignimgs.com/src/core/js/lib/leaflet/leaflet-0.5.1.src.js, http://oystatic.ignimgs.com/src/core/js/bootstrap/bootstrap.js, http://oystatic.ignimgs.com/src/ignmedia/js/maps/maps.js, http://oystatic.ignimgs.com/src/core/js/widgets/../lib/leaflet/modules/leaflet.markercluster-src.js, http://oystatic.ignimgs.com/src/core/js/widgets/../external/jquery/plugins/jquery.lionbars.0.3.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/mixins/api.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/mixins/icon.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/mixins/types.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/mixins/maps.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/mixins/markers.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/ign/type.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/ign/marker.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/ign/pendingmarker.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/ign/markerclustergroup.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/ign/popupcontent/clustercontent.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/ign/popupcontent/content.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/ign/popupcontent/editcontent.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/ign/popupcontent/wikicontent.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/ign/popupcontent/pendingcontent.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/ign/map.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/ign/interactivemap.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/controls/fullscreen.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/controls/slidingview.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/controls/title.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/controls/loadingindicator.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/controls/searchbar.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/controls/overlayfilter.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/controls/contextmenu.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/controls/persistence.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/controls/moderation.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/controls/eventtracker.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/controls/externallink.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/controls/markeradder.js, http://oystatic.ignimgs.com/src/core/js/widgets/tools/maps/ign/interface.js, http://oystatic.ignimgs.com/src/core/js/widgets/global/page/footer.js, http://oystatic.ignimgs.com/src/core/js/widgets/global/page/optimizely.js, http://oystatic.ignimgs.com/src/core/js/widgets/global/page/globalheader/global-header.js, http://oystatic.ignimgs.com/src/core/js/widgets/global/page/globalheader/section_layout.js]*/ (function (k, i, l) { var b, o; typeof exports !== l + "" ? b = exports : (o = k.L, b = { noConflict: function () { k.L = o; return this } }, k.L = b); b.version = "0.5.1"; b.Util = { extend: function (a) { var c = Array.prototype.slice.call(arguments, 1), b, d, f, g; for (d = 0, f = c.length; d < f; d++) for (b in g = c[d] || {}, g) g.hasOwnProperty(b) && (a[b] = g[b]); return a }, bind: function (a, c) { var b = 2 < arguments.length ? Array.prototype.slice.call(arguments, 2) : null; return function () { return a.apply(c, b || arguments) } }, stamp: function () { var a = 0; return function (c) { c._leaflet_id = c._leaflet_id || ++a; return c._leaflet_id } }(), limitExecByInterval: function (a, c, b) { var d, f; return function h() { var j = arguments; d ? f = !0 : (d = !0, setTimeout(function () { d = !1; f && (h.apply(b, j), f = !1) }, c), a.apply(b, j)) } }, falseFn: function () { return !1 }, formatNum: function (a, c) { var b = Math.pow(10, c || 5); return Math.round(a * b) / b }, splitWords: function (a) { return a.replace(/^\s+|\s+$/g, "").split(/\s+/) }, setOptions: function (a, c) { a.options = b.extend({}, a.options, c); return a.options }, getParamString: function (a, c) { var b = [], d; for (d in a) a.hasOwnProperty(d) && b.push(d + "=" + a[d]); return (!c || -1 === c.indexOf("?") ? "?" : "&") + b.join("&") }, template: function (a, c) { return a.replace(/\{ *([\w_]+) *\}/g, function (a, b) { var f = c[b]; if (!c.hasOwnProperty(b)) throw Error("No value provided for variable " + a); return f }) }, isArray: function (a) { return "[object Array]" === Object.prototype.toString.call(a) }, emptyImageUrl: "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" }; (function () { function a(a) { var c, b, e = ["webkit", "moz", "o", "ms"]; for (c = 0; c < e.length && !b; c++) b = k[e[c] + a]; return b } function c(a) { var c = +new Date, b = Math.max(0, 16 - (c - e)); e = c + b; return k.setTimeout(a, b) } var e = 0, d = k.requestAnimationFrame || a("RequestAnimationFrame") || c, f = k.cancelAnimationFrame || a("CancelAnimationFrame") || a("CancelRequestAnimationFrame") || function (a) { k.clearTimeout(a) }; b.Util.requestAnimFrame = function (a, e, f, i) { a = b.bind(a, e); if (f && d === c) a(); else return d.call(k, a, i) }; b.Util.cancelAnimFrame = function (a) { a && f.call(k, a) } })(); b.extend = b.Util.extend; b.bind = b.Util.bind; b.stamp = b.Util.stamp; b.setOptions = b.Util.setOptions; b.Class = function () {}; b.Class.extend = function (a) { var c = function () { this.initialize && this.initialize.apply(this, arguments); this._initHooks && this.callInitHooks() }, e = function () {}; e.prototype = this.prototype; var d = new e; d.constructor = c; c.prototype = d; for (var f in this) this.hasOwnProperty(f) && "prototype" !== f && (c[f] = this[f]); a.statics && (b.extend(c, a.statics), delete a.statics); a.includes && (b.Util.extend.apply(null, [d].concat(a.includes)), delete a.includes); if (a.options && d.options) a.options = b.extend({}, d.options, a.options); b.extend(d, a); d._initHooks = []; var g = this; d.callInitHooks = function () { if (!this._initHooksCalled) { g.prototype.callInitHooks && g.prototype.callInitHooks.call(this); this._initHooksCalled = !0; for (var a = 0, c = d._initHooks.length; a < c; a++) d._initHooks[a].call(this) } }; return c }; b.Class.include = function (a) { b.extend(this.prototype, a) }; b.Class.mergeOptions = function (a) { b.extend(this.prototype.options, a) }; b.Class.addInitHook = function (a) { var c = Array.prototype.slice.call(arguments, 1), b; this.prototype._initHooks = this.prototype._initHooks || []; this.prototype._initHooks.push("function" === typeof a ? a : function () { this[a].apply(this, c) }) }; b.Mixin = {}; b.Mixin.Events = { addEventListener: function (a, c, e) { var d = this._leaflet_events = this._leaflet_events || {}, f, g; if ("object" === typeof a) { for (f in a) a.hasOwnProperty(f) && this.addEventListener(f, a[f], c); return this } a = b.Util.splitWords(a); for (f = 0, g = a.length; f < g; f++) d[a[f]] = d[a[f]] || [], d[a[f]].push({ action: c, context: e || this }); return this }, hasEventListeners: function (a) { return "_leaflet_events" in this && a in this._leaflet_events && 0 < this._leaflet_events[a].length }, removeEventListener: function (a, c, e) { var d = this._leaflet_events, f, g, h, j; if ("object" === typeof a) { for (f in a) a.hasOwnProperty(f) && this.removeEventListener(f, a[f], c); return this } a = b.Util.splitWords(a); for (f = 0, g = a.length; f < g; f++) if (this.hasEventListeners(a[f])) { h = d[a[f]]; for (j = h.length - 1; 0 <= j; j--)(!c || h[j].action === c) && (!e || h[j].context === e) && h.splice(j, 1) } return this }, fireEvent: function (a, c) { if (!this.hasEventListeners(a)) return this; for (var e = b.extend({ type: a, target: this }, c), d = this._leaflet_events[a].slice(), f = 0, g = d.length; f < g; f++) d[f].action.call(d[f].context || this, e); return this } }; b.Mixin.Events.on = b.Mixin.Events.addEventListener; b.Mixin.Events.off = b.Mixin.Events.removeEventListener; b.Mixin.Events.fire = b.Mixin.Events.fireEvent; (function () { var a = !!k.ActiveXObject, c = a && !k.XMLHttpRequest, e = a && !i.querySelector, d = navigator.userAgent.toLowerCase(), f = -1 !== d.indexOf("webkit"), g = -1 !== d.indexOf("chrome"), h = -1 !== d.indexOf("android"), d = -1 !== d.search("android [23]"), j = typeof orientation !== l + "", q = k.navigator && k.navigator.msPointerEnabled && k.navigator.msMaxTouchPoints, t = "devicePixelRatio" in k && 1 < k.devicePixelRatio || "matchMedia" in k && k.matchMedia("(min-resolution:144dpi)") && k.matchMedia("(min-resolution:144dpi)").matches, m = i.documentElement, n = a && "transition" in m.style, p = "WebKitCSSMatrix" in k && "m11" in new k.WebKitCSSMatrix, r = "MozPerspective" in m.style, s = "OTransition" in m.style, o = !k.L_DISABLE_3D && (n || p || r || s), u = !k.L_NO_TOUCH && function () { if (q || "ontouchstart" in m) return !0; var a = i.createElement("div"), c = !1; if (!a.setAttribute) return !1; a.setAttribute("ontouchstart", "return;"); "function" === typeof a.ontouchstart && (c = !0); a.removeAttribute("ontouchstart"); return c }(); b.Browser = { ie: a, ie6: c, ie7: e, webkit: f, android: h, android23: d, chrome: g, ie3d: n, webkit3d: p, gecko3d: r, opera3d: s, any3d: o, mobile: j, mobileWebkit: j && f, mobileWebkit3d: j && p, mobileOpera: j && k.opera, touch: u, msTouch: q, retina: t } })(); b.Point = function (a, c, b) { this.x = b ? Math.round(a) : a; this.y = b ? Math.round(c) : c }; b.Point.prototype = { clone: function () { return new b.Point(this.x, this.y) }, add: function (a) { return this.clone()._add(b.point(a)) }, _add: function (a) { this.x += a.x; this.y += a.y; return this }, subtract: function (a) { return this.clone()._subtract(b.point(a)) }, _subtract: function (a) { this.x -= a.x; this.y -= a.y; return this }, divideBy: function (a) { return this.clone()._divideBy(a) }, _divideBy: function (a) { this.x /= a; this.y /= a; return this }, multiplyBy: function (a) { return this.clone()._multiplyBy(a) }, _multiplyBy: function (a) { this.x *= a; this.y *= a; return this }, round: function () { return this.clone()._round() }, _round: function () { this.x = Math.round(this.x); this.y = Math.round(this.y); return this }, floor: function () { return this.clone()._floor() }, _floor: function () { this.x = Math.floor(this.x); this.y = Math.floor(this.y); return this }, distanceTo: function (a) { var a = b.point(a), c = a.x - this.x, a = a.y - this.y; return Math.sqrt(c * c + a * a) }, equals: function (a) { return a.x === this.x && a.y === this.y }, toString: function () { return "Point(" + b.Util.formatNum(this.x) + ", " + b.Util.formatNum(this.y) + ")" } }; b.point = function (a, c, e) { return a instanceof b.Point ? a : b.Util.isArray(a) ? new b.Point(a[0], a[1]) : isNaN(a) ? a : new b.Point(a, c, e) }; b.Bounds = function (a, c) { if (a) for (var b = c ? [a, c] : a, d = 0, f = b.length; d < f; d++) this.extend(b[d]) }; b.Bounds.prototype = { extend: function (a) { a = b.point(a); !this.min && !this.max ? (this.min = a.clone(), this.max = a.clone()) : (this.min.x = Math.min(a.x, this.min.x), this.max.x = Math.max(a.x, this.max.x), this.min.y = Math.min(a.y, this.min.y), this.max.y = Math.max(a.y, this.max.y)); return this }, getCenter: function (a) { return new b.Point((this.min.x + this.max.x) / 2, (this.min.y + this.max.y) / 2, a) }, getBottomLeft: function () { return new b.Point(this.min.x, this.max.y) }, getTopRight: function () { return new b.Point(this.max.x, this.min.y) }, getSize: function () { return this.max.subtract(this.min) }, contains: function (a) { var c, a = "number" === typeof a[0] || a instanceof b.Point ? b.point(a) : b.bounds(a); a instanceof b.Bounds ? (c = a.min, a = a.max) : c = a; return c.x >= this.min.x && a.x <= this.max.x && c.y >= this.min.y && a.y <= this.max.y }, intersects: function (a) { var a = b.bounds(a), c = this.min, e = this.max, d = a.min, a = a.max, f = a.y >= c.y && d.y <= e.y; return a.x >= c.x && d.x <= e.x && f }, isValid: function () { return !(!this.min || !this.max) } }; b.bounds = function (a, c) { return !a || a instanceof b.Bounds ? a : new b.Bounds(a, c) }; b.Transformation = function (a, c, b, d) { this._a = a; this._b = c; this._c = b; this._d = d }; b.Transformation.prototype = { transform: function (a, c) { return this._transform(a.clone(), c) }, _transform: function (a, c) { c = c || 1; a.x = c * (this._a * a.x + this._b); a.y = c * (this._c * a.y + this._d); return a }, untransform: function (a, c) { c = c || 1; return new b.Point((a.x / c - this._b) / this._a, (a.y / c - this._d) / this._c) } }; b.DomUtil = { get: function (a) { return "string" === typeof a ? i.getElementById(a) : a }, getStyle: function (a, c) { var b = a.style[c]; !b && a.currentStyle && (b = a.currentStyle[c]); if ((!b || "auto" === b) && i.defaultView) b = (b = i.defaultView.getComputedStyle(a, null)) ? b[c] : null; return "auto" === b ? null : b }, getViewportOffset: function (a) { var c = 0, e = 0, d = a, f = i.body, g, h = b.Browser.ie7; do { c += d.offsetTop || 0; e += d.offsetLeft || 0; c += parseInt(b.DomUtil.getStyle(d, "borderTopWidth"), 10) || 0; e += parseInt(b.DomUtil.getStyle(d, "borderLeftWidth"), 10) || 0; g = b.DomUtil.getStyle(d, "position"); if (d.offsetParent === f && "absolute" === g) break; if ("fixed" === g) { c += f.scrollTop || 0; e += f.scrollLeft || 0; break } d = d.offsetParent } while (d); d = a; do { if (d === f) break; c -= d.scrollTop || 0; e -= d.scrollLeft || 0; if (!b.DomUtil.documentIsLtr() && (b.Browser.webkit || h)) e += d.scrollWidth - d.clientWidth, h && "hidden" !== b.DomUtil.getStyle(d, "overflow-y") && "hidden" !== b.DomUtil.getStyle(d, "overflow") && (e += 17); d = d.parentNode } while (d); return new b.Point(e, c) }, documentIsLtr: function () { if (!b.DomUtil._docIsLtrCached) b.DomUtil._docIsLtrCached = !0, b.DomUtil._docIsLtr = "ltr" === b.DomUtil.getStyle(i.body, "direction"); return b.DomUtil._docIsLtr }, create: function (a, c, b) { a = i.createElement(a); a.className = c; b && b.appendChild(a); return a }, disableTextSelection: function () { i.selection && i.selection.empty && i.selection.empty(); if (!this._onselectstart) this._onselectstart = i.onselectstart || null, i.onselectstart = b.Util.falseFn }, enableTextSelection: function () { if (i.onselectstart === b.Util.falseFn) i.onselectstart = this._onselectstart, this._onselectstart = null }, hasClass: function (a, c) { return 0 < a.className.length && RegExp("(^|\\s)" + c + "(\\s|$)").test(a.className) }, addClass: function (a, c) { b.DomUtil.hasClass(a, c) || (a.className += (a.className ? " " : "") + c) }, removeClass: function (a, c) { a.className = a.className.replace(/(\S+)\s*/g, function (a, b) { return b === c ? "" : a }).replace(/(^\s+|\s+$)/, "") }, setOpacity: function (a, c) { if ("opacity" in a.style) a.style.opacity = c; else if ("filter" in a.style) { var b = !1; try { b = a.filters.item("DXImageTransform.Microsoft.Alpha") } catch (d) {} c = Math.round(100 * c); b ? (b.Enabled = 100 !== c, b.Opacity = c) : a.style.filter += " progid:DXImageTransform.Microsoft.Alpha(opacity=" + c + ")" } }, testProp: function (a) { for (var c = i.documentElement.style, b = 0; b < a.length; b++) if (a[b] in c) return a[b]; return !1 }, getTranslateString: function (a) { var c = b.Browser.webkit3d; return "translate" + (c ? "3d" : "") + "(" + a.x + "px," + a.y + "px" + ((c ? ",0" : "") + ")") }, getScaleString: function (a, c) { return b.DomUtil.getTranslateString(c.add(c.multiplyBy(-1 * a))) + (" scale(" + a + ") ") }, setPosition: function (a, c, e) { a._leaflet_pos = c; if (!e && b.Browser.any3d) { if (a.style[b.DomUtil.TRANSFORM] = b.DomUtil.getTranslateString(c), b.Browser.mobileWebkit3d) a.style.WebkitBackfaceVisibility = "hidden" } else a.style.left = c.x + "px", a.style.top = c.y + "px" }, getPosition: function (a) { return a._leaflet_pos } }; b.DomUtil.TRANSFORM = b.DomUtil.testProp(["transform", "WebkitTransform", "OTransform", "MozTransform", "msTransform"]); b.DomUtil.TRANSITION = b.DomUtil.testProp(["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition" ]); b.DomUtil.TRANSITION_END = "webkitTransition" === b.DomUtil.TRANSITION || "OTransition" === b.DomUtil.TRANSITION ? b.DomUtil.TRANSITION + "End" : "transitionend"; b.LatLng = function (a, c) { var b = parseFloat(a), d = parseFloat(c); if (isNaN(b) || isNaN(d)) throw Error("Invalid LatLng object: (" + a + ", " + c + ")"); this.lat = b; this.lng = d }; b.extend(b.LatLng, { DEG_TO_RAD: Math.PI / 180, RAD_TO_DEG: 180 / Math.PI, MAX_MARGIN: 1.0E-9 }); b.LatLng.prototype = { equals: function (a) { if (!a) return !1; a = b.latLng(a); return Math.max(Math.abs(this.lat - a.lat), Math.abs(this.lng - a.lng)) <= b.LatLng.MAX_MARGIN }, toString: function (a) { return "LatLng(" + b.Util.formatNum(this.lat, a) + ", " + b.Util.formatNum(this.lng, a) + ")" }, distanceTo: function (a) { var a = b.latLng(a), c = b.LatLng.DEG_TO_RAD, e = (a.lng - this.lng) * c, d = this.lat * c, f = a.lat * c, a = Math.sin((a.lat - this.lat) * c / 2), e = Math.sin(e / 2), d = a * a + e * e * Math.cos(d) * Math.cos(f); return 12756274 * Math.atan2(Math.sqrt(d), Math.sqrt(1 - d)) }, wrap: function (a, c) { var e = this.lng, a = a || -180, c = c || 180; return new b.LatLng(this.lat, (e + c) % (c - a) + (e < a || e === c ? c : a)) } }; b.latLng = function (a, c) { return a instanceof b.LatLng ? a : b.Util.isArray(a) ? new b.LatLng(a[0], a[1]) : isNaN(a) ? a : new b.LatLng(a, c) }; b.LatLngBounds = function (a, c) { if (a) for (var b = c ? [a, c] : a, d = 0, f = b.length; d < f; d++) this.extend(b[d]) }; b.LatLngBounds.prototype = { extend: function (a) { a = "number" === typeof a[0] || "string" === typeof a[0] || a instanceof b.LatLng ? b.latLng(a) : b.latLngBounds(a); a instanceof b.LatLng ? !this._southWest && !this._northEast ? (this._southWest = new b.LatLng(a.lat, a.lng), this._northEast = new b.LatLng(a.lat, a.lng)) : (this._southWest.lat = Math.min(a.lat, this._southWest.lat), this._southWest.lng = Math.min(a.lng, this._southWest.lng), this._northEast.lat = Math.max(a.lat, this._northEast.lat), this._northEast.lng = Math.max(a.lng, this._northEast.lng)) : a instanceof b.LatLngBounds && (this.extend(a._southWest), this.extend(a._northEast)); return this }, pad: function (a) { var c = this._southWest, e = this._northEast, d = Math.abs(c.lat - e.lat) * a, a = Math.abs(c.lng - e.lng) * a; return new b.LatLngBounds(new b.LatLng(c.lat - d, c.lng - a), new b.LatLng(e.lat + d, e.lng + a)) }, getCenter: function () { return new b.LatLng((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 b.LatLng(this._northEast.lat, this._southWest.lng) }, getSouthEast: function () { return new b.LatLng(this._southWest.lat, this._northEast.lng) }, contains: function (a) { var a = "number" === typeof a[0] || a instanceof b.LatLng ? b.latLng(a) : b.latLngBounds(a), c = this._southWest, e = this._northEast, d; a instanceof b.LatLngBounds ? (d = a.getSouthWest(), a = a.getNorthEast()) : d = a; return d.lat >= c.lat && a.lat <= e.lat && d.lng >= c.lng && a.lng <= e.lng }, intersects: function (a) { var a = b.latLngBounds(a), c = this._southWest, e = this._northEast, d = a.getSouthWest(), a = a.getNorthEast(), f = a.lng >= c.lng && d.lng <= e.lng; return a.lat >= c.lat && d.lat <= e.lat && f }, toBBoxString: function () { var a = this._southWest, c = this._northEast; return [a.lng, a.lat, c.lng, c.lat].join() }, equals: function (a) { if (!a) return !1; a = b.latLngBounds(a); return this._southWest.equals(a.getSouthWest()) && this._northEast.equals(a.getNorthEast()) }, isValid: function () { return !(!this._southWest || !this._northEast) } }; b.latLngBounds = function (a, c) { return !a || a instanceof b.LatLngBounds ? a : new b.LatLngBounds(a, c) }; b.Projection = {}; b.Projection.SphericalMercator = { MAX_LATITUDE: 85.0511287798, project: function (a) { var c = b.LatLng.DEG_TO_RAD, e = this.MAX_LATITUDE, e = Math.max(Math.min(e, a.lat), -e), a = a.lng * c, c = Math.log(Math.tan(Math.PI / 4 + e * c / 2)); return new b.Point(a, c) }, unproject: function (a) { var c = b.LatLng.RAD_TO_DEG, e = a.x * c, a = (2 * Math.atan(Math.exp(a.y)) - Math.PI / 2) * c; return new b.LatLng(a, e) } }; b.Projection.LonLat = { project: function (a) { return new b.Point(a.lng, a.lat) }, unproject: function (a) { return new b.LatLng(a.y, a.x) } }; b.CRS = { latLngToPoint: function (a, c) { var b = this.projection.project(a), d = this.scale(c); return this.transformation._transform(b, d) }, pointToLatLng: function (a, c) { var b = this.scale(c); return this.projection.unproject(this.transformation.untransform(a, b)) }, project: function (a) { return this.projection.project(a) }, scale: function (a) { return 256 * Math.pow(2, a) } }; b.CRS.Simple = b.extend({}, b.CRS, { projection: b.Projection.LonLat, transformation: new b.Transformation(1, 0, -1, 0), scale: function (a) { return Math.pow(2, a) } }); b.CRS.EPSG3857 = b.extend({}, b.CRS, { code: "EPSG:3857", projection: b.Projection.SphericalMercator, transformation: new b.Transformation(0.5 / Math.PI, 0.5, -0.5 / Math.PI, 0.5), project: function (a) { return this.projection.project(a).multiplyBy(6378137) } }); b.CRS.EPSG900913 = b.extend({}, b.CRS.EPSG3857, { code: "EPSG:900913" }); b.CRS.EPSG4326 = b.extend({}, b.CRS, { code: "EPSG:4326", projection: b.Projection.LonLat, transformation: new b.Transformation(1 / 360, 0.5, -1 / 360, 0.5) }); b.Map = b.Class.extend({ includes: b.Mixin.Events, options: { crs: b.CRS.EPSG3857, fadeAnimation: b.DomUtil.TRANSITION && !b.Browser.android23, trackResize: !0, markerZoomAnimation: b.DomUtil.TRANSITION && b.Browser.any3d }, initialize: function (a, c) { c = b.setOptions(this, c); this._initContainer(a); this._initLayout(); this.callInitHooks(); this._initEvents(); c.maxBounds && this.setMaxBounds(c.maxBounds); c.center && c.zoom !== l && this.setView(b.latLng(c.center), c.zoom, !0); this._initLayers(c.layers) }, setView: function (a, c) { this._resetView(b.latLng(a), this._limitZoom(c)); return this }, setZoom: function (a) { return this.setView(this.getCenter(), a) }, zoomIn: function (a) { return this.setZoom(this._zoom + (a || 1)) }, zoomOut: function (a) { return this.setZoom(this._zoom - (a || 1)) }, fitBounds: function (a) { var c = this.getBoundsZoom(a); return this.setView(b.latLngBounds(a).getCenter(), c) }, fitWorld: function () { var a = new b.LatLng(-60, -170), c = new b.LatLng(85, 179); return this.fitBounds(new b.LatLngBounds(a, c)) }, panTo: function (a) { return this.setView(a, this._zoom) }, panBy: function (a) { this.fire("movestart"); this._rawPanBy(b.point(a)); this.fire("move"); return this.fire("moveend") }, setMaxBounds: function (a) { a = b.latLngBounds(a); this.options.maxBounds = a; if (!a) return this._boundsMinZoom = null, this; var c = this.getBoundsZoom(a, !0); this._boundsMinZoom = c; this._loaded && (this._zoom < c ? this.setView(a.getCenter(), c) : this.panInsideBounds(a)); return this }, panInsideBounds: function (a) { var a = b.latLngBounds(a), c = this.getBounds(), e = this.project(c.getSouthWest()), c = this.project(c.getNorthEast()), d = this.project(a.getSouthWest()), a = this.project(a.getNorthEast()), f = 0, g = 0; c.y < a.y && (g = a.y - c.y); c.x > a.x && (f = a.x - c.x); e.y > d.y && (g = d.y - e.y); e.x < d.x && (f = d.x - e.x); return this.panBy(new b.Point(f, g, !0)) }, addLayer: function (a) { var c = b.stamp(a); if (this._layers[c]) return this; this._layers[c] = a; if (a.options && (!isNaN(a.options.maxZoom) || !isNaN(a.options.minZoom))) this._zoomBoundLayers[c] = a, this._updateZoomLevels(); this.options.zoomAnimation && b.TileLayer && a instanceof b.TileLayer && (this._tileLayersNum++, this._tileLayersToLoad++, a.on("load", this._onTileLayerLoad, this)); this.whenReady(function () { a.onAdd(this); this.fire("layeradd", { layer: a }) }, this); return this }, removeLayer: function (a) { var c = b.stamp(a); if (this._layers[c]) return a.onRemove(this), delete this._layers[c], this._zoomBoundLayers[c] && (delete this._zoomBoundLayers[c], this._updateZoomLevels()), this.options.zoomAnimation && b.TileLayer && a instanceof b.TileLayer && (this._tileLayersNum--, this._tileLayersToLoad--, a.off("load", this._onTileLayerLoad, this)), this.fire("layerremove", { layer: a }) }, hasLayer: function (a) { return this._layers.hasOwnProperty(b.stamp(a)) }, invalidateSize: function (a) { var c = this.getSize(); this._sizeChanged = !0; this.options.maxBounds && this.setMaxBounds(this.options.maxBounds); if (!this._loaded) return this; c = c._subtract(this.getSize())._divideBy(2)._round(); !0 === a ? this.panBy(c) : (this._rawPanBy(c), this.fire("move"), clearTimeout(this._sizeTimer), this._sizeTimer = setTimeout(b.bind(this.fire, this, "moveend"), 200)); return this }, addHandler: function (a, c) { if (c) return this[a] = new c(this), this.options[a] && this[a].enable(), this }, getCenter: function () { return this.layerPointToLatLng(this._getCenterLayerPoint()) }, getZoom: function () { return this._zoom }, getBounds: function () { var a = this.getPixelBounds(), c = this.unproject(a.getBottomLeft()), a = this.unproject(a.getTopRight()); return new b.LatLngBounds(c, a) }, getMinZoom: function () { return Math.max(this.options.minZoom || 0, this._layersMinZoom || 0, this._boundsMinZoom || 0) }, getMaxZoom: function () { return Math.min(this.options.maxZoom === l ? Infinity : this.options.maxZoom, this._layersMaxZoom === l ? Infinity : this._layersMaxZoom) }, getBoundsZoom: function (a, c) { var a = b.latLngBounds(a), e = this.getSize(), d = this.options.minZoom || 0, f = this.getMaxZoom(), g = a.getNorthEast(), h = a.getSouthWest(), j, i; j = !0; c && d--; do d++, j = this.project(g, d), i = this.project(h, d), j = new b.Point(Math.abs(j.x - i.x), Math.abs(i.y - j.y)), j = c ? j.x < e.x || j.y < e.y : j.x <= e.x && j.y <= e.y; while (j && d <= f); return j && c ? null : c ? d : d - 1 }, getSize: function () { if (!this._size || this._sizeChanged) this._size = new b.Point(this._container.clientWidth, this._container.clientHeight), this._sizeChanged = !1; return this._size.clone() }, getPixelBounds: function () { var a = this._getTopLeftPoint(); return new b.Bounds(a, a.add(this.getSize())) }, getPixelOrigin: function () { return this._initialTopLeftPoint }, getPanes: function () { return this._panes }, getContainer: function () { return this._container }, getZoomScale: function (a) { var c = this.options.crs; return c.scale(a) / c.scale(this._zoom) }, getScaleZoom: function (a) { return this._zoom + Math.log(a) / Math.LN2 }, project: function (a, c) { c = c === l ? this._zoom : c; return this.options.crs.latLngToPoint(b.latLng(a), c) }, unproject: function (a, c) { c = c === l ? this._zoom : c; return this.options.crs.pointToLatLng(b.point(a), c) }, layerPointToLatLng: function (a) { return this.unproject(b.point(a).add(this._initialTopLeftPoint)) }, latLngToLayerPoint: function (a) { return this.project(b.latLng(a))._round()._subtract(this._initialTopLeftPoint) }, containerPointToLayerPoint: function (a) { return b.point(a).subtract(this._getMapPanePos()) }, layerPointToContainerPoint: function (a) { return b.point(a).add(this._getMapPanePos()) }, containerPointToLatLng: function (a) { return this.layerPointToLatLng(this.containerPointToLayerPoint(b.point(a))) }, latLngToContainerPoint: function (a) { return this.layerPointToContainerPoint(this.latLngToLayerPoint(b.latLng(a))) }, mouseEventToContainerPoint: function (a) { return b.DomEvent.getMousePosition(a, this._container) }, mouseEventToLayerPoint: function (a) { return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(a)) }, mouseEventToLatLng: function (a) { return this.layerPointToLatLng(this.mouseEventToLayerPoint(a)) }, _initContainer: function (a) { a = this._container = b.DomUtil.get(a); if (a._leaflet) throw Error("Map container is already initialized."); a._leaflet = !0 }, _initLayout: function () { var a = this._container; b.DomUtil.addClass(a, "leaflet-container"); b.Browser.touch && b.DomUtil.addClass(a, "leaflet-touch"); this.options.fadeAnimation && b.DomUtil.addClass(a, "leaflet-fade-anim"); var c = b.DomUtil.getStyle(a, "position"); if ("absolute" !== c && "relative" !== c && "fixed" !== c) a.style.position = "relative"; this._initPanes(); this._initControlPos && this._initControlPos() }, _initPanes: function () { var a = this._panes = {}; this._mapPane = a.mapPane = this._createPane("leaflet-map-pane", this._container); this._tilePane = a.tilePane = this._createPane("leaflet-tile-pane", this._mapPane); a.objectsPane = this._createPane("leaflet-objects-pane", this._mapPane); a.shadowPane = this._createPane("leaflet-shadow-pane"); a.overlayPane = this._createPane("leaflet-overlay-pane"); a.markerPane = this._createPane("leaflet-marker-pane"); a.popupPane = this._createPane("leaflet-popup-pane"); this.options.markerZoomAnimation || (b.DomUtil.addClass(a.markerPane, " leaflet-zoom-hide"), b.DomUtil.addClass(a.shadowPane, " leaflet-zoom-hide"), b.DomUtil.addClass(a.popupPane, " leaflet-zoom-hide")) }, _createPane: function (a, c) { return b.DomUtil.create("div", a, c || this._panes.objectsPane) }, _initLayers: function (a) { a = a ? b.Util.isArray(a) ? a : [a] : []; this._layers = {}; this._zoomBoundLayers = {}; this._tileLayersNum = 0; var c, e; for (c = 0, e = a.length; c < e; c++) this.addLayer(a[c]) }, _resetView: function (a, c, e, d) { var f = this._zoom !== c; d || (this.fire("movestart"), f && this.fire("zoomstart")); this._zoom = c; this._initialTopLeftPoint = this._getNewTopLeftPoint(a); e ? this._initialTopLeftPoint._add(this._getMapPanePos()) : b.DomUtil.setPosition(this._mapPane, new b.Point(0, 0)); this._tileLayersToLoad = this._tileLayersNum; a = !this._loaded; this._loaded = !0; this.fire("viewreset", { hard: !e }); this.fire("move"); (f || d) && this.fire("zoomend"); this.fire("moveend", { hard: !e }); a && this.fire("load") }, _rawPanBy: function (a) { b.DomUtil.setPosition(this._mapPane, this._getMapPanePos().subtract(a)) }, _updateZoomLevels: function () { var a, c = Infinity, b = -Infinity; for (a in this._zoomBoundLayers) if (this._zoomBoundLayers.hasOwnProperty(a)) { var d = this._zoomBoundLayers[a]; isNaN(d.options.minZoom) || (c = Math.min(c, d.options.minZoom)); isNaN(d.options.maxZoom) || (b = Math.max(b, d.options.maxZoom)) } a === l ? this._layersMaxZoom = this._layersMinZoom = l : (this._layersMaxZoom = b, this._layersMinZoom = c) }, _initEvents: function () { if (b.DomEvent) { b.DomEvent.on(this._container, "click", this._onMouseClick, this); var a = "dblclick,mousedown,mouseup,mouseenter,mouseleave,mousemove,contextmenu".split(","), c, e; for (c = 0, e = a.length; c < e; c++) b.DomEvent.on(this._container, a[c], this._fireMouseEvent, this); if (this.options.trackResize) b.DomEvent.on(k, "resize", this._onResize, this) } }, _onResize: function () { b.Util.cancelAnimFrame(this._resizeRequest); this._resizeRequest = b.Util.requestAnimFrame(this.invalidateSize, this, !1, this._container) }, _onMouseClick: function (a) { if (this._loaded && (!this.dragging || !this.dragging.moved())) this.fire("preclick"), this._fireMouseEvent(a) }, _fireMouseEvent: function (a) { if (this._loaded) { var c = a.type, c = "mouseenter" === c ? "mouseover" : "mouseleave" === c ? "mouseout" : c; if (this.hasEventListeners(c)) { "contextmenu" === c && b.DomEvent.preventDefault(a); var e = this.mouseEventToContainerPoint(a), d = this.containerPointToLayerPoint(e), f = this.layerPointToLatLng(d); this.fire(c, { latlng: f, layerPoint: d, containerPoint: e, originalEvent: a }) } } }, _onTileLayerLoad: function () { this._tileLayersToLoad--; if (this._tileLayersNum && !this._tileLayersToLoad && this._tileBg) clearTimeout(this._clearTileBgTimer), this._clearTileBgTimer = setTimeout(b.bind(this._clearTileBg, this), 500) }, whenReady: function (a, c) { if (this._loaded) a.call(c || this, this); else this.on("load", a, c); return this }, _getMapPanePos: function () { return b.DomUtil.getPosition(this._mapPane) }, _getTopLeftPoint: function () { if (!this._loaded) throw Error("Set map center and zoom first."); return this._initialTopLeftPoint.subtract(this._getMapPanePos()) }, _getNewTopLeftPoint: function (a, c) { var b = this.getSize()._divideBy(2); return this.project(a, c)._subtract(b)._round() }, _latLngToNewLayerPoint: function (a, c, b) { b = this._getNewTopLeftPoint(b, c).add(this._getMapPanePos()); return this.project(a, c)._subtract(b) }, _getCenterLayerPoint: function () { return this.containerPointToLayerPoint(this.getSize()._divideBy(2)) }, _getCenterOffset: function (a) { return this.latLngToLayerPoint(a).subtract(this._getCenterLayerPoint()) }, _limitZoom: function (a) { var c = this.getMinZoom(), b = this.getMaxZoom(); return Math.max(c, Math.min(b, a)) } }); b.map = function (a, c) { return new b.Map(a, c) }; b.Projection.Mercator = { MAX_LATITUDE: 85.0840591556, R_MINOR: 6356752.3142, R_MAJOR: 6378137, project: function (a) { var c = b.LatLng.DEG_TO_RAD, e = this.MAX_LATITUDE, d = Math.max(Math.min(e, a.lat), -e), f = this.R_MAJOR, e = this.R_MINOR, a = a.lng * c * f, c = d * c, f = e / f, f = Math.sqrt(1 - f * f), d = f * Math.sin(c), d = Math.pow((1 - d) / (1 + d), 0.5 * f), c = Math.tan(0.5 * (0.5 * Math.PI - c)) / d, c = -e * Math.log(c); return new b.Point(a, c) }, unproject: function (a) { for (var c = b.LatLng.RAD_TO_DEG, e = this.R_MAJOR, d = this.R_MINOR, f = a.x * c / e, e = d / e, e = Math.sqrt(1 - e * e), a = Math.exp(-a.y / d), d = Math.PI / 2 - 2 * Math.atan(a), g = 15, h = 0.1; 1.0E-7 < Math.abs(h) && 0 < --g;) h = e * Math.sin(d), h = Math.PI / 2 - 2 * Math.atan(a * Math.pow((1 - h) / (1 + h), 0.5 * e)) - d, d += h; return new b.LatLng(d * c, f) } }; b.CRS.EPSG3395 = b.extend({}, b.CRS, { code: "EPSG:3395", projection: b.Projection.Mercator, transformation: function () { var a = b.Projection.Mercator; return new b.Transformation(0.5 / (Math.PI * a.R_MAJOR), 0.5, -0.5 / (Math.PI * a.R_MINOR), 0.5) }() }); b.TileLayer = b.Class.extend({ includes: b.Mixin.Events, options: { minZoom: 0, maxZoom: 18, tileSize: 256, subdomains: "abc", errorTileUrl: "", attribution: "", zoomOffset: 0, opacity: 1, unloadInvisibleTiles: b.Browser.mobile, updateWhenIdle: b.Browser.mobile }, initialize: function (a, c) { c = b.setOptions(this, c); if (c.detectRetina && b.Browser.retina && 0 < c.maxZoom) c.tileSize = Math.floor(c.tileSize / 2), c.zoomOffset++, 0 < c.minZoom && c.minZoom--, this.options.maxZoom--; this._url = a; var e = this.options.subdomains; if ("string" === typeof e) this.options.subdomains = e.split("") }, onAdd: function (a) { this._map = a; this._initContainer(); this._createTileProto(); a.on({ viewreset: this._resetCallback, moveend: this._update }, this); if (!this.options.updateWhenIdle) this._limitedUpdate = b.Util.limitExecByInterval(this._update, 150, this), a.on("move", this._limitedUpdate, this); this._reset(); this._update() }, addTo: function (a) { a.addLayer(this); return this }, onRemove: function (a) { this._container.parentNode.removeChild(this._container); a.off({ viewreset: this._resetCallback, moveend: this._update }, this); this.options.updateWhenIdle || a.off("move", this._limitedUpdate, this); this._map = this._container = null }, bringToFront: function () { var a = this._map._panes.tilePane; this._container && (a.appendChild(this._container), this._setAutoZIndex(a, Math.max)); return this }, bringToBack: function () { var a = this._map._panes.tilePane; this._container && (a.insertBefore(this._container, a.firstChild), this._setAutoZIndex(a, Math.min)); return this }, getAttribution: function () { return this.options.attribution }, setOpacity: function (a) { this.options.opacity = a; this._map && this._updateOpacity(); return this }, setZIndex: function (a) { this.options.zIndex = a; this._updateZIndex(); return this }, setUrl: function (a, c) { this._url = a; c || this.redraw(); return this }, redraw: function () { if (this._map) this._map._panes.tilePane.empty = !1, this._reset(!0), this._update(); return this }, _updateZIndex: function () { if (this._container && this.options.zIndex !== l) this._container.style.zIndex = this.options.zIndex }, _setAutoZIndex: function (a, c) { var b = a.children, d = -c(Infinity, -Infinity), f, g, h; for (g = 0, h = b.length; g < h; g++) b[g] !== this._container && (f = parseInt(b[g].style.zIndex, 10), isNaN(f) || (d = c(d, f))); this.options.zIndex = this._container.style.zIndex = (isFinite(d) ? d : 0) + c(1, -1) }, _updateOpacity: function () { b.DomUtil.setOpacity(this._container, this.options.opacity); var a, c = this._tiles; if (b.Browser.webkit) for (a in c) c.hasOwnProperty(a) && (c[a].style.webkitTransform += " translate(0,0)") }, _initContainer: function () { var a = this._map._panes.tilePane; if (!this._container || a.empty) this._container = b.DomUtil.create("div", "leaflet-layer"), this._updateZIndex(), a.appendChild(this._container), 1 > this.options.opacity && this._updateOpacity() }, _resetCallback: function (a) { this._reset(a.hard) }, _reset: function (a) { var c = this._tiles, b; for (b in c) c.hasOwnProperty(b) && this.fire("tileunload", { tile: c[b] }); this._tiles = {}; this._tilesToLoad = 0; if (this.options.reuseTiles) this._unusedTiles = []; if (a && this._container) this._container.innerHTML = ""; this._initContainer() }, _update: function () { if (this._map) { var a = this._map.getPixelBounds(), c = this._map.getZoom(), e = this.options.tileSize; c > this.options.maxZoom || c < this.options.minZoom || (c = new b.Point(Math.floor(a.min.x / e), Math.floor(a.min.y / e)), a = new b.Point(Math.floor(a.max.x / e), Math.floor(a.max.y / e)), a = new b.Bounds(c, a), this._addTilesFromCenterOut(a), (this.options.unloadInvisibleTiles || this.options.reuseTiles) && this._removeOtherTiles(a)) } }, _addTilesFromCenterOut: function (a) { var c = [], e = a.getCenter(), d, f, g; for (d = a.min.y; d <= a.max.y; d++) for (f = a.min.x; f <= a.max.x; f++) g = new b.Point(f, d), this._tileShouldBeLoaded(g) && c.push(g); a = c.length; if (0 !== a) { c.sort(function (a, c) { return a.distanceTo(e) - c.distanceTo(e) }); d = i.createDocumentFragment(); this._tilesToLoad || this.fire("loading"); this._tilesToLoad += a; for (f = 0; f < a; f++) this._addTile(c[f], d); this._container.appendChild(d) } }, _tileShouldBeLoaded: function (a) { if (a.x + ":" + a.y in this._tiles) return !1; if (!this.options.continuousWorld) { var c = this._getWrapTileNum(); if (this.options.noWrap && (0 > a.x || a.x >= c) || 0 > a.y || a.y >= c) return !1 } return !0 }, _removeOtherTiles: function (a) { var c, b, d; for (d in this._tiles) this._tiles.hasOwnProperty(d) && (c = d.split(":"), b = parseInt(c[0], 10), c = parseInt(c[1], 10), (b < a.min.x || b > a.max.x || c < a.min.y || c > a.max.y) && this._removeTile(d)) }, _removeTile: function (a) { var c = this._tiles[a]; this.fire("tileunload", { tile: c, url: c.src }); this.options.reuseTiles ? (b.DomUtil.removeClass(c, "leaflet-tile-loaded"), this._unusedTiles.push(c)) : c.parentNode === this._container && this._container.removeChild(c); if (!b.Browser.android) c.src = b.Util.emptyImageUrl; delete this._tiles[a] }, _addTile: function (a, c) { var e = this._getTilePos(a), d = this._getTile(); b.DomUtil.setPosition(d, e, b.Browser.chrome || b.Browser.android23); this._tiles[a.x + ":" + a.y] = d; this._loadTile(d, a); d.parentNode !== this._container && c.appendChild(d) }, _getZoomForUrl: function () { var a = this.options, c = this._map.getZoom(); a.zoomReverse && (c = a.maxZoom - c); return c + a.zoomOffset }, _getTilePos: function (a) { var c = this._map.getPixelOrigin(); return a.multiplyBy(this.options.tileSize).subtract(c) }, getTileUrl: function (a) { this._adjustTilePoint(a); return b.Util.template(this._url, b.extend({ s: this._getSubdomain(a), z: this._getZoomForUrl(), x: a.x, y: a.y }, this.options)) }, _getWrapTileNum: function () { return Math.pow(2, this._getZoomForUrl()) }, _adjustTilePoint: function (a) { var c = this._getWrapTileNum(); if (!this.options.continuousWorld && !this.options.noWrap) a.x = (a.x % c + c) % c; if (this.options.tms) a.y = c - a.y - 1 }, _getSubdomain: function (a) { return this.options.subdomains[(a.x + a.y) % this.options.subdomains.length] }, _createTileProto: function () { var a = this._tileImg = b.DomUtil.create("img", "leaflet-tile"); a.style.width = a.style.height = this.options.tileSize + "px"; a.galleryimg = "no" }, _getTile: function () { if (this.options.reuseTiles && 0 < this._unusedTiles.length) { var a = this._unusedTiles.pop(); this._resetTile(a); return a } return this._createTile() }, _resetTile: function () {}, _createTile: function () { var a = this._tileImg.cloneNode(!1); a.onselectstart = a.onmousemove = b.Util.falseFn; return a }, _loadTile: function (a, c) { a._layer = this; a.onload = this._tileOnLoad; a.onerror = this._tileOnError; a.src = this.getTileUrl(c) }, _tileLoaded: function () { this._tilesToLoad--; this._tilesToLoad || this.fire("load") }, _tileOnLoad: function () { var a = this._layer; this.src !== b.Util.emptyImageUrl && (b.DomUtil.addClass(this, "leaflet-tile-loaded"), a.fire("tileload", { tile: this, url: this.src })); a._tileLoaded() }, _tileOnError: function () { var a = this._layer; a.fire("tileerror", { tile: this, url: this.src }); var c = a.options.errorTileUrl; if (c) this.src = c; a._tileLoaded() } }); b.tileLayer = function (a, c) { return new b.TileLayer(a, c) }; b.TileLayer.WMS = b.TileLayer.extend({ defaultWmsParams: { service: "WMS", request: "GetMap", version: "1.1.1", layers: "", styles: "", format: "image/jpeg", transparent: !1 }, initialize: function (a, c) { this._url = a; var e = b.extend({}, this.defaultWmsParams); e.width = c.detectRetina && b.Browser.retina ? e.height = 2 * this.options.tileSize : e.height = this.options.tileSize; for (var d in c) this.options.hasOwnProperty(d) || (e[d] = c[d]); this.wmsParams = e; b.setOptions(this, c) }, onAdd: function (a) { this.wmsParams[1.3 <= parseFloat(this.wmsParams.version) ? "crs" : "srs"] = a.options.crs.code; b.TileLayer.prototype.onAdd.call(this, a) }, getTileUrl: function (a, c) { this._adjustTilePoint(a); var e = this._map, d = e.options.crs, f = this.options.tileSize, g = a.multiplyBy(f), f = g.add(new b.Point(f, f)), g = d.project(e.unproject(g, c)), e = d.project(e.unproject(f, c)), e = [g.x, e.y, e.x, g.y].join(), d = b.Util.template(this._url, { s: this._getSubdomain(a) }); return d + b.Util.getParamString(this.wmsParams, d) + "&bbox=" + e }, setParams: function (a, c) { b.extend(this.wmsParams, a); c || this.redraw(); return this } }); b.tileLayer.wms = function (a, c) { return new b.TileLayer.WMS(a, c) }; b.TileLayer.Canvas = b.TileLayer.extend({ options: { async: !1 }, initialize: function (a) { b.setOptions(this, a) }, redraw: function () { var a = this._tiles, c; for (c in a) a.hasOwnProperty(c) && this._redrawTile(a[c]) }, _redrawTile: function (a) { this.drawTile(a, a._tilePoint, this._map._zoom) }, _createTileProto: function () { var a = this._canvasProto = b.DomUtil.create("canvas", "leaflet-tile"); a.width = a.height = this.options.tileSize }, _createTile: function () { var a = this._canvasProto.cloneNode(!1); a.onselectstart = a.onmousemove = b.Util.falseFn; return a }, _loadTile: function (a, c) { a._layer = this; a._tilePoint = c; this._redrawTile(a); this.options.async || this.tileDrawn(a) }, drawTile: function () {}, tileDrawn: function (a) { this._tileOnLoad.call(a) } }); b.tileLayer.canvas = function (a) { return new b.TileLayer.Canvas(a) }; b.ImageOverlay = b.Class.extend({ includes: b.Mixin.Events, options: { opacity: 1 }, initialize: function (a, c, e) { this._url = a; this._bounds = b.latLngBounds(c); b.setOptions(this, e) }, onAdd: function (a) { this._map = a; this._image || this._initImage(); a._panes.overlayPane.appendChild(this._image); a.on("viewreset", this._reset, this); if (a.options.zoomAnimation && b.Browser.any3d) a.on("zoomanim", this._animateZoom, this); this._reset() }, onRemove: function (a) { a.getPanes().overlayPane.removeChild(this._image); a.off("viewreset", this._reset, this); a.options.zoomAnimation && a.off("zoomanim", this._animateZoom, this) }, addTo: function (a) { a.addLayer(this); return this }, setOpacity: function (a) { this.options.opacity = a; this._updateOpacity(); return this }, bringToFront: function () { this._image && this._map._panes.overlayPane.appendChild(this._image); return this }, bringToBack: function () { var a = this._map._panes.overlayPane; this._image && a.insertBefore(this._image, a.firstChild); return this }, _initImage: function () { this._image = b.DomUtil.create("img", "leaflet-image-layer"); this._map.options.zoomAnimation && b.Browser.any3d ? b.DomUtil.addClass(this._image, "leaflet-zoom-animated") : b.DomUtil.addClass(this._image, "leaflet-zoom-hide"); this._updateOpacity(); b.extend(this._image, { galleryimg: "no", onselectstart: b.Util.falseFn, onmousemove: b.Util.falseFn, onload: b.bind(this._onImageLoad, this), src: this._url }) }, _animateZoom: function (a) { var c = this._map, e = this._image, d = c.getZoomScale(a.zoom), f = this._bounds.getNorthWest(), g = this._bounds.getSouthEast(), f = c._latLngToNewLayerPoint(f, a.zoom, a.center), a = c._latLngToNewLayerPoint(g, a.zoom, a.center)._subtract(f), a = f._add(a._multiplyBy(0.5 * (1 - 1 / d))); e.style[b.DomUtil.TRANSFORM] = b.DomUtil.getTranslateString(a) + " scale(" + d + ") " }, _reset: function () { var a = this._image, c = this._map.latLngToLayerPoint(this._bounds.getNorthWest()), e = this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(c); b.DomUtil.setPosition(a, c); a.style.width = e.x + "px"; a.style.height = e.y + "px" }, _onImageLoad: function () { this.fire("load") }, _updateOpacity: function () { b.DomUtil.setOpacity(this._image, this.options.opacity) } }); b.imageOverlay = function (a, c, e) { return new b.ImageOverlay(a, c, e) }; b.Icon = b.Class.extend({ options: { className: "" }, initialize: function (a) { b.setOptions(this, a) }, createIcon: function () { return this._createIcon("icon") }, createShadow: function () { return this._createIcon("shadow") }, _createIcon: function (a) { var c = this._getIconUrl(a); if (!c) { if ("icon" === a) throw Error("iconUrl not set in Icon options (see the docs)."); return null } c = this._createImg(c); this._setIconStyles(c, a); return c }, _setIconStyles: function (a, c) { var e = this.options, d = b.point(e[c + "Size"]), f; f = "shadow" === c ? b.point(e.shadowAnchor || e.iconAnchor) : b.point(e.iconAnchor); !f && d && (f = d.divideBy(2, !0)); a.className = "leaflet-marker-" + c + " " + e.className; if (f) a.style.marginLeft = -f.x + "px", a.style.marginTop = -f.y + "px"; if (d) a.style.width = d.x + "px", a.style.height = d.y + "px" }, _createImg: function (a) { var c; b.Browser.ie6 ? (c = i.createElement("div"), c.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + a + '")') : (c = i.createElement("img"), c.src = a); return c }, _getIconUrl: function (a) { return b.Browser.retina && this.options[a + "RetinaUrl"] ? this.options[a + "RetinaUrl"] : this.options[a + "Url"] } }); b.icon = function (a) { return new b.Icon(a) }; b.Icon.Default = b.Icon.extend({ options: { iconSize: new b.Point(25, 41), iconAnchor: new b.Point(12, 41), popupAnchor: new b.Point(1, -34), shadowSize: new b.Point(41, 41) }, _getIconUrl: function (a) { var c = a + "Url"; if (this.options[c]) return this.options[c]; b.Browser.retina && "icon" === a && (a += "@2x"); c = b.Icon.Default.imagePath; if (!c) throw Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually."); return c + "/marker-" + a + ".png" } }); b.Icon.Default.imagePath = function () { var a = i.getElementsByTagName("script"), c = /\/?leaflet[\-\._]?([\w\-\._]*)\.js\??/, b, d, f, g; for (b = 0, d = a.length; b < d; b++) if (f = a[b].src, g = f.match(c)) return f.split(c)[0] + "/images" }(); b.Marker = b.Class.extend({ includes: b.Mixin.Events, options: { icon: new b.Icon.Default, title: "", clickable: !0, draggable: !1, zIndexOffset: 0, opacity: 1, riseOnHover: !1, riseOffset: 250 }, initialize: function (a, c) { b.setOptions(this, c); this._latlng = b.latLng(a) }, onAdd: function (a) { this._map = a; a.on("viewreset", this.update, this); this._initIcon(); this.update(); if (a.options.zoomAnimation && a.options.markerZoomAnimation) a.on("zoomanim", this._animateZoom, this) }, addTo: function (a) { a.addLayer(this); return this }, onRemove: function (a) { this._removeIcon(); this.fire("remove"); a.off({ viewreset: this.update, zoomanim: this._animateZoom }, this); this._map = null }, getLatLng: function () { return this._latlng }, setLatLng: function (a) { this._latlng = b.latLng(a); this.update(); return this.fire("move", { latlng: this._latlng }) }, setZIndexOffset: function (a) { this.options.zIndexOffset = a; this.update(); return this }, setIcon: function (a) { this._map && this._removeIcon(); this.options.icon = a; this._map && (this._initIcon(), this.update()); return this }, update: function () { this._icon && this._setPos(this._map.latLngToLayerPoint(this._latlng).round()); return this }, _initIcon: function () { var a = this.options, c = this._map, c = c.options.zoomAnimation && c.options.markerZoomAnimation ? "leaflet-zoom-animated" : "leaflet-zoom-hide", e = !1; if (!this._icon) { this._icon = a.icon.createIcon(); if (a.title) this._icon.title = a.title; this._initInteraction(); e = 1 > this.options.opacity; b.DomUtil.addClass(this._icon, c); if (a.riseOnHover) b.DomEvent.on(this._icon, "mouseover", this._bringToFront, this).on(this._icon, "mouseout", this._resetZIndex, this) } if (!this._shadow && (this._shadow = a.icon.createShadow())) b.DomUtil.addClass(this._shadow, c), e = 1 > this.options.opacity; e && this._updateOpacity(); a = this._map._panes; a.markerPane.appendChild(this._icon); this._shadow && a.shadowPane.appendChild(this._shadow) }, _removeIcon: function () { var a = this._map._panes; this.options.riseOnHover && b.DomEvent.off(this._icon, "mouseover", this._bringToFront).off(this._icon, "mouseout", this._resetZIndex); a.markerPane.removeChild(this._icon); this._shadow && a.shadowPane.removeChild(this._shadow); this._icon = this._shadow = null }, _setPos: function (a) { b.DomUtil.setPosition(this._icon, a); this._shadow && b.DomUtil.setPosition(this._shadow, a); this._zIndex = a.y + this.options.zIndexOffset; this._resetZIndex() }, _updateZIndex: function (a) { this._icon.style.zIndex = this._zIndex + a }, _animateZoom: function (a) { this._setPos(this._map._latLngToNewLayerPoint(this._latlng, a.zoom, a.center)) }, _initInteraction: function () { if (this.options.clickable) { var a = this._icon, c = ["dblclick", "mousedown", "mouseover", "mouseout", "contextmenu"]; b.DomUtil.addClass(a, "leaflet-clickable"); b.DomEvent.on(a, "click", this._onMouseClick, this); for (var e = 0; e < c.length; e++) b.DomEvent.on(a, c[e], this._fireMouseEvent, this); if (b.Handler.MarkerDrag) this.dragging = new b.Handler.MarkerDrag(this), this.options.draggable && this.dragging.enable() } }, _onMouseClick: function (a) { var c = this.dragging && this.dragging.moved(); (this.hasEventListeners(a.type) || c) && b.DomEvent.stopPropagation(a); c || (!this.dragging || !this.dragging._enabled) && this._map.dragging && this._map.dragging.moved() || this.fire(a.type, { originalEvent: a }) }, _fireMouseEvent: function (a) { this.fire(a.type, { originalEvent: a }); "contextmenu" === a.type && this.hasEventListeners(a.type) && b.DomEvent.preventDefault(a); "mousedown" !== a.type && b.DomEvent.stopPropagation(a) }, setOpacity: function (a) { this.options.opacity = a; this._map && this._updateOpacity() }, _updateOpacity: function () { b.DomUtil.setOpacity(this._icon, this.options.opacity); this._shadow && b.DomUtil.setOpacity(this._shadow, this.options.opacity) }, _bringToFront: function () { this._updateZIndex(this.options.riseOffset) }, _resetZIndex: function () { this._updateZIndex(0) } }); b.marker = function (a, c) { return new b.Marker(a, c) }; b.DivIcon = b.Icon.extend({ options: { iconSize: new b.Point(12, 12), className: "leaflet-div-icon" }, createIcon: function () { var a = i.createElement("div"), c = this.options; if (c.html) a.innerHTML = c.html; if (c.bgPos) a.style.backgroundPosition = -c.bgPos.x + "px " + -c.bgPos.y + "px"; this._setIconStyles(a, "icon"); return a }, createShadow: function () { return null } }); b.divIcon = function (a) { return new b.DivIcon(a) }; b.Map.mergeOptions({ closePopupOnClick: !0 }); b.Popup = b.Class.extend({ includes: b.Mixin.Events, options: { minWidth: 50, maxWidth: 300, maxHeight: null, autoPan: !0, closeButton: !0, offset: new b.Point(0, 6), autoPanPadding: new b.Point(5, 5), className: "", zoomAnimation: !0 }, initialize: function (a, c) { b.setOptions(this, a); this._source = c; this._animated = b.Browser.any3d && this.options.zoomAnimation }, onAdd: function (a) { this._map = a; this._container || this._initLayout(); this._updateContent(); var c = a.options.fadeAnimation; c && b.DomUtil.setOpacity(this._container, 0); a._panes.popupPane.appendChild(this._container); a.on("viewreset", this._updatePosition, this); if (this._animated) a.on("zoomanim", this._zoomAnimation, this); if (a.options.closePopupOnClick) a.on("preclick", this._close, this); this._update(); c && b.DomUtil.setOpacity(this._container, 1) }, addTo: function (a) { a.addLayer(this); return this }, openOn: function (a) { a.openPopup(this); return this }, onRemove: function (a) { a._panes.popupPane.removeChild(this._container); b.Util.falseFn(this._container.offsetWidth); a.off({ viewreset: this._updatePosition, preclick: this._close, zoomanim: this._zoomAnimation }, this); a.options.fadeAnimation && b.DomUtil.setOpacity(this._container, 0); this._map = null }, setLatLng: function (a) { this._latlng = b.latLng(a); this._update(); return this }, setContent: function (a) { this._content = a; this._update(); return this }, _close: function () { var a = this._map; if (a) a._popup = null, a.removeLayer(this).fire("popupclose", { popup: this }) }, _initLayout: function () { var a = this._container = b.DomUtil.create("div", "leaflet-popup " + this.options.className + " leaflet-zoom-" + (this._animated ? "animated" : "hide")), c; if (this.options.closeButton) c = this._closeButton = b.DomUtil.create("a", "leaflet-popup-close-button", a), c.href = "#close", c.innerHTML = "×", b.DomEvent.on(c, "click", this._onCloseButtonClick, this); c = this._wrapper = b.DomUtil.create("div", "leaflet-popup-content-wrapper", a); b.DomEvent.disableClickPropagation(c); this._contentNode = b.DomUtil.create("div", "leaflet-popup-content", c); b.DomEvent.on(this._contentNode, "mousewheel", b.DomEvent.stopPropagation); this._tipContainer = b.DomUtil.create("div", "leaflet-popup-tip-container", a); this._tip = b.DomUtil.create("div", "leaflet-popup-tip", this._tipContainer) }, _update: function () { if (this._map) this._container.style.visibility = "hidden", this._updateContent(), this._updateLayout(), this._updatePosition(), this._container.style.visibility = "", this._adjustPan() }, _updateContent: function () { if (this._content) { if ("string" === typeof this._content) this._contentNode.innerHTML = this._content; else { for (; this._contentNode.hasChildNodes();) this._contentNode.removeChild(this._contentNode.firstChild); this._contentNode.appendChild(this._content) } this.fire("contentupdate") } }, _updateLayout: function () { var a = this._contentNode, c = a.style; c.width = ""; c.whiteSpace = "nowrap"; var e = a.offsetWidth, e = Math.min(e, this.options.maxWidth), e = Math.max(e, this.options.minWidth); c.width = e + 1 + "px"; c.whiteSpace = ""; c.height = ""; var e = a.offsetHeight, d = this.options.maxHeight; d && e > d ? (c.height = d + "px", b.DomUtil.addClass(a, "leaflet-popup-scrolled")) : b.DomUtil.removeClass(a, "leaflet-popup-scrolled"); this._containerWidth = this._container.offsetWidth }, _updatePosition: function () { if (this._map) { var a = this._map.latLngToLayerPoint(this._latlng), c = this._animated, e = this.options.offset; c && b.DomUtil.setPosition(this._container, a); this._containerBottom = -e.y - (c ? 0 : a.y); this._containerLeft = -Math.round(this._containerWidth / 2) + e.x + (c ? 0 : a.x); this._container.style.bottom = this._containerBottom + "px"; this._container.style.left = this._containerLeft + "px" } }, _zoomAnimation: function (a) { a = this._map._latLngToNewLayerPoint(this._latlng, a.zoom, a.center); b.DomUtil.setPosition(this._container, a) }, _adjustPan: function () { if (this.options.autoPan) { var a = this._map, c = this._container.offsetHeight, e = this._containerWidth, d = new b.Point(this._containerLeft, -c - this._containerBottom); this._animated && d._add(b.DomUtil.getPosition(this._container)); var d = a.layerPointToContainerPoint(d), f = this.options.autoPanPadding, g = a.getSize(), h = 0, j = 0; 0 > d.x && (h = d.x - f.x); d.x + e > g.x && (h = d.x + e - g.x + f.x); 0 > d.y && (j = d.y - f.y); d.y + c > g.y && (j = d.y + c - g.y + f.y); (h || j) && a.panBy(new b.Point(h, j)) } }, _onCloseButtonClick: function (a) { this._close(); b.DomEvent.stop(a) } }); b.popup = function (a, c) { return new b.Popup(a, c) }; b.Marker.include({ openPopup: function () { this._popup && this._map && (this._popup.setLatLng(this._latlng), this._map.openPopup(this._popup)); return this }, closePopup: function () { this._popup && this._popup._close(); return this }, bindPopup: function (a, c) { var e = b.point(this.options.icon.options.popupAnchor) || new b.Point(0, 0), e = e.add(b.Popup.prototype.options.offset); c && c.offset && (e = e.add(c.offset)); c = b.extend({ offset: e }, c); if (!this._popup) this.on("click", this.openPopup, this).on("remove", this.closePopup, this).on("move", this._movePopup, this); this._popup = (new b.Popup(c, this)).setContent(a); return this }, unbindPopup: function () { if (this._popup) this._popup = null, this.off("click", this.openPopup).off("remove", this.closePopup).off("move", this._movePopup); return this }, _movePopup: function (a) { this._popup.setLatLng(a.latlng) } }); b.Map.include({ openPopup: function (a) { this.closePopup(); this._popup = a; return this.addLayer(a).fire("popupopen", { popup: this._popup }) }, closePopup: function () { this._popup && this._popup._close(); return this } }); b.LayerGroup = b.Class.extend({ initialize: function (a) { this._layers = {}; var c, b; if (a) for (c = 0, b = a.length; c < b; c++) this.addLayer(a[c]) }, addLayer: function (a) { this._layers[b.stamp(a)] = a; this._map && this._map.addLayer(a); return this }, removeLayer: function (a) { delete this._layers[b.stamp(a)]; this._map && this._map.removeLayer(a); return this }, clearLayers: function () { this.eachLayer(this.removeLayer, this); return this }, invoke: function (a) { var c = Array.prototype.slice.call(arguments, 1), b, d; for (b in this._layers) this._layers.hasOwnProperty(b) && (d = this._layers[b], d[a] && d[a].apply(d, c)); return this }, onAdd: function (a) { this._map = a; this.eachLayer(a.addLayer, a) }, onRemove: function (a) { this.eachLayer(a.removeLayer, a); this._map = null }, addTo: function (a) { a.addLayer(this); return this }, eachLayer: function (a, c) { for (var b in this._layers) this._layers.hasOwnProperty(b) && a.call(c, this._layers[b]) }, setZIndex: function (a) { return this.invoke("setZIndex", a) } }); b.layerGroup = function (a) { return new b.LayerGroup(a) }; b.FeatureGroup = b.LayerGroup.extend({ includes: b.Mixin.Events, statics: { EVENTS: "click dblclick mouseover mouseout mousemove contextmenu" }, addLayer: function (a) { if (this._layers[b.stamp(a)]) return this; a.on(b.FeatureGroup.EVENTS, this._propagateEvent, this); b.LayerGroup.prototype.addLayer.call(this, a); this._popupContent && a.bindPopup && a.bindPopup(this._popupContent, this._popupOptions); return this.fire("layeradd", { layer: a }) }, removeLayer: function (a) { a.off(b.FeatureGroup.EVENTS, this._propagateEvent, this); b.LayerGroup.prototype.removeLayer.call(this, a); this._popupContent && this.invoke("unbindPopup"); return this.fire("layerremove", { layer: a }) }, bindPopup: function (a, c) { this._popupContent = a; this._popupOptions = c; return this.invoke("bindPopup", a, c) }, setStyle: function (a) { return this.invoke("setStyle", a) }, bringToFront: function () { return this.invoke("bringToFront") }, bringToBack: function () { return this.invoke("bringToBack") }, getBounds: function () { var a = new b.LatLngBounds; this.eachLayer(function (c) { a.extend(c instanceof b.Marker ? c.getLatLng() : c.getBounds()) }); return a }, _propagateEvent: function (a) { a.layer = a.target; a.target = this; this.fire(a.type, a) } }); b.featureGroup = function (a) { return new b.FeatureGroup(a) }; b.Path = b.Class.extend({ includes: [b.Mixin.Events], statics: { CLIP_PADDING: b.Browser.mobile ? Math.max(0, Math.min(0.5, (1280 / Math.max(k.innerWidth, k.innerHeight) - 1) / 2)) : 0.5 }, options: { stroke: !0, color: "#0033ff", dashArray: null, weight: 5, opacity: 0.5, fill: !1, fillColor: null, fillOpacity: 0.2, clickable: !0 }, initialize: function (a) { b.setOptions(this, a) }, onAdd: function (a) { this._map = a; this._container || (this._initElements(), this._initEvents()); this.projectLatlngs(); this._updatePath(); this._container && this._map._pathRoot.appendChild(this._container); this.fire("add"); a.on({ viewreset: this.projectLatlngs, moveend: this._updatePath }, this) }, addTo: function (a) { a.addLayer(this); return this }, onRemove: function (a) { a._pathRoot.removeChild(this._container); this.fire("remove"); this._map = null; if (b.Browser.vml) this._fill = this._stroke = this._container = null; a.off({ viewreset: this.projectLatlngs, moveend: this._updatePath }, this) }, projectLatlngs: function () {}, setStyle: function (a) { b.setOptions(this, a); this._container && this._updateStyle(); return this }, redraw: function () { this._map && (this.projectLatlngs(), this._updatePath()); return this } }); b.Map.include({ _updatePathViewport: function () { var a = b.Path.CLIP_PADDING, c = this.getSize(), e = b.DomUtil.getPosition(this._mapPane).multiplyBy(-1)._subtract(c.multiplyBy(a)._round()), a = e.add(c.multiplyBy(1 + 2 * a)._round()); this._pathViewport = new b.Bounds(e, a) } }); b.Path.SVG_NS = "http://www.w3.org/2000/svg"; b.Browser.svg = !(!i.createElementNS || !i.createElementNS(b.Path.SVG_NS, "svg").createSVGRect); b.Path = b.Path.extend({ statics: { SVG: b.Browser.svg }, bringToFront: function () { var a = this._map._pathRoot, c = this._container; c && a.lastChild !== c && a.appendChild(c); return this }, bringToBack: function () { var a = this._map._pathRoot, c = this._container, b = a.firstChild; c && b !== c && a.insertBefore(c, b); return this }, getPathString: function () {}, _createElement: function (a) { return i.createElementNS(b.Path.SVG_NS, a) }, _initElements: function () { this._map._initPathRoot(); this._initPath(); this._initStyle() }, _initPath: function () { this._container = this._createElement("g"); this._path = this._createElement("path"); this._container.appendChild(this._path) }, _initStyle: function () { this.options.stroke && (this._path.setAttribute("stroke-linejoin", "round"), this._path.setAttribute("stroke-linecap", "round")); this.options.fill && this._path.setAttribute("fill-rule", "evenodd"); this._updateStyle() }, _updateStyle: function () { this.options.stroke ? (this._path.setAttribute("stroke", this.options.color), this._path.setAttribute("stroke-opacity", this.options.opacity), this._path.setAttribute("stroke-width", this.options.weight), this.options.dashArray ? this._path.setAttribute("stroke-dasharray", this.options.dashArray) : this._path.removeAttribute("stroke-dasharray")) : this._path.setAttribute("stroke", "none"); this.options.fill ? (this._path.setAttribute("fill", this.options.fillColor || this.options.color), this._path.setAttribute("fill-opacity", this.options.fillOpacity)) : this._path.setAttribute("fill", "none") }, _updatePath: function () { var a = this.getPathString(); a || (a = "M0 0"); this._path.setAttribute("d", a) }, _initEvents: function () { if (this.options.clickable) { (b.Browser.svg || !b.Browser.vml) && this._path.setAttribute("class", "leaflet-clickable"); b.DomEvent.on(this._container, "click", this._onMouseClick, this); for (var a = "dblclick,mousedown,mouseover,mouseout,mousemove,contextmenu".split(","), c = 0; c < a.length; c++) b.DomEvent.on(this._container, a[c], this._fireMouseEvent, this) } }, _onMouseClick: function (a) { (!this._map.dragging || !this._map.dragging.moved()) && this._fireMouseEvent(a) }, _fireMouseEvent: function (a) { if (this.hasEventListeners(a.type)) { var c = this._map, e = c.mouseEventToContainerPoint(a), d = c.containerPointToLayerPoint(e), c = c.layerPointToLatLng(d); this.fire(a.type, { latlng: c, layerPoint: d, containerPoint: e, originalEvent: a }); "contextmenu" === a.type && b.DomEvent.preventDefault(a); "mousemove" !== a.type && b.DomEvent.stopPropagation(a) } } }); b.Map.include({ _initPathRoot: function () { if (!this._pathRoot) this._pathRoot = b.Path.prototype._createElement("svg"), this._panes.overlayPane.appendChild(this._pathRoot), this.options.zoomAnimation && b.Browser.any3d ? (this._pathRoot.setAttribute("class", " leaflet-zoom-animated"), this.on({ zoomanim: this._animatePathZoom, zoomend: this._endPathZoom })) : this._pathRoot.setAttribute("class", " leaflet-zoom-hide"), this.on("moveend", this._updateSvgViewport), this._updateSvgViewport() }, _animatePathZoom: function (a) { var c = this.getZoomScale(a.zoom), a = this._getCenterOffset(a.center)._multiplyBy(-c)._add(this._pathViewport.min); this._pathRoot.style[b.DomUtil.TRANSFORM] = b.DomUtil.getTranslateString(a) + " scale(" + c + ") "; this._pathZooming = !0 }, _endPathZoom: function () { this._pathZooming = !1 }, _updateSvgViewport: function () { if (!this._pathZooming) { this._updatePathViewport(); var a = this._pathViewport, c = a.min, e = a.max, a = e.x - c.x, e = e.y - c.y, d = this._pathRoot, f = this._panes.overlayPane; b.Browser.mobileWebkit && f.removeChild(d); b.DomUtil.setPosition(d, c); d.setAttribute("width", a); d.setAttribute("height", e); d.setAttribute("viewBox", [c.x, c.y, a, e].join(" ")); b.Browser.mobileWebkit && f.appendChild(d) } } }); b.Path.include({ bindPopup: function (a, c) { if (!this._popup || c) this._popup = new b.Popup(c, this); this._popup.setContent(a); if (!this._popupHandlersAdded) this.on("click", this._openPopup, this).on("remove", this.closePopup, this), this._popupHandlersAdded = !0; return this }, unbindPopup: function () { if (this._popup) this._popup = null, this.off("click", this._openPopup).off("remove", this.closePopup), this._popupHandlersAdded = !1; return this }, openPopup: function (a) { this._popup && (a = a || this._latlng || this._latlngs[Math.floor(this._latlngs.length / 2)], this._openPopup({ latlng: a })); return this }, closePopup: function () { this._popup && this._popup._close(); return this }, _openPopup: function (a) { this._popup.setLatLng(a.latlng); this._map.openPopup(this._popup) } }); b.Browser.vml = !b.Browser.svg && function () { try { var a = i.createElement("div"); a.innerHTML = ''; var c = a.firstChild; c.style.behavior = "url(#default#VML)"; return c && "object" === typeof c.adj } catch (b) { return !1 } }(); b.Path = b.Browser.svg || !b.Browser.vml ? b.Path : b.Path.extend({ statics: { VML: !0, CLIP_PADDING: 0.02 }, _createElement: function () { try { return i.namespaces.add("lvml", "urn:schemas-microsoft-com:vml"), function (a) { return i.createElement("') } } catch (a) { return function (a) { return i.createElement("<" + a + ' xmlns="urn:schemas-microsoft.com:vml" class="lvml">') } } }(), _initPath: function () { var a = this._container = this._createElement("shape"); b.DomUtil.addClass(a, "leaflet-vml-shape"); this.options.clickable && b.DomUtil.addClass(a, "leaflet-clickable"); a.coordsize = "1 1"; this._path = this._createElement("path"); a.appendChild(this._path); this._map._pathRoot.appendChild(a) }, _initStyle: function () { this._updateStyle() }, _updateStyle: function () { var a = this._stroke, c = this._fill, b = this.options, d = this._container; d.stroked = b.stroke; d.filled = b.fill; if (b.stroke) { if (!a) a = this._stroke = this._createElement("stroke"), a.endcap = "round", d.appendChild(a); a.weight = b.weight + "px"; a.color = b.color; a.opacity = b.opacity; a.dashStyle = b.dashArray ? b.dashArray instanceof Array ? b.dashArray.join(" ") : b.dashArray.replace(/ *, */g, " ") : "" } else if (a) d.removeChild(a), this._stroke = null; if (b.fill) { if (!c) c = this._fill = this._createElement("fill"), d.appendChild(c); c.color = b.fillColor || b.color; c.opacity = b.fillOpacity } else if (c) d.removeChild(c), this._fill = null }, _updatePath: function () { var a = this._container.style; a.display = "none"; this._path.v = this.getPathString() + " "; a.display = "" } }); b.Map.include(b.Browser.svg || !b.Browser.vml ? {} : { _initPathRoot: function () { if (!this._pathRoot) { var a = this._pathRoot = i.createElement("div"); a.className = "leaflet-vml-container"; this._panes.overlayPane.appendChild(a); this.on("moveend", this._updatePathViewport); this._updatePathViewport() } } }); b.Browser.canvas = !!i.createElement("canvas").getContext; b.Path = b.Path.SVG && !k.L_PREFER_CANVAS || !b.Browser.canvas ? b.Path : b.Path.extend({ statics: { CANVAS: !0, SVG: !1 }, redraw: function () { this._map && (this.projectLatlngs(), this._requestUpdate()); return this }, setStyle: function (a) { b.setOptions(this, a); this._map && (this._updateStyle(), this._requestUpdate()); return this }, onRemove: function (a) { a.off("viewreset", this.projectLatlngs, this).off("moveend", this._updatePath, this); this.options.clickable && this._map.off("click", this._onClick, this); this._requestUpdate(); this._map = null }, _requestUpdate: function () { if (this._map && !b.Path._updateRequest) b.Path._updateRequest = b.Util.requestAnimFrame(this._fireMapMoveEnd, this._map) }, _fireMapMoveEnd: function () { b.Path._updateRequest = null; this.fire("moveend") }, _initElements: function () { this._map._initPathRoot(); this._ctx = this._map._canvasCtx }, _updateStyle: function () { var a = this.options; if (a.stroke) this._ctx.lineWidth = a.weight, this._ctx.strokeStyle = a.color; if (a.fill) this._ctx.fillStyle = a.fillColor || a.color }, _drawPath: function () { var a, c, e, d, f, g; this._ctx.beginPath(); for (a = 0, e = this._parts.length; a < e; a++) { for (c = 0, d = this._parts[a].length; c < d; c++) f = this._parts[a][c], g = (0 === c ? "move" : "line") + "To", this._ctx[g](f.x, f.y); this instanceof b.Polygon && this._ctx.closePath() } }, _checkIfEmpty: function () { return !this._parts.length }, _updatePath: function () { if (!this._checkIfEmpty()) { var a = this._ctx, c = this.options; this._drawPath(); a.save(); this._updateStyle(); if (c.fill) a.globalAlpha = c.fillOpacity, a.fill(); if (c.stroke) a.globalAlpha = c.opacity, a.stroke(); a.restore() } }, _initEvents: function () { if (this.options.clickable) this._map.on("click", this._onClick, this) }, _onClick: function (a) { this._containsPoint(a.layerPoint) && this.fire("click", { latlng: a.latlng, layerPoint: a.layerPoint, containerPoint: a.containerPoint, originalEvent: a }) } }); b.Map.include(b.Path.SVG && !k.L_PREFER_CANVAS || !b.Browser.canvas ? {} : { _initPathRoot: function () { var a = this._pathRoot, c; if (!a) { a = this._pathRoot = i.createElement("canvas"); a.style.position = "absolute"; c = this._canvasCtx = a.getContext("2d"); c.lineCap = "round"; c.lineJoin = "round"; this._panes.overlayPane.appendChild(a); if (this.options.zoomAnimation) this._pathRoot.className = "leaflet-zoom-animated", this.on("zoomanim", this._animatePathZoom), this.on("zoomend", this._endPathZoom); this.on("moveend", this._updateCanvasViewport); this._updateCanvasViewport() } }, _updateCanvasViewport: function () { if (!this._pathZooming) { this._updatePathViewport(); var a = this._pathViewport, c = a.min, a = a.max.subtract(c), e = this._pathRoot; b.DomUtil.setPosition(e, c); e.width = a.x; e.height = a.y; e.getContext("2d").translate(-c.x, -c.y) } } }); b.LineUtil = { simplify: function (a, c) { if (!c || !a.length) return a.slice(); var b = c * c, a = this._reducePoints(a, b); return a = this._simplifyDP(a, b) }, pointToSegmentDistance: function (a, c, b) { return Math.sqrt(this._sqClosestPointOnSegment(a, c, b, !0)) }, closestPointOnSegment: function (a, c, b) { return this._sqClosestPointOnSegment(a, c, b) }, _simplifyDP: function (a, c) { var b = a.length, d = new(typeof Uint8Array !== l + "" ? Uint8Array : Array)(b); d[0] = d[b - 1] = 1; this._simplifyDPStep(a, d, c, 0, b - 1); var f, g = []; for (f = 0; f < b; f++) d[f] && g.push(a[f]); return g }, _simplifyDPStep: function (a, c, b, d, f) { var g = 0, h, j, i; for (j = d + 1; j <= f - 1; j++) i = this._sqClosestPointOnSegment(a[j], a[d], a[f], !0), i > g && (h = j, g = i); g > b && (c[h] = 1, this._simplifyDPStep(a, c, b, d, h), this._simplifyDPStep(a, c, b, h, f)) }, _reducePoints: function (a, c) { for (var b = [a[0]], d = 1, f = 0, g = a.length; d < g; d++) this._sqDist(a[d], a[f]) > c && (b.push(a[d]), f = d); f < g - 1 && b.push(a[g - 1]); return b }, clipSegment: function (a, c, b, d) { var d = d ? this._lastCode : this._getBitCode(a, b), f = this._getBitCode(c, b), g, h, j; for (this._lastCode = f;;) if (d | f) { if (d & f) return !1; g = d || f; h = this._getEdgeIntersection(a, c, g, b); j = this._getBitCode(h, b); g === d ? (a = h, d = j) : (c = h, f = j) } else return [a, c] }, _getEdgeIntersection: function (a, c, e, d) { var f = c.x - a.x, c = c.y - a.y, g = d.min, d = d.max; if (e & 8) return new b.Point(a.x + f * (d.y - a.y) / c, d.y); if (e & 4) return new b.Point(a.x + f * (g.y - a.y) / c, g.y); if (e & 2) return new b.Point(d.x, a.y + c * (d.x - a.x) / f); if (e & 1) return new b.Point(g.x, a.y + c * (g.x - a.x) / f) }, _getBitCode: function (a, c) { var b = 0; a.x < c.min.x ? b |= 1 : a.x > c.max.x && (b |= 2); a.y < c.min.y ? b |= 4 : a.y > c.max.y && (b |= 8); return b }, _sqDist: function (a, c) { var b = c.x - a.x, d = c.y - a.y; return b * b + d * d }, _sqClosestPointOnSegment: function (a, c, e, d) { var f = c.x, c = c.y, g = e.x - f, h = e.y - c, j = g * g + h * h; if (0 < j) j = ((a.x - f) * g + (a.y - c) * h) / j, 1 < j ? (f = e.x, c = e.y) : 0 < j && (f += g * j, c += h * j); g = a.x - f; h = a.y - c; return d ? g * g + h * h : new b.Point(f, c) } }; b.Polyline = b.Path.extend({ initialize: function (a, c) { b.Path.prototype.initialize.call(this, c); this._latlngs = this._convertLatLngs(a) }, options: { smoothFactor: 1, noClip: !1 }, projectLatlngs: function () { this._originalPoints = []; for (var a = 0, c = this._latlngs.length; a < c; a++) this._originalPoints[a] = this._map.latLngToLayerPoint(this._latlngs[a]) }, getPathString: function () { for (var a = 0, c = this._parts.length, b = ""; a < c; a++) b += this._getPathPartStr(this._parts[a]); return b }, getLatLngs: function () { return this._latlngs }, setLatLngs: function (a) { this._latlngs = this._convertLatLngs(a); return this.redraw() }, addLatLng: function (a) { this._latlngs.push(b.latLng(a)); return this.redraw() }, spliceLatLngs: function () { var a = [].splice.apply(this._latlngs, arguments); this._convertLatLngs(this._latlngs); this.redraw(); return a }, closestLayerPoint: function (a) { for (var c = Infinity, e = this._parts, d, f, g = null, h = 0, j = e.length; h < j; h++) for (var i = e[h], k = 1, m = i.length; k < m; k++) { d = i[k - 1]; f = i[k]; var l = b.LineUtil._sqClosestPointOnSegment(a, d, f, !0); l < c && (c = l, g = b.LineUtil._sqClosestPointOnSegment(a, d, f)) } if (g) g.distance = Math.sqrt(c); return g }, getBounds: function () { var a = new b.LatLngBounds, c = this.getLatLngs(), e, d; for (e = 0, d = c.length; e < d; e++) a.extend(c[e]); return a }, _convertLatLngs: function (a) { var c, e; for (c = 0, e = a.length; c < e; c++) { if (b.Util.isArray(a[c]) && "number" !== typeof a[c][0]) return; a[c] = b.latLng(a[c]) } return a }, _initEvents: function () { b.Path.prototype._initEvents.call(this) }, _getPathPartStr: function (a) { for (var c = b.Path.VML, e = 0, d = a.length, f = "", g; e < d; e++) g = a[e], c && g._round(), f += (e ? "L" : "M") + g.x + " " + g.y; return f }, _clipPoints: function () { var a = this._originalPoints, c = a.length, e, d, f; if (this.options.noClip) this._parts = [a]; else { var g = this._parts = [], h = this._map._pathViewport, j = b.LineUtil; for (e = 0, d = 0; e < c - 1; e++) if (f = j.clipSegment(a[e], a[e + 1], h, e)) if (g[d] = g[d] || [], g[d].push(f[0]), f[1] !== a[e + 1] || e === c - 2) g[d].push(f[1]), d++ } }, _simplifyPoints: function () { for (var a = this._parts, c = b.LineUtil, e = 0, d = a.length; e < d; e++) a[e] = c.simplify(a[e], this.options.smoothFactor) }, _updatePath: function () { this._map && (this._clipPoints(), this._simplifyPoints(), b.Path.prototype._updatePath.call(this)) } }); b.polyline = function (a, c) { return new b.Polyline(a, c) }; b.PolyUtil = {}; b.PolyUtil.clipPolygon = function (a, c) { var e, d = [1, 4, 2, 8], f, g, h, j, i, k, m = b.LineUtil; for (f = 0, i = a.length; f < i; f++) a[f]._code = m._getBitCode(a[f], c); for (h = 0; 4 > h; h++) { k = d[h]; e = []; for (f = 0, i = a.length, g = i - 1; f < i; g = f++) if (j = a[f], g = a[g], j._code & k) { if (!(g._code & k)) g = m._getEdgeIntersection(g, j, k, c), g._code = m._getBitCode(g, c), e.push(g) } else { if (g._code & k) g = m._getEdgeIntersection(g, j, k, c), g._code = m._getBitCode(g, c), e.push(g); e.push(j) } a = e } return a }; b.Polygon = b.Polyline.extend({ options: { fill: !0 }, initialize: function (a, c) { b.Polyline.prototype.initialize.call(this, a, c); if (a && b.Util.isArray(a[0]) && "number" !== typeof a[0][0]) this._latlngs = this._convertLatLngs(a[0]), this._holes = a.slice(1) }, projectLatlngs: function () { b.Polyline.prototype.projectLatlngs.call(this); this._holePoints = []; if (this._holes) { var a, c, e, d; for (a = 0, e = this._holes.length; a < e; a++) { this._holePoints[a] = []; for (c = 0, d = this._holes[a].length; c < d; c++) this._holePoints[a][c] = this._map.latLngToLayerPoint(this._holes[a][c]) } } }, _clipPoints: function () { var a = []; this._parts = [this._originalPoints].concat(this._holePoints); if (!this.options.noClip) { for (var c = 0, e = this._parts.length; c < e; c++) { var d = b.PolyUtil.clipPolygon(this._parts[c], this._map._pathViewport); d.length && a.push(d) } this._parts = a } }, _getPathPartStr: function (a) { return b.Polyline.prototype._getPathPartStr.call(this, a) + (b.Browser.svg ? "z" : "x") } }); b.polygon = function (a, c) { return new b.Polygon(a, c) }; (function () { function a(a) { return b.FeatureGroup.extend({ initialize: function (a, c) { this._layers = {}; this._options = c; this.setLatLngs(a) }, setLatLngs: function (b) { var d = 0, f = b.length; for (this.eachLayer(function (a) { d < f ? a.setLatLngs(b[d++]) : this.removeLayer(a) }, this); d < f;) this.addLayer(new a(b[d++], this._options)); return this } }) } b.MultiPolyline = a(b.Polyline); b.MultiPolygon = a(b.Polygon); b.multiPolyline = function (a, e) { return new b.MultiPolyline(a, e) }; b.multiPolygon = function (a, e) { return new b.MultiPolygon(a, e) } })(); b.Rectangle = b.Polygon.extend({ initialize: function (a, c) { b.Polygon.prototype.initialize.call(this, this._boundsToLatLngs(a), c) }, setBounds: function (a) { this.setLatLngs(this._boundsToLatLngs(a)) }, _boundsToLatLngs: function (a) { a = b.latLngBounds(a); return [a.getSouthWest(), a.getNorthWest(), a.getNorthEast(), a.getSouthEast() ] } }); b.rectangle = function (a, c) { return new b.Rectangle(a, c) }; b.Circle = b.Path.extend({ initialize: function (a, c, e) { b.Path.prototype.initialize.call(this, e); this._latlng = b.latLng(a); this._mRadius = c }, options: { fill: !0 }, setLatLng: function (a) { this._latlng = b.latLng(a); return this.redraw() }, setRadius: function (a) { this._mRadius = a; return this.redraw() }, projectLatlngs: function () { var a = this._getLngRadius(), a = this._map.latLngToLayerPoint(new b.LatLng(this._latlng.lat, this._latlng.lng - a)); this._point = this._map.latLngToLayerPoint(this._latlng); this._radius = Math.max(Math.round(this._point.x - a.x), 1) }, getBounds: function () { var a = this._getLngRadius(), c = 360 * (this._mRadius / 40075017), e = this._latlng, d = new b.LatLng(e.lat - c, e.lng - a), a = new b.LatLng(e.lat + c, e.lng + a); return new b.LatLngBounds(d, a) }, getLatLng: function () { return this._latlng }, getPathString: function () { var a = this._point, c = this._radius; if (this._checkIfEmpty()) return ""; if (b.Browser.svg) return "M" + a.x + "," + (a.y - c) + "A" + c + "," + c + ",0,1,1," + (a.x - 0.1) + "," + (a.y - c) + " z"; a._round(); c = Math.round(c); return "AL " + a.x + "," + a.y + " " + c + "," + c + " 0,23592600" }, getRadius: function () { return this._mRadius }, _getLatRadius: function () { return 360 * (this._mRadius / 40075017) }, _getLngRadius: function () { return this._getLatRadius() / Math.cos(b.LatLng.DEG_TO_RAD * this._latlng.lat) }, _checkIfEmpty: function () { if (!this._map) return !1; var a = this._map._pathViewport, c = this._radius, b = this._point; return b.x - c > a.max.x || b.y - c > a.max.y || b.x + c < a.min.x || b.y + c < a.min.y } }); b.circle = function (a, c, e) { return new b.Circle(a, c, e) }; b.CircleMarker = b.Circle.extend({ options: { radius: 10, weight: 2 }, initialize: function (a, c) { b.Circle.prototype.initialize.call(this, a, null, c); this._radius = this.options.radius }, projectLatlngs: function () { this._point = this._map.latLngToLayerPoint(this._latlng) }, _updateStyle: function () { b.Circle.prototype._updateStyle.call(this); this.setRadius(this.options.radius) }, setRadius: function (a) { this.options.radius = this._radius = a; return this.redraw() } }); b.circleMarker = function (a, c) { return new b.CircleMarker(a, c) }; b.Polyline.include(!b.Path.CANVAS ? {} : { _containsPoint: function (a, c) { var e, d, f, g, h, j, i = this.options.weight / 2; b.Browser.touch && (i += 10); for (e = 0, g = this._parts.length; e < g; e++) { j = this._parts[e]; for (d = 0, h = j.length, f = h - 1; d < h; f = d++) if (c || 0 !== d) if (f = b.LineUtil.pointToSegmentDistance(a, j[f], j[d]), f <= i) return !0 } return !1 } }); b.Polygon.include(!b.Path.CANVAS ? {} : { _containsPoint: function (a) { var c = !1, e, d, f, g, h, j, i; if (b.Polyline.prototype._containsPoint.call(this, a, !0)) return !0; for (g = 0, j = this._parts.length; g < j; g++) { e = this._parts[g]; for (h = 0, i = e.length, f = i - 1; h < i; f = h++) d = e[h], f = e[f], d.y > a.y !== f.y > a.y && a.x < (f.x - d.x) * (a.y - d.y) / (f.y - d.y) + d.x && (c = !c) } return c } }); b.Circle.include(!b.Path.CANVAS ? {} : { _drawPath: function () { var a = this._point; this._ctx.beginPath(); this._ctx.arc(a.x, a.y, this._radius, 0, 2 * Math.PI, !1) }, _containsPoint: function (a) { var c = this.options.stroke ? this.options.weight / 2 : 0; return a.distanceTo(this._point) <= this._radius + c } }); b.GeoJSON = b.FeatureGroup.extend({ initialize: function (a, c) { b.setOptions(this, c); this._layers = {}; a && this.addData(a) }, addData: function (a) { var c = b.Util.isArray(a) ? a : a.features, e; if (c) { for (a = 0, e = c.length; a < e; a++)(c[a].geometries || c[a].geometry || c[a].features) && this.addData(c[a]); return this } c = this.options; if (!c.filter || c.filter(a)) { e = b.GeoJSON.geometryToLayer(a, c.pointToLayer); e.feature = a; e.defaultOptions = e.options; this.resetStyle(e); if (c.onEachFeature) c.onEachFeature(a, e); return this.addLayer(e) } }, resetStyle: function (a) { var c = this.options.style; c && (b.Util.extend(a.options, a.defaultOptions), this._setLayerStyle(a, c)) }, setStyle: function (a) { this.eachLayer(function (c) { this._setLayerStyle(c, a) }, this) }, _setLayerStyle: function (a, c) { "function" === typeof c && (c = c(a.feature)); a.setStyle && a.setStyle(c) } }); b.extend(b.GeoJSON, { geometryToLayer: function (a, c) { var e = "Feature" === a.type ? a.geometry : a, d = e.coordinates, f = [], g, h, j; switch (e.type) { case "Point": return e = this.coordsToLatLng(d), c ? c(a, e) : new b.Marker(e); case "MultiPoint": for (g = 0, h = d.length; g < h; g++) e = this.coordsToLatLng(d[g]), j = c ? c(a, e) : new b.Marker(e), f.push(j); return new b.FeatureGroup(f); case "LineString": return d = this.coordsToLatLngs(d), new b.Polyline(d); case "Polygon": return d = this.coordsToLatLngs(d, 1), new b.Polygon(d); case "MultiLineString": return d = this.coordsToLatLngs(d, 1), new b.MultiPolyline(d); case "MultiPolygon": return d = this.coordsToLatLngs(d, 2), new b.MultiPolygon(d); case "GeometryCollection": for (g = 0, h = e.geometries.length; g < h; g++) j = this.geometryToLayer({ geometry: e.geometries[g], type: "Feature", properties: a.properties }, c), f.push(j); return new b.FeatureGroup(f); default: throw Error("Invalid GeoJSON object."); } }, coordsToLatLng: function (a, c) { var e = parseFloat(a[c ? 0 : 1]), d = parseFloat(a[c ? 1 : 0]); return new b.LatLng(e, d) }, coordsToLatLngs: function (a, c, b) { var d, f = [], g, h; for (g = 0, h = a.length; g < h; g++) d = c ? this.coordsToLatLngs(a[g], c - 1, b) : this.coordsToLatLng(a[g], b), f.push(d); return f } }); b.geoJson = function (a, c) { return new b.GeoJSON(a, c) }; b.DomEvent = { addListener: function (a, c, e, d) { var f = b.stamp(e), g = "_leaflet_" + c + f, h, j; if (a[g]) return this; h = function (c) { return e.call(d || a, c || b.DomEvent._getEvent()) }; if (b.Browser.msTouch && 0 === c.indexOf("touch")) return this.addMsTouchListener(a, c, h, f); b.Browser.touch && "dblclick" === c && this.addDoubleTapListener && this.addDoubleTapListener(a, h, f); "addEventListener" in a ? "mousewheel" === c ? (a.addEventListener("DOMMouseScroll", h, !1), a.addEventListener(c, h, !1)) : "mouseenter" === c || "mouseleave" === c ? (j = h, h = function (c) { return !b.DomEvent._checkMouse(a, c) ? void 0 : j(c) }, a.addEventListener("mouseenter" === c ? "mouseover" : "mouseout", h, !1)) : a.addEventListener(c, h, !1) : "attachEvent" in a && a.attachEvent("on" + c, h); a[g] = h; return this }, removeListener: function (a, c, e) { var e = b.stamp(e), d = "_leaflet_" + c + e, f = a[d]; if (f) return b.Browser.msTouch && 0 === c.indexOf("touch") ? this.removeMsTouchListener(a, c, e) : b.Browser.touch && "dblclick" === c && this.removeDoubleTapListener ? this.removeDoubleTapListener(a, e) : "removeEventListener" in a ? "mousewheel" === c ? (a.removeEventListener("DOMMouseScroll", f, !1), a.removeEventListener(c, f, !1)) : "mouseenter" === c || "mouseleave" === c ? a.removeEventListener("mouseenter" === c ? "mouseover" : "mouseout", f, !1) : a.removeEventListener(c, f, !1) : "detachEvent" in a && a.detachEvent("on" + c, f), a[d] = null, this }, stopPropagation: function (a) { a.stopPropagation ? a.stopPropagation() : a.cancelBubble = !0; return this }, disableClickPropagation: function (a) { for (var c = b.DomEvent.stopPropagation, e = b.Draggable.START.length - 1; 0 <= e; e--) b.DomEvent.addListener(a, b.Draggable.START[e], c); return b.DomEvent.addListener(a, "click", c).addListener(a, "dblclick", c) }, preventDefault: function (a) { a.preventDefault ? a.preventDefault() : a.returnValue = !1; return this }, stop: function (a) { return b.DomEvent.preventDefault(a).stopPropagation(a) }, getMousePosition: function (a, c) { var e = i.body, d = i.documentElement, e = new b.Point(a.pageX ? a.pageX : a.clientX + e.scrollLeft + d.scrollLeft, a.pageY ? a.pageY : a.clientY + e.scrollTop + d.scrollTop); return c ? e._subtract(b.DomUtil.getViewportOffset(c)) : e }, getWheelDelta: function (a) { var c = 0; a.wheelDelta && (c = a.wheelDelta / 120); a.detail && (c = -a.detail / 3); return c }, _checkMouse: function (a, c) { var b = c.relatedTarget; if (!b) return !0; try { for (; b && b !== a;) b = b.parentNode } catch (d) { return !1 } return b !== a }, _getEvent: function () { var a = k.event; if (!a) for (var c = arguments.callee.caller; c && !((a = c.arguments[0]) && k.Event === a.constructor);) c = c.caller; return a } }; b.DomEvent.on = b.DomEvent.addListener; b.DomEvent.off = b.DomEvent.removeListener; b.Draggable = b.Class.extend({ includes: b.Mixin.Events, statics: { START: b.Browser.touch ? ["touchstart", "mousedown"] : ["mousedown"], END: { mousedown: "mouseup", touchstart: "touchend", MSPointerDown: "touchend" }, MOVE: { mousedown: "mousemove", touchstart: "touchmove", MSPointerDown: "touchmove" }, TAP_TOLERANCE: 15 }, initialize: function (a, c, e) { this._element = a; this._dragStartTarget = c || a; this._longPress = e && !b.Browser.msTouch }, enable: function () { if (!this._enabled) { for (var a = b.Draggable.START.length - 1; 0 <= a; a--) b.DomEvent.on(this._dragStartTarget, b.Draggable.START[a], this._onDown, this); this._enabled = !0 } }, disable: function () { if (this._enabled) { for (var a = b.Draggable.START.length - 1; 0 <= a; a--) b.DomEvent.off(this._dragStartTarget, b.Draggable.START[a], this._onDown, this); this._moved = this._enabled = !1 } }, _onDown: function (a) { if (!(!b.Browser.touch && a.shiftKey || 1 !== a.which && 1 !== a.button && !a.touches)) if (b.DomEvent.preventDefault(a), b.DomEvent.stopPropagation(a), !b.Draggable._disabled) if (this._simulateClick = !0, a.touches && 1 < a.touches.length) this._simulateClick = !1, clearTimeout(this._longPressTimeout); else { var c = a.touches && 1 === a.touches.length ? a.touches[0] : a, e = c.target; b.Browser.touch && "a" === e.tagName.toLowerCase() && b.DomUtil.addClass(e, "leaflet-active"); this._moved = !1; if (!this._moving) { this._startPoint = new b.Point(c.clientX, c.clientY); this._startPos = this._newPos = b.DomUtil.getPosition(this._element); if (a.touches && 1 === a.touches.length && b.Browser.touch && this._longPress) this._longPressTimeout = setTimeout(b.bind(function () { if ((this._newPos && this._newPos.distanceTo(this._startPos) || 0) < b.Draggable.TAP_TOLERANCE) this._simulateClick = !1, this._onUp(), this._simulateEvent("contextmenu", c) }, this), 1E3); b.DomEvent.on(i, b.Draggable.MOVE[a.type], this._onMove, this); b.DomEvent.on(i, b.Draggable.END[a.type], this._onUp, this) } } }, _onMove: function (a) { if (!(a.touches && 1 < a.touches.length)) { var c = a.touches && 1 === a.touches.length ? a.touches[0] : a, c = (new b.Point(c.clientX, c.clientY)).subtract(this._startPoint); if (c.x || c.y) { b.DomEvent.preventDefault(a); if (!this._moved) this.fire("dragstart"), this._moved = !0, this._startPos = b.DomUtil.getPosition(this._element).subtract(c), b.Browser.touch || (b.DomUtil.disableTextSelection(), this._setMovingCursor()); this._newPos = this._startPos.add(c); this._moving = !0; b.Util.cancelAnimFrame(this._animRequest); this._animRequest = b.Util.requestAnimFrame(this._updatePosition, this, !0, this._dragStartTarget) } } }, _updatePosition: function () { this.fire("predrag"); b.DomUtil.setPosition(this._element, this._newPos); this.fire("drag") }, _onUp: function (a) { var c; clearTimeout(this._longPressTimeout); if (this._simulateClick && a.changedTouches) { var a = a.changedTouches[0], e = a.target, d = this._newPos && this._newPos.distanceTo(this._startPos) || 0; "a" === e.tagName.toLowerCase() && b.DomUtil.removeClass(e, "leaflet-active"); d < b.Draggable.TAP_TOLERANCE && (c = a) } b.Browser.touch || (b.DomUtil.enableTextSelection(), this._restoreCursor()); for (var f in b.Draggable.MOVE) b.Draggable.MOVE.hasOwnProperty(f) && (b.DomEvent.off(i, b.Draggable.MOVE[f], this._onMove), b.DomEvent.off(i, b.Draggable.END[f], this._onUp)); this._moved && (b.Util.cancelAnimFrame(this._animRequest), this.fire("dragend")); this._moving = !1; if (c) this._moved = !1, this._simulateEvent("click", c) }, _setMovingCursor: function () { b.DomUtil.addClass(i.body, "leaflet-dragging") }, _restoreCursor: function () { b.DomUtil.removeClass(i.body, "leaflet-dragging") }, _simulateEvent: function (a, c) { var b = i.createEvent("MouseEvents"); b.initMouseEvent(a, !0, !0, k, 1, c.screenX, c.screenY, c.clientX, c.clientY, !1, !1, !1, !1, 0, null); c.target.dispatchEvent(b) } }); b.Handler = b.Class.extend({ initialize: function (a) { this._map = a }, enable: function () { if (!this._enabled) this._enabled = !0, this.addHooks() }, disable: function () { if (this._enabled) this._enabled = !1, this.removeHooks() }, enabled: function () { return !!this._enabled } }); b.Map.mergeOptions({ dragging: !0, inertia: !b.Browser.android23, inertiaDeceleration: 3400, inertiaMaxSpeed: Infinity, inertiaThreshold: b.Browser.touch ? 32 : 18, easeLinearity: 0.25, longPress: !0, worldCopyJump: !1 }); b.Map.Drag = b.Handler.extend({ addHooks: function () { if (!this._draggable) { var a = this._map; this._draggable = new b.Draggable(a._mapPane, a._container, a.options.longPress); this._draggable.on({ dragstart: this._onDragStart, drag: this._onDrag, dragend: this._onDragEnd }, this); a.options.worldCopyJump && (this._draggable.on("predrag", this._onPreDrag, this), a.on("viewreset", this._onViewReset, this)) } this._draggable.enable() }, removeHooks: function () { this._draggable.disable() }, moved: function () { return this._draggable && this._draggable._moved }, _onDragStart: function () { var a = this._map; a._panAnim && a._panAnim.stop(); a.fire("movestart").fire("dragstart"); if (a.options.inertia) this._positions = [], this._times = [] }, _onDrag: function () { if (this._map.options.inertia) { var a = this._lastTime = +new Date; this._positions.push(this._lastPos = this._draggable._newPos); this._times.push(a); 200 < a - this._times[0] && (this._positions.shift(), this._times.shift()) } this._map.fire("move").fire("drag") }, _onViewReset: function () { var a = this._map.getSize()._divideBy(2); this._initialWorldOffset = this._map.latLngToLayerPoint(new b.LatLng(0, 0)).subtract(a).x; this._worldWidth = this._map.project(new b.LatLng(0, 180)).x }, _onPreDrag: function () { var a = this._worldWidth, c = Math.round(a / 2), b = this._initialWorldOffset, d = this._draggable._newPos.x, f = (d - c + b) % a + c - b, a = (d + c + b) % a - c - b; this._draggable._newPos.x = Math.abs(f + b) < Math.abs(a + b) ? f : a }, _onDragEnd: function () { var a = this._map, c = a.options, e = +new Date - this._lastTime; if (!c.inertia || e > c.inertiaThreshold || !this._positions[0]) a.fire("moveend"); else { var d = this._lastPos.subtract(this._positions[0]), f = c.easeLinearity, d = d.multiplyBy(f / ((this._lastTime + e - this._times[0]) / 1E3)), g = d.distanceTo(new b.Point(0, 0)), e = Math.min(c.inertiaMaxSpeed, g), d = d.multiplyBy(e / g), h = e / (c.inertiaDeceleration * f), j = d.multiplyBy(-h / 2).round(); b.Util.requestAnimFrame(function () { a.panBy(j, h, f) }) } a.fire("dragend"); c.maxBounds && b.Util.requestAnimFrame(this._panInsideMaxBounds, a, !0, a._container) }, _panInsideMaxBounds: function () { this.panInsideBounds(this.options.maxBounds) } }); b.Map.addInitHook("addHandler", "dragging", b.Map.Drag); b.Map.mergeOptions({ doubleClickZoom: !0 }); b.Map.DoubleClickZoom = b.Handler.extend({ addHooks: function () { this._map.on("dblclick", this._onDoubleClick) }, removeHooks: function () { this._map.off("dblclick", this._onDoubleClick) }, _onDoubleClick: function (a) { this.setView(a.latlng, this._zoom + 1) } }); b.Map.addInitHook("addHandler", "doubleClickZoom", b.Map.DoubleClickZoom); b.Map.mergeOptions({ scrollWheelZoom: !0 }); b.Map.ScrollWheelZoom = b.Handler.extend({ addHooks: function () { b.DomEvent.on(this._map._container, "mousewheel", this._onWheelScroll, this); this._delta = 0 }, removeHooks: function () { b.DomEvent.off(this._map._container, "mousewheel", this._onWheelScroll) }, _onWheelScroll: function (a) { this._delta += b.DomEvent.getWheelDelta(a); this._lastMousePos = this._map.mouseEventToContainerPoint(a); if (!this._startTime) this._startTime = +new Date; var c = Math.max(40 - (+new Date - this._startTime), 0); clearTimeout(this._timer); this._timer = setTimeout(b.bind(this._performZoom, this), c); b.DomEvent.preventDefault(a); b.DomEvent.stopPropagation(a) }, _performZoom: function () { var a = this._map, c = this._delta, b = a.getZoom(), c = 0 < c ? Math.ceil(c) : Math.round(c), c = Math.max(Math.min(c, 4), -4), c = a._limitZoom(b + c) - b; this._delta = 0; this._startTime = null; c && (c = b + c, b = this._getCenterForScrollWheelZoom(c), a.setView(b, c)) }, _getCenterForScrollWheelZoom: function (a) { var c = this._map, b = c.getZoomScale(a), a = c.getSize()._divideBy(2), b = this._lastMousePos._subtract(a)._multiplyBy(1 - 1 / b), a = c._getTopLeftPoint()._add(a)._add(b); return c.unproject(a) } }); b.Map.addInitHook("addHandler", "scrollWheelZoom", b.Map.ScrollWheelZoom); b.extend(b.DomEvent, { _touchstart: b.Browser.msTouch ? "MSPointerDown" : "touchstart", _touchend: b.Browser.msTouch ? "MSPointerUp" : "touchend", addDoubleTapListener: function (a, c, e) { function d(a) { var c; b.Browser.msTouch ? (n.push(a.pointerId), c = n.length) : c = a.touches.length; if (!(1 < c)) { c = Date.now(); var e = c - (g || c); k = a.touches ? a.touches[0] : a; h = 0 < e && e <= j; g = c } } function f(a) { if (b.Browser.msTouch) { a = n.indexOf(a.pointerId); if (-1 === a) return; n.splice(a, 1) } if (h) { if (b.Browser.msTouch) { var a = {}, e, d; for (d in k) e = k[d], a[d] = "function" === typeof e ? e.bind(k) : e; k = a } k.type = "dblclick"; c(k); g = null } } var g, h = !1, j = 250, k, l = this._touchstart, m = this._touchend, n = []; a["_leaflet_" + l + e] = d; a["_leaflet_" + m + e] = f; e = b.Browser.msTouch ? i.documentElement : a; a.addEventListener(l, d, !1); e.addEventListener(m, f, !1); b.Browser.msTouch && e.addEventListener("MSPointerCancel", f, !1); return this }, removeDoubleTapListener: function (a, c) { a.removeEventListener(this._touchstart, a["_leaflet_" + this._touchstart + c], !1); (b.Browser.msTouch ? i.documentElement : a).removeEventListener(this._touchend, a["_leaflet_" + this._touchend + c], !1); b.Browser.msTouch && i.documentElement.removeEventListener("MSPointerCancel", a["_leaflet_" + this._touchend + c], !1); return this } }); b.extend(b.DomEvent, { _msTouches: [], _msDocumentListener: !1, addMsTouchListener: function (a, c, b, d) { switch (c) { case "touchstart": return this.addMsTouchListenerStart(a, c, b, d); case "touchend": return this.addMsTouchListenerEnd(a, c, b, d); case "touchmove": return this.addMsTouchListenerMove(a, c, b, d); default: throw "Unknown touch event type"; } }, addMsTouchListenerStart: function (a, c, b, d) { var f = this._msTouches, c = function (a) { for (var c = !1, d = 0; d < f.length; d++) if (f[d].pointerId === a.pointerId) { c = !0; break } c || f.push(a); a.touches = f.slice(); a.changedTouches = [a]; b(a) }; a["_leaflet_touchstart" + d] = c; a.addEventListener("MSPointerDown", c, !1); if (!this._msDocumentListener) a = function (a) { for (var c = 0; c < f.length; c++) if (f[c].pointerId === a.pointerId) { f.splice(c, 1); break } }, i.documentElement.addEventListener("MSPointerUp", a, !1), i.documentElement.addEventListener("MSPointerCancel", a, !1), this._msDocumentListener = !0; return this }, addMsTouchListenerMove: function (a, c, b, d) { function f(a) { if (!(a.pointerType === a.MSPOINTER_TYPE_MOUSE && 0 === a.buttons)) { for (var c = 0; c < g.length; c++) if (g[c].pointerId === a.pointerId) { g[c] = a; break } a.touches = g.slice(); a.changedTouches = [a]; b(a) } } var g = this._msTouches; a["_leaflet_touchmove" + d] = f; a.addEventListener("MSPointerMove", f, !1); return this }, addMsTouchListenerEnd: function (a, c, b, d) { var f = this._msTouches, c = function (a) { for (var c = 0; c < f.length; c++) if (f[c].pointerId === a.pointerId) { f.splice(c, 1); break } a.touches = f.slice(); a.changedTouches = [a]; b(a) }; a["_leaflet_touchend" + d] = c; a.addEventListener("MSPointerUp", c, !1); a.addEventListener("MSPointerCancel", c, !1); return this }, removeMsTouchListener: function (a, c, b) { b = a["_leaflet_" + c + b]; switch (c) { case "touchstart": a.removeEventListener("MSPointerDown", b, !1); break; case "touchmove": a.removeEventListener("MSPointerMove", b, !1); break; case "touchend": a.removeEventListener("MSPointerUp", b, !1), a.removeEventListener("MSPointerCancel", b, !1) } return this } }); b.Map.mergeOptions({ touchZoom: b.Browser.touch && !b.Browser.android23 }); b.Map.TouchZoom = b.Handler.extend({ addHooks: function () { b.DomEvent.on(this._map._container, "touchstart", this._onTouchStart, this) }, removeHooks: function () { b.DomEvent.off(this._map._container, "touchstart", this._onTouchStart, this) }, _onTouchStart: function (a) { var c = this._map; if (a.touches && !(2 !== a.touches.length || c._animatingZoom || this._zooming)) { var e = c.mouseEventToLayerPoint(a.touches[0]), d = c.mouseEventToLayerPoint(a.touches[1]), f = c._getCenterLayerPoint(); this._startCenter = e.add(d)._divideBy(2); this._startDist = e.distanceTo(d); this._moved = !1; this._zooming = !0; this._centerOffset = f.subtract(this._startCenter); c._panAnim && c._panAnim.stop(); b.DomEvent.on(i, "touchmove", this._onTouchMove, this).on(i, "touchend", this._onTouchEnd, this); b.DomEvent.preventDefault(a) } }, _onTouchMove: function (a) { if (a.touches && 2 === a.touches.length) { var c = this._map, e = c.mouseEventToLayerPoint(a.touches[0]), d = c.mouseEventToLayerPoint(a.touches[1]); this._scale = e.distanceTo(d) / this._startDist; this._delta = e._add(d)._divideBy(2)._subtract(this._startCenter); if (1 !== this._scale) { if (!this._moved) b.DomUtil.addClass(c._mapPane, "leaflet-zoom-anim leaflet-touching"), c.fire("movestart").fire("zoomstart")._prepareTileBg(), this._moved = !0; b.Util.cancelAnimFrame(this._animRequest); this._animRequest = b.Util.requestAnimFrame(this._updateOnMove, this, !0, this._map._container); b.DomEvent.preventDefault(a) } } }, _updateOnMove: function () { var a = this._map, c = this._getScaleOrigin(), c = a.layerPointToLatLng(c); a.fire("zoomanim", { center: c, zoom: a.getScaleZoom(this._scale) }); a._tileBg.style[b.DomUtil.TRANSFORM] = b.DomUtil.getTranslateString(this._delta) + " " + b.DomUtil.getScaleString(this._scale, this._startCenter) }, _onTouchEnd: function () { if (this._moved && this._zooming) { var a = this._map; this._zooming = !1; b.DomUtil.removeClass(a._mapPane, "leaflet-touching"); b.DomEvent.off(i, "touchmove", this._onTouchMove).off(i, "touchend", this._onTouchEnd); var c = this._getScaleOrigin(), e = a.layerPointToLatLng(c), d = a.getZoom(), f = a.getScaleZoom(this._scale) - d, f = 0 < f ? Math.ceil(f) : Math.floor(f), d = a._limitZoom(d + f); a.fire("zoomanim", { center: e, zoom: d }); a._runAnimation(e, d, a.getZoomScale(d) / this._scale, c, !0) } }, _getScaleOrigin: function () { return this._startCenter.add(this._centerOffset.subtract(this._delta).divideBy(this._scale)) } }); b.Map.addInitHook("addHandler", "touchZoom", b.Map.TouchZoom); b.Map.mergeOptions({ boxZoom: !0 }); b.Map.BoxZoom = b.Handler.extend({ initialize: function (a) { this._map = a; this._container = a._container; this._pane = a._panes.overlayPane }, addHooks: function () { b.DomEvent.on(this._container, "mousedown", this._onMouseDown, this) }, removeHooks: function () { b.DomEvent.off(this._container, "mousedown", this._onMouseDown) }, _onMouseDown: function (a) { if (!a.shiftKey || 1 !== a.which && 1 !== a.button) return !1; b.DomUtil.disableTextSelection(); this._startLayerPoint = this._map.mouseEventToLayerPoint(a); this._box = b.DomUtil.create("div", "leaflet-zoom-box", this._pane); b.DomUtil.setPosition(this._box, this._startLayerPoint); this._container.style.cursor = "crosshair"; b.DomEvent.on(i, "mousemove", this._onMouseMove, this).on(i, "mouseup", this._onMouseUp, this).preventDefault(a); this._map.fire("boxzoomstart") }, _onMouseMove: function (a) { var c = this._startLayerPoint, e = this._box, d = this._map.mouseEventToLayerPoint(a), a = d.subtract(c), c = new b.Point(Math.min(d.x, c.x), Math.min(d.y, c.y)); b.DomUtil.setPosition(e, c); e.style.width = Math.max(0, Math.abs(a.x) - 4) + "px"; e.style.height = Math.max(0, Math.abs(a.y) - 4) + "px" }, _onMouseUp: function (a) { this._pane.removeChild(this._box); this._container.style.cursor = ""; b.DomUtil.enableTextSelection(); b.DomEvent.off(i, "mousemove", this._onMouseMove).off(i, "mouseup", this._onMouseUp); var c = this._map, a = c.mouseEventToLayerPoint(a); this._startLayerPoint.equals(a) || (a = new b.LatLngBounds(c.layerPointToLatLng(this._startLayerPoint), c.layerPointToLatLng(a)), c.fitBounds(a), c.fire("boxzoomend", { boxZoomBounds: a })) } }); b.Map.addInitHook("addHandler", "boxZoom", b.Map.BoxZoom); b.Map.mergeOptions({ keyboard: !0, keyboardPanOffset: 80, keyboardZoomOffset: 1 }); b.Map.Keyboard = b.Handler.extend({ keyCodes: { left: [37], right: [39], down: [40], up: [38], zoomIn: [187, 107, 61], zoomOut: [189, 109, 173] }, initialize: function (a) { this._map = a; this._setPanOffset(a.options.keyboardPanOffset); this._setZoomOffset(a.options.keyboardZoomOffset) }, addHooks: function () { var a = this._map._container; if (-1 === a.tabIndex) a.tabIndex = "0"; b.DomEvent.on(a, "focus", this._onFocus, this).on(a, "blur", this._onBlur, this).on(a, "mousedown", this._onMouseDown, this); this._map.on("focus", this._addHooks, this).on("blur", this._removeHooks, this) }, removeHooks: function () { this._removeHooks(); var a = this._map._container; b.DomEvent.off(a, "focus", this._onFocus, this).off(a, "blur", this._onBlur, this).off(a, "mousedown", this._onMouseDown, this); this._map.off("focus", this._addHooks, this).off("blur", this._removeHooks, this) }, _onMouseDown: function () { this._focused || this._map._container.focus() }, _onFocus: function () { this._focused = !0; this._map.fire("focus") }, _onBlur: function () { this._focused = !1; this._map.fire("blur") }, _setPanOffset: function (a) { var c = this._panKeys = {}, b = this.keyCodes, d, f; for (d = 0, f = b.left.length; d < f; d++) c[b.left[d]] = [-1 * a, 0]; for (d = 0, f = b.right.length; d < f; d++) c[b.right[d]] = [a, 0]; for (d = 0, f = b.down.length; d < f; d++) c[b.down[d]] = [0, a]; for (d = 0, f = b.up.length; d < f; d++) c[b.up[d]] = [0, -1 * a] }, _setZoomOffset: function (a) { var c = this._zoomKeys = {}, b = this.keyCodes, d, f; for (d = 0, f = b.zoomIn.length; d < f; d++) c[b.zoomIn[d]] = a; for (d = 0, f = b.zoomOut.length; d < f; d++) c[b.zoomOut[d]] = -a }, _addHooks: function () { b.DomEvent.on(i, "keydown", this._onKeyDown, this) }, _removeHooks: function () { b.DomEvent.off(i, "keydown", this._onKeyDown, this) }, _onKeyDown: function (a) { var c = a.keyCode, e = this._map; if (this._panKeys.hasOwnProperty(c)) e.panBy(this._panKeys[c]), e.options.maxBounds && e.panInsideBounds(e.options.maxBounds); else if (this._zoomKeys.hasOwnProperty(c)) e.setZoom(e.getZoom() + this._zoomKeys[c]); else return; b.DomEvent.stop(a) } }); b.Map.addInitHook("addHandler", "keyboard", b.Map.Keyboard); b.Handler.MarkerDrag = b.Handler.extend({ initialize: function (a) { this._marker = a }, addHooks: function () { var a = this._marker._icon; if (!this._draggable) this._draggable = (new b.Draggable(a, a)).on("dragstart", this._onDragStart, this).on("drag", this._onDrag, this).on("dragend", this._onDragEnd, this); this._draggable.enable() }, removeHooks: function () { this._draggable.disable() }, moved: function () { return this._draggable && this._draggable._moved }, _onDragStart: function () { this._marker.closePopup().fire("movestart").fire("dragstart") }, _onDrag: function () { var a = this._marker, c = a._shadow, e = b.DomUtil.getPosition(a._icon), d = a._map.layerPointToLatLng(e); c && b.DomUtil.setPosition(c, e); a._latlng = d; a.fire("move", { latlng: d }).fire("drag") }, _onDragEnd: function () { this._marker.fire("moveend").fire("dragend") } }); b.Handler.PolyEdit = b.Handler.extend({ options: { icon: new b.DivIcon({ iconSize: new b.Point(8, 8), className: "leaflet-div-icon leaflet-editing-icon" }) }, initialize: function (a, c) { this._poly = a; b.setOptions(this, c) }, addHooks: function () { this._poly._map && (this._markerGroup || this._initMarkers(), this._poly._map.addLayer(this._markerGroup)) }, removeHooks: function () { this._poly._map && (this._poly._map.removeLayer(this._markerGroup), delete this._markerGroup, delete this._markers) }, updateMarkers: function () { this._markerGroup.clearLayers(); this._initMarkers() }, _initMarkers: function () { if (!this._markerGroup) this._markerGroup = new b.LayerGroup; this._markers = []; var a = this._poly._latlngs, c, e, d; for (c = 0, e = a.length; c < e; c++) d = this._createMarker(a[c], c), d.on("click", this._onMarkerClick, this), this._markers.push(d); for (c = 0, a = e - 1; c < e; a = c++) if (0 !== c || b.Polygon && this._poly instanceof b.Polygon) a = this._markers[a], d = this._markers[c], this._createMiddleMarker(a, d), this._updatePrevNext(a, d) }, _createMarker: function (a, c) { var e = new b.Marker(a, { draggable: !0, icon: this.options.icon }); e._origLatLng = a; e._index = c; e.on("drag", this._onMarkerDrag, this); e.on("dragend", this._fireEdit, this); this._markerGroup.addLayer(e); return e }, _fireEdit: function () { this._poly.fire("edit") }, _onMarkerDrag: function (a) { a = a.target; b.extend(a._origLatLng, a._latlng); a._middleLeft && a._middleLeft.setLatLng(this._getMiddleLatLng(a._prev, a)); a._middleRight && a._middleRight.setLatLng(this._getMiddleLatLng(a, a._next)); this._poly.redraw() }, _onMarkerClick: function (a) { if (!(3 > this._poly._latlngs.length)) { var a = a.target, c = a._index; this._markerGroup.removeLayer(a); this._markers.splice(c, 1); this._poly.spliceLatLngs(c, 1); this._updateIndexes(c, -1); this._updatePrevNext(a._prev, a._next); a._middleLeft && this._markerGroup.removeLayer(a._middleLeft); a._middleRight && this._markerGroup.removeLayer(a._middleRight); if (a._prev && a._next) this._createMiddleMarker(a._prev, a._next); else if (a._prev) { if (!a._next) a._prev._middleRight = null } else a._next._middleLeft = null; this._poly.fire("edit") } }, _updateIndexes: function (a, c) { this._markerGroup.eachLayer(function (b) { b._index > a && (b._index += c) }) }, _createMiddleMarker: function (a, c) { var b = this._getMiddleLatLng(a, c), d = this._createMarker(b), f, g, h; d.setOpacity(0.6); a._middleRight = c._middleLeft = d; g = function () { var g = c._index; d._index = g; d.off("click", f).on("click", this._onMarkerClick, this); b.lat = d.getLatLng().lat; b.lng = d.getLatLng().lng; this._poly.spliceLatLngs(g, 0, b); this._markers.splice(g, 0, d); d.setOpacity(1); this._updateIndexes(g, 1); c._index++; this._updatePrevNext(a, d); this._updatePrevNext(d, c) }; h = function () { d.off("dragstart", g, this); d.off("dragend", h, this); this._createMiddleMarker(a, d); this._createMiddleMarker(d, c) }; f = function () { g.call(this); h.call(this); this._poly.fire("edit") }; d.on("click", f, this).on("dragstart", g, this).on("dragend", h, this); this._markerGroup.addLayer(d) }, _updatePrevNext: function (a, c) { if (a) a._next = c; if (c) c._prev = a }, _getMiddleLatLng: function (a, c) { var b = this._poly._map, d = b.latLngToLayerPoint(a.getLatLng()), f = b.latLngToLayerPoint(c.getLatLng()); return b.layerPointToLatLng(d._add(f)._divideBy(2)) } }); b.Polyline.addInitHook(function () { if (b.Handler.PolyEdit) this.editing = new b.Handler.PolyEdit(this), this.options.editable && this.editing.enable(); this.on("add", function () { this.editing && this.editing.enabled() && this.editing.addHooks() }); this.on("remove", function () { this.editing && this.editing.enabled() && this.editing.removeHooks() }) }); b.Control = b.Class.extend({ options: { position: "topright" }, initialize: function (a) { b.setOptions(this, a) }, getPosition: function () { return this.options.position }, setPosition: function (a) { var c = this._map; c && c.removeControl(this); this.options.position = a; c && c.addControl(this); return this }, addTo: function (a) { this._map = a; var c = this._container = this.onAdd(a), e = this.getPosition(), a = a._controlCorners[e]; b.DomUtil.addClass(c, "leaflet-control"); - 1 !== e.indexOf("bottom") ? a.insertBefore(c, a.firstChild) : a.appendChild(c); return this }, removeFrom: function (a) { var c = this.getPosition(); a._controlCorners[c].removeChild(this._container); this._map = null; if (this.onRemove) this.onRemove(a); return this } }); b.control = function (a) { return new b.Control(a) }; b.Map.include({ addControl: function (a) { a.addTo(this); return this }, removeControl: function (a) { a.removeFrom(this); return this }, _initControlPos: function () { function a(a, g) { c[a + g] = b.DomUtil.create("div", e + a + " " + e + g, d) } var c = this._controlCorners = {}, e = "leaflet-", d = this._controlContainer = b.DomUtil.create("div", e + "control-container", this._container); a("top", "left"); a("top", "right"); a("bottom", "left"); a("bottom", "right") } }); b.Control.Zoom = b.Control.extend({ options: { position: "topleft" }, onAdd: function (a) { var c = b.DomUtil.create("div", "leaflet-control-zoom leaflet-bar"); this._map = a; this._zoomInButton = this._createButton("+", "Zoom in", "leaflet-control-zoom-in leaflet-bar-part leaflet-bar-part-top", c, this._zoomIn, this); this._zoomOutButton = this._createButton("-", "Zoom out", "leaflet-control-zoom-out leaflet-bar-part leaflet-bar-part-bottom", c, this._zoomOut, this); a.on("zoomend", this._updateDisabled, this); return c }, onRemove: function (a) { a.off("zoomend", this._updateDisabled, this) }, _zoomIn: function (a) { this._map.zoomIn(a.shiftKey ? 3 : 1) }, _zoomOut: function (a) { this._map.zoomOut(a.shiftKey ? 3 : 1) }, _createButton: function (a, c, e, d, f, g) { e = b.DomUtil.create("a", e, d); e.innerHTML = a; e.href = "#"; e.title = c; a = b.DomEvent.stopPropagation; b.DomEvent.on(e, "click", a).on(e, "mousedown", a).on(e, "dblclick", a).on(e, "click", b.DomEvent.preventDefault).on(e, "click", f, g); return e }, _updateDisabled: function () { var a = this._map; b.DomUtil.removeClass(this._zoomInButton, "leaflet-control-zoom-disabled"); b.DomUtil.removeClass(this._zoomOutButton, "leaflet-control-zoom-disabled"); a._zoom === a.getMinZoom() && b.DomUtil.addClass(this._zoomOutButton, "leaflet-control-zoom-disabled"); a._zoom === a.getMaxZoom() && b.DomUtil.addClass(this._zoomInButton, "leaflet-control-zoom-disabled") } }); b.Map.mergeOptions({ zoomControl: !0 }); b.Map.addInitHook(function () { if (this.options.zoomControl) this.zoomControl = new b.Control.Zoom, this.addControl(this.zoomControl) }); b.control.zoom = function (a) { return new b.Control.Zoom(a) }; b.Control.Attribution = b.Control.extend({ options: { position: "bottomright", prefix: 'Powered by Leaflet' }, initialize: function (a) { b.setOptions(this, a); this._attributions = {} }, onAdd: function (a) { this._container = b.DomUtil.create("div", "leaflet-control-attribution"); b.DomEvent.disableClickPropagation(this._container); a.on("layeradd", this._onLayerAdd, this).on("layerremove", this._onLayerRemove, this); this._update(); return this._container }, onRemove: function (a) { a.off("layeradd", this._onLayerAdd).off("layerremove", this._onLayerRemove) }, setPrefix: function (a) { this.options.prefix = a; this._update(); return this }, addAttribution: function (a) { if (a) return this._attributions[a] || (this._attributions[a] = 0), this._attributions[a]++, this._update(), this }, removeAttribution: function (a) { if (a) return this._attributions[a]--, this._update(), this }, _update: function () { if (this._map) { var a = [], c; for (c in this._attributions) this._attributions.hasOwnProperty(c) && this._attributions[c] && a.push(c); c = []; this.options.prefix && c.push(this.options.prefix); a.length && c.push(a.join(", ")); this._container.innerHTML = c.join(" — ") } }, _onLayerAdd: function (a) { a.layer.getAttribution && this.addAttribution(a.layer.getAttribution()) }, _onLayerRemove: function (a) { a.layer.getAttribution && this.removeAttribution(a.layer.getAttribution()) } }); b.Map.mergeOptions({ attributionControl: !0 }); b.Map.addInitHook(function () { if (this.options.attributionControl) this.attributionControl = (new b.Control.Attribution).addTo(this) }); b.control.attribution = function (a) { return new b.Control.Attribution(a) }; b.Control.Scale = b.Control.extend({ options: { position: "bottomleft", maxWidth: 100, metric: !0, imperial: !0, updateWhenIdle: !1 }, onAdd: function (a) { this._map = a; var c = b.DomUtil.create("div", "leaflet-control-scale"), e = this.options; this._addScales(e, "leaflet-control-scale", c); a.on(e.updateWhenIdle ? "moveend" : "move", this._update, this); a.whenReady(this._update, this); return c }, onRemove: function (a) { a.off(this.options.updateWhenIdle ? "moveend" : "move", this._update, this) }, _addScales: function (a, c, e) { if (a.metric) this._mScale = b.DomUtil.create("div", c + "-line", e); if (a.imperial) this._iScale = b.DomUtil.create("div", c + "-line", e) }, _update: function () { var a = this._map.getBounds(), c = a.getCenter().lat, a = 6378137 * Math.PI * Math.cos(c * Math.PI / 180) * (a.getNorthEast().lng - a.getSouthWest().lng) / 180, c = this._map.getSize(), b = this.options, d = 0; 0 < c.x && (d = a * (b.maxWidth / c.x)); this._updateScales(b, d) }, _updateScales: function (a, c) { a.metric && c && this._updateMetric(c); a.imperial && c && this._updateImperial(c) }, _updateMetric: function (a) { var c = this._getRoundNum(a); this._mScale.style.width = this._getScaleWidth(c / a) + "px"; this._mScale.innerHTML = 1E3 > c ? c + " m" : c / 1E3 + " km" }, _updateImperial: function (a) { var c = 3.2808399 * a, a = this._iScale, b; 5280 < c ? (c /= 5280, b = this._getRoundNum(c), a.style.width = this._getScaleWidth(b / c) + "px", a.innerHTML = b + " mi") : (b = this._getRoundNum(c), a.style.width = this._getScaleWidth(b / c) + "px", a.innerHTML = b + " ft") }, _getScaleWidth: function (a) { return Math.round(this.options.maxWidth * a) - 10 }, _getRoundNum: function (a) { var b = Math.pow(10, (Math.floor(a) + "").length - 1), a = a / b; return b * (10 <= a ? 10 : 5 <= a ? 5 : 3 <= a ? 3 : 2 <= a ? 2 : 1) } }); b.control.scale = function (a) { return new b.Control.Scale(a) }; b.Control.Layers = b.Control.extend({ options: { collapsed: !0, position: "topright", autoZIndex: !0 }, initialize: function (a, c, e) { b.setOptions(this, e); this._layers = {}; this._lastZIndex = 0; this._handlingClick = !1; for (var d in a) a.hasOwnProperty(d) && this._addLayer(a[d], d); for (d in c) c.hasOwnProperty(d) && this._addLayer(c[d], d, !0) }, onAdd: function (a) { this._initLayout(); this._update(); a.on("layeradd", this._onLayerChange, this).on("layerremove", this._onLayerChange, this); return this._container }, onRemove: function (a) { a.off("layeradd", this._onLayerChange).off("layerremove", this._onLayerChange) }, addBaseLayer: function (a, b) { this._addLayer(a, b); this._update(); return this }, addOverlay: function (a, b) { this._addLayer(a, b, !0); this._update(); return this }, removeLayer: function (a) { delete this._layers[b.stamp(a)]; this._update(); return this }, _initLayout: function () { var a = this._container = b.DomUtil.create("div", "leaflet-control-layers"); if (b.Browser.touch) b.DomEvent.on(a, "click", b.DomEvent.stopPropagation); else b.DomEvent.disableClickPropagation(a), b.DomEvent.on(a, "mousewheel", b.DomEvent.stopPropagation); var c = this._form = b.DomUtil.create("form", "leaflet-control-layers-list"); if (this.options.collapsed) { b.DomEvent.on(a, "mouseover", this._expand, this).on(a, "mouseout", this._collapse, this); var e = this._layersLink = b.DomUtil.create("a", "leaflet-control-layers-toggle", a); e.href = "#"; e.title = "Layers"; if (b.Browser.touch) b.DomEvent.on(e, "click", b.DomEvent.stopPropagation).on(e, "click", b.DomEvent.preventDefault).on(e, "click", this._expand, this); else b.DomEvent.on(e, "focus", this._expand, this); this._map.on("movestart", this._collapse, this) } else this._expand(); this._baseLayersList = b.DomUtil.create("div", "leaflet-control-layers-base", c); this._separator = b.DomUtil.create("div", "leaflet-control-layers-separator", c); this._overlaysList = b.DomUtil.create("div", "leaflet-control-layers-overlays", c); a.appendChild(c) }, _addLayer: function (a, c, e) { this._layers[b.stamp(a)] = { layer: a, name: c, overlay: e }; this.options.autoZIndex && a.setZIndex && (this._lastZIndex++, a.setZIndex(this._lastZIndex)) }, _update: function () { if (this._container) { this._baseLayersList.innerHTML = ""; this._overlaysList.innerHTML = ""; var a = !1, b = !1, e; for (e in this._layers) if (this._layers.hasOwnProperty(e)) { var d = this._layers[e]; this._addItem(d); b = b || d.overlay; a = a || !d.overlay } this._separator.style.display = b && a ? "" : "none" } }, _onLayerChange: function (a) { this._layers[b.stamp(a.layer)] && !this._handlingClick && this._update() }, _createRadioElement: function (a, b) { var e = '", d = i.createElement("div"); d.innerHTML = e; return d.firstChild }, _addItem: function (a) { var c = i.createElement("label"), e, d = this._map.hasLayer(a.layer); a.overlay ? (e = i.createElement("input"), e.type = "checkbox", e.className = "leaflet-control-layers-selector", e.defaultChecked = d) : e = this._createRadioElement("leaflet-base-layers", d); e.layerId = b.stamp(a.layer); b.DomEvent.on(e, "click", this._onInputClick, this); d = i.createElement("span"); d.innerHTML = " " + a.name; c.appendChild(e); c.appendChild(d); (a.overlay ? this._overlaysList : this._baseLayersList).appendChild(c); return c }, _onInputClick: function () { var a, b, e, d = this._form.getElementsByTagName("input"), f = d.length, g; this._handlingClick = !0; for (a = 0; a < f; a++) if (b = d[a], e = this._layers[b.layerId], b.checked && !this._map.hasLayer(e.layer)) { if (this._map.addLayer(e.layer), !e.overlay) g = e.layer } else !b.checked && this._map.hasLayer(e.layer) && this._map.removeLayer(e.layer); g && (this._map.setZoom(this._map.getZoom()), this._map.fire("baselayerchange", { layer: g })); this._handlingClick = !1 }, _expand: function () { b.DomUtil.addClass(this._container, "leaflet-control-layers-expanded") }, _collapse: function () { this._container.className = this._container.className.replace(" leaflet-control-layers-expanded", "") } }); b.control.layers = function (a, c, e) { return new b.Control.Layers(a, c, e) }; b.PosAnimation = b.Class.extend({ includes: b.Mixin.Events, run: function (a, c, e, d) { this.stop(); this._el = a; this._inProgress = !0; this.fire("start"); a.style[b.DomUtil.TRANSITION] = "all " + (e || 0.25) + "s cubic-bezier(0,0," + (d || 0.5) + ",1)"; b.DomEvent.on(a, b.DomUtil.TRANSITION_END, this._onTransitionEnd, this); b.DomUtil.setPosition(a, c); b.Util.falseFn(a.offsetWidth); this._stepTimer = setInterval(b.bind(this.fire, this, "step"), 50) }, stop: function () { this._inProgress && (b.DomUtil.setPosition(this._el, this._getPos()), this._onTransitionEnd(), b.Util.falseFn(this._el.offsetWidth)) }, _transformRe: /(-?[\d\.]+), (-?[\d\.]+)\)/, _getPos: function () { var a, c; c = k.getComputedStyle(this._el); b.Browser.any3d ? (c = c[b.DomUtil.TRANSFORM].match(this._transformRe), a = parseFloat(c[1]), c = parseFloat(c[2])) : (a = parseFloat(c.left), c = parseFloat(c.top)); console.log(a, c); return new b.Point(a, c, !0) }, _onTransitionEnd: function () { b.DomEvent.off(this._el, b.DomUtil.TRANSITION_END, this._onTransitionEnd, this); if (this._inProgress) this._inProgress = !1, this._el.style[b.DomUtil.TRANSITION] = "", clearInterval(this._stepTimer), this.fire("step").fire("end") } }); b.Map.include({ setView: function (a, b, e) { var b = this._limitZoom(b), d = this._zoom !== b; if (this._loaded && !e && this._layers && (this._panAnim && this._panAnim.stop(), d ? this._zoomToIfClose && this._zoomToIfClose(a, b) : this._panByIfClose(a))) return clearTimeout(this._sizeTimer), this; this._resetView(a, b); return this }, panBy: function (a, c, e) { a = b.point(a); if (!a.x && !a.y) return this; if (!this._panAnim) this._panAnim = new b.PosAnimation, this._panAnim.on({ step: this._onPanTransitionStep, end: this._onPanTransitionEnd }, this); this.fire("movestart"); b.DomUtil.addClass(this._mapPane, "leaflet-pan-anim"); this._panAnim.run(this._mapPane, b.DomUtil.getPosition(this._mapPane).subtract(a)._round(), c || 0.25, e); return this }, _onPanTransitionStep: function () { this.fire("move") }, _onPanTransitionEnd: function () { b.DomUtil.removeClass(this._mapPane, "leaflet-pan-anim"); this.fire("moveend") }, _panByIfClose: function (a) { a = this._getCenterOffset(a)._floor(); return this._offsetIsWithinView(a) ? (this.panBy(a), !0) : !1 }, _offsetIsWithinView: function (a, b) { var e = b || 1, d = this.getSize(); return Math.abs(a.x) <= d.x * e && Math.abs(a.y) <= d.y * e } }); b.PosAnimation = b.DomUtil.TRANSITION ? b.PosAnimation : b.PosAnimation.extend({ run: function (a, c, e, d) { this.stop(); this._el = a; this._inProgress = !0; this._duration = e || 0.25; this._easeOutPower = 1 / Math.max(d || 0.5, 0.2); this._startPos = b.DomUtil.getPosition(a); this._offset = c.subtract(this._startPos); this._startTime = +new Date; this.fire("start"); this._animate() }, stop: function () { this._inProgress && (this._step(), this._complete()) }, _animate: function () { this._animId = b.Util.requestAnimFrame(this._animate, this); this._step() }, _step: function () { var a = +new Date - this._startTime, b = 1E3 * this._duration; a < b ? this._runFrame(this._easeOut(a / b)) : (this._runFrame(1), this._complete()) }, _runFrame: function (a) { a = this._startPos.add(this._offset.multiplyBy(a)); b.DomUtil.setPosition(this._el, a); this.fire("step") }, _complete: function () { b.Util.cancelAnimFrame(this._animId); this._inProgress = !1; this.fire("end") }, _easeOut: function (a) { return 1 - Math.pow(1 - a, this._easeOutPower) } }); b.Map.mergeOptions({ zoomAnimation: b.DomUtil.TRANSITION && !b.Browser.android23 && !b.Browser.mobileOpera }); b.DomUtil.TRANSITION && b.Map.addInitHook(function () { b.DomEvent.on(this._mapPane, b.DomUtil.TRANSITION_END, this._catchTransitionEnd, this) }); b.Map.include(!b.DomUtil.TRANSITION ? {} : { _zoomToIfClose: function (a, c) { if (this._animatingZoom) return !0; if (!this.options.zoomAnimation) return !1; var e = this.getZoomScale(c), d = this._getCenterOffset(a)._divideBy(1 - 1 / e); if (!this._offsetIsWithinView(d, 1)) return !1; b.DomUtil.addClass(this._mapPane, "leaflet-zoom-anim"); this.fire("movestart").fire("zoomstart"); this.fire("zoomanim", { center: a, zoom: c }); d = this._getCenterLayerPoint().add(d); this._prepareTileBg(); this._runAnimation(a, c, e, d); return !0 }, _catchTransitionEnd: function () { this._animatingZoom && this._onZoomTransitionEnd() }, _runAnimation: function (a, c, e, d, f) { this._animateToCenter = a; this._animateToZoom = c; this._animatingZoom = !0; if (b.Draggable) b.Draggable._disabled = !0; a = b.DomUtil.TRANSFORM; c = this._tileBg; clearTimeout(this._clearTileBgTimer); b.Util.falseFn(c.offsetWidth); e = b.DomUtil.getScaleString(e, d); d = c.style[a]; c.style[a] = f ? d + " " + e : e + " " + d }, _prepareTileBg: function () { var a = this._tilePane, c = this._tileBg; if (c && 0.5 < this._getLoadedTilesPercentage(c) && 0.5 > this._getLoadedTilesPercentage(a)) a.style.visibility = "hidden", a.empty = !0; else { if (!c) c = this._tileBg = this._createPane("leaflet-tile-pane", this._mapPane), c.style.zIndex = 1; c.style[b.DomUtil.TRANSFORM] = ""; c.style.visibility = "hidden"; c.empty = !0; a.empty = !1; this._tilePane = this._panes.tilePane = c; a = this._tileBg = a; b.DomUtil.addClass(a, "leaflet-zoom-animated") } this._stopLoadingImages(a) }, _getLoadedTilesPercentage: function (a) { var a = a.getElementsByTagName("img"), b, e, d = 0; for (b = 0, e = a.length; b < e; b++) a[b].complete && d++; return d / e }, _stopLoadingImages: function (a) { var a = Array.prototype.slice.call(a.getElementsByTagName("img")), c, e, d; for (c = 0, e = a.length; c < e; c++) if (d = a[c], !d.complete) d.onload = b.Util.falseFn, d.onerror = b.Util.falseFn, d.src = b.Util.emptyImageUrl, d.parentNode.removeChild(d) }, _onZoomTransitionEnd: function () { this._restoreTileFront(); b.DomUtil.removeClass(this._mapPane, "leaflet-zoom-anim"); b.Util.falseFn(this._tileBg.offsetWidth); this._animatingZoom = !1; this._resetView(this._animateToCenter, this._animateToZoom, !0, !0); if (b.Draggable) b.Draggable._disabled = !1 }, _restoreTileFront: function () { this._tilePane.innerHTML = ""; this._tilePane.style.visibility = ""; this._tilePane.style.zIndex = 2; this._tileBg.style.zIndex = 1 }, _clearTileBg: function () { if (!this._animatingZoom && !this.touchZoom._zooming) this._tileBg.innerHTML = "" } }); b.Map.include({ _defaultLocateOptions: { watch: !1, setView: !1, maxZoom: Infinity, timeout: 1E4, maximumAge: 0, enableHighAccuracy: !1 }, locate: function (a) { a = this._locationOptions = b.extend(this._defaultLocateOptions, a); if (!navigator.geolocation) return this._handleGeolocationError({ code: 0, message: "Geolocation not supported." }), this; var c = b.bind(this._handleGeolocationResponse, this), e = b.bind(this._handleGeolocationError, this); a.watch ? this._locationWatchId = navigator.geolocation.watchPosition(c, e, a) : navigator.geolocation.getCurrentPosition(c, e, a); return this }, stopLocate: function () { navigator.geolocation && navigator.geolocation.clearWatch(this._locationWatchId); return this }, _handleGeolocationError: function (a) { var b = a.code, a = a.message || (1 === b ? "permission denied" : 2 === b ? "position unavailable" : "timeout"); this._locationOptions.setView && !this._loaded && this.fitWorld(); this.fire("locationerror", { code: b, message: "Geolocation error: " + a + "." }) }, _handleGeolocationResponse: function (a) { var c = 180 * a.coords.accuracy / 4E7, e = 2 * c, d = a.coords.latitude, f = a.coords.longitude, g = new b.LatLng(d, f), h = new b.LatLng(d - c, f - e), c = new b.LatLng(d + c, f + e), h = new b.LatLngBounds(h, c), c = this._locationOptions; c.setView && (c = Math.min(this.getBoundsZoom(h), c.maxZoom), this.setView(g, c)); this.fire("locationfound", { latlng: g, bounds: h, accuracy: a.coords.accuracy }) } }) })(this, document); (function (b) { b(function () { var e = b.support, a; a: { a = document.createElement("bootstrap"); var c = { WebkitTransition: "webkitTransitionEnd", MozTransition: "transitionend", OTransition: "oTransitionEnd", msTransition: "MSTransitionEnd", transition: "transitionend" }, d; for (d in c) if (void 0 !== a.style[d]) { a = c[d]; break a } a = void 0 } e.transition = a && { end: a } }) })(window.jQuery); (function (b) { var e = function (a) { b(a).on("click", '[data-dismiss="alert"]', this.close) }; e.prototype.close = function (a) { function c() { e.trigger("closed").remove() } var d = b(this), f = d.attr("data-target"), e; f || (f = (f = d.attr("href")) && f.replace(/.*(?=#[^\s]*$)/, "")); e = b(f); a && a.preventDefault(); e.length || (e = d.hasClass("alert") ? d : d.parent()); e.trigger(a = b.Event("close")); a.isDefaultPrevented() || (e.removeClass("in"), b.support.transition && e.hasClass("fade") ? e.on(b.support.transition.end, c) : c()) }; b.fn.alert = function (a) { return this.each(function () { var c = b(this), d = c.data("alert"); d || c.data("alert", d = new e(this)); "string" == typeof a && d[a].call(c) }) }; b.fn.alert.Constructor = e; b(function () { b("body").on("click.alert.data-api", '[data-dismiss="alert"]', e.prototype.close) }) })(window.jQuery); (function (b) { var e = function (a, c) { this.$element = b(a); this.options = b.extend({}, b.fn.button.defaults, c) }; e.prototype.setState = function (a) { var b = this.$element, d = b.data(), f = b.is("input") ? "val" : "html", a = a + "Text"; d.resetText || b.data("resetText", b[f]()); b[f](d[a] || this.options[a]); setTimeout(function () { "loadingText" == a ? b.addClass("disabled").attr("disabled", "disabled") : b.removeClass("disabled").removeAttr("disabled") }, 0) }; e.prototype.toggle = function () { var a = this.$element.parent('[data-toggle="buttons-radio"]'); a && a.find(".active").removeClass("active"); this.$element.toggleClass("active") }; b.fn.button = function (a) { return this.each(function () { var c = b(this), d = c.data("button"), f = "object" == typeof a && a; d || c.data("button", d = new e(this, f)); "toggle" == a ? d.toggle() : a && d.setState(a) }) }; b.fn.button.defaults = { loadingText: "loading..." }; b.fn.button.Constructor = e; b(function () { b("body").on("click.button.data-api", "[data-toggle^=button]", function (a) { a = b(a.target); a.hasClass("btn") || (a = a.closest(".btn")); a.button("toggle") }) }) })(window.jQuery); (function (b) { var e = function (a, c) { this.$element = b(a); this.options = c; this.options.slide && this.slide(this.options.slide); "hover" == this.options.pause && this.$element.on("mouseenter", b.proxy(this.pause, this)).on("mouseleave", b.proxy(this.cycle, this)) }; e.prototype = { cycle: function (a) { if (!a) this.paused = !1; this.options.interval && !this.paused && (this.interval = setInterval(b.proxy(this.next, this), this.options.interval)); return this }, to: function (a) { var c = this.$element.find(".active"), d = c.parent().children(), c = d.index(c), f = this; if (!(a > d.length - 1 || 0 > a)) return this.sliding ? this.$element.one("slid", function () { f.to(a) }) : c == a ? this.pause().cycle() : this.slide(a > c ? "next" : "prev", b(d[a])) }, pause: function (a) { if (!a) this.paused = !0; clearInterval(this.interval); this.interval = null; return this }, next: function () { return this.sliding ? void 0 : this.slide("next") }, prev: function () { return this.sliding ? void 0 : this.slide("prev") }, slide: function (a, c) { var d = this.$element.find(".active"), f = c || d[a](), e = this.interval, g = "next" == a ? "left" : "right", i = "next" == a ? "first" : "last", k = this, j = b.Event("slide"); this.sliding = !0; e && this.pause(); f = f.length ? f : this.$element.find(".item")[i](); if (!f.hasClass("active")) { if (b.support.transition && this.$element.hasClass("slide")) { this.$element.trigger(j); if (j.isDefaultPrevented()) return; f.addClass(a); d.addClass(g); f.addClass(g); this.$element.one(b.support.transition.end, function () { f.removeClass([a, g].join(" ")).addClass("active"); d.removeClass(["active", g].join(" ")); k.sliding = !1; setTimeout(function () { k.$element.trigger("slid") }, 0) }) } else { this.$element.trigger(j); if (j.isDefaultPrevented()) return; d.removeClass("active"); f.addClass("active"); this.sliding = !1; this.$element.trigger("slid") } e && this.cycle(); return this } } }; b.fn.carousel = function (a) { return this.each(function () { var c = b(this), d = c.data("carousel"), f = b.extend({}, b.fn.carousel.defaults, "object" == typeof a && a); d || c.data("carousel", d = new e(this, f)); if ("number" == typeof a) d.to(a); else if ("string" == typeof a || (a = f.slide)) d[a](); else f.interval && d.cycle() }) }; b.fn.carousel.defaults = { interval: 5E3, pause: "hover" }; b.fn.carousel.Constructor = e; b(function () { b("body").on("click.carousel.data-api", "[data-slide]", function (a) { var c = b(this), d, f = b(c.attr("data-target") || (d = c.attr("href")) && d.replace(/.*(?=#[^\s]+$)/, "")), c = !f.data("modal") && b.extend({}, f.data(), c.data()); f.carousel(c); a.preventDefault() }) }) })(window.jQuery); (function (b) { var e = function (a, c) { this.$element = b(a); this.options = b.extend({}, b.fn.collapse.defaults, c); if (this.options.parent) this.$parent = b(this.options.parent); this.options.toggle && this.toggle() }; e.prototype = { constructor: e, dimension: function () { return this.$element.hasClass("width") ? "width" : "height" }, show: function () { var a, c, d, f; if (!this.transitioning) { a = this.dimension(); c = b.camelCase(["scroll", a].join("-")); if ((d = this.$parent && this.$parent.find("> .accordion-group > .in")) && d.length) { if ((f = d.data("collapse")) && f.transitioning) return; d.collapse("hide"); f || d.data("collapse", null) } this.$element[a](0); this.transition("addClass", b.Event("show"), "shown"); this.$element[a](this.$element[0][c]) } }, hide: function () { var a; this.transitioning || (a = this.dimension(), this.reset(this.$element[a]()), this.transition("removeClass", b.Event("hide"), "hidden"), this.$element[a](0)) }, reset: function (a) { var b = this.dimension(); this.$element.removeClass("collapse")[b](a || "auto"); this.$element[null !== a ? "addClass" : "removeClass"]("collapse"); return this }, transition: function (a, c, d) { var f = this, e = function () { "show" == c.type && f.reset(); f.transitioning = 0; f.$element.trigger(d) }; this.$element.trigger(c); if (!c.isDefaultPrevented()) this.transitioning = 1, this.$element[a]("in"), b.support.transition && this.$element.hasClass("collapse") ? this.$element.one(b.support.transition.end, e) : e() }, toggle: function () { this[this.$element.hasClass("in") ? "hide" : "show"]() } }; b.fn.collapse = function (a) { return this.each(function () { var c = b(this), d = c.data("collapse"), f = "object" == typeof a && a; d || c.data("collapse", d = new e(this, f)); if ("string" == typeof a) d[a]() }) }; b.fn.collapse.defaults = { toggle: !0 }; b.fn.collapse.Constructor = e; b(function () { b("body").on("click.collapse.data-api", "[data-toggle=collapse]", function (a) { var c = b(this), d, a = c.attr("data-target") || a.preventDefault() || (d = c.attr("href")) && d.replace(/.*(?=#[^\s]+$)/, ""), c = b(a).data("collapse") ? "toggle" : c.data(); b(a).collapse(c) }) }) })(window.jQuery); (function (b) { function e() { b(a).parent().removeClass("open") } var a = '[data-toggle="dropdown"]', c = function (a) { var c = b(a).on("click.dropdown.data-api", this.toggle); b("html").on("click.dropdown.data-api", function () { c.parent().removeClass("open") }) }; c.prototype = { constructor: c, toggle: function () { var a = b(this), c; if (!a.is(".disabled, :disabled")) return c = a.attr("data-target"), c || (c = (c = a.attr("href")) && c.replace(/.*(?=#[^\s]*$)/, "")), c = b(c), c.length || (c = a.parent()), a = c.hasClass("open"), e(), a || c.toggleClass("open"), !1 } }; b.fn.dropdown = function (a) { return this.each(function () { var f = b(this), e = f.data("dropdown"); e || f.data("dropdown", e = new c(this)); "string" == typeof a && e[a].call(f) }) }; b.fn.dropdown.Constructor = c; b(function () { b("html").on("click.dropdown.data-api", e); b("body").on("click.dropdown", ".dropdown form", function (a) { a.stopPropagation() }).on("click.dropdown.data-api", a, c.prototype.toggle) }) })(window.jQuery); (function (b) { function e() { var c = this, d = setTimeout(function () { c.$element.off(b.support.transition.end); a.call(c) }, 500); this.$element.one(b.support.transition.end, function () { clearTimeout(d); a.call(c) }) } function a() { this.$element.hide().trigger("hidden"); c.call(this) } function c(a) { var c = this.$element.hasClass("fade") ? "fade" : ""; if (this.isShown && this.options.backdrop) { var f = b.support.transition && c; this.$backdrop = b('