/* 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('').appendTo(document.body);
"static" != this.options.backdrop &&
this.$backdrop.click(b.proxy(this.hide, this));
this.$backdrop.addClass("in");
f ? this.$backdrop.one(b.support.transition.end, a) : a()
} else !this.isShown && this.$backdrop ? (this.$backdrop.removeClass("in"), b.support.transition && this.$element.hasClass("fade") ? this.$backdrop.one(b.support.transition.end, b.proxy(d, this)) : d.call(this)) : a && a()
}
function d() {
this.$backdrop.remove();
this.$backdrop = null
}
function f() {
var a = this;
if (this.isShown && this.options.keyboard) b(document).on("keyup.dismiss.modal", function (b) {
27 ==
b.which && a.hide()
});
else this.isShown || b(document).off("keyup.dismiss.modal")
}
var h = function (a, c) {
this.options = c;
this.$element = b(a).delegate('[data-dismiss="modal"]', "click.dismiss.modal", b.proxy(this.hide, this))
};
h.prototype = {
constructor: h,
toggle: function () {
return this[!this.isShown ? "show" : "hide"]()
},
show: function () {
var a = this,
d = b.Event("show");
this.$element.trigger(d);
if (!this.isShown && !d.isDefaultPrevented()) b("body").addClass("modal-open"), this.isShown = !0, f.call(this), c.call(this, function () {
var c =
b.support.transition && a.$element.hasClass("fade");
a.$element.parent().length || a.$element.appendTo(document.body);
a.$element.show();
a.$element.addClass("in");
c ? a.$element.one(b.support.transition.end, function () {
a.$element.trigger("shown")
}) : a.$element.trigger("shown")
})
},
hide: function (c) {
c && c.preventDefault();
c = b.Event("hide");
this.$element.trigger(c);
if (this.isShown && !c.isDefaultPrevented()) this.isShown = !1, b("body").removeClass("modal-open"), f.call(this), this.$element.removeClass("in"), b.support.transition &&
this.$element.hasClass("fade") ? e.call(this) : a.call(this)
}
};
b.fn.modal = function (a) {
return this.each(function () {
var c = b(this),
d = c.data("modal"),
f = b.extend({}, b.fn.modal.defaults, c.data(), "object" == typeof a && a);
d || c.data("modal", d = new h(this, f));
if ("string" == typeof a) d[a]();
else f.show && d.show()
})
};
b.fn.modal.defaults = {
backdrop: !0,
keyboard: !0,
show: !0
};
b.fn.modal.Constructor = h;
b(function () {
b("body").on("click.modal.data-api", '[data-toggle="modal"]', function (a) {
var c = b(this),
d, f = b(c.attr("data-target") ||
(d = c.attr("href")) && d.replace(/.*(?=#[^\s]+$)/, "")),
c = f.data("modal") ? "toggle" : b.extend({}, f.data(), c.data());
a.preventDefault();
f.modal(c)
})
})
})(window.jQuery);
(function (b) {
var e = function (a, b) {
this.init("tooltip", a, b)
};
e.prototype = {
constructor: e,
init: function (a, c, d) {
this.type = a;
this.$element = b(c);
this.options = this.getOptions(d);
this.enabled = !0;
"manual" != this.options.trigger && (a = "hover" == this.options.trigger ? "mouseenter" : "focus", c = "hover" == this.options.trigger ? "mouseleave" : "blur", this.$element.on(a, this.options.selector, b.proxy(this.enter, this)), this.$element.on(c, this.options.selector, b.proxy(this.leave, this)));
this.options.selector ? this._options = b.extend({},
this.options, {
trigger: "manual",
selector: ""
}) : this.fixTitle()
},
getOptions: function (a) {
a = b.extend({}, b.fn[this.type].defaults, a, this.$element.data());
if (a.delay && "number" == typeof a.delay) a.delay = {
show: a.delay,
hide: a.delay
};
return a
},
enter: function (a) {
var c = b(a.currentTarget)[this.type](this._options).data(this.type);
if (!c.options.delay || !c.options.delay.show) return c.show();
clearTimeout(this.timeout);
c.hoverState = "in";
this.timeout = setTimeout(function () {
"in" == c.hoverState && c.show()
}, c.options.delay.show)
},
leave: function (a) {
var c = b(a.currentTarget)[this.type](this._options).data(this.type);
if (!c.options.delay || !c.options.delay.hide) return c.hide();
clearTimeout(this.timeout);
c.hoverState = "out";
this.timeout = setTimeout(function () {
"out" == c.hoverState && c.hide()
}, c.options.delay.hide)
},
show: function () {
var a, b, d, f, e, g, i;
if (this.hasContent() && this.enabled) {
a = this.tip();
this.setContent();
this.options.animation && a.addClass("fade");
g = "function" == typeof this.options.placement ? this.options.placement.call(this, a[0],
this.$element[0]) : this.options.placement;
b = /in/.test(g);
a.remove().css({
top: 0,
left: 0,
display: "block"
}).appendTo(b ? this.$element : document.body);
d = this.getPosition(b);
f = a[0].offsetWidth;
e = a[0].offsetHeight;
switch (b ? g.split(" ")[1] : g) {
case "bottom":
i = {
top: d.top + d.height,
left: d.left + d.width / 2 - f / 2
};
break;
case "top":
i = {
top: d.top - e,
left: d.left + d.width / 2 - f / 2
};
break;
case "left":
i = {
top: d.top + d.height / 2 - e / 2,
left: d.left - f
};
break;
case "right":
i = {
top: d.top + d.height / 2 - e / 2,
left: d.left + d.width
}
}
a.css(i).addClass(g).addClass("in")
}
},
isHTML: function (a) {
return "string" != typeof a || "<" === a.charAt(0) && ">" === a.charAt(a.length - 1) && 3 <= a.length || /^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(a)
},
setContent: function () {
var a = this.tip(),
b = this.getTitle();
a.find(".tooltip-inner")[this.isHTML(b) ? "html" : "text"](b);
a.removeClass("fade in top bottom left right")
},
hide: function () {
function a() {
var a = setTimeout(function () {
c.off(b.support.transition.end).remove()
}, 500);
c.one(b.support.transition.end, function () {
clearTimeout(a);
c.remove()
})
}
var c = this.tip();
c.removeClass("in");
b.support.transition && this.$tip.hasClass("fade") ? a() : c.remove()
},
fixTitle: function () {
var a = this.$element;
if (a.attr("title") || "string" != typeof a.attr("data-original-title")) a.attr("data-original-title", a.attr("title") || "").removeAttr("title")
},
hasContent: function () {
return this.getTitle()
},
getPosition: function (a) {
return b.extend({}, a ? {
top: 0,
left: 0
} : this.$element.offset(), {
width: this.$element[0].offsetWidth,
height: this.$element[0].offsetHeight
})
},
getTitle: function () {
var a = this.$element,
b = this.options;
return a.attr("data-original-title") || ("function" == typeof b.title ? b.title.call(a[0]) : b.title)
},
tip: function () {
return this.$tip = this.$tip || b(this.options.template)
},
validate: function () {
if (!this.$element[0].parentNode) this.hide(), this.options = this.$element = null
},
enable: function () {
this.enabled = !0
},
disable: function () {
this.enabled = !1
},
toggleEnabled: function () {
this.enabled = !this.enabled
},
toggle: function () {
this[this.tip().hasClass("in") ? "hide" : "show"]()
}
};
b.fn.tooltip = function (a) {
return this.each(function () {
var c =
b(this),
d = c.data("tooltip"),
f = "object" == typeof a && a;
d || c.data("tooltip", d = new e(this, f));
if ("string" == typeof a) d[a]()
})
};
b.fn.tooltip.Constructor = e;
b.fn.tooltip.defaults = {
animation: !0,
placement: "top",
selector: !1,
template: '
',
trigger: "hover",
title: "",
delay: 0
}
})(window.jQuery);
(function (b) {
var e = function (a, b) {
this.init("popover", a, b)
};
e.prototype = b.extend({}, b.fn.tooltip.Constructor.prototype, {
constructor: e,
setContent: function () {
var a = this.tip(),
b = this.getTitle(),
d = this.getContent();
a.find(".popover-title")[this.isHTML(b) ? "html" : "text"](b);
a.find(".popover-content > *")[this.isHTML(d) ? "html" : "text"](d);
a.removeClass("fade top bottom left right in")
},
hasContent: function () {
return this.getTitle() || this.getContent()
},
getContent: function () {
var a = this.$element,
b = this.options;
return a.attr("data-content") || ("function" == typeof b.content ? b.content.call(a[0]) : b.content)
},
tip: function () {
if (!this.$tip) this.$tip = b(this.options.template);
return this.$tip
}
});
b.fn.popover = function (a) {
return this.each(function () {
var c = b(this),
d = c.data("popover"),
f = "object" == typeof a && a;
d || c.data("popover", d = new e(this, f));
if ("string" == typeof a) d[a]()
})
};
b.fn.popover.Constructor = e;
b.fn.popover.defaults = b.extend({}, b.fn.tooltip.defaults, {
placement: "right",
content: "",
template: '
'
})
})(window.jQuery);
(function (b) {
function e(a, c) {
var d = b.proxy(this.process, this),
f = b(a).is("body") ? b(window) : b(a),
e;
this.options = b.extend({}, b.fn.scrollspy.defaults, c);
this.$scrollElement = f.on("scroll.scroll.data-api", d);
this.selector = (this.options.target || (e = b(a).attr("href")) && e.replace(/.*(?=#[^\s]+$)/, "") || "") + " .nav li > a";
this.$body = b("body");
this.refresh();
this.process()
}
e.prototype = {
constructor: e,
refresh: function () {
var a = this;
this.offsets = b([]);
this.targets = b([]);
this.$body.find(this.selector).map(function () {
var a =
b(this),
a = a.data("target") || a.attr("href"),
d = /^#\w/.test(a) && b(a);
return d && a.length && [
[d.position().top, a]
] || null
}).sort(function (a, b) {
return a[0] - b[0]
}).each(function () {
a.offsets.push(this[0]);
a.targets.push(this[1])
})
},
process: function () {
var a = this.$scrollElement.scrollTop() + this.options.offset,
b = (this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight) - this.$scrollElement.height(),
d = this.offsets,
f = this.targets,
e = this.activeTarget,
g;
if (a >= b) return e != (g = f.last()[0]) && this.activate(g);
for (g =
d.length; g--;) e != f[g] && a >= d[g] && (!d[g + 1] || a <= d[g + 1]) && this.activate(f[g])
},
activate: function (a) {
this.activeTarget = a;
b(this.selector).parent(".active").removeClass("active");
a = b(this.selector + '[data-target="' + a + '"],' + this.selector + '[href="' + a + '"]').parent("li").addClass("active");
a.parent(".dropdown-menu") && (a = a.closest("li.dropdown").addClass("active"));
a.trigger("activate")
}
};
b.fn.scrollspy = function (a) {
return this.each(function () {
var c = b(this),
d = c.data("scrollspy"),
f = "object" == typeof a && a;
d || c.data("scrollspy",
d = new e(this, f));
if ("string" == typeof a) d[a]()
})
};
b.fn.scrollspy.Constructor = e;
b.fn.scrollspy.defaults = {
offset: 10
};
b(function () {
b('[data-spy="scroll"]').each(function () {
var a = b(this);
a.scrollspy(a.data())
})
})
})(window.jQuery);
(function (b) {
var e = function (a) {
this.element = b(a)
};
e.prototype = {
constructor: e,
show: function () {
var a = this.element,
c = a.closest("ul:not(.dropdown-menu)"),
d = a.attr("data-target"),
f, e;
d || (d = (d = a.attr("href")) && d.replace(/.*(?=#[^\s]*$)/, ""));
a.parent("li").hasClass("active") || (f = c.find(".active a").last()[0], e = b.Event("show", {
relatedTarget: f
}), a.trigger(e), e.isDefaultPrevented() || (d = b(d), this.activate(a.parent("li"), c), this.activate(d, d.parent(), function () {
a.trigger({
type: "shown",
relatedTarget: f
})
})))
},
activate: function (a, c, d) {
function f() {
e.removeClass("active").find("> .dropdown-menu > .active").removeClass("active");
a.addClass("active");
g ? a.addClass("in") : a.removeClass("fade");
a.parent(".dropdown-menu") && a.closest("li.dropdown").addClass("active");
d && d()
}
var e = c.find("> .active"),
g = d && b.support.transition && e.hasClass("fade");
g ? e.one(b.support.transition.end, f) : f();
e.removeClass("in")
}
};
b.fn.tab = function (a) {
return this.each(function () {
var c = b(this),
d = c.data("tab");
d || c.data("tab", d = new e(this));
if ("string" == typeof a) d[a]()
})
};
b.fn.tab.Constructor = e;
b(function () {
b("body").on("click.tab.data-api", '[data-toggle="tab"], [data-toggle="pill"]', function (a) {
a.preventDefault();
b(this).tab("show")
})
})
})(window.jQuery);
(function (b) {
var e = function (a, c) {
this.$element = b(a);
this.options = b.extend({}, b.fn.typeahead.defaults, c);
this.matcher = this.options.matcher || this.matcher;
this.sorter = this.options.sorter || this.sorter;
this.highlighter = this.options.highlighter || this.highlighter;
this.updater = this.options.updater || this.updater;
this.$menu = b(this.options.menu).appendTo("body");
this.source = this.options.source;
this.shown = !1;
this.listen()
};
e.prototype = {
constructor: e,
select: function () {
this.$element.val(this.updater(this.$menu.find(".active").attr("data-value"))).change();
return this.hide()
},
updater: function (a) {
return a
},
show: function () {
var a = b.extend({}, this.$element.offset(), {
height: this.$element[0].offsetHeight
});
this.$menu.css({
top: a.top + a.height,
left: a.left
});
this.$menu.show();
this.shown = !0;
return this
},
hide: function () {
this.$menu.hide();
this.shown = !1;
return this
},
lookup: function () {
var a = this,
c;
this.query = this.$element.val();
if (!this.query) return this.shown ? this.hide() : this;
c = b.grep(this.source, function (b) {
return a.matcher(b)
});
c = this.sorter(c);
return !c.length ?
this.shown ? this.hide() : this : this.render(c.slice(0, this.options.items)).show()
},
matcher: function (a) {
return ~a.toLowerCase().indexOf(this.query.toLowerCase())
},
sorter: function (a) {
for (var b = [], d = [], e = [], h; h = a.shift();) h.toLowerCase().indexOf(this.query.toLowerCase()) ? ~h.indexOf(this.query) ? d.push(h) : e.push(h) : b.push(h);
return b.concat(d, e)
},
highlighter: function (a) {
var b = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
return a.replace(RegExp("(" + b + ")", "ig"), function (a, b) {
return "" + b + ""
})
},
render: function (a) {
var c = this,
a = b(a).map(function (a, e) {
a = b(c.options.item).attr("data-value", e);
a.find("a").html(c.highlighter(e));
return a[0]
});
a.first().addClass("active");
this.$menu.html(a);
return this
},
next: function () {
var a = this.$menu.find(".active").removeClass("active").next();
a.length || (a = b(this.$menu.find("li")[0]));
a.addClass("active")
},
prev: function () {
var a = this.$menu.find(".active").removeClass("active").prev();
a.length || (a = this.$menu.find("li").last());
a.addClass("active")
},
listen: function () {
this.$element.on("blur",
b.proxy(this.blur, this)).on("keypress", b.proxy(this.keypress, this)).on("keyup", b.proxy(this.keyup, this));
if (b.browser.webkit || b.browser.msie) this.$element.on("keydown", b.proxy(this.keypress, this));
this.$menu.on("click", b.proxy(this.click, this)).on("mouseenter", "li", b.proxy(this.mouseenter, this))
},
keyup: function (a) {
switch (a.keyCode) {
case 40:
case 38:
break;
case 9:
case 13:
if (!this.shown) return;
this.select();
break;
case 27:
if (!this.shown) return;
this.hide();
break;
default:
this.lookup()
}
a.stopPropagation();
a.preventDefault()
},
keypress: function (a) {
if (this.shown) {
switch (a.keyCode) {
case 9:
case 13:
case 27:
a.preventDefault();
break;
case 38:
if ("keydown" != a.type) break;
a.preventDefault();
this.prev();
break;
case 40:
if ("keydown" != a.type) break;
a.preventDefault();
this.next()
}
a.stopPropagation()
}
},
blur: function () {
var a = this;
setTimeout(function () {
a.hide()
}, 150)
},
click: function (a) {
a.stopPropagation();
a.preventDefault();
this.select()
},
mouseenter: function (a) {
this.$menu.find(".active").removeClass("active");
b(a.currentTarget).addClass("active")
}
};
b.fn.typeahead = function (a) {
return this.each(function () {
var c = b(this),
d = c.data("typeahead"),
f = "object" == typeof a && a;
d || c.data("typeahead", d = new e(this, f));
if ("string" == typeof a) d[a]()
})
};
b.fn.typeahead.defaults = {
source: [],
items: 8,
menu: '
',
item: '
'
};
b.fn.typeahead.Constructor = e;
b(function () {
b("body").on("focus.typeahead.data-api", '[data-provide="typeahead"]', function (a) {
var c = b(this);
c.data("typeahead") || (a.preventDefault(), c.typeahead(c.data()))
})
})
})(window.jQuery);
var topSpacer = 0,
updateMapContainerHeight = function () {
var a = jQuery(window).height() - topSpacer;
jQuery(".mapMainContainer").height(a);
jQuery(".mapContainer").height(a);
jQuery(".rightContainer").height(a)
};
jQuery(document).ready(function () {
topSpacer = (jQuery("#header-nav").hasClass("fixed") ? jQuery("#header-nav").height() : jQuery("#ign-header").height()) + jQuery(".breadcrumb-inverted").height();
updateMapContainerHeight();
jQuery(window).resize(function () {
updateMapContainerHeight()
});
jQuery(".embed-link").click(function (a) {
var b = jQuery(this).data("popup");
jQuery("#" + b).show();
a.preventDefault();
a.stopPropagation()
});
jQuery("#close-comment-link").click(function (a) {
jQuery(".comment-overlay").hide();
a.preventDefault();
a.stopPropagation()
});
jQuery(".show-comments").click(function (a) {
jQuery(".comment-overlay").show();
a.preventDefault();
a.stopPropagation()
});
jQuery(".close-button").click(function (a) {
jQuery(this).parent(".share-popup").hide();
a.preventDefault();
a.stopPropagation()
});
jQuery("#comment-socialLogin").click(function () {
jQuery(".comment-overlay").hide()
});
jQuery(".expandable-container a.toggle").click(function (a) {
var b = jQuery(this).next(".expandable-list");
b.is(":visible") ? (b.stop().slideUp("fast"), jQuery(this).removeClass("contract")) :
(b.stop().slideDown("fast"), jQuery(this).addClass("contract"));
a.preventDefault();
a.stopPropagation()
});
jQuery(".map-embed-code").click(function () {
jQuery(this).focus();
jQuery(this).select()
})
});
(function () {
L.MarkerClusterGroup = L.FeatureGroup.extend({
options: {
maxClusterRadius: 80,
iconCreateFunction: null,
spiderfyOnMaxZoom: !0,
showCoverageOnHover: !0,
zoomToBoundsOnClick: !0,
singleMarkerMode: !1,
disableClusteringAtZoom: null,
skipDuplicateAddTesting: !1,
animateAddingMarkers: !1,
polygonOptions: {}
},
initialize: function (a) {
L.Util.setOptions(this, a);
if (!this.options.iconCreateFunction) this.options.iconCreateFunction = this._defaultIconCreateFunction;
L.FeatureGroup.prototype.initialize.call(this, []);
this._inZoomAnimation =
0;
this._needsClustering = [];
this._currentShownBounds = null
},
addLayer: function (a) {
if (a instanceof L.LayerGroup) {
for (var b in a._layers) a._layers.hasOwnProperty(b) && this.addLayer(a._layers[b]);
return this
}
if (this.options.singleMarkerMode) a.options.icon = this.options.iconCreateFunction({
getChildCount: function () {
return 1
},
getAllChildMarkers: function () {
return [a]
}
});
if (!this._map) return this._needsClustering.push(a), this;
if (!this.options.skipDuplicateAddTesting && this.hasLayer(a)) return this;
this._unspiderfy &&
this._unspiderfy();
this._addLayer(a, this._maxZoom);
b = a;
var d = this._map.getZoom();
if (a.__parent)
for (; b.__parent._zoom >= d;) b = b.__parent;
this._currentShownBounds.contains(b.getLatLng()) && (this.options.animateAddingMarkers ? this._animationAddLayer(a, b) : this._animationAddLayerNonAnimated(a, b));
return this
},
removeLayer: function (a) {
if (!this._map) return this._arraySplice(this._needsClustering, a), this;
if (!a.__parent) return this;
this._unspiderfy && (this._unspiderfy(), this._unspiderfyLayer(a));
this._removeLayer(a, !0);
a._icon && (L.FeatureGroup.prototype.removeLayer.call(this, a), a.setOpacity(1));
return this
},
clearLayers: function () {
if (!this._map) return this._needsClustering = [], this;
this._unspiderfy && this._unspiderfy();
for (var a in this._layers) this._layers.hasOwnProperty(a) && L.FeatureGroup.prototype.removeLayer.call(this, this._layers[a]);
this._generateInitialClusters();
return this
},
hasLayer: function (a) {
var b = !1;
this._topClusterLevel._recursively(new L.LatLngBounds([a.getLatLng()]), 0, this._map.getMaxZoom() + 1, function (d) {
for (var e =
d._markers.length - 1; 0 <= e && !b; e--) d._markers[e] === a && (b = !0)
}, null);
return b
},
zoomToShowLayer: function (a, b) {
var d = function () {
if ((a._icon || a.__parent._icon) && !this._inZoomAnimation)
if (this._map.off("moveend", d, this), this.off("animationend", d, this), a._icon) b();
else if (a.__parent._icon) {
var e = function () {
this.off("spiderfied", e, this);
b()
};
this.on("spiderfied", e, this);
a.__parent.spiderfy()
}
};
a._icon ? b() : a.__parent._zoom < this._map.getZoom() ? (this._map.on("moveend", d, this), a._icon || this._map.panTo(a.getLatLng())) :
(this._map.on("moveend", d, this), this.on("animationend", d, this), this._map.setView(a.getLatLng(), a.__parent._zoom + 1), a.__parent.zoomToBounds())
},
onAdd: function (a) {
L.FeatureGroup.prototype.onAdd.call(this, a);
this._gridClusters || this._generateInitialClusters();
for (var a = 0, b = this._needsClustering.length; a < b; a++) this._addLayer(this._needsClustering[a], this._maxZoom);
this._needsClustering = [];
this._map.on("zoomend", this._zoomEnd, this);
this._map.on("moveend", this._moveEnd, this);
this._spiderfierOnAdd && this._spiderfierOnAdd();
this._bindEvents();
this._zoom = this._map.getZoom();
this._currentShownBounds = this._getExpandedVisibleBounds();
this._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds)
},
onRemove: function (a) {
this._map.off("zoomend", this._zoomEnd, this);
this._map.off("moveend", this._moveEnd, this);
this._map._mapPane.className = this._map._mapPane.className.replace(" leaflet-cluster-anim", "");
this._spiderfierOnRemove && this._spiderfierOnRemove();
L.FeatureGroup.prototype.onRemove.call(this,
a)
},
_arraySplice: function (a, b) {
for (var d = a.length - 1; 0 <= d; d--)
if (a[d] === b) {
a.splice(d, 1);
break
}
},
_removeLayer: function (a, b) {
var d = this._gridClusters,
e = this._gridUnclustered,
g = this._map;
if (b)
for (var c = this._maxZoom; 0 <= c && e[c].removeObject(a, g.project(a.getLatLng(), c)); c--);
var c = a.__parent,
f;
for (this._arraySplice(c._markers, a); c;) {
c._childCount--;
if (0 > c._zoom) break;
else b && 1 >= c._childCount ? (f = c._markers[0] === a ? c._markers[1] : c._markers[0], d[c._zoom].removeObject(c, g.project(c._cLatLng, c._zoom)), e[c._zoom].addObject(f,
g.project(f.getLatLng(), c._zoom)), this._arraySplice(c.__parent._childClusters, c), c.__parent._markers.push(f), f.__parent = c.__parent, c._icon && (L.FeatureGroup.prototype.removeLayer.call(this, c), L.FeatureGroup.prototype.addLayer.call(this, f))) : (c._recalculateBounds(), c._updateIcon());
c = c.__parent
}
},
_propagateEvent: function (a) {
if (a.target instanceof L.MarkerCluster) a.type = "cluster" + a.type;
L.FeatureGroup.prototype._propagateEvent.call(this, a)
},
_defaultIconCreateFunction: function (a) {
var a = a.getChildCount(),
b = " marker-cluster-";
return new L.DivIcon({
html: "
" + a + "
",
className: "marker-cluster" + (10 > a ? b + "small" : 100 > a ? b + "medium" : b + "large"),
iconSize: new L.Point(40, 40)
})
},
_bindEvents: function () {
var a = null,
b = this._map,
d = this.options.spiderfyOnMaxZoom,
e = this.options.showCoverageOnHover,
g = this.options.zoomToBoundsOnClick;
if (d || g) this.on("clusterclick", function (a) {
b.getMaxZoom() === b.getZoom() ? d && a.layer.spiderfy() : g && a.layer.zoomToBounds()
}, this);
e && (this.on("clustermouseover", function (c) {
this._inZoomAnimation ||
(a && b.removeLayer(a), 2 < c.layer.getChildCount() && (a = new L.Polygon(c.layer.getConvexHull(), this.options.polygonOptions), b.addLayer(a)))
}, this), this.on("clustermouseout", function () {
a && (b.removeLayer(a), a = null)
}, this), b.on("zoomend", function () {
a && (b.removeLayer(a), a = null)
}, this), b.on("layerremove", function (c) {
a && c.layer === this && (b.removeLayer(a), a = null)
}, this))
},
_zoomEnd: function () {
if (this._map) this._mergeSplitClusters(), this._zoom = this._map._zoom, this._currentShownBounds = this._getExpandedVisibleBounds()
},
_moveEnd: function () {
if (!this._inZoomAnimation) {
var a = this._getExpandedVisibleBounds();
this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, this._zoom, a);
this._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, a);
this._currentShownBounds = a
}
},
_generateInitialClusters: function () {
var a = this._map.getMaxZoom(),
b = this.options.maxClusterRadius;
this.options.disableClusteringAtZoom && (a = this.options.disableClusteringAtZoom - 1);
this._maxZoom = a;
this._gridClusters = {};
for (this._gridUnclustered = {}; 0 <= a; a--) this._gridClusters[a] = new L.DistanceGrid(b), this._gridUnclustered[a] = new L.DistanceGrid(b);
this._topClusterLevel = new L.MarkerCluster(this, -1)
},
_addLayer: function (a, b) {
for (var d = this._gridClusters, e = this._gridUnclustered, g, c; 0 <= b; b--) {
g = this._map.project(a.getLatLng(), b);
var f = d[b].getNearObject(g);
if (f) {
f._addChild(a);
a.__parent = f;
return
}
if (f = e[b].getNearObject(g)) {
f.__parent && this._removeLayer(f, !1);
g = f.__parent;
c = new L.MarkerCluster(this, b, f, a);
d[b].addObject(c, this._map.project(c._cLatLng,
b));
f.__parent = c;
var h = a.__parent = c;
for (c = b - 1; c > g._zoom; c--) h = new L.MarkerCluster(this, c, h), d[c].addObject(h, this._map.project(f.getLatLng(), c));
g._addChild(h);
for (c = b; 0 <= c && e[c].removeObject(f, this._map.project(f.getLatLng(), c)); c--);
return
}
e[b].addObject(a, g)
}
this._topClusterLevel._addChild(a);
a.__parent = this._topClusterLevel
},
_mergeSplitClusters: function () {
this._zoom < this._map._zoom ? (this._animationStart(), this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, this._zoom,
this._getExpandedVisibleBounds()), this._animationZoomIn(this._zoom, this._map._zoom)) : this._zoom > this._map._zoom ? (this._animationStart(), this._animationZoomOut(this._zoom, this._map._zoom)) : this._moveEnd()
},
_getExpandedVisibleBounds: function () {
var a = this._map,
b = a.getPixelBounds(),
d = L.Browser.mobile ? 0 : Math.abs(b.max.x - b.min.x),
e = L.Browser.mobile ? 0 : Math.abs(b.max.y - b.min.y),
g = a.unproject(new L.Point(b.min.x - d, b.min.y - e)),
a = a.unproject(new L.Point(b.max.x + d, b.max.y + e));
return new L.LatLngBounds(g, a)
},
_animationAddLayerNonAnimated: function (a, b) {
if (b === a) L.FeatureGroup.prototype.addLayer.call(this, a);
else if (2 === b._childCount) {
b._addToMap();
var d = b.getAllChildMarkers();
L.FeatureGroup.prototype.removeLayer.call(this, d[0]);
L.FeatureGroup.prototype.removeLayer.call(this, d[1])
} else b._updateIcon()
}
});
L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
_animationStart: function () {},
_animationZoomIn: function (a, b) {
this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, a);
this._topClusterLevel._recursivelyAddChildrenToMap(null,
b, this._getExpandedVisibleBounds())
},
_animationZoomOut: function (a, b) {
this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, a);
this._topClusterLevel._recursivelyAddChildrenToMap(null, b, this._getExpandedVisibleBounds())
},
_animationAddLayer: function (a, b) {
this._animationAddLayerNonAnimated(a, b)
}
} : {
_animationStart: function () {
this._map._mapPane.className += " leaflet-cluster-anim";
this._inZoomAnimation++
},
_animationEnd: function () {
if (this._map) this._map._mapPane.className = this._map._mapPane.className.replace(" leaflet-cluster-anim",
"");
this._inZoomAnimation--;
this.fire("animationend")
},
_animationZoomIn: function (a, b) {
var d = this,
e = this._getExpandedVisibleBounds(),
g;
this._topClusterLevel._recursively(e, a, 0, function (c) {
var f = c._latlng,
i = c._markers;
c._isSingleParent() && a + 1 === b ? (L.FeatureGroup.prototype.removeLayer.call(d, c), c._recursivelyAddChildrenToMap(null, b, e)) : (c.setOpacity(0), c._recursivelyAddChildrenToMap(f, b, e));
for (g = i.length - 1; 0 <= g; g--) c = i[g], e.contains(c._latlng) || L.FeatureGroup.prototype.removeLayer.call(d, c)
});
this._forceLayout();
var c, f;
d._topClusterLevel._recursivelyBecomeVisible(e, b);
for (c in d._layers) d._layers.hasOwnProperty(c) && (f = d._layers[c], !(f instanceof L.MarkerCluster) && f._icon && f.setOpacity(1));
d._topClusterLevel._recursively(e, a, b, function (a) {
a._recursivelyRestoreChildPositions(b)
});
setTimeout(function () {
d._topClusterLevel._recursively(e, a, 0, function (a) {
L.FeatureGroup.prototype.removeLayer.call(d, a);
a.setOpacity(1)
});
d._animationEnd()
}, 250)
},
_animationZoomOut: function (a, b) {
this._animationZoomOutSingle(this._topClusterLevel,
a - 1, b);
this._topClusterLevel._recursivelyAddChildrenToMap(null, b, this._getExpandedVisibleBounds());
this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, a, this._getExpandedVisibleBounds())
},
_animationZoomOutSingle: function (a, b, d) {
var e = this._getExpandedVisibleBounds();
a._recursivelyAnimateChildrenInAndAddSelfToMap(e, b + 1, d);
var g = this;
this._forceLayout();
a._recursivelyBecomeVisible(e, d);
setTimeout(function () {
if (1 === a._childCount) {
var c = a._markers[0];
c.setLatLng(c.getLatLng());
c.setOpacity(1)
} else a._recursively(e, d, 0, function (a) {
a._recursivelyRemoveChildrenFromMap(e, b + 1)
}), g._animationEnd()
}, 250)
},
_animationAddLayer: function (a, b) {
var d = this;
L.FeatureGroup.prototype.addLayer.call(this, a);
b !== a && (2 < b._childCount ? (b._updateIcon(), this._forceLayout(), this._animationStart(), a._setPos(this._map.latLngToLayerPoint(b.getLatLng())), a.setOpacity(0), setTimeout(function () {
L.FeatureGroup.prototype.removeLayer.call(d, a);
a.setOpacity(1);
d._animationEnd()
}, 250)) : (this._forceLayout(),
d._animationStart(), d._animationZoomOutSingle(b, this._map.getMaxZoom(), this._map.getZoom())))
},
_forceLayout: function () {
L.Util.falseFn(document.body.offsetWidth)
}
});
L.MarkerCluster = L.Marker.extend({
initialize: function (a, b, d, e) {
L.Marker.prototype.initialize.call(this, d ? d._cLatLng || d.getLatLng() : new L.LatLng(0, 0), {
icon: this
});
this._group = a;
this._zoom = b;
this._markers = [];
this._childClusters = [];
this._childCount = 0;
this._iconNeedsUpdate = !0;
this._bounds = new L.LatLngBounds;
d && this._addChild(d);
e && this._addChild(e)
},
getAllChildMarkers: function (a) {
for (var a = a || [], b = this._childClusters.length - 1; 0 <= b; b--) this._childClusters[b].getAllChildMarkers(a);
for (b = this._markers.length - 1; 0 <= b; b--) a.push(this._markers[b]);
return a
},
getChildCount: function () {
return this._childCount
},
zoomToBounds: function () {
this._group._map.fitBounds(this._bounds)
},
_updateIcon: function () {
this._iconNeedsUpdate = !0;
this._icon && this.setIcon(this)
},
createIcon: function () {
if (this._iconNeedsUpdate) this._iconObj = this._group.options.iconCreateFunction(this),
this._iconNeedsUpdate = !1;
return this._iconObj.createIcon()
},
createShadow: function () {
return this._iconObj.createShadow()
},
_addChild: function (a, b) {
this._iconNeedsUpdate = !0;
this._expandBounds(a);
if (a instanceof L.MarkerCluster) {
if (!b) this._childClusters.push(a), a.__parent = this;
this._childCount += a._childCount
} else b || this._markers.push(a), this._childCount++;
this.__parent && this.__parent._addChild(a, !0)
},
_expandBounds: function (a) {
var b, d = a._wLatLng || a._latlng;
a instanceof L.MarkerCluster ? (this._bounds.extend(a._bounds),
b = a._childCount) : (this._bounds.extend(d), b = 1);
if (!this._cLatLng) this._cLatLng = a._cLatLng || d;
a = this._childCount + b;
this._wLatLng ? (this._wLatLng.lat = (d.lat * b + this._wLatLng.lat * this._childCount) / a, this._wLatLng.lng = (d.lng * b + this._wLatLng.lng * this._childCount) / a) : this._latlng = this._wLatLng = new L.LatLng(d.lat, d.lng)
},
_addToMap: function (a) {
if (a) this._backupLatlng = this._latlng, this.setLatLng(a);
L.FeatureGroup.prototype.addLayer.call(this._group, this)
},
_recursivelyAnimateChildrenIn: function (a, b, d) {
this._recursively(a,
0, d - 1,
function (a) {
var a = a._markers,
d, c;
for (d = a.length - 1; 0 <= d; d--) c = a[d], c._icon && (c._setPos(b), c.setOpacity(0))
},
function (a) {
var a = a._childClusters,
d, c;
for (d = a.length - 1; 0 <= d; d--) c = a[d], c._icon && (c._setPos(b), c.setOpacity(0))
})
},
_recursivelyAnimateChildrenInAndAddSelfToMap: function (a, b, d) {
this._recursively(a, d, 0, function (e) {
e._recursivelyAnimateChildrenIn(a, e._group._map.latLngToLayerPoint(e.getLatLng()).round(), b);
e._isSingleParent() && b - 1 === d ? (e.setOpacity(1), e._recursivelyRemoveChildrenFromMap(a,
b)) : e.setOpacity(0);
e._addToMap()
})
},
_recursivelyBecomeVisible: function (a, b) {
this._recursively(a, 0, b, null, function (a) {
a.setOpacity(1)
})
},
_recursivelyAddChildrenToMap: function (a, b, d) {
this._recursively(d, -1, b, function (e) {
if (b !== e._zoom)
for (var g = e._markers.length - 1; 0 <= g; g--) {
var c = e._markers[g];
if (d.contains(c._latlng)) {
if (a) c._backupLatlng = c.getLatLng(), c.setLatLng(a), c.setOpacity(0);
L.FeatureGroup.prototype.addLayer.call(e._group, c)
}
}
}, function (b) {
b._addToMap(a)
})
},
_recursivelyRestoreChildPositions: function (a) {
for (var b =
this._markers.length - 1; 0 <= b; b--) {
var d = this._markers[b];
d._backupLatlng && (d.setLatLng(d._backupLatlng), delete d._backupLatlng)
}
if (a - 1 === this._zoom)
for (a = this._childClusters.length - 1; 0 <= a; a--) this._childClusters[a]._restorePosition();
else
for (b = this._childClusters.length - 1; 0 <= b; b--) this._childClusters[b]._recursivelyRestoreChildPositions(a)
},
_restorePosition: function () {
this._backupLatlng && (this.setLatLng(this._backupLatlng), delete this._backupLatlng)
},
_recursivelyRemoveChildrenFromMap: function (a, b,
d) {
var e, g;
this._recursively(a, -1, b - 1, function (a) {
for (g = a._markers.length - 1; 0 <= g; g--)
if (e = a._markers[g], !d || !d.contains(e._latlng)) L.FeatureGroup.prototype.removeLayer.call(a._group, e), e.setOpacity(1)
}, function (a) {
for (g = a._childClusters.length - 1; 0 <= g; g--)
if (e = a._childClusters[g], !d || !d.contains(e._latlng)) L.FeatureGroup.prototype.removeLayer.call(a._group, e), e.setOpacity(1)
})
},
_recursively: function (a, b, d, e, g) {
var c = this._childClusters,
f = this._zoom,
h;
if (b > f)
for (f = c.length - 1; 0 <= f; f--) h = c[f], a.intersects(h._bounds) &&
h._recursively(a, b, d, e, g);
else if (e && e(this), g && this._zoom === d && g(this), d > f)
for (f = c.length - 1; 0 <= f; f--) h = c[f], a.intersects(h._bounds) && h._recursively(a, b, d, e, g)
},
_recalculateBounds: function () {
var a = this._markers,
b = this._childClusters,
d;
this._bounds = new L.LatLngBounds;
delete this._wLatLng;
for (d = a.length - 1; 0 <= d; d--) this._expandBounds(a[d]);
for (d = b.length - 1; 0 <= d; d--) this._expandBounds(b[d])
},
_isSingleParent: function () {
return 0 < this._childClusters.length && this._childClusters[0]._childCount === this._childCount
}
});
L.DistanceGrid = function (a) {
this._cellSize = a;
this._sqCellSize = a * a;
this._grid = {};
this._objectPoint = {}
};
L.DistanceGrid.prototype = {
addObject: function (a, b) {
var d = this._getCoord(b.x),
e = this._getCoord(b.y),
g = this._grid,
e = g[e] = g[e] || {},
d = e[d] = e[d] || [];
this._objectPoint[L.Util.stamp(a)] = b;
d.push(a)
},
updateObject: function (a, b) {
this.removeObject(a);
this.addObject(a, b)
},
removeObject: function (a, b) {
var d = this._getCoord(b.x),
e = this._getCoord(b.y),
g = this._grid,
e = g[e] = g[e] || {},
g = e[d] = e[d] || [],
c, f;
delete this._objectPoint[L.Util.stamp(a)];
for (c = 0, f = g.length; c < f; c++)
if (g[c] === a) return g.splice(c, 1), 1 === f && delete e[d], !0
},
eachObject: function (a, b) {
var d, e, g, c, f, h, j, i = this._grid;
for (d in i)
if (i.hasOwnProperty(d))
for (e in f = i[d], f)
if (f.hasOwnProperty(e)) {
h = f[e];
for (g = 0, c = h.length; g < c; g++)
if (j = a.call(b, h[g])) g--, c--
}
},
getNearObject: function (a) {
var b = this._getCoord(a.x),
d = this._getCoord(a.y),
e, g, c, f, h, j, i, k, n = this._objectPoint,
l = this._sqCellSize,
m = null;
for (e = d - 1; e <= d + 1; e++)
if (f = this._grid[e])
for (g = b - 1; g <= b + 1; g++)
if (h = f[g])
for (c = 0, j = h.length; c <
j; c++) i = h[c], k = this._sqDist(n[L.Util.stamp(i)], a), k < l && (l = k, m = i);
return m
},
_getCoord: function (a) {
return Math.floor(a / this._cellSize)
},
_sqDist: function (a, b) {
var d = b.x - a.x,
e = b.y - a.y;
return d * d + e * e
}
};
(function () {
L.QuickHull = {
getDistant: function (a, b) {
return (b[0].lng - b[1].lng) * (a.lat - b[0].lat) + (b[1].lat - b[0].lat) * (a.lng - b[0].lng)
},
findMostDistantPointFromBaseLine: function (a, b) {
var d = 0,
e = null,
g = [],
c, f, h;
for (c = b.length - 1; 0 <= c; c--) f = b[c], h = this.getDistant(f, a), 0 < h && (g.push(f), h > d && (d = h, e = f));
return {
maxPoint: e,
newPoints: g
}
},
buildConvexHull: function (a, b) {
var d = [],
e = this.findMostDistantPointFromBaseLine(a, b);
return e.maxPoint ? (d = d.concat(this.buildConvexHull([a[0], e.maxPoint], e.newPoints)), d = d.concat(this.buildConvexHull([e.maxPoint, a[1]], e.newPoints))) : [a]
},
getConvexHull: function (a) {
var b = !1,
d = !1,
e = null,
g = null,
c;
for (c = a.length - 1; 0 <= c; c--) {
var f = a[c];
if (!1 === b || f.lat > b) e = f, b = f.lat;
if (!1 === d || f.lat < d) g = f, d = f.lat
}
return [].concat(this.buildConvexHull([g, e], a), this.buildConvexHull([e, g], a))
}
}
})();
L.MarkerCluster.include({
getConvexHull: function () {
var a =
this.getAllChildMarkers(),
b = [],
d = [],
e, g;
for (g = a.length - 1; 0 <= g; g--) e = a[g].getLatLng(), b.push(e);
a = L.QuickHull.getConvexHull(b);
for (g = a.length - 1; 0 <= g; g--) d.push(a[g][0]);
return d
}
});
L.MarkerCluster.include({
_2PI: 2 * Math.PI,
_circleFootSeparation: 25,
_circleStartAngle: Math.PI / 6,
_spiralFootSeparation: 28,
_spiralLengthStart: 11,
_spiralLengthFactor: 5,
_circleSpiralSwitchover: 9,
spiderfy: function () {
if (!(this._group._spiderfied === this || this._group._inZoomAnimation)) {
var a = this.getAllChildMarkers(),
b = this._group._map.latLngToLayerPoint(this._latlng);
this._group._unspiderfy();
this._group._spiderfied = this;
a.length >= this._circleSpiralSwitchover ? b = this._generatePointsSpiral(a.length, b) : (b.y += 10, b = this._generatePointsCircle(a.length, b));
this._animationSpiderfy(a, b)
}
},
unspiderfy: function (a) {
if (!this._group._inZoomAnimation) this._animationUnspiderfy(a), this._group._spiderfied = null
},
_generatePointsCircle: function (a, b) {
var d = this._circleFootSeparation * (2 + a) / this._2PI,
e = this._2PI / a,
g = [],
c, f;
g.length = a;
for (c = a - 1; 0 <= c; c--) f = this._circleStartAngle + c * e, g[c] =
(new L.Point(b.x + d * Math.cos(f), b.y + d * Math.sin(f)))._round();
return g
},
_generatePointsSpiral: function (a, b) {
var d = this._spiralLengthStart,
e = 0,
g = [],
c;
g.length = a;
for (c = a - 1; 0 <= c; c--) e += this._spiralFootSeparation / d + 5.0E-4 * c, g[c] = (new L.Point(b.x + d * Math.cos(e), b.y + d * Math.sin(e)))._round(), d += this._2PI * this._spiralLengthFactor / e;
return g
}
});
L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
_animationSpiderfy: function (a, b) {
var d = this._group,
e = d._map,
g, c, f;
for (g = a.length - 1; 0 <= g; g--) f = e.layerPointToLatLng(b[g]),
c = a[g], c._preSpiderfyLatlng = c._latlng, c.setLatLng(f), c.setZIndexOffset(1E6), L.FeatureGroup.prototype.addLayer.call(d, c), f = new L.Polyline([this._latlng, f], {
weight: 1.5,
color: "#222"
}), e.addLayer(f), c._spiderLeg = f;
this.setOpacity(0.3);
d.fire("spiderfied")
},
_animationUnspiderfy: function () {
var a = this._group,
b = a._map,
d = this.getAllChildMarkers(),
e, g;
this.setOpacity(1);
for (g = d.length - 1; 0 <= g; g--) e = d[g], L.FeatureGroup.prototype.removeLayer.call(a, e), e.setLatLng(e._preSpiderfyLatlng), delete e._preSpiderfyLatlng,
e.setZIndexOffset(0), b.removeLayer(e._spiderLeg), delete e._spiderLeg
}
} : {
_animationSpiderfy: function (a, b) {
var d = this._group,
e = d._map,
g = e.latLngToLayerPoint(this._latlng),
c, f, h;
for (c = a.length - 1; 0 <= c; c--) f = a[c], f.setZIndexOffset(1E6), f.setOpacity(0), L.FeatureGroup.prototype.addLayer.call(d, f), f._setPos(g);
d._forceLayout();
d._animationStart();
var g = L.Path.SVG ? 0 : 0.3,
j = L.Path.SVG_NS;
for (c = a.length - 1; 0 <= c; c--)
if (h = e.layerPointToLatLng(b[c]), f = a[c], f._preSpiderfyLatlng = f._latlng, f.setLatLng(h), f.setOpacity(1),
h = new L.Polyline([this._latlng, h], {
weight: 1.5,
color: "#222",
opacity: g
}), e.addLayer(h), f._spiderLeg = h, L.Path.SVG) {
f = h._path.getTotalLength();
h._path.setAttribute("stroke-dasharray", f + "," + f);
var i = document.createElementNS(j, "animate");
i.setAttribute("attributeName", "stroke-dashoffset");
i.setAttribute("begin", "indefinite");
i.setAttribute("from", f);
i.setAttribute("to", 0);
i.setAttribute("dur", 0.25);
h._path.appendChild(i);
i.beginElement();
i = document.createElementNS(j, "animate");
i.setAttribute("attributeName",
"stroke-opacity");
i.setAttribute("attributeName", "stroke-opacity");
i.setAttribute("begin", "indefinite");
i.setAttribute("from", 0);
i.setAttribute("to", 0.5);
i.setAttribute("dur", 0.25);
h._path.appendChild(i);
i.beginElement()
}
this.setOpacity(0.3);
if (L.Path.SVG) {
this._group._forceLayout();
for (c = a.length - 1; 0 <= c; c--) f = a[c]._spiderLeg, f.options.opacity = 0.5, f._path.setAttribute("stroke-opacity", 0.5)
}
setTimeout(function () {
d._animationEnd();
d.fire("spiderfied")
}, 250)
},
_animationUnspiderfy: function (a) {
var b = this._group,
d = b._map,
a = a ? d._latLngToNewLayerPoint(this._latlng, a.zoom, a.center) : d.latLngToLayerPoint(this._latlng),
e = this.getAllChildMarkers(),
g = L.Path.SVG,
c, f, h;
b._animationStart();
this.setOpacity(1);
for (f = e.length - 1; 0 <= f; f--) c = e[f], c.setLatLng(c._preSpiderfyLatlng), delete c._preSpiderfyLatlng, c._setPos(a), c.setOpacity(0), g && (h = c._spiderLeg._path.childNodes[0], h.setAttribute("to", h.getAttribute("from")), h.setAttribute("from", 0), h.beginElement(), h = c._spiderLeg._path.childNodes[1], h.setAttribute("from", 0.5), h.setAttribute("to",
0), h.setAttribute("stroke-opacity", 0), h.beginElement(), c._spiderLeg._path.setAttribute("stroke-opacity", 0));
setTimeout(function () {
var a = 0;
for (f = e.length - 1; 0 <= f; f--) c = e[f], c._spiderLeg && a++;
for (f = e.length - 1; 0 <= f; f--) c = e[f], c._spiderLeg && (c.setOpacity(1), c.setZIndexOffset(0), 1 < a && L.FeatureGroup.prototype.removeLayer.call(b, c), d.removeLayer(c._spiderLeg), delete c._spiderLeg);
b._animationEnd()
}, 250)
}
});
L.MarkerClusterGroup.include({
_spiderfied: null,
_spiderfierOnAdd: function () {
this._map.on("click", this._unspiderfyWrapper,
this);
if (this._map.options.zoomAnimation) this._map.on("zoomstart", this._unspiderfyZoomStart, this);
else this._map.on("zoomend", this._unspiderfyWrapper, this);
L.Path.SVG && !L.Browser.touch && this._map._initPathRoot()
},
_spiderfierOnRemove: function () {
this._map.off("click", this._unspiderfyWrapper, this);
this._map.off("zoomstart", this._unspiderfyZoomStart, this);
this._map.off("zoomanim", this._unspiderfyZoomAnim, this);
this._unspiderfy()
},
_unspiderfyZoomStart: function () {
if (this._map) this._map.on("zoomanim", this._unspiderfyZoomAnim,
this)
},
_unspiderfyZoomAnim: function (a) {
L.DomUtil.hasClass(this._map._mapPane, "leaflet-touching") || (this._map.off("zoomanim", this._unspiderfyZoomAnim, this), this._unspiderfy(a))
},
_unspiderfyWrapper: function () {
this._unspiderfy()
},
_unspiderfy: function (a) {
this._spiderfied && this._spiderfied.unspiderfy(a)
},
_unspiderfyLayer: function (a) {
a._spiderLeg && (L.FeatureGroup.prototype.removeLayer.call(this, a), a.setOpacity(1), a.setZIndexOffset(0), this._map.removeLayer(a._spiderLeg), delete a._spiderLeg)
}
})
})(this);
(function (c) {
c.fn.hasScrollBar = function () {
return this.get(0).scrollHeight > this.height()
};
c.fn.lionbars = function (h) {
function S(a) {
var b = c(a);
if (i || j) b.find(".lb-wrap").on("scroll", function () {
b.find(".lb-v-scrollbar-slider").css({
top: -c(this).scrollTop() / b.attr("vratio")
});
b.find(".lb-h-scrollbar-slider").css({
left: -c(this).scrollLeft() / b.attr("hratio")
});
if (b.find(".lb-v-scrollbar").height() == parseInt(b.find(".lb-v-scrollbar-slider").css("top")) + b.find(".lb-v-scrollbar-slider").height() && "function" ==
typeof h.reachedBottom && !L) {
L = !0;
var a = c(this);
h.reachedBottom.apply(c(this).children(".lb-content"), [function () {
r(c(a).parent(), {
height: c(a).children(".lb-content").get(0).scrollHeight,
width: c(a).children(".lb-content").get(0).scrollWidth
});
y(c(a).parent());
z(c(a).parent());
A(c(a).parent());
B();
L = !1
}])
}
b.find(".lb-h-scrollbar").width() == parseInt(b.find(".lb-h-scrollbar-slider").css("left")) + b.find(".lb-h-scrollbar-slider").width() && "function" == typeof h.reachedRight && !M && (M = !0, a = c(this), h.reachedRight.apply(c(this).children(".lb-content"), [function () {
r(c(a).parent(), {
height: c(a).children(".lb-content").get(0).scrollHeight,
width: c(a).children(".lb-content").get(0).scrollWidth
});
y(c(a).parent());
z(c(a).parent());
A(c(a).parent());
B();
M = !1
}]))
});
i && (b.find(".lb-v-scrollbar-slider").mousedown(function (a) {
T = a.pageY;
o = !0;
C = c(this);
f = b.find(".lb-wrap");
D = f.parent().attr("vratio");
E = C.position().top;
return !1
}), b.find(".lb-v-scrollbar").mousedown(function (a) {
c(a.target).hasClass("lb-v-scrollbar-slider") || b.find(".lb-wrap").scrollTop((a.pageY -
c(this).offset().top) * Math.abs(b.attr("vratio")) - c(this).find(".lb-v-scrollbar-slider").height() / 2);
return !1
}));
j && (b.find(".lb-h-scrollbar-slider").mousedown(function (a) {
U = a.pageX;
p = !0;
C = c(this);
f = b.find(".lb-wrap");
D = f.parent().attr("hratio");
E = C.position().left;
return !1
}), b.find(".lb-h-scrollbar").mousedown(function (a) {
c(a.target).hasClass("lb-h-scrollbar-slider") || b.find(".lb-wrap").scrollLeft((a.pageX - c(this).offset().left) * Math.abs(b.attr("hratio")) - c(this).find(".lb-h-scrollbar-slider").width() /
2);
return !1
}));
if ((i || j) && autohide) b.find(".lb-v-scrollbar, .lb-h-scrollbar").hide(), b.hover(function () {
c(this).data("hover", !0);
b.find(".lb-v-scrollbar, .lb-h-scrollbar").fadeIn(150)
}, function () {
c(this).data("hover", !1);
b.find(".lb-v-scrollbar, .lb-h-scrollbar").fadeOut(150)
})
}
function A(a) {
V = (k - c(a).find(".lb-wrap").get(0).scrollHeight - F - G) / (s - l);
W = (m - c(a).find(".lb-wrap").get(0).scrollWidth - H - I) / (t - n);
a = c(a);
a.attr("vratio", V);
a.attr("hratio", W)
}
function z(a) {
var a = c(a),
b, d;
0 != a.find(".lb-v-scrollbar").length &&
(b = 20, d = k - a.find(".lb-v-scrollbar").height(), d = k - d - b, l = Math.round(k * d / J), l = l < b ? b : l);
0 != a.find(".lb-h-scrollbar").length && (b = 20, d = m - a.find(".lb-h-scrollbar").width(), d = m - d - b, n = Math.round(m * d / N), n = n < b ? b : n);
a.find(".lb-v-scrollbar-slider").css({
height: l
});
a.find(".lb-h-scrollbar-slider").css({
width: n
})
}
function B() {
O = P = 0;
i = j = !1;
t = s = n = l = K = Q = k = m = N = J = I = G = H = F = u = v = w = x = 0
}
function y(a) {
a = c(a);
i && j ? (s = a.height() - 12, t = a.width() - 12) : (s = a.height() - 4, t = a.width() - 4);
a.find(".lb-v-scrollbar").css({
height: s
});
a.find(".lb-h-scrollbar").css({
width: t
})
}
function X(a, b, d) {
a = c(a);
if (b || d) a.css({
overflow: "hidden"
}), d = a.find(".lb-wrap"), b = c(a), d = c(d), b.css({
padding: 0
}), d.css({
"padding-top": x + "px",
"padding-left": w + "px",
"padding-bottom": v + "px",
"padding-right": u + "px"
}), b = c(a), b.css({
width: b.width() + w + u,
height: b.height() + x + v
}), b = a.find(".lb-wrap"), a = c(a), b = c(b), a.css({
position: "relative"
}), b.css({
width: a.width() + P - w - u,
height: a.height() + O - x - v
})
}
function R(a) {
a = c(a);
j = i = !1;
if (a.find(".lb-v-scrollbar-slider").length) return !1;
var b = c(a);
x = parseInt(b.css("padding-top").replace("px",
""));
w = parseInt(b.css("padding-left").replace("px", ""));
v = parseInt(b.css("padding-bottom").replace("px", ""));
u = parseInt(b.css("padding-right").replace("px", ""));
b = c(a);
F = parseInt(b.css("border-top-width").replace("px", ""));
I = parseInt(b.css("border-right-width").replace("px", ""));
G = parseInt(b.css("border-bottom-width").replace("px", ""));
H = parseInt(b.css("border-left-width").replace("px", ""));
var b = a.css("overflow-y"),
d = a.css("overflow-x");
a.css({
overflow: "hidden"
});
"hidden" != b && a.get(0).scrollHeight >
a.get(0).clientHeight && (i = !0);
"hidden" != d && a.get(0).scrollWidth > a.get(0).clientWidth && (j = !0);
a.css({
overflow: "auto"
});
if (i || j) return !0
}
function r(a, b, d) {
var e = c(a).get(0);
d && (e = c(e).find(".lb-wrap").get(0));
J = "undefined" != typeof b && !1 != b ? b.height : e.scrollHeight;
N = "undefined" != typeof b && !1 != b ? b.width : e.scrollWidth;
K = e.clientHeight;
Q = e.clientWidth;
k = e.offsetHeight;
m = e.offsetWidth;
b = c(a);
b = c(b);
b.css({
overflow: "auto"
});
P = m - Q - H - I;
b.css({
overflow: "hidden"
});
a = c(a);
a = c(a);
a.css({
overflow: "auto"
});
O = k - K -
F - G;
a.css({
overflow: "hidden"
})
}
h = h || {};
autohide = h.autohide;
var p = !1,
o = !1,
C = 0,
f = 0,
U, T, Y, Z, D, E, L = !1,
M = !1,
g = c(this),
q = 0,
P = 0,
O = 0,
j = !1,
i = !1,
x = 0,
w = 0,
v = 0,
u = 0,
F = 0,
I = 0,
G = 0,
H = 0,
J = 0,
N = 0,
m = 0,
k = 0,
Q = 0,
K = 0,
V = 0,
W = 0,
l = 0,
n = 0,
s = 0,
t = 0;
this.mainLoop = function () {
for (var a = 0; void 0 !== g[a]; a++)
if (R(g[a]) && !c(g[a]).hasClass("nolionbars")) {
target = g[a];
r(target);
var b = i,
d = j,
e = c(target),
f = e.attr("id"),
h = 0;
void 0 !== f ? (e.wrapInner(''), h = c("#lb-wrap-" + q + "-" + f)) : (e.wrapInner(''), h = c("#lb-wrap-" + q));
h.wrapInner('');
b && (e.prepend(''), e.find(".lb-v-scrollbar").append(''));
d && (e.prepend(''), e.find(".lb-h-scrollbar").append(''));
q += 1;
X(target, i, j);
y(target);
z(target);
A(target);
S(target);
B()
}
};
this.mainLoop();
this.Update = function () {
for (var a = 0; void 0 !== g[a]; a++) R(g[a]) && !c(g[a]).hasClass("nolionbars") &&
(target = g[a], r(target, !1, !0), X(target, i, j), y(target), z(target), A(target), S(target), B())
};
this.scrollToBottom = function () {
for (var a = 0; void 0 !== g[a]; a++)
if (R(g[a]) && !c(g[a]).hasClass("nolionbars")) {
target = g[a];
r(target, !1, !0);
var b = c(target).find(".lb-wrap"),
d = b.parent().attr("vratio"),
d = (J - K) * Math.abs(d);
b.scrollTop(d)
}
};
c(document).mousemove(function (a) {
if (p || o) {
f.parent().find(".lb-v-scrollbar, .lb-h-scrollbar").show();
if (o) Z = a.pageY, f.scrollTop((E + Z - T) * Math.abs(D));
if (p) Y = a.pageX, f.scrollLeft((E +
Y - U) * Math.abs(D))
}
});
c(document).mouseup(function () {
if (p || o) f.parent().find(".lb-v-scrollbar, .lb-h-scrollbar").fadeOut(150), o && (o = !1), p && (p = !1)
});
return this.each(function () {})
}
})(jQuery);
if (!IGN) var IGN = {};
if (!IGN.Mixins) IGN.Mixins = {};
IGN.Mixins.MapsAPI = {
API: {
ENDPOINT: {
TYPES: {
action: "get_marker_types",
method: "GET",
dataType: "jsonp",
path: "api"
},
MAPS: {
action: "get_maps",
method: "GET",
dataType: "jsonp",
path: "api"
},
MARKERS: {
GET: {
action: "get_markers",
method: "GET",
dataType: "jsonp",
path: "api"
},
PUT: {
action: "update_marker",
method: "GET",
dataType: "jsonp",
path: "api"
},
POST: {
action: "create_marker",
method: "GET",
dataType: "jsonp",
path: "api"
},
DELETE: {
action: "delete_marker",
method: "GET",
dataType: "jsonp",
path: "api"
},
PENDING: {
GET: {
action: "pending_markers",
method: "GET",
dataType: "jsonp",
path: "api"
},
DECLINE: {
action: "decline_pending_marker",
method: "GET",
dataType: "jsonp",
path: "api"
},
ACCEPT: {
action: "accept_pending_marker",
method: "GET",
dataType: "jsonp",
path: "api"
}
}
},
WIKI: {
action: "get_wiki_content",
method: "GET",
dataType: "jsonp",
path: "wikiapi"
},
WIKI_PAGE: {
action: "search_wiki_pages",
method: "GET",
dataType: "jsonp",
path: "wikilookup"
},
SEARCH: {
action: "search",
method: "GET",
dataType: "jsonp",
path: "api"
}
}
},
proxyUrl : "http://www.ign.com/maps/",
callApi: function (b, a, c) {
var url;
a["do"] = b.action;
if (!a.objectSlug) a.objectSlug = this.metadata.objectSlug;
if (!a.mapSlug) a.mapSlug = this.metadata.mapSlug;
if(b.action == 'get_markers') {
url = 'http://tv.duowan.com/s/ignmap/maker/'+this.metadata.mapSlug+'.js'
jQuery.ajax({
type: b.method,
dataType: b.dataType,
jsonpCallback: 'jsonpMapMarkerCallback',
url: url,
data: a,
success: function (a) {
c.call(this, a)
},
error: function (a, b, c) {
console.log(a);
console.log(b);
console.log(c)
}
})
} else {
url = this._proxyUrl() + b.path;
jQuery.ajax({
type: b.method,
dataType: b.dataType,
url: url,
data: a,
success: function (a) {
c.call(this, a)
},
error: function (a, b, c) {
console.log(a);
console.log(b);
console.log(c)
}
})
}
},
_proxyUrl: function () {
return this.proxyUrl ? this.proxyUrl : "ign.com".indexOf(window.location.hostname) ? this.proxyUrl = "http://" + window.location.hostname.replace("widgets.", "www.").replace(".docs.", ".") + "/maps/" : "http://www.ign.com/maps/"
}
};
if (!IGN) var IGN = {};
if (!IGN.Mixins) IGN.Mixins = {};
IGN.Mixins.Icons = {
createMarkerIcon: function (a) {
var b = "",
c;
a && (a.badges && (b = '' + a.badges + ""), a.iconUrl && (c = {
iconSize: a.iconSize,
iconAnchor: a.iconAnchor,
popupAnchor: a.popupAnchor,
html: b + ''
}));
a = {
iconSize: [36, 46],
iconAnchor: [18, 42],
className: "single-div-icon",
html: b + '',
popupAnchor: [0, -42]
};
L.Util.extend(a, c);
return new L.DivIcon(a)
},
createDefaultClusterIcon: function (a) {
return new L.DivIcon({
className: a && a.retina ? "cluster-div-icon-retina" : "cluster-div-icon",
iconSize: [36, 47],
iconAnchor: [18, 42]
})
}
};
if (!IGN) var IGN = {};
if (!IGN.Mixins) IGN.Mixins = {};
IGN.Mixins.Types = {
_bindTypesEvents: function () {
this.on("loadtypes", function (d) {
this.loadMarkersForTypes(d)
})
},
initTypes: function (d) {
this._bindTypesEvents();
var a = this,
e = {
retina: this.options.retina,
clusters: {
enabled: this.options.clusters.enabled,
clusterRadius: this.options.clusters.clusterRadius,
disableClusteringAtZoom: this.options.minZoom
}
},
c;
this.markers = {};
this.types = {};
jQuery.each(d, function (d, b) {
if (b.parentTypeSlug) b.parentType = a.types[b.parentTypeSlug];
if (b.markerCounts && b.markerCounts[a.metadata.mapSlug]) b.markerCount =
b.markerCounts[a.metadata.mapSlug];
c = new IGN.Type(b, e);
c.hasParent() && a.types[c.parentTypeSlug].addChild(c);
a.types[c.typeSlug] = c
});
a.fireEvent("typesloaded")
},
loadMarkersForTypes: function (d) {
var a = [],
e = {},
c = this,
f, b;
f = d.filterEvent ? d.filterEvent : "filter";
jQuery.each(d.types, function (c, b) {
if (1 == d.types.length || "korok-seed" != b.typeSlug) a.push(b.typeSlug), b.loaded = !0
});
this.callApi(this.API.ENDPOINT.MARKERS.GET, {
types: a.join(",")
}, function (a) {
jQuery.each(a.data, function (d, a) {
a.type = c.types[a.metadata.typeSlug];
if (c.options.moderator) a.displayBadgeCount = !0;
b = new IGN.Marker([a.location.lat, a.location.lng], a);
if(c.types[a.metadata.typeSlug]) {
c.types[a.metadata.typeSlug].addMarker(b);
c.markers[a.metadata.markerSlug] = b;
c.overlayFilter.addMarker(b)
}
});
if (d.parentType) e.type = d.parentType;
c.fireEvent(f, e)
})
}
};
if (!IGN) var IGN = {};
if (!IGN.Mixins) IGN.Mixins = {};
IGN.Mixins.Maps = {
relatedMaps: function (a) {
if (this.options.madeAdditionalMapsCall) a.call(this, this._maps);
else {
var b = this;
this._maps = [];
this.options.madeAdditionalMapsCall = !1;
this.callApi(this.API.ENDPOINT.MAPS, {}, function (c) {
b._maps = c.data;
b.options.madeAdditionalMapsCall = !0;
a && a.call(this, b._maps)
})
}
}
};
if (!IGN) var IGN = {};
if (!IGN.Mixins) IGN.Mixins = {};
IGN.Mixins.Markers = {
activateMarker: function (a) {
var b = this,
c;
this.markers[a.metadata.markerSlug] && this.markers[a.metadata.markerSlug]._map ? this.markers[a.metadata.markerSlug].fireEvent("click") : loadingInterval = setInterval(function () {
if (b.markers[a.metadata.markerSlug]) b.markers[a.metadata.markerSlug]._map ? (b.markers[a.metadata.markerSlug].fireEvent("click"), clearInterval(loadingInterval)) : (c = b.markers[a.metadata.markerSlug].location, b.setView([c.lat, c.lng], b.getZoom()))
}, 100)
}
};
if (!IGN) var IGN = {};
IGN.Type = L.Class.extend({
includes: IGN.Mixins.Icons,
initialize: function (a, b) {
this.children = [];
this.loaded = !1;
this._layerGroup = new L.LayerGroup;
if (!a.markerCount) a.markerCount = 0;
L.Util.extend(this, a);
if (b && b.retina && this.legend && this.legend.retinaUrl) this.legend.url = this.legend.retinaUrl;
if (b && b.retina && this.markerIcon && this.markerIcon.retinaUrl) this.markerIcon.url = this.markerIcon.retinaUrl;
this.setTopLevelMarkerIcon()
},
hasChildren: function () {
return 0 < this.children.length ? !0 : !1
},
hasParent: function () {
return this.hasOwnProperty("parentTypeSlug") ?
!0 : !1
},
addChild: function (a) {
this.children.push(a)
},
allChildren: function (a) {
jQuery.each(this.children, function (b, c) {
0 < c.children.length && c.allChildren(a);
a.call(this, c)
})
},
eachChild: function (a) {
jQuery.each(this.children, function (b, c) {
a.call(this, c)
})
},
eachParent: function (a) {
this.parentType && (a.call(this, this.parentType), this.parentType.eachParent(a))
},
setTopLevelMarkerIcon: function () {
if (!(this.markerIcon && null != this.markerIcon.url)) {
var a = this;
this.hasParent() && this.eachParent(function (b) {
if (b.markerIcon &&
null != b.markerIcon.url) a.markerIcon = b.markerIcon
})
}
},
addMarker: function (a) {
this._layerGroup.addLayer(a);
this.markerCount++;
this.eachParent(function () {
this.markerCount++
})
},
removeMarker: function (a) {
this._layerGroup.removeLayer(a);
this.markerCount--;
this.eachParent(function () {
this.markerCount--
})
},
createIcon: function (a) {
var b = {};
if (this.markerIcon) b.iconUrl = this.markerIcon.url, b.iconSize = [this.markerIcon.width, this.markerIcon.height], b.iconAnchor = [this.markerIcon.anchorX, this.markerIcon.anchorY], b.popupAnchor = [0, -this.markerIcon.anchorY];
if (a && 0 != a) b.badges = a;
return this.createMarkerIcon(b)
},
legendUrl: function () {
var a;
this.legend ? a = this.legend.url : this.eachParent(function (b) {
if (b.legend) a = b.legend.url
});
return a
}
});
if (!IGN) var IGN = {};
IGN.Marker = L.Marker.extend({
options: {
exists: !0,
displayBageCount: !1
},
includes: IGN.Mixins.MapsAPI,
initialize: function (a, b) {
if (!b.metadata) b.metadata = {};
if (!b.location) b.location = {
lat: a.lat,
lng: a.lng
};
L.Util.extend(this, b);
L.Marker.prototype.initialize.call(this, a, b);
this.updateIcon();
this._createStatics();
this._bindEvents();
this.state = this.STATES.NORMAL
},
updateIcon: function () {
var a = this.metadata.pendingCount,
a = this.displayBadgeCount ? a : 0;
try{
this.setIcon(this.type.createIcon(a))
} catch(e) {}
},
enableDragging: function () {
this.dragging.enable()
},
disableDragging: function () {
this.dragging.disable()
},
enableEditing: function () {
this._replicate();
this.state = this.STATES.EDIT;
this.closePopup();
this.enableDragging();
this.fireEvent("click")
},
disableEditing: function () {
this.state = this.STATES.NORMAL;
this.closePopup();
this._restoreFromReplicate();
this.options.exists && (this.updateIcon(), this.setLatLng([this.location.lat, this.location.lng]), this.disableDragging(), this.fireEvent("click"))
},
setType: function (a) {
this.type = a;
this.metadata.typeSlug = a.typeSlug;
this.updateIcon(a.createIcon())
},
duplicate: function () {
var a = {
metadata: {
markerName: this.metadata.markerName,
objectSlug: this.metadata.objectSlug,
mapSlug: this.metadata.mapSlug,
typeSlug: this.metadata.typeSlug,
wikiPage: this.metadata.wikiPage
},
location: {
lat: this.getLatLng().lat,
lng: this.getLatLng().lng
},
type: this.type,
exists: !1
};
return new IGN.Marker(new L.LatLng(this.getLatLng().lat, this.getLatLng().lng), a)
},
serviceCallSave: function () {
var a = this._map,
b, c;
c = this.options.exists ? this.API.ENDPOINT.MARKERS.PUT : this.API.ENDPOINT.MARKERS.POST;
b = {
objectSlug: this.metadata.objectSlug,
markerSlug: this.metadata.markerSlug,
lat: this.getLatLng().lat,
lng: this.getLatLng().lng,
wikiPage: this.metadata.wikiPage,
typeSlug: this.metadata.typeSlug,
createdBy: this.metadata.createdBy,
updatedBy: this.metadata.updatedBy,
markerName: this.metadata.markerName,
mapref: this.metadata.mapRef
};
this.callApi(c, b, function () {});
this.options.exists ? a.fireEvent("markerupdate", this) : a.fireEvent("markercreate", this);
a.overlayFilter && a.overlayFilter.removeMarker(this);
this.type.removeMarker(this);
this.type = a.types[this.metadata.typeSlug];
this.closePopup();
this.state = this.STATES.NORMAL;
this.type.addMarker(this);
this.disableDragging();
a.overlayFilter.addMarker(this);
a.fireEvent("changefilter", this.type);
this.options.exists = !0
},
serviceCallDelete: function () {
var a = this._map;
a.fireEvent("markerdelete", this);
this._removeFromMap();
a.fireEvent("redraw");
this.callApi(this.API.ENDPOINT.MARKERS.DELETE, {
markerSlug: this.metadata.markerSlug
}, function () {})
},
_createStatics: function () {
this.STATES = {
NORMAL: 1,
EDIT: 2,
PENDING: 3,
CLUSTER: 4
}
},
_removeFromMap: function () {
var a =
this._map;
this.type.removeMarker(this);
a.overlayFilter.removeMarker(this)
},
_bindEvents: function () {
var a, b, c;
if ("undefined" !== typeof IGN.PopupContent) this.on("click", function () {
var d = !1;
switch (this.state) {
case this.STATES.EDIT:
c = IGN.PopupContent.editContent;
d = !1;
break;
default:
c = IGN.PopupContent.content, d = !0
}
this._map.panTo(this.getLatLng());
this.bindPopup(c(this), {
autoPanPadding: new L.Point(5, 100),
autoPan: !0
}).openPopup();
if (this.wikiContent) IGN.PopupContent.updateWikiContent(this, this.wikiContent);
else if (d && "undefined" != typeof this.metadata.wikiPage) {
a = this;
a.metadata.wikiPage = a.metadata.wikiPage.replace("edit/", "").replace("empty/", "");
b = {
wiki: a.metadata.objectSlug,
page: a.metadata.wikiPage
};
if (a.metadata.createdBy) b.createdBy = a.metadata.createdBy;
if (a.metadata.updatedBy) b.updatedBy = a.metadata.updatedBy;
// this.callApi(this.API.ENDPOINT.WIKI, b, function (b) {
// a.wikiContent = IGN.PopupContent.wikiContent(a, b);
// a._popup._update()
// })
a.wikiContent = IGN.PopupContent.wikiContent(a, b);
a._popup._update()
} else this.wikiContent = IGN.PopupContent.wikiContent(this, "");
this._map.fireEvent("markerclick", {
marker: this
});
this._popup._update()
})
},
_replicate: function () {
if (this.options.exists) this._replicaMarkerName = this.metadata.markerName, this._replicaWikiPage = this.metadata.wikiPage, this._replicaLat = this.getLatLng().lat, this._replicaLng = this.getLatLng().lng, this._replicaTypeSlug = this.metadata.typeSlug
},
_restoreFromReplicate: function () {
if (this.options.exists) this.metadata.markerName = this._replicaMarkerName, this.metadata.wikiPage = this._replicaWikiPage, this.location.lat = this._replicaLat, this.location.lng =
this._replicaLng, this.metadata.typeSlug = this._replicaTypeSlug, this.type = this._map.types[this.metadata.typeSlug]
}
});
if (!IGN) var IGN = {};
IGN.PendingMarker = IGN.Marker.extend({
include: IGN.Mixins.API,
options: {
pendingAction: "edit"
},
initialize: function (a, b) {
L.Util.extend(this.options, b);
IGN.Marker.prototype.initialize.call(this, a, b)
},
compareTo: function (a) {
var b = {};
if (this.metadata.markerName != a.metadata.markerName) b.markerName = a.metadata.markerName;
if (this.metadata.wikiPage != a.metadata.wikiPage) b.wikiPage = a.metadata.wikiPage;
if (this.metadata.typeSlug != a.metadata.typeSlug) b.typeSlug = a.metadata.typeSlug;
if (this.metadata.mapRef != a.metadata.mapRef) b.mapRef =
a.metadata.mapRef ? a.metadata.mapRef : "None";
if (this.location.lat != a.location.lat || this.location.lng != a.location.lng) b.location = a.location;
return b
},
decline: function () {
var a = this._map;
a.removeLayer(this);
this._originalMarker && (this._originalMarker.metadata.pendingCount--, this._originalMarker.updateIcon());
this.serviceCallDecline();
this._finalizeAcceptOrDecline(a)
},
accept: function () {
var a = this._map;
this.options.pendingAction == this.PENDING_STATES.EDIT ? this._acceptEdit() : this.options.pendingAction == this.PENDING_STATES.CREATE ?
this._acceptCreate() : this.options.pendingAction == this.PENDING_STATES.DELETE && this._acceptDelete();
this._finalizeAcceptOrDecline(a)
},
serviceCallDecline: function () {
this.callApi(this.API.ENDPOINT.MARKERS.PENDING.DECLINE, {
pendingUUID: this.pendingMarkerUUID
}, function () {})
},
_createStatics: function () {
this.PENDING_STATES = {
CREATE: "create",
EDIT: "edit",
DELETE: "delete"
};
IGN.Marker.prototype._createStatics.call(this)
},
_bindEvents: function () {
var a;
this.on("click", function () {
a = this.options.pendingAction == this.PENDING_STATES.DELETE ?
IGN.PopupContent.pendingDelete : IGN.PopupContent.editContent;
if (this._originalMarker) this._differences = this.compareTo(this._originalMarker);
this.bindPopup(a(this)).openPopup();
this._map.fireEvent("markerclick", {
marker: this
})
})
},
_acceptEdit: function () {
this._originalMarker.metadata.markerName = this.metadata.markerName;
this._originalMarker.metadata.wikiPage = this.metadata.wikiPage;
this._originalMarker.metadata.typeSlug = this.metadata.typeSlug;
this._originalMarker.type = this.type;
this._originalMarker.metadata.mapRef =
this.metadata.mapRef;
this._originalMarker.metadata.updatedBy = this.metadata.updatedBy;
this._originalMarker.setLatLng(this.getLatLng());
this._originalMarker.serviceCallSave();
this._originalMarker.metadata.pendingCount--;
this._originalMarker.updateIcon();
this._originalMarker.state = this._originalMarker.STATES.NORMAL;
this.serviceCallDecline()
},
_acceptCreate: function () {
var a = {
exists: !1
},
b = this._map;
a.type = this.type;
a.metadata = this.metadata;
a.metadata.pendingCount = 0;
a.metadata.createdBy = this.metadata.createdBy;
a.location = this.location;
a = new IGN.Marker(this.getLatLng(), a);
b.addLayer(a);
a.serviceCallSave();
this.serviceCallDecline()
},
_acceptDelete: function () {
var a = this._map;
this._originalMarker.serviceCallDelete();
this.serviceCallDelete();
a.fireEvent("disablemoderation")
},
_finalizeAcceptOrDecline: function (a) {
this._originalMarker && 0 >= this._originalMarker.metadata.pendingCount && (a.fireEvent("changefilter", this._originalMarker.type), a.fireEvent("disablemoderation"), a.fireEvent("redraw"));
this._moderationListLink &&
jQuery(this._moderationListLink).slideUp("fast");
a.removeLayer(this)
}
});
if (!IGN) var IGN = {};
IGN.MarkerClusterGroup = L.MarkerClusterGroup.extend({
includes: IGN.Mixins.Icons,
initialize: function (a) {
var c = this,
b = {
zoomToBoundsOnClick: !1,
showCoverageOnHover: !1,
spiderfyOnMaxZoom: !1,
disableClusteringAtZoom: 3,
maxClusterRadius: 80,
animateAddingMarkers: !1,
iconCreateFunction: function () {
return new c.createDefaultClusterIcon(c.options)
}
};
L.Util.extend(b, a);
L.Util.extend(this, b);
L.MarkerClusterGroup.prototype.initialize.call(this, b)
},
removeLayer: function (a) {
if (!a.__parent) return this;
this._unspiderfy && (this._unspiderfy(),
this._unspiderfyLayer(a));
this._removeLayer(a, !0);
a._icon && (L.FeatureGroup.prototype.removeLayer.call(this, a), a.setOpacity(1));
return this
}
});
if (!IGN) var IGN = {};
if (!IGN.PopupContent) IGN.PopupContent = {};
IGN.PopupContent.clusterContent = function (b) {
var i = 0,
c, j, k, d, a, e, f, l, g, h;
e = b.layer;
f = e._map;
a = e.getAllChildMarkers();
b = L.DomUtil.create("div", "cluster-popup-holder");
c = L.DomUtil.create("h3", "cluster-headline", b);
l = a[0].type.legendUrl();
g = {
count: a.length,
data: []
};
jQuery.each(a, function (a, b) {
g.data.push({
metadata: b.metadata
})
});
h = escape(JSON.stringify(g));
jQuery(c).html('' +
a.length + ' markers at this location:' + a.length + " markers at this location");
j = L.DomUtil.create("ul", "marker-list", b);
jQuery.each(a, function (a, b) {
k = L.DomUtil.create("li", null, j);
d = L.DomUtil.create("a", null, k);
jQuery(d).html(b.metadata.markerName);
jQuery(d).data("marker", b);
jQuery(d).click(function (a) {
var b = jQuery(this).data("marker");
f.fireEvent("changefilter", b.type);
f.fireEvent("activatemarker", f.markers[b.metadata.markerSlug]);
a.stopPropagation();
a.preventDefault()
});
i++;
if (3 <= i) return !1
});
a = a.length - 3;
0 < a && (c = L.DomUtil.create("div", "cluster-desc", b), jQuery(c).html("\u2026and " + a + " others."));
c = L.DomUtil.create("a", "btn btn-inverse zoom-in-btn", b);
jQuery(c).html("Zoom In");
a = L.DomUtil.create("span", "see-all-markers", b);
jQuery(a).html(" to see all markers.");
jQuery(c).click(function (a) {
e.zoomToBounds();
a.stopPropagation();
a.preventDefault()
});
return b
};
if (!IGN) var IGN = {};
if (!IGN.PopupContent) IGN.PopupContent = {};
IGN.PopupContent.content = function (b) {
var cur = b.metadata.markerSlug;
var mdata = b._map.markers;
var curData = mdata[cur] || {};
var d = b._map,
a, c, e, f;
e = "http://www.ign.com/wikis/" + b.metadata.objectSlug + "/" + b.metadata.wikiPage;
a = L.DomUtil.create("div", "popup-holder");
b._map.options.editable && IGN.PopupContent._editButtons(a, b);
c = L.DomUtil.create("span", "headline", a);
wikicontent = L.DomUtil.create("div", b.metadata.markerSlug + "-wikicontent interactivemap-wikicontent", a);
var ltitle = curData.metadata.title || b.metadata.markerName;
f = b.type.legendUrl();
jQuery(c).html('
' + ltitle + "
");
L.DomUtil.create("div", "interactivemap-popupLoading", wikicontent);
b.metadata.mapRef;
d.options.moderator && (duplicateButton = L.DomUtil.create("a", "duplicate-button", a), jQuery(duplicateButton).html(' Duplicate this marker'),
jQuery(duplicateButton).on("click", function (a) {
var c = b.duplicate();
c.addTo(d);
c.enableEditing();
a.preventDefault();
a.stopPropagation()
}));
L.DomUtil.create("div", "clearfix", a);
return a
};
IGN.PopupContent._editButtons = function (b, d) {
var a;
a = L.DomUtil.create("div", "edit-controls", b);
a = L.DomUtil.create("a", "button-edit", a);
L.DomUtil.create("i", "icon icon-white icon-edit", a);
jQuery(a).attr("title", "Edit").tooltip({
placement: "top"
});
jQuery(a).click(function (a) {
d.enableEditing();
jQuery(this).tooltip("hide");
a.preventDefault();
a.stopPropagation()
})
};
if (!IGN) var IGN = {};
if (!IGN.PopupContent) IGN.PopupContent = {};
IGN.PopupContent.editContent = function (d) {
var a, e;
a = L.DomUtil.create("div", "popup-holder");
e = L.DomUtil.create("h5", "editing-headline", a);
d.state == d.STATES.PENDING ? (headlineContent = "Pending " + d.options.pendingAction, "create" == d.options.pendingAction && "undefined" != typeof d.createdBy.name ? headlineContent += " by " + d.createdBy.name : "edit" == d.options.pendingAction && "undefined" != typeof d.updatedBy.name && (headlineContent += " by " + d.updatedBy.name), jQuery(e).html(headlineContent)) : d.metadata && d.metadata.markerName ?
jQuery(e).html("Editing: " + d.metadata.markerName) : jQuery(e).html("新的标记");
IGN.PopupContent._editForm(a, d);
return a
};
IGN.PopupContent._editForm = function (d, a) {
var e = a._map,
c, f, b, j, h, l, g, i, m, q, n, o, k, p;
c = L.DomUtil.create("form", "edit-form", d);
f = jQuery('');
jQuery(f).appendTo(c);
a.metadata && a.metadata.markerName && jQuery(f).val(a.metadata.markerName);
a.state == a.STATES.PENDING && a._differences && a._differences.markerName && (h = L.DomUtil.create("span", "help-block marker-difference-label", c), jQuery(h).html('Was "' + a._differences.markerName + '"'));
h = L.DomUtil.create("label", "label-with-module-selector",
c);
jQuery(h).html("选择标记分类");
p = L.DomUtil.create("div", "category-selector", c);
h = L.DomUtil.create("div", "ign-leaflet-module", p);
b = L.DomUtil.create("a", "category-button main-selector", h);
jQuery(b).html(a.type.typeName);
L.DomUtil.create("span", "red-arrow", b);
k = L.DomUtil.create("ul", "dropdown-menu general-dropdown-menu category-field-list", p);
IGN.PopupContent._typeSelector(b, k, k, e.types, a);
jQuery(b).click(function (a) {
jQuery(k).is(":visible") ? jQuery(k).hide() : jQuery(k).show();
a.preventDefault();
a.stopPropagation()
});
a.state == a.STATES.PENDING && a._differences && a._differences.typeSlug && (b = L.DomUtil.create("span", "help-block marker-difference-label", c), jQuery(b).html('Was "' + a._differences.typeSlug + '"'));
// b = L.DomUtil.create("label", "label-with-module-selector wiki-label", c);
// jQuery(b).html("Wiki Page");
// j = jQuery('');
// jQuery(j).appendTo(c);
a.metadata && a.metadata.wikiPage && jQuery(j).val(a.metadata.wikiPage);
a.state == a.STATES.PENDING && a._differences && a._differences.wikiPage && (wikiDifference =
L.DomUtil.create("span", "help-block marker-difference-label", c), jQuery(wikiDifference).html('Was "' + a._differences.wikiPage + '"'));
g = L.DomUtil.create("div", "dropdown-menu url-dropdown-menu general-dropdown-menu related-wiki-page-dropdown", d);
jQuery(j).keyup(function () {
clearTimeout(i);
m = jQuery(this).val();
a.metadata.wikiPage = m;
q = {
objectSlug: e.metadata.objectSlug,
mapSlug: e.metadata.mapSlug,
lookup: m
};
i = setTimeout(function () {
IGN.Mixins.MapsAPI.callApi(IGN.Mixins.MapsAPI.API.ENDPOINT.WIKI_PAGE, q, function (b) {
jQuery(g).empty();
b && b.query && b.query.allpages && (jQuery.each(b.query.allpages, function (b, c) {
n = L.DomUtil.create("a", null, g);
jQuery(n).html(c.title);
jQuery(n).click(function (b) {
jQuery(j).val(c.title);
a.metadata.wikiPage = c.title;
jQuery(g).hide();
b.preventDefault();
b.stopPropagation()
})
}), o = L.DomUtil.create("a", null, g), jQuery(o).html(' Cancel'), jQuery(o).click(function (a) {
jQuery(g).hide();
a.preventDefault();
a.stopPropagation()
}), jQuery(g).show())
})
}, 200)
});
// b = L.DomUtil.create("label",
// "map-label", c);
// jQuery(b).html("External map");
// l = L.DomUtil.create("select", null, c);
e.relatedMaps(function (b) {
IGN.PopupContent._mapSelector(l, b, a)
});
a.state == a.STATES.PENDING && a._differences && a._differences.mapRef && (b = L.DomUtil.create("span", "help-block marker-difference-label", c), jQuery(b).html('Was "' + a._differences.mapRef + '"'));
a.state == a.STATES.PENDING && a._differences && a._differences.location && (b = L.DomUtil.create("span", "help-block marker-difference-label", c), jQuery(b).html("Location was lat:" +
a._differences.location.lat + ", lng:" + a._differences.location.lng + ""));
L.DomUtil.create("div", "clearfix mb30", c);
jQuery(f).change(function () {
a.metadata.markerName = jQuery(this).val()
});
jQuery(j).change(function () {
a.metadata.wikiPage = jQuery(this).val()
});
jQuery(h).change(function () {
a.metadata.typeSlug = jQuery(this).val()
});
jQuery(l).change(function () {
a.metadata.mapRef = jQuery(this).val()
});
a.state == a.STATES.EDIT ? (f = L.DomUtil.create("a", "btn", c), jQuery(f).html("取消"), jQuery(f).click(function (b) {
a.disableEditing();
a.options.exists || e.removeLayer(a);
b.preventDefault();
b.stopPropagation()
}), a.options.exists && (f = L.DomUtil.create("a", "btn btn-inverse btn-delete", c), jQuery(f).html(''), jQuery(f).click(function (b) {
confirm("Are you sure you want to delete this marker?") && a.serviceCallDelete();
b.preventDefault();
b.stopPropagation()
})), f = L.DomUtil.create("a", "btn btn-primary pull-right gray-btn-right-arrow", c), jQuery(f).html(" 保存点标 "), jQuery(f).click(function (b) {
a.serviceCallSave();
a.wikiContent = !1;
b.preventDefault();
b.stopPropagation()
})) : a.state == a.STATES.PENDING && (f = L.DomUtil.create("a", "btn btn-danger", c), jQuery(f).html("Decline"), jQuery(f).click(function (b) {
a.decline();
b.preventDefault();
b.stopPropagation()
}), f = L.DomUtil.create("a", "btn btn-primary pull-right", c), jQuery(f).html("Accept"), jQuery(f).click(function (b) {
a.accept();
b.preventDefault();
b.stopPropagation()
}));
jQuery(c).on("submit", function (a) {
a.preventDefault();
a.stopPropagation()
})
};
IGN.PopupContent._mapSelector = function (d, a, e) {
var c;
c = L.DomUtil.create("option", null, d);
jQuery(c).html("None");
"undefined" !== typeof a && jQuery.each(a, function (a, b) {
if (!b.metadata.status || "published" != b.metadata.status) return !0;
b.metadata.mapSlug != e.metadata.mapSlug && (jQuery('").appendTo(d), e.metadata.mapRef && e.metadata.mapRef == b.metadata.mapSlug && jQuery(d).val(e.metadata.mapRef))
})
};
IGN.PopupContent._typeSelector = function (d, a, e, c, f) {
var b;
b = function (c, h) {
var e, g, i;
e = jQuery("");
g = jQuery("" + h.typeName + "");
f.type.typeSlug == h.typeSlug && (jQuery("a", a).removeClass("active"), g.addClass("active"));
h.legend && h.legend.url ? (jQuery('').prependTo(g), g.addClass("icon")) : g.addClass("no-icon");
h.hasChildren() && jQuery('').appendTo(g);
jQuery('').appendTo(g);
g.appendTo(e);
g.data("type", h);
i = jQuery('
');
jQuery(i).appendTo(e);
h.eachChild(function (a) {
jQuery(b(i, a)).appendTo(i)
});
e.appendTo(c);
g.click(function (b) {
var c = jQuery(this).data("type");
if (c.hasChildren()) {
var c = jQuery(".children:first", e),
h = jQuery(".icon:first", g);
c.is(":visible") ? (c.hide(), h.removeClass("icon-chevron-down").addClass("icon-chevron-right")) : (c.show(), h.removeClass("icon-chevron-right").addClass("icon-chevron-down"))
} else jQuery("a", a).removeClass("active"),
g.addClass("active"), jQuery(a).hide(), f.setType(c), f.enableDragging(), jQuery(d).html(c.typeName), L.DomUtil.create("span", "red-arrow", d);
b.preventDefault();
b.stopPropagation()
})
};
jQuery.each(c, function (a, c) {
c.hasParent() || b(e, c)
})
};
if (!IGN) var IGN = {};
if (!IGN.PopupContent) IGN.PopupContent = {};
IGN.PopupContent.wikiContent = function (e, a) {
var cur = e.metadata.markerSlug;
var mdata = e._map.markers;
var curData = mdata[cur] || {};
var f = 0,
h = 0,
b, i, c, d, j, k, g;
c = L.DomUtil.create("div", "internal-container");
jQuery(c).html('