This file is indexed.

/usr/share/javascript/leaflet/leaflet.js is in libjs-leaflet 0.7.2-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

1
2
3
4
5
6
/*
 Leaflet, a JavaScript library for mobile-friendly interactive maps. http://leafletjs.com
 (c) 2010-2013, Vladimir Agafonkin
 (c) 2010-2011, CloudMade
*/
(function(e,t,n){var r=e.L,i={};i.version="0.7.2",typeof module=="object"&&typeof module.exports=="object"?module.exports=i:typeof define=="function"&&define.amd&&define(i),i.noConflict=function(){return e.L=r,this},e.L=i,i.Util={extend:function(e){var t=Array.prototype.slice.call(arguments,1),n,r,i,s;for(r=0,i=t.length;r<i;r++){s=t[r]||{};for(n in s)s.hasOwnProperty(n)&&(e[n]=s[n])}return e},bind:function(e,t){var n=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return e.apply(t,n||arguments)}},stamp:function(){var e=0,t="_leaflet_id";return function(n){return n[t]=n[t]||++e,n[t]}}(),invokeEach:function(e,t,n){var r,i;if(typeof e=="object"){i=Array.prototype.slice.call(arguments,3);for(r in e)t.apply(n,[r,e[r]].concat(i));return!0}return!1},limitExecByInterval:function(e,t,n){var r,i;return function s(){var o=arguments;if(r){i=!0;return}r=!0,setTimeout(function(){r=!1,i&&(s.apply(n,o),i=!1)},t),e.apply(n,o)}},falseFn:function(){return!1},formatNum:function(e,t){var n=Math.pow(10,t||5);return Math.round(e*n)/n},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},splitWords:function(e){return i.Util.trim(e).split(/\s+/)},setOptions:function(e,t){return e.options=i.extend({},e.options,t),e.options},getParamString:function(e,t,n){var r=[];for(var i in e)r.push(encodeURIComponent(n?i.toUpperCase():i)+"="+encodeURIComponent(e[i]));return(!t||t.indexOf("?")===-1?"?":"&")+r.join("&")},template:function(e,t){return e.replace(/\{ *([\w_]+) *\}/g,function(e,r){var i=t[r];if(i===n)throw Error("No value provided for variable "+e);return typeof i=="function"&&(i=i(t)),i})},isArray:Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function t(t){var n,r,i=["webkit","moz","o","ms"];for(n=0;n<i.length&&!r;n++)r=e[i[n]+t];return r}function r(t){var r=+(new Date),i=Math.max(0,16-(r-n));return n=r+i,e.setTimeout(t,i)}var n=0,s=e.requestAnimationFrame||t("RequestAnimationFrame")||r,o=e.cancelAnimationFrame||t("CancelAnimationFrame")||t("CancelRequestAnimationFrame")||function(t){e.clearTimeout(t)};i.Util.requestAnimFrame=function(t,n,o,u){t=i.bind(t,n);if(!o||s!==r)return s.call(e,t,u);t()},i.Util.cancelAnimFrame=function(t){t&&o.call(e,t)}}(),i.extend=i.Util.extend,i.bind=i.Util.bind,i.stamp=i.Util.stamp,i.setOptions=i.Util.setOptions,i.Class=function(){},i.Class.extend=function(e){var t=function(){this.initialize&&this.initialize.apply(this,arguments),this._initHooks&&this.callInitHooks()},n=function(){};n.prototype=this.prototype;var r=new n;r.constructor=t,t.prototype=r;for(var s in this)this.hasOwnProperty(s)&&s!=="prototype"&&(t[s]=this[s]);e.statics&&(i.extend(t,e.statics),delete e.statics),e.includes&&(i.Util.extend.apply(null,[r].concat(e.includes)),delete e.includes),e.options&&r.options&&(e.options=i.extend({},r.options,e.options)),i.extend(r,e),r._initHooks=[];var o=this;return t.__super__=o.prototype,r.callInitHooks=function(){if(this._initHooksCalled)return;o.prototype.callInitHooks&&o.prototype.callInitHooks.call(this),this._initHooksCalled=!0;for(var e=0,t=r._initHooks.length;e<t;e++)r._initHooks[e].call(this)},t},i.Class.include=function(e){i.extend(this.prototype,e)},i.Class.mergeOptions=function(e){i.extend(this.prototype.options,e)},i.Class.addInitHook=function(e){var t=Array.prototype.slice.call(arguments,1),n=typeof e=="function"?e:function(){this[e].apply(this,t)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(n)};var s="_leaflet_events";i.Mixin={},i.Mixin.Events={addEventListener:function(e,t,n){if(i.Util.invokeEach(e,this.addEventListener,this,t,n))return this;var r=this[s]=this[s]||{},o=n&&n!==this&&i.stamp(n),u,a,f,l,c,h,p;e=i.Util.splitWords(e);for(u=0,a=e.length;u<a;u++)f={action:t,context:n||this},l=e[u],o?(c=l+"_idx",h=c+"_len",p=r[c]=r[c]||{},p[o]||(p[o]=[],r[h]=(r[h]||0)+1),p[o].push(f)):(r[l]=r[l]||[],r[l].push(f));return this},hasEventListeners:function(e){var t=this[s];return!!t&&(e in t&&t[e].length>0||e+"_idx"in t&&t[e+"_idx_len"]>0)},removeEventListener:function(e,t,n){if(!this[s])return this;if(!e)return this.clearAllEventListeners();if(i.Util.invokeEach(e,this.removeEventListener,this,t,n))return this;var r=this[s],o=n&&n!==this&&i.stamp(n),u,a,f,l,c,h,p,d,v;e=i.Util.splitWords(e);for(u=0,a=e.length;u<a;u++){f=e[u],h=f+"_idx",p=h+"_len",d=r[h];if(!t)delete r[f],delete r[h],delete r[p];else{l=o&&d?d[o]:r[f];if(l){for(c=l.length-1;c>=0;c--)l[c].action===t&&(!n||l[c].context===n)&&(v=l.splice(c,1),v[0].action=i.Util.falseFn);n&&d&&l.length===0&&(delete d[o],r[p]--)}}}return this},clearAllEventListeners:function(){return delete this[s],this},fireEvent:function(e,t){if(!this.hasEventListeners(e))return this;var n=i.Util.extend({},t,{type:e,target:this}),r=this[s],o,u,a,f,l;if(r[e]){o=r[e].slice();for(u=0,a=o.length;u<a;u++)o[u].action.call(o[u].context,n)}f=r[e+"_idx"];for(l in f){o=f[l].slice();if(o)for(u=0,a=o.length;u<a;u++)o[u].action.call(o[u].context,n)}return this},addOneTimeEventListener:function(e,t,n){if(i.Util.invokeEach(e,this.addOneTimeEventListener,this,t,n))return this;var r=i.bind(function(){this.removeEventListener(e,t,n).removeEventListener(e,r,n)},this);return this.addEventListener(e,t,n).addEventListener(e,r,n)}},i.Mixin.Events.on=i.Mixin.Events.addEventListener,i.Mixin.Events.off=i.Mixin.Events.removeEventListener,i.Mixin.Events.once=i.Mixin.Events.addOneTimeEventListener,i.Mixin.Events.fire=i.Mixin.Events.fireEvent,function(){var r="ActiveXObject"in e,s=r&&!t.addEventListener,o=navigator.userAgent.toLowerCase(),u=o.indexOf("webkit")!==-1,a=o.indexOf("chrome")!==-1,f=o.indexOf("phantom")!==-1,l=o.indexOf("android")!==-1,c=o.search("android [23]")!==-1,h=o.indexOf("gecko")!==-1,p=typeof orientation!=n+"",d=e.navigator&&e.navigator.msPointerEnabled&&e.navigator.msMaxTouchPoints&&!e.PointerEvent,v=e.PointerEvent&&e.navigator.pointerEnabled&&e.navigator.maxTouchPoints||d,m="devicePixelRatio"in e&&e.devicePixelRatio>1||"matchMedia"in e&&e.matchMedia("(min-resolution:144dpi)")&&e.matchMedia("(min-resolution:144dpi)").matches,g=t.documentElement,y=r&&"transition"in g.style,b="WebKitCSSMatrix"in e&&"m11"in new e.WebKitCSSMatrix&&!c,w="MozPerspective"in g.style,E="OTransition"in g.style,S=!e.L_DISABLE_3D&&(y||b||w||E)&&!f,x=!e.L_NO_TOUCH&&!f&&function(){var e="ontouchstart";if(v||e in g)return!0;var n=t.createElement("div"),r=!1;return n.setAttribute?(n.setAttribute(e,"return;"),typeof n[e]=="function"&&(r=!0),n.removeAttribute(e),n=null,r):!1}();i.Browser={ie:r,ielt9:s,webkit:u,gecko:h&&!u&&!e.opera&&!r,android:l,android23:c,chrome:a,ie3d:y,webkit3d:b,gecko3d:w,opera3d:E,any3d:S,mobile:p,mobileWebkit:p&&u,mobileWebkit3d:p&&b,mobileOpera:p&&e.opera,touch:x,msPointer:d,pointer:v,retina:m}}(),i.Point=function(e,t,n){this.x=n?Math.round(e):e,this.y=n?Math.round(t):t},i.Point.prototype={clone:function(){return new i.Point(this.x,this.y)},add:function(e){return this.clone()._add(i.point(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(i.point(e))},_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){return this.x/=e,this.y/=e,this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){return this.x*=e,this.y*=e,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(e){e=i.point(e);var t=e.x-this.x,n=e.y-this.y;return Math.sqrt(t*t+n*n)},equals:function(e){return e=i.point(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=i.point(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+i.Util.formatNum(this.x)+", "+i.Util.formatNum(this.y)+")"}},i.point=function(e,t,r){return e instanceof i.Point?e:i.Util.isArray(e)?new i.Point(e[0],e[1]):e===n||e===null?e:new i.Point(e,t,r)},i.Bounds=function(e,t){if(!e)return;var n=t?[e,t]:e;for(var r=0,i=n.length;r<i;r++)this.extend(n[r])},i.Bounds.prototype={extend:function(e){return e=i.point(e),!this.min&&!this.max?(this.min=e.clone(),this.max=e.clone()):(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(e.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(e.y,this.max.y)),this},getCenter:function(e){return new i.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,e)},getBottomLeft:function(){return new i.Point(this.min.x,this.max.y)},getTopRight:function(){return new i.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(e){var t,n;return typeof e[0]=="number"||e instanceof i.Point?e=i.point(e):e=i.bounds(e),e instanceof i.Bounds?(t=e.min,n=e.max):t=n=e,t.x>=this.min.x&&n.x<=this.max.x&&t.y>=this.min.y&&n.y<=this.max.y},intersects:function(e){e=i.bounds(e);var t=this.min,n=this.max,r=e.min,s=e.max,o=s.x>=t.x&&r.x<=n.x,u=s.y>=t.y&&r.y<=n.y;return o&&u},isValid:function(){return!!this.min&&!!this.max}},i.bounds=function(e,t){return!e||e instanceof i.Bounds?e:new i.Bounds(e,t)},i.Transformation=function(e,t,n,r){this._a=e,this._b=t,this._c=n,this._d=r},i.Transformation.prototype={transform:function(e,t){return this._transform(e.clone(),t)},_transform:function(e,t){return t=t||1,e.x=t*(this._a*e.x+this._b),e.y=t*(this._c*e.y+this._d),e},untransform:function(e,t){return t=t||1,new i.Point((e.x/t-this._b)/this._a,(e.y/t-this._d)/this._c)}},i.DomUtil={get:function(e){return typeof e=="string"?t.getElementById(e):e},getStyle:function(e,n){var r=e.style[n];!r&&e.currentStyle&&(r=e.currentStyle[n]);if((!r||r==="auto")&&t.defaultView){var i=t.defaultView.getComputedStyle(e,null);r=i?i[n]:null}return r==="auto"?null:r},getViewportOffset:function(e){var n=0,r=0,s=e,o=t.body,u=t.documentElement,a;do{n+=s.offsetTop||0,r+=s.offsetLeft||0,n+=parseInt(i.DomUtil.getStyle(s,"borderTopWidth"),10)||0,r+=parseInt(i.DomUtil.getStyle(s,"borderLeftWidth"),10)||0,a=i.DomUtil.getStyle(s,"position");if(s.offsetParent===o&&a==="absolute")break;if(a==="fixed"){n+=o.scrollTop||u.scrollTop||0,r+=o.scrollLeft||u.scrollLeft||0;break}if(a==="relative"&&!s.offsetLeft){var f=i.DomUtil.getStyle(s,"width"),l=i.DomUtil.getStyle(s,"max-width"),c=s.getBoundingClientRect();if(f!=="none"||l!=="none")r+=c.left+s.clientLeft;n+=c.top+(o.scrollTop||u.scrollTop||0);break}s=s.offsetParent}while(s);s=e;do{if(s===o)break;n-=s.scrollTop||0,r-=s.scrollLeft||0,s=s.parentNode}while(s);return new i.Point(r,n)},documentIsLtr:function(){return i.DomUtil._docIsLtrCached||(i.DomUtil._docIsLtrCached=!0,i.DomUtil._docIsLtr=i.DomUtil.getStyle(t.body,"direction")==="ltr"),i.DomUtil._docIsLtr},create:function(e,n,r){var i=t.createElement(e);return i.className=n,r&&r.appendChild(i),i},hasClass:function(e,t){if(e.classList!==n)return e.classList.contains(t);var r=i.DomUtil._getClass(e);return r.length>0&&RegExp("(^|\\s)"+t+"(\\s|$)").test(r)},addClass:function(e,t){if(e.classList!==n){var r=i.Util.splitWords(t);for(var s=0,o=r.length;s<o;s++)e.classList.add(r[s])}else if(!i.DomUtil.hasClass(e,t)){var u=i.DomUtil._getClass(e);i.DomUtil._setClass(e,(u?u+" ":"")+t)}},removeClass:function(e,t){e.classList!==n?e.classList.remove(t):i.DomUtil._setClass(e,i.Util.trim((" "+i.DomUtil._getClass(e)+" ").replace(" "+t+" "," ")))},_setClass:function(e,t){e.className.baseVal===n?e.className=t:e.className.baseVal=t},_getClass:function(e){return e.className.baseVal===n?e.className:e.className.baseVal},setOpacity:function(e,t){if("opacity"in e.style)e.style.opacity=t;else if("filter"in e.style){var n=!1,r="DXImageTransform.Microsoft.Alpha";try{n=e.filters.item(r)}catch(i){if(t===1)return}t=Math.round(t*100),n?(n.Enabled=t!==100,n.Opacity=t):e.style.filter+=" progid:"+r+"(opacity="+t+")"}},testProp:function(e){var n=t.documentElement.style;for(var r=0;r<e.length;r++)if(e[r]in n)return e[r];return!1},getTranslateString:function(e){var t=i.Browser.webkit3d,n="translate"+(t?"3d":"")+"(",r=(t?",0":"")+")";return n+e.x+"px,"+e.y+"px"+r},getScaleString:function(e,t){var n=i.DomUtil.getTranslateString(t.add(t.multiplyBy(-1*e))),r=" scale("+e+") ";return n+r},setPosition:function(e,t,n){e._leaflet_pos=t,!n&&i.Browser.any3d?e.style[i.DomUtil.TRANSFORM]=i.DomUtil.getTranslateString(t):(e.style.left=t.x+"px",e.style.top=t.y+"px")},getPosition:function(e){return e._leaflet_pos}},i.DomUtil.TRANSFORM=i.DomUtil.testProp(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]),i.DomUtil.TRANSITION=i.DomUtil.testProp(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),i.DomUtil.TRANSITION_END=i.DomUtil.TRANSITION==="webkitTransition"||i.DomUtil.TRANSITION==="OTransition"?i.DomUtil.TRANSITION+"End":"transitionend",function(){if("onselectstart"in t)i.extend(i.DomUtil,{disableTextSelection:function(){i.DomEvent.on(e,"selectstart",i.DomEvent.preventDefault)},enableTextSelection:function(){i.DomEvent.off(e,"selectstart",i.DomEvent.preventDefault)}});else{var n=i.DomUtil.testProp(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);i.extend(i.DomUtil,{disableTextSelection:function(){if(n){var e=t.documentElement.style;this._userSelect=e[n],e[n]="none"}},enableTextSelection:function(){n&&(t.documentElement.style[n]=this._userSelect,delete this._userSelect)}})}i.extend(i.DomUtil,{disableImageDrag:function(){i.DomEvent.on(e,"dragstart",i.DomEvent.preventDefault)},enableImageDrag:function(){i.DomEvent.off(e,"dragstart",i.DomEvent.preventDefault)}})}(),i.LatLng=function(e,t,r){e=parseFloat(e),t=parseFloat(t);if(isNaN(e)||isNaN(t))throw Error("Invalid LatLng object: ("+e+", "+t+")");this.lat=e,this.lng=t,r!==n&&(this.alt=parseFloat(r))},i.extend(i.LatLng,{DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,MAX_MARGIN:1e-9}),i.LatLng.prototype={equals:function(e){if(!e)return!1;e=i.latLng(e);var t=Math.max(Math.abs(this.lat-e.lat),Math.abs(this.lng-e.lng));return t<=i.LatLng.MAX_MARGIN},toString:function(e){return"LatLng("+i.Util.formatNum(this.lat,e)+", "+i.Util.formatNum(this.lng,e)+")"},distanceTo:function(e){e=i.latLng(e);var t=6378137,n=i.LatLng.DEG_TO_RAD,r=(e.lat-this.lat)*n,s=(e.lng-this.lng)*n,o=this.lat*n,u=e.lat*n,a=Math.sin(r/2),f=Math.sin(s/2),l=a*a+f*f*Math.cos(o)*Math.cos(u);return t*2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))},wrap:function(e,t){var n=this.lng;return e=e||-180,t=t||180,n=(n+t)%(t-e)+(n<e||n===t?t:e),new i.LatLng(this.lat,n)}},i.latLng=function(e,t){return e instanceof i.LatLng?e:i.Util.isArray(e)?typeof e[0]=="number"||typeof e[0]=="string"?new i.LatLng(e[0],e[1],e[2]):null:e===n||e===null?e:typeof e=="object"&&"lat"in e?new i.LatLng(e.lat,"lng"in e?e.lng:e.lon):t===n?null:new i.LatLng(e,t)},i.LatLngBounds=function(e,t){if(!e)return;var n=t?[e,t]:e;for(var r=0,i=n.length;r<i;r++)this.extend(n[r])},i.LatLngBounds.prototype={extend:function(e){if(!e)return this;var t=i.latLng(e);return t!==null?e=t:e=i.latLngBounds(e),e instanceof i.LatLng?!this._southWest&&!this._northEast?(this._southWest=new i.LatLng(e.lat,e.lng),this._northEast=new i.LatLng(e.lat,e.lng)):(this._southWest.lat=Math.min(e.lat,this._southWest.lat),this._southWest.lng=Math.min(e.lng,this._southWest.lng),this._northEast.lat=Math.max(e.lat,this._northEast.lat),this._northEast.lng=Math.max(e.lng,this._northEast.lng)):e instanceof i.LatLngBounds&&(this.extend(e._southWest),this.extend(e._northEast)),this},pad:function(e){var t=this._southWest,n=this._northEast,r=Math.abs(t.lat-n.lat)*e,s=Math.abs(t.lng-n.lng)*e;return new i.LatLngBounds(new i.LatLng(t.lat-r,t.lng-s),new i.LatLng(n.lat+r,n.lng+s))},getCenter:function(){return new i.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 i.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new i.LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(e){typeof e[0]=="number"||e instanceof i.LatLng?e=i.latLng(e):e=i.latLngBounds(e);var t=this._southWest,n=this._northEast,r,s;return e instanceof i.LatLngBounds?(r=e.getSouthWest(),s=e.getNorthEast()):r=s=e,r.lat>=t.lat&&s.lat<=n.lat&&r.lng>=t.lng&&s.lng<=n.lng},intersects:function(e){e=i.latLngBounds(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),s=e.getNorthEast(),o=s.lat>=t.lat&&r.lat<=n.lat,u=s.lng>=t.lng&&r.lng<=n.lng;return o&&u},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(e){return e?(e=i.latLngBounds(e),this._southWest.equals(e.getSouthWest())&&this._northEast.equals(e.getNorthEast())):!1},isValid:function(){return!!this._southWest&&!!this._northEast}},i.latLngBounds=function(e,t){return!e||e instanceof i.LatLngBounds?e:new i.LatLngBounds(e,t)},i.Projection={},i.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(e){var t=i.LatLng.DEG_TO_RAD,n=this.MAX_LATITUDE,r=Math.max(Math.min(n,e.lat),-n),s=e.lng*t,o=r*t;return o=Math.log(Math.tan(Math.PI/4+o/2)),new i.Point(s,o)},unproject:function(e){var t=i.LatLng.RAD_TO_DEG,n=e.x*t,r=(2*Math.atan(Math.exp(e.y))-Math.PI/2)*t;return new i.LatLng(r,n)}},i.Projection.LonLat={project:function(e){return new i.Point(e.lng,e.lat)},unproject:function(e){return new i.LatLng(e.y,e.x)}},i.CRS={latLngToPoint:function(e,t){var n=this.projection.project(e),r=this.scale(t);return this.transformation._transform(n,r)},pointToLatLng:function(e,t){var n=this.scale(t),r=this.transformation.untransform(e,n);return this.projection.unproject(r)},project:function(e){return this.projection.project(e)},scale:function(e){return 256*Math.pow(2,e)},getSize:function(e){var t=this.scale(e);return i.point(t,t)}},i.CRS.Simple=i.extend({},i.CRS,{projection:i.Projection.LonLat,transformation:new i.Transformation(1,0,-1,0),scale:function(e){return Math.pow(2,e)}}),i.CRS.EPSG3857=i.extend({},i.CRS,{code:"EPSG:3857",projection:i.Projection.SphericalMercator,transformation:new i.Transformation(.5/Math.PI,.5,-0.5/Math.PI,.5),project:function(e){var t=this.projection.project(e),n=6378137;return t.multiplyBy(n)}}),i.CRS.EPSG900913=i.extend({},i.CRS.EPSG3857,{code:"EPSG:900913"}),i.CRS.EPSG4326=i.extend({},i.CRS,{code:"EPSG:4326",projection:i.Projection.LonLat,transformation:new i.Transformation(1/360,.5,-1/360,.5)}),i.Map=i.Class.extend({includes:i.Mixin.Events,options:{crs:i.CRS.EPSG3857,fadeAnimation:i.DomUtil.TRANSITION&&!i.Browser.android23,trackResize:!0,markerZoomAnimation:i.DomUtil.TRANSITION&&i.Browser.any3d},initialize:function(e,t){t=i.setOptions(this,t),this._initContainer(e),this._initLayout(),this._onResize=i.bind(this._onResize,this),this._initEvents(),t.maxBounds&&this.setMaxBounds(t.maxBounds),t.center&&t.zoom!==n&&this.setView(i.latLng(t.center),t.zoom,{reset:!0}),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0,this.callInitHooks(),this._addLayers(t.layers)},setView:function(e,t){return t=t===n?this.getZoom():t,this._resetView(i.latLng(e),this._limitZoom(t)),this},setZoom:function(e,t){return this._loaded?this.setView(this.getCenter(),e,{zoom:t}):(this._zoom=this._limitZoom(e),this)},zoomIn:function(e,t){return this.setZoom(this._zoom+(e||1),t)},zoomOut:function(e,t){return this.setZoom(this._zoom-(e||1),t)},setZoomAround:function(e,t,n){var r=this.getZoomScale(t),s=this.getSize().divideBy(2),o=e instanceof i.Point?e:this.latLngToContainerPoint(e),u=o.subtract(s).multiplyBy(1-1/r),a=this.containerPointToLatLng(s.add(u));return this.setView(a,t,{zoom:n})},fitBounds:function(e,t){t=t||{},e=e.getBounds?e.getBounds():i.latLngBounds(e);var n=i.point(t.paddingTopLeft||t.padding||[0,0]),r=i.point(t.paddingBottomRight||t.padding||[0,0]),s=this.getBoundsZoom(e,!1,n.add(r)),o=r.subtract(n).divideBy(2),u=this.project(e.getSouthWest(),s),a=this.project(e.getNorthEast(),s),f=this.unproject(u.add(a).divideBy(2).add(o),s);return s=t&&t.maxZoom?Math.min(t.maxZoom,s):s,this.setView(f,s,t)},fitWorld:function(e){return this.fitBounds([[-90,-180],[90,180]],e)},panTo:function(e,t){return this.setView(e,this._zoom,{pan:t})},panBy:function(e){return this.fire("movestart"),this._rawPanBy(i.point(e)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(e){return e=i.latLngBounds(e),this.options.maxBounds=e,e?(this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds,this)):this.off("moveend",this._panInsideMaxBounds,this)},panInsideBounds:function(e,t){var n=this.getCenter(),r=this._limitCenter(n,this._zoom,e);return n.equals(r)?this:this.panTo(r,t)},addLayer:function(e){var t=i.stamp(e);return this._layers[t]?this:(this._layers[t]=e,e.options&&(!isNaN(e.options.maxZoom)||!isNaN(e.options.minZoom))&&(this._zoomBoundLayers[t]=e,this._updateZoomLevels()),this.options.zoomAnimation&&i.TileLayer&&e instanceof i.TileLayer&&(this._tileLayersNum++,this._tileLayersToLoad++,e.on("load",this._onTileLayerLoad,this)),this._loaded&&this._layerAdd(e),this)},removeLayer:function(e){var t=i.stamp(e);return this._layers[t]?(this._loaded&&e.onRemove(this),delete this._layers[t],this._loaded&&this.fire("layerremove",{layer:e}),this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels()),this.options.zoomAnimation&&i.TileLayer&&e instanceof i.TileLayer&&(this._tileLayersNum--,this._tileLayersToLoad--,e.off("load",this._onTileLayerLoad,this)),this):this},hasLayer:function(e){return e?i.stamp(e)in this._layers:!1},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},invalidateSize:function(e){if(!this._loaded)return this;e=i.extend({animate:!1,pan:!0},e===!0?{animate:!0}:e);var t=this.getSize();this._sizeChanged=!0,this._initialCenter=null;var n=this.getSize(),r=t.divideBy(2).round(),s=n.divideBy(2).round(),o=r.subtract(s);return!o.x&&!o.y?this:(e.animate&&e.pan?this.panBy(o):(e.pan&&this._rawPanBy(o),this.fire("move"),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(i.bind(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:t,newSize:n}))},addHandler:function(e,t){if(!t)return this;var n=this[e]=new t(this);return this._handlers.push(n),this.options[e]&&n.enable(),this},remove:function(){this._loaded&&this.fire("unload"),this._initEvents("off");try{delete this._container._leaflet}catch(e){this._container._leaflet=n}return this._clearPanes(),this._clearControlPos&&this._clearControlPos(),this._clearHandlers(),this},getCenter:function(){return this._checkIfLoaded(),this._initialCenter&&!this._moved()?this._initialCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds(),t=this.unproject(e.getBottomLeft()),n=this.unproject(e.getTopRight());return new i.LatLngBounds(t,n)},getMinZoom:function(){return this.options.minZoom===n?this._layersMinZoom===n?0:this._layersMinZoom:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===n?this._layersMaxZoom===n?Infinity:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,t,n){e=i.latLngBounds(e);var r=this.getMinZoom()-(t?1:0),s=this.getMaxZoom(),o=this.getSize(),u=e.getNorthWest(),a=e.getSouthEast(),f=!0,l;n=i.point(n||[0,0]);do r++,l=this.project(a,r).subtract(this.project(u,r)).add(n),f=t?l.x<o.x||l.y<o.y:o.contains(l);while(f&&r<=s);return f&&t?null:t?r:r-1},getSize:function(){if(!this._size||this._sizeChanged)this._size=new i.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1;return this._size.clone()},getPixelBounds:function(){var e=this._getTopLeftPoint();return new i.Bounds(e,e.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e){var t=this.options.crs;return t.scale(e)/t.scale(this._zoom)},getScaleZoom:function(e){return this._zoom+Math.log(e)/Math.LN2},project:function(e,t){return t=t===n?this._zoom:t,this.options.crs.latLngToPoint(i.latLng(e),t)},unproject:function(e,t){return t=t===n?this._zoom:t,this.options.crs.pointToLatLng(i.point(e),t)},layerPointToLatLng:function(e){var t=i.point(e).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(e){var t=this.project(i.latLng(e))._round();return t._subtract(this.getPixelOrigin())},containerPointToLayerPoint:function(e){return i.point(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return i.point(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var t=this.containerPointToLayerPoint(i.point(e));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(i.latLng(e)))},mouseEventToContainerPoint:function(e){return i.DomEvent.getMousePosition(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var t=this._container=i.DomUtil.get(e);if(!t)throw Error("Map container not found.");if(t._leaflet)throw Error("Map container is already initialized.");t._leaflet=!0},_initLayout:function(){var e=this._container;i.DomUtil.addClass(e,"leaflet-container"+(i.Browser.touch?" leaflet-touch":"")+(i.Browser.retina?" leaflet-retina":"")+(i.Browser.ielt9?" leaflet-oldie":"")+(this.options.fadeAnimation?" leaflet-fade-anim":""));var t=i.DomUtil.getStyle(e,"position");t!=="absolute"&&t!=="relative"&&t!=="fixed"&&(e.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._mapPane=e.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=e.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),e.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),e.shadowPane=this._createPane("leaflet-shadow-pane"),e.overlayPane=this._createPane("leaflet-overlay-pane"),e.markerPane=this._createPane("leaflet-marker-pane"),e.popupPane=this._createPane("leaflet-popup-pane");var t=" leaflet-zoom-hide";this.options.markerZoomAnimation||(i.DomUtil.addClass(e.markerPane,t),i.DomUtil.addClass(e.shadowPane,t),i.DomUtil.addClass(e.popupPane,t))},_createPane:function(e,t){return i.DomUtil.create("div",e,t||this._panes.objectsPane)},_clearPanes:function(){this._container.removeChild(this._mapPane)},_addLayers:function(e){e=e?i.Util.isArray(e)?e:[e]:[];for(var t=0,n=e.length;t<n;t++)this.addLayer(e[t])},_resetView:function(e,t,n,r){var s=this._zoom!==t;r||(this.fire("movestart"),s&&this.fire("zoomstart")),this._zoom=t,this._initialCenter=e,this._initialTopLeftPoint=this._getNewTopLeftPoint(e),n?this._initialTopLeftPoint._add(this._getMapPanePos()):i.DomUtil.setPosition(this._mapPane,new i.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var o=!this._loaded;this._loaded=!0,o&&(this.fire("load"),this.eachLayer(this._layerAdd,this)),this.fire("viewreset",{hard:!n}),this.fire("move"),(s||r)&&this.fire("zoomend"),this.fire("moveend",{hard:!n})},_rawPanBy:function(e){i.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_updateZoomLevels:function(){var e,t=Infinity,r=-Infinity,i=this._getZoomSpan();for(e in this._zoomBoundLayers){var s=this._zoomBoundLayers[e];isNaN(s.options.minZoom)||(t=Math.min(t,s.options.minZoom)),isNaN(s.options.maxZoom)||(r=Math.max(r,s.options.maxZoom))}e===n?this._layersMaxZoom=this._layersMinZoom=n:(this._layersMaxZoom=r,this._layersMinZoom=t),i!==this._getZoomSpan()&&this.fire("zoomlevelschange")},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw Error("Set map center and zoom first.")},_initEvents:function(t){if(!i.DomEvent)return;t=t||"on",i.DomEvent[t](this._container,"click",this._onMouseClick,this);var n=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"],r,s;for(r=0,s=n.length;r<s;r++)i.DomEvent[t](this._container,n[r],this._fireMouseEvent,this);this.options.trackResize&&i.DomEvent[t](e,"resize",this._onResize,this)},_onResize:function(){i.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=i.Util.requestAnimFrame(function(){this.invalidateSize({debounceMoveend:!0})},this,!1,this._container)},_onMouseClick:function(e){if(!this._loaded||!e._simulated&&(this.dragging&&this.dragging.moved()||this.boxZoom&&this.boxZoom.moved())||i.DomEvent._skipped(e))return;this.fire("preclick"),this._fireMouseEvent(e)},_fireMouseEvent:function(e){if(!this._loaded||i.DomEvent._skipped(e))return;var t=e.type;t=t==="mouseenter"?"mouseover":t==="mouseleave"?"mouseout":t;if(!this.hasEventListeners(t))return;t==="contextmenu"&&i.DomEvent.preventDefault(e);var n=this.mouseEventToContainerPoint(e),r=this.containerPointToLayerPoint(n),s=this.layerPointToLatLng(r);this.fire(t,{latlng:s,layerPoint:r,containerPoint:n,originalEvent:e})},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this.fire("tilelayersload")},_clearHandlers:function(){for(var e=0,t=this._handlers.length;e<t;e++)this._handlers[e].disable()},whenReady:function(e,t){return this._loaded?e.call(t||this,this):this.on("load",e,t),this},_layerAdd:function(e){e.onAdd(this),this.fire("layeradd",{layer:e})},_getMapPanePos:function(){return i.DomUtil.getPosition(this._mapPane)},_moved:function(){var e=this._getMapPanePos();return e&&!e.equals([0,0])},_getTopLeftPoint:function(){return this.getPixelOrigin().subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(e,t){var n=this.getSize()._divideBy(2);return this.project(e,t)._subtract(n)._round()},_latLngToNewLayerPoint:function(e,t,n){var r=this._getNewTopLeftPoint(n,t).add(this._getMapPanePos());return this.project(e,t)._subtract(r)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(e){return this.latLngToLayerPoint(e).subtract(this._getCenterLayerPoint())},_limitCenter:function(e,t,n){if(!n)return e;var r=this.project(e,t),s=this.getSize().divideBy(2),o=new i.Bounds(r.subtract(s),r.add(s)),u=this._getBoundsOffset(o,n,t);return this.unproject(r.add(u),t)},_limitOffset:function(e,t){if(!t)return e;var n=this.getPixelBounds(),r=new i.Bounds(n.min.add(e),n.max.add(e));return e.add(this._getBoundsOffset(r,t))},_getBoundsOffset:function(e,t,n){var r=this.project(t.getNorthWest(),n).subtract(e.min),s=this.project(t.getSouthEast(),n).subtract(e.max),o=this._rebound(r.x,-s.x),u=this._rebound(r.y,-s.y);return new i.Point(o,u)},_rebound:function(e,t){return e+t>0?Math.round(e-t)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(t))},_limitZoom:function(e){var t=this.getMinZoom(),n=this.getMaxZoom();return Math.max(t,Math.min(n,e))}}),i.map=function(e,t){return new i.Map(e,t)},i.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.314245179,R_MAJOR:6378137,project:function(e){var t=i.LatLng.DEG_TO_RAD,n=this.MAX_LATITUDE,r=Math.max(Math.min(n,e.lat),-n),s=this.R_MAJOR,o=this.R_MINOR,u=e.lng*t*s,a=r*t,f=o/s,l=Math.sqrt(1-f*f),c=l*Math.sin(a);c=Math.pow((1-c)/(1+c),l*.5);var h=Math.tan(.5*(Math.PI*.5-a))/c;return a=-s*Math.log(h),new i.Point(u,a)},unproject:function(e){var t=i.LatLng.RAD_TO_DEG,n=this.R_MAJOR,r=this.R_MINOR,s=e.x*t/n,o=r/n,u=Math.sqrt(1-o*o),a=Math.exp(-e.y/n),f=Math.PI/2-2*Math.atan(a),l=15,c=1e-7,h=l,p=.1,d;while(Math.abs(p)>c&&--h>0)d=u*Math.sin(f),p=Math.PI/2-2*Math.atan(a*Math.pow((1-d)/(1+d),.5*u))-f,f+=p;return new i.LatLng(f*t,s)}},i.CRS.EPSG3395=i.extend({},i.CRS,{code:"EPSG:3395",projection:i.Projection.Mercator,transformation:function(){var e=i.Projection.Mercator,t=e.R_MAJOR,n=.5/(Math.PI*t);return new i.Transformation(n,.5,-n,.5)}()}),i.TileLayer=i.Class.extend({includes:i.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:i.Browser.mobile,updateWhenIdle:i.Browser.mobile},initialize:function(e,t){t=i.setOptions(this,t),t.detectRetina&&i.Browser.retina&&t.maxZoom>0&&(t.tileSize=Math.floor(t.tileSize/2),t.zoomOffset++,t.minZoom>0&&t.minZoom--,this.options.maxZoom--),t.bounds&&(t.bounds=i.latLngBounds(t.bounds)),this._url=e;var n=this.options.subdomains;typeof n=="string"&&(this.options.subdomains=n.split(""))},onAdd:function(e){this._map=e,this._animated=e._zoomAnimated,this._initContainer(),e.on({viewreset:this._reset,moveend:this._update},this),this._animated&&e.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||(this._limitedUpdate=i.Util.limitExecByInterval(this._update,150,this),e.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(e){return e.addLayer(this),this},onRemove:function(e){this._container.parentNode.removeChild(this._container),e.off({viewreset:this._reset,moveend:this._update},this),this._animated&&e.off({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||e.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var e=this._map._panes.tilePane;return this._container&&(e.appendChild(this._container),this._setAutoZIndex(e,Math.max)),this},bringToBack:function(){var e=this._map._panes.tilePane;return this._container&&(e.insertBefore(this._container,e.firstChild),this._setAutoZIndex(e,Math.min)),this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(e){return this.options.opacity=e,this._map&&this._updateOpacity(),this},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},setUrl:function(e,t){return this._url=e,t||this.redraw(),this},redraw:function(){return this._map&&(this._reset({hard:!0}),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==n&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(e,t){var n=e.children,r=-t(Infinity,-Infinity),i,s,o;for(s=0,o=n.length;s<o;s++)n[s]!==this._container&&(i=parseInt(n[s].style.zIndex,10),isNaN(i)||(r=t(r,i)));this.options.zIndex=this._container.style.zIndex=(isFinite(r)?r:0)+t(1,-1)},_updateOpacity:function(){var e,t=this._tiles;if(i.Browser.ielt9)for(e in t)i.DomUtil.setOpacity(t[e],this.options.opacity);else i.DomUtil.setOpacity(this._container,this.options.opacity)},_initContainer:function(){var e=this._map._panes.tilePane;if(!this._container){this._container=i.DomUtil.create("div","leaflet-layer"),this._updateZIndex();if(this._animated){var t="leaflet-tile-container";this._bgBuffer=i.DomUtil.create("div",t,this._container),this._tileContainer=i.DomUtil.create("div",t,this._container)}else this._tileContainer=this._container;e.appendChild(this._container),this.options.opacity<1&&this._updateOpacity()}},_reset:function(e){for(var t in this._tiles)this.fire("tileunload",{tile:this._tiles[t]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),this._tileContainer.innerHTML="",this._animated&&e&&e.hard&&this._clearBgBuffer(),this._initContainer()},_getTileSize:function(){var e=this._map,t=e.getZoom()+this.options.zoomOffset,n=this.options.maxNativeZoom,r=this.options.tileSize;return n&&t>n&&(r=Math.round(e.getZoomScale(t)/e.getZoomScale(n)*r)),r},_update:function(){if(!this._map)return;var e=this._map,t=e.getPixelBounds(),n=e.getZoom(),r=this._getTileSize();if(n>this.options.maxZoom||n<this.options.minZoom)return;var s=i.bounds(t.min.divideBy(r)._floor(),t.max.divideBy(r)._floor());this._addTilesFromCenterOut(s),(this.options.unloadInvisibleTiles||this.options.reuseTiles)&&this._removeOtherTiles(s)},_addTilesFromCenterOut:function(e){var n=[],r=e.getCenter(),s,o,u;for(s=e.min.y;s<=e.max.y;s++)for(o=e.min.x;o<=e.max.x;o++)u=new i.Point(o,s),this._tileShouldBeLoaded(u)&&n.push(u);var a=n.length;if(a===0)return;n.sort(function(e,t){return e.distanceTo(r)-t.distanceTo(r)});var f=t.createDocumentFragment();this._tilesToLoad||this.fire("loading"),this._tilesToLoad+=a;for(o=0;o<a;o++)this._addTile(n[o],f);this._tileContainer.appendChild(f)},_tileShouldBeLoaded:function(e){if(e.x+":"+e.y in this._tiles)return!1;var t=this.options;if(!t.continuousWorld){var n=this._getWrapTileNum();if(t.noWrap&&(e.x<0||e.x>=n.x)||e.y<0||e.y>=n.y)return!1}if(t.bounds){var r=t.tileSize,i=e.multiplyBy(r),s=i.add([r,r]),o=this._map.unproject(i),u=this._map.unproject(s);!t.continuousWorld&&!t.noWrap&&(o=o.wrap(),u=u.wrap());if(!t.bounds.intersects([o,u]))return!1}return!0},_removeOtherTiles:function(e){var t,n,r,i;for(i in this._tiles)t=i.split(":"),n=parseInt(t[0],10),r=parseInt(t[1],10),(n<e.min.x||n>e.max.x||r<e.min.y||r>e.max.y)&&this._removeTile(i)},_removeTile:function(e){var t=this._tiles[e];this.fire("tileunload",{tile:t,url:t.src}),this.options.reuseTiles?(i.DomUtil.removeClass(t,"leaflet-tile-loaded"),this._unusedTiles.push(t)):t.parentNode===this._tileContainer&&this._tileContainer.removeChild(t),i.Browser.android||(t.onload=null,t.src=i.Util.emptyImageUrl),delete this._tiles[e]},_addTile:function(e,t){var n=this._getTilePos(e),r=this._getTile();i.DomUtil.setPosition(r,n,i.Browser.chrome),this._tiles[e.x+":"+e.y]=r,this._loadTile(r,e),r.parentNode!==this._tileContainer&&t.appendChild(r)},_getZoomForUrl:function(){var e=this.options,t=this._map.getZoom();return e.zoomReverse&&(t=e.maxZoom-t),t+=e.zoomOffset,e.maxNativeZoom?Math.min(t,e.maxNativeZoom):t},_getTilePos:function(e){var t=this._map.getPixelOrigin(),n=this._getTileSize();return e.multiplyBy(n).subtract(t)},getTileUrl:function(e){return i.Util.template(this._url,i.extend({s:this._getSubdomain(e),z:e.z,x:e.x,y:e.y},this.options))},_getWrapTileNum:function(){var e=this._map.options.crs,t=e.getSize(this._map.getZoom());return t.divideBy(this._getTileSize())._floor()},_adjustTilePoint:function(e){var t=this._getWrapTileNum();!this.options.continuousWorld&&!this.options.noWrap&&(e.x=(e.x%t.x+t.x)%t.x),this.options.tms&&(e.y=t.y-e.y-1),e.z=this._getZoomForUrl()},_getSubdomain:function(e){var t=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[t]},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var e=this._unusedTiles.pop();return this._resetTile(e),e}return this._createTile()},_resetTile:function(){},_createTile:function(){var e=i.DomUtil.create("img","leaflet-tile");return e.style.width=e.style.height=this._getTileSize()+"px",e.galleryimg="no",e.onselectstart=e.onmousemove=i.Util.falseFn,i.Browser.ielt9&&this.options.opacity!==n&&i.DomUtil.setOpacity(e,this.options.opacity),i.Browser.mobileWebkit3d&&(e.style.WebkitBackfaceVisibility="hidden"),e},_loadTile:function(e,t){e._layer=this,e.onload=this._tileOnLoad,e.onerror=this._tileOnError,this._adjustTilePoint(t),e.src=this.getTileUrl(t),this.fire("tileloadstart",{tile:e,url:e.src})},_tileLoaded:function(){this._tilesToLoad--,this._animated&&i.DomUtil.addClass(this._tileContainer,"leaflet-zoom-animated"),this._tilesToLoad||(this.fire("load"),this._animated&&(clearTimeout(this._clearBgBufferTimer),this._clearBgBufferTimer=setTimeout(i.bind(this._clearBgBuffer,this),500)))},_tileOnLoad:function(){var e=this._layer;this.src!==i.Util.emptyImageUrl&&(i.DomUtil.addClass(this,"leaflet-tile-loaded"),e.fire("tileload",{tile:this,url:this.src})),e._tileLoaded()},_tileOnError:function(){var e=this._layer;e.fire("tileerror",{tile:this,url:this.src});var t=e.options.errorTileUrl;t&&(this.src=t),e._tileLoaded()}}),i.tileLayer=function(e,t){return new i.TileLayer(e,t)},i.TileLayer.WMS=i.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(e,t){this._url=e;var n=i.extend({},this.defaultWmsParams),r=t.tileSize||this.options.tileSize;t.detectRetina&&i.Browser.retina?n.width=n.height=r*2:n.width=n.height=r;for(var s in t)!this.options.hasOwnProperty(s)&&s!=="crs"&&(n[s]=t[s]);this.wmsParams=n,i.setOptions(this,t)},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var t=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[t]=this._crs.code,i.TileLayer.prototype.onAdd.call(this,e)},getTileUrl:function(e){var t=this._map,n=this.options.tileSize,r=e.multiplyBy(n),s=r.add([n,n]),o=this._crs.project(t.unproject(r,e.z)),u=this._crs.project(t.unproject(s,e.z)),a=this._wmsVersion>=1.3&&this._crs===i.CRS.EPSG4326?[u.y,o.x,o.y,u.x].join(","):[o.x,u.y,u.x,o.y].join(","),f=i.Util.template(this._url,{s:this._getSubdomain(e)});return f+i.Util.getParamString(this.wmsParams,f,!0)+"&BBOX="+a},setParams:function(e,t){return i.extend(this.wmsParams,e),t||this.redraw(),this}}),i.tileLayer.wms=function(e,t){return new i.TileLayer.WMS(e,t)},i.TileLayer.Canvas=i.TileLayer.extend({options:{async:!1},initialize:function(e){i.setOptions(this,e)},redraw:function(){this._map&&(this._reset({hard:!0}),this._update());for(var e in this._tiles)this._redrawTile(this._tiles[e]);return this},_redrawTile:function(e){this.drawTile(e,e._tilePoint,this._map._zoom)},_createTile:function(){var e=i.DomUtil.create("canvas","leaflet-tile");return e.width=e.height=this.options.tileSize,e.onselectstart=e.onmousemove=i.Util.falseFn,e},_loadTile:function(e,t){e._layer=this,e._tilePoint=t,this._redrawTile(e),this.options.async||this.tileDrawn(e)},drawTile:function(){},tileDrawn:function(e){this._tileOnLoad.call(e)}}),i.tileLayer.canvas=function(e){return new i.TileLayer.Canvas(e)},i.ImageOverlay=i.Class.extend({includes:i.Mixin.Events,options:{opacity:1},initialize:function(e,t,n){this._url=e,this._bounds=i.latLngBounds(t),i.setOptions(this,n)},onAdd:function(e){this._map=e,this._image||this._initImage(),e._panes.overlayPane.appendChild(this._image),e.on("viewreset",this._reset,this),e.options.zoomAnimation&&i.Browser.any3d&&e.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(e){e.getPanes().overlayPane.removeChild(this._image),e.off("viewreset",this._reset,this),e.options.zoomAnimation&&e.off("zoomanim",this._animateZoom,this)},addTo:function(e){return e.addLayer(this),this},setOpacity:function(e){return this.options.opacity=e,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var e=this._map._panes.overlayPane;return this._image&&e.insertBefore(this._image,e.firstChild),this},setUrl:function(e){this._url=e,this._image.src=this._url},getAttribution:function(){return this.options.attribution},_initImage:function(){this._image=i.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&i.Browser.any3d?i.DomUtil.addClass(this._image,"leaflet-zoom-animated"):i.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),i.extend(this._image,{galleryimg:"no",onselectstart:i.Util.falseFn,onmousemove:i.Util.falseFn,onload:i.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(e){var t=this._map,n=this._image,r=t.getZoomScale(e.zoom),s=this._bounds.getNorthWest(),o=this._bounds.getSouthEast(),u=t._latLngToNewLayerPoint(s,e.zoom,e.center),a=t._latLngToNewLayerPoint(o,e.zoom,e.center)._subtract(u),f=u._add(a._multiplyBy(.5*(1-1/r)));n.style[i.DomUtil.TRANSFORM]=i.DomUtil.getTranslateString(f)+" scale("+r+") "},_reset:function(){var e=this._image,t=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),n=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(t);i.DomUtil.setPosition(e,t),e.style.width=n.x+"px",e.style.height=n.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){i.DomUtil.setOpacity(this._image,this.options.opacity)}}),i.imageOverlay=function(e,t,n){return new i.ImageOverlay(e,t,n)},i.Icon=i.Class.extend({options:{className:""},initialize:function(e){i.setOptions(this,e)},createIcon:function(e){return this._createIcon("icon",e)},createShadow:function(e){return this._createIcon("shadow",e)},_createIcon:function(e,t){var n=this._getIconUrl(e);if(!n){if(e==="icon")throw Error("iconUrl not set in Icon options (see the docs).");return null}var r;return!t||t.tagName!=="IMG"?r=this._createImg(n):r=this._createImg(n,t),this._setIconStyles(r,e),r},_setIconStyles:function(e,t){var n=this.options,r=i.point(n[t+"Size"]),s;t==="shadow"?s=i.point(n.shadowAnchor||n.iconAnchor):s=i.point(n.iconAnchor),!s&&r&&(s=r.divideBy(2,!0)),e.className="leaflet-marker-"+t+" "+n.className,s&&(e.style.marginLeft=-s.x+"px",e.style.marginTop=-s.y+"px"),r&&(e.style.width=r.x+"px",e.style.height=r.y+"px")},_createImg:function(e,n){return n=n||t.createElement("img"),n.src=e,n},_getIconUrl:function(e){return i.Browser.retina&&this.options[e+"RetinaUrl"]?this.options[e+"RetinaUrl"]:this.options[e+"Url"]}}),i.icon=function(e){return new i.Icon(e)},i.Icon.Default=i.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(e){var t=e+"Url";if(this.options[t])return this.options[t];i.Browser.retina&&e==="icon"&&(e+="-2x");var n=i.Icon.Default.imagePath;if(!n)throw Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return n+"/marker-"+e+".png"}}),i.Icon.Default.imagePath=function(){var e=t.getElementsByTagName("script"),n=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/,r,i,s,o,u;for(r=0,i=e.length;r<i;r++){s=e[r].src,o=s.match(n);if(o)return u=s.split(n)[0],(u?u+"/":"")+"images"}}(),i.Marker=i.Class.extend({includes:i.Mixin.Events,options:{icon:new i.Icon.Default,title:"",alt:"",clickable:!0,draggable:!1,keyboard:!0,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(e,t){i.setOptions(this,t),this._latlng=i.latLng(e)},onAdd:function(e){this._map=e,e.on("viewreset",this.update,this),this._initIcon(),this.update(),this.fire("add"),e.options.zoomAnimation&&e.options.markerZoomAnimation&&e.on("zoomanim",this._animateZoom,this)},addTo:function(e){return e.addLayer(this),this},onRemove:function(e){this.dragging&&this.dragging.disable(),this._removeIcon(),this._removeShadow(),this.fire("remove"),e.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(e){return this._latlng=i.latLng(e),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(e){return this.options.zIndexOffset=e,this.update(),this},setIcon:function(e){return this.options.icon=e,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup),this},update:function(){if(this._icon){var e=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(e)}return this},_initIcon:function(){var e=this.options,t=this._map,n=t.options.zoomAnimation&&t.options.markerZoomAnimation,r=n?"leaflet-zoom-animated":"leaflet-zoom-hide",s=e.icon.createIcon(this._icon),o=!1;s!==this._icon&&(this._icon&&this._removeIcon(),o=!0,e.title&&(s.title=e.title),e.alt&&(s.alt=e.alt)),i.DomUtil.addClass(s,r),e.keyboard&&(s.tabIndex="0"),this._icon=s,this._initInteraction(),e.riseOnHover&&i.DomEvent.on(s,"mouseover",this._bringToFront,this).on(s,"mouseout",this._resetZIndex,this);var u=e.icon.createShadow(this._shadow),a=!1;u!==this._shadow&&(this._removeShadow(),a=!0),u&&i.DomUtil.addClass(u,r),this._shadow=u,e.opacity<1&&this._updateOpacity();var f=this._map._panes;o&&f.markerPane.appendChild(this._icon),u&&a&&f.shadowPane.appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&i.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),this._map._panes.markerPane.removeChild(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&this._map._panes.shadowPane.removeChild(this._shadow),this._shadow=null},_setPos:function(e){i.DomUtil.setPosition(this._icon,e),this._shadow&&i.DomUtil.setPosition(this._shadow,e),this._zIndex=e.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(e){this._icon.style.zIndex=this._zIndex+e},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center).round();this._setPos(t)},_initInteraction:function(){if(!this.options.clickable)return;var e=this._icon,t=["dblclick","mousedown","mouseover","mouseout","contextmenu"];i.DomUtil.addClass(e,"leaflet-clickable"),i.DomEvent.on(e,"click",this._onMouseClick,this),i.DomEvent.on(e,"keypress",this._onKeyPress,this);for(var n=0;n<t.length;n++)i.DomEvent.on(e,t[n],this._fireMouseEvent,this);i.Handler.MarkerDrag&&(this.dragging=new i.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())},_onMouseClick:function(e){var t=this.dragging&&this.dragging.moved();(this.hasEventListeners(e.type)||t)&&i.DomEvent.stopPropagation(e);if(t)return;if((!this.dragging||!this.dragging._enabled)&&this._map.dragging&&this._map.dragging.moved())return;this.fire(e.type,{originalEvent:e,latlng:this._latlng})},_onKeyPress:function(e){e.keyCode===13&&this.fire("click",{originalEvent:e,latlng:this._latlng})},_fireMouseEvent:function(e){this.fire(e.type,{originalEvent:e,latlng:this._latlng}),e.type==="contextmenu"&&this.hasEventListeners(e.type)&&i.DomEvent.preventDefault(e),e.type!=="mousedown"?i.DomEvent.stopPropagation(e):i.DomEvent.preventDefault(e)},setOpacity:function(e){return this.options.opacity=e,this._map&&this._updateOpacity(),this},_updateOpacity:function(){i.DomUtil.setOpacity(this._icon,this.options.opacity),this._shadow&&i.DomUtil.setOpacity(this._shadow,this.options.opacity)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)}}),i.marker=function(e,t){return new i.Marker(e,t)},i.DivIcon=i.Icon.extend({options:{iconSize:[12,12],className:"leaflet-div-icon",html:!1},createIcon:function(e){var n=e&&e.tagName==="DIV"?e:t.createElement("div"),r=this.options;return r.html!==!1?n.innerHTML=r.html:n.innerHTML="",r.bgPos&&(n.style.backgroundPosition=-r.bgPos.x+"px "+ -r.bgPos.y+"px"),this._setIconStyles(n,"icon"),n},createShadow:function(){return null}}),i.divIcon=function(e){return new i.DivIcon(e)},i.Map.mergeOptions({closePopupOnClick:!0}),i.Popup=i.Class.extend({includes:i.Mixin.Events,options:{minWidth:50,maxWidth:300,autoPan:!0,closeButton:!0,offset:[0,7],autoPanPadding:[5,5],keepInView:!1,className:"",zoomAnimation:!0},initialize:function(e,t){i.setOptions(this,e),this._source=t,this._animated=i.Browser.any3d&&this.options.zoomAnimation,this._isOpen=!1},onAdd:function(e){this._map=e,this._container||this._initLayout();var t=e.options.fadeAnimation;t&&i.DomUtil.setOpacity(this._container,0),e._panes.popupPane.appendChild(this._container),e.on(this._getEvents(),this),this.update(),t&&i.DomUtil.setOpacity(this._container,1),this.fire("open"),e.fire("popupopen",{popup:this}),this._source&&this._source.fire("popupopen",{popup:this})},addTo:function(e){return e.addLayer(this),this},openOn:function(e){return e.openPopup(this),this},onRemove:function(e){e._panes.popupPane.removeChild(this._container),i.Util.falseFn(this._container.offsetWidth),e.off(this._getEvents(),this),e.options.fadeAnimation&&i.DomUtil.setOpacity(this._container,0),this._map=null,this.fire("close"),e.fire("popupclose",{popup:this}),this._source&&this._source.fire("popupclose",{popup:this})},getLatLng:function(){return this._latlng},setLatLng:function(e){return this._latlng=i.latLng(e),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(e){return this._content=e,this.update(),this},update:function(){if(!this._map)return;this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan()},_getEvents:function(){var e={viewreset:this._updatePosition};this._animated&&(e.zoomanim=this._zoomAnimation);if("closeOnClick"in this.options?this.options.closeOnClick:this._map.options.closePopupOnClick)e.preclick=this._close;return this.options.keepInView&&(e.moveend=this._adjustPan),e},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var e="leaflet-popup",t=e+" "+this.options.className+" leaflet-zoom-"+(this._animated?"animated":"hide"),n=this._container=i.DomUtil.create("div",t),r;this.options.closeButton&&(r=this._closeButton=i.DomUtil.create("a",e+"-close-button",n),r.href="#close",r.innerHTML="&#215;",i.DomEvent.disableClickPropagation(r),i.DomEvent.on(r,"click",this._onCloseButtonClick,this));var s=this._wrapper=i.DomUtil.create("div",e+"-content-wrapper",n);i.DomEvent.disableClickPropagation(s),this._contentNode=i.DomUtil.create("div",e+"-content",s),i.DomEvent.disableScrollPropagation(this._contentNode),i.DomEvent.on(s,"contextmenu",i.DomEvent.stopPropagation),this._tipContainer=i.DomUtil.create("div",e+"-tip-container",n),this._tip=i.DomUtil.create("div",e+"-tip",this._tipContainer)},_updateContent:function(){if(!this._content)return;if(typeof this._content=="string")this._contentNode.innerHTML=this._content;else{while(this._contentNode.hasChildNodes())this._contentNode.removeChild(this._contentNode.firstChild);this._contentNode.appendChild(this._content)}this.fire("contentupdate")},_updateLayout:function(){var e=this._contentNode,t=e.style;t.width="",t.whiteSpace="nowrap";var n=e.offsetWidth;n=Math.min(n,this.options.maxWidth),n=Math.max(n,this.options.minWidth),t.width=n+1+"px",t.whiteSpace="",t.height="";var r=e.offsetHeight,s=this.options.maxHeight,o="leaflet-popup-scrolled";s&&r>s?(t.height=s+"px",i.DomUtil.addClass(e,o)):i.DomUtil.removeClass(e,o),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(!this._map)return;var e=this._map.latLngToLayerPoint(this._latlng),t=this._animated,n=i.point(this.options.offset);t&&i.DomUtil.setPosition(this._container,e),this._containerBottom=-n.y-(t?0:e.y),this._containerLeft=-Math.round(this._containerWidth/2)+n.x+(t?0:e.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"},_zoomAnimation:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);i.DomUtil.setPosition(this._container,t)},_adjustPan:function(){if(!this.options.autoPan)return;var e=this._map,t=this._container.offsetHeight,n=this._containerWidth,r=new i.Point(this._containerLeft,-t-this._containerBottom);this._animated&&r._add(i.DomUtil.getPosition(this._container));var s=e.layerPointToContainerPoint(r),o=i.point(this.options.autoPanPadding),u=i.point(this.options.autoPanPaddingTopLeft||o),a=i.point(this.options.autoPanPaddingBottomRight||o),f=e.getSize(),l=0,c=0;s.x+n+a.x>f.x&&(l=s.x+n-f.x+a.x),s.x-l-u.x<0&&(l=s.x-u.x),s.y+t+a.y>f.y&&(c=s.y+t-f.y+a.y),s.y-c-u.y<0&&(c=s.y-u.y),(l||c)&&e.fire("autopanstart").panBy([l,c])},_onCloseButtonClick:function(e){this._close(),i.DomEvent.stop(e)}}),i.popup=function(e,t){return new i.Popup(e,t)},i.Map.include({openPopup:function(e,t,n){this.closePopup();if(!(e instanceof i.Popup)){var r=e;e=(new i.Popup(n)).setLatLng(t).setContent(r)}return e._isOpen=!0,this._popup=e,this.addLayer(e)},closePopup:function(e){if(!e||e===this._popup)e=this._popup,this._popup=null;return e&&(this.removeLayer(e),e._isOpen=!1),this}}),i.Marker.include({openPopup:function(){return this._popup&&this._map&&!this._map.hasLayer(this._popup)&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(){return this._popup&&(this._popup._isOpen?this.closePopup():this.openPopup()),this},bindPopup:function(e,t){var n=i.point(this.options.icon.options.popupAnchor||[0,0]);return n=n.add(i.Popup.prototype.options.offset),t&&t.offset&&(n=n.add(t.offset)),t=i.extend({offset:n},t),this._popupHandlersAdded||(this.on("click",this.togglePopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),this._popupHandlersAdded=!0),e instanceof i.Popup?(i.setOptions(e,t),this._popup=e):this._popup=(new i.Popup(t,this)).setContent(e),this},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.togglePopup,this).off("remove",this.closePopup,this).off("move",this._movePopup,this),this._popupHandlersAdded=!1),this},getPopup:function(){return this._popup},_movePopup:function(e){this._popup.setLatLng(e.latlng)}}),i.LayerGroup=i.Class.extend({initialize:function(e){this._layers={};var t,n;if(e)for(t=0,n=e.length;t<n;t++)this.addLayer(e[t])},addLayer:function(e){var t=this.getLayerId(e);return this._layers[t]=e,this._map&&this._map.addLayer(e),this},removeLayer:function(e){var t=e in this._layers?e:this.getLayerId(e);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(e){return e?e in this._layers||this.getLayerId(e)in this._layers:!1},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(e){var t=Array.prototype.slice.call(arguments,1),n,r;for(n in this._layers)r=this._layers[n],r[e]&&r[e].apply(r,t);return this},onAdd:function(e){this._map=e,this.eachLayer(e.addLayer,e)},onRemove:function(e){this.eachLayer(e.removeLayer,e),this._map=null},addTo:function(e){return e.addLayer(this),this},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},getLayer:function(e){return this._layers[e]},getLayers:function(){var e=[];for(var t in this._layers)e.push(this._layers[t]);return e},setZIndex:function(e){return this.invoke("setZIndex",e)},getLayerId:function(e){return i.stamp(e)}}),i.layerGroup=function(e){return new i.LayerGroup(e)},i.FeatureGroup=i.LayerGroup.extend({includes:i.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose"},addLayer:function(e){return this.hasLayer(e)?this:("on"in e&&e.on(i.FeatureGroup.EVENTS,this._propagateEvent,this),i.LayerGroup.prototype.addLayer.call(this,e),this._popupContent&&e.bindPopup&&e.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:e}))},removeLayer:function(e){return this.hasLayer(e)?(e in this._layers&&(e=this._layers[e]),e.off(i.FeatureGroup.EVENTS,this._propagateEvent,this),i.LayerGroup.prototype.removeLayer.call(this,e),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:e})):this},bindPopup:function(e,t){return this._popupContent=e,this._popupOptions=t,this.invoke("bindPopup",e,t)},openPopup:function(e){for(var t in this._layers){this._layers[t].openPopup(e);break}return this},setStyle:function(e){return this.invoke("setStyle",e)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var e=new i.LatLngBounds;return this.eachLayer(function(t){e.extend(t instanceof i.Marker?t.getLatLng():t.getBounds())}),e},_propagateEvent:function(e){e=i.extend({layer:e.target,target:this},e),this.fire(e.type,e)}}),i.featureGroup=function(e){return new i.FeatureGroup(e)},i.Path=i.Class.extend({includes:[i.Mixin.Events],statics:{CLIP_PADDING:function(){var t=i.Browser.mobile?1280:2e3,n=(t/Math.max(e.outerWidth,e.outerHeight)-1)/2;return Math.max(0,Math.min(.5,n))}()},options:{stroke:!0,color:"#0033ff",dashArray:null,lineCap:null,lineJoin:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(e){i.setOptions(this,e)},onAdd:function(e){this._map=e,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),e.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(e){return e.addLayer(this),this},onRemove:function(e){e._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,i.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),e.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(e){return i.setOptions(this,e),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),i.Map.include({_updatePathViewport:function(){var e=i.Path.CLIP_PADDING,t=this.getSize(),n=i.DomUtil.getPosition(this._mapPane),r=n.multiplyBy(-1)._subtract(t.multiplyBy(e)._round()),s=r.add(t.multiplyBy(1+e*2)._round());this._pathViewport=new i.Bounds(r,s)}}),i.Path.SVG_NS="http://www.w3.org/2000/svg",i.Browser.svg=!!t.createElementNS&&!!t.createElementNS(i.Path.SVG_NS,"svg").createSVGRect,i.Path=i.Path.extend({statics:{SVG:i.Browser.svg},bringToFront:function(){var e=this._map._pathRoot,t=this._container;return t&&e.lastChild!==t&&e.appendChild(t),this},bringToBack:function(){var e=this._map._pathRoot,t=this._container,n=e.firstChild;return t&&n!==t&&e.insertBefore(t,n),this},getPathString:function(){},_createElement:function(e){return t.createElementNS(i.Path.SVG_NS,e)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this.options.className&&i.DomUtil.addClass(this._path,this.options.className),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.options.pointerEvents&&this._path.setAttribute("pointer-events",this.options.pointerEvents),!this.options.clickable&&!this.options.pointerEvents&&this._path.setAttribute("pointer-events","none"),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.options.lineCap&&this._path.setAttribute("stroke-linecap",this.options.lineCap),this.options.lineJoin&&this._path.setAttribute("stroke-linejoin",this.options.lineJoin)):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 e=this.getPathString();e||(e="M0 0"),this._path.setAttribute("d",e)},_initEvents:function(){if(this.options.clickable){(i.Browser.svg||!i.Browser.vml)&&i.DomUtil.addClass(this._path,"leaflet-clickable"),i.DomEvent.on(this._container,"click",this._onMouseClick,this);var e=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"];for(var t=0;t<e.length;t++)i.DomEvent.on(this._container,e[t],this._fireMouseEvent,this)}},_onMouseClick:function(e){if(this._map.dragging&&this._map.dragging.moved())return;this._fireMouseEvent(e)},_fireMouseEvent:function(e){if(!this.hasEventListeners(e.type))return;var t=this._map,n=t.mouseEventToContainerPoint(e),r=t.containerPointToLayerPoint(n),s=t.layerPointToLatLng(r);this.fire(e.type,{latlng:s,layerPoint:r,containerPoint:n,originalEvent:e}),e.type==="contextmenu"&&i.DomEvent.preventDefault(e),e.type!=="mousemove"&&i.DomEvent.stopPropagation(e)}}),i.Map.include({_initPathRoot:function(){this._pathRoot||(this._pathRoot=i.Path.prototype._createElement("svg"),this._panes.overlayPane.appendChild(this._pathRoot),this.options.zoomAnimation&&i.Browser.any3d?(i.DomUtil.addClass(this._pathRoot,"leaflet-zoom-animated"),this.on({zoomanim:this._animatePathZoom,zoomend:this._endPathZoom})):i.DomUtil.addClass(this._pathRoot,"leaflet-zoom-hide"),this.on("moveend",this._updateSvgViewport),this._updateSvgViewport())},_animatePathZoom:function(e){var t=this.getZoomScale(e.zoom),n=this._getCenterOffset(e.center)._multiplyBy(-t)._add(this._pathViewport.min);this._pathRoot.style[i.DomUtil.TRANSFORM]=i.DomUtil.getTranslateString(n)+" scale("+t+") ",this._pathZooming=!0},_endPathZoom:function(){this._pathZooming=!1},_updateSvgViewport:function(){if(this._pathZooming)return;this._updatePathViewport();var e=this._pathViewport,t=e.min,n=e.max,r=n.x-t.x,s=n.y-t.y,o=this._pathRoot,u=this._panes.overlayPane;i.Browser.mobileWebkit&&u.removeChild(o),i.DomUtil.setPosition(o,t),o.setAttribute("width",r),o.setAttribute("height",s),o.setAttribute("viewBox",[t.x,t.y,r,s].join(" ")),i.Browser.mobileWebkit&&u.appendChild(o)}}),i.Path.include({bindPopup:function(e,t){if(e instanceof i.Popup)this._popup=e;else{if(!this._popup||t)this._popup=new i.Popup(t,this);this._popup.setContent(e)}return this._popupHandlersAdded||(this.on("click",this._openPopup,this).on("remove",this.closePopup,this),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this._openPopup).off("remove",this.closePopup),this._popupHandlersAdded=!1),this},openPopup:function(e){return this._popup&&(e=e||this._latlng||this._latlngs[Math.floor(this._latlngs.length/2)],this._openPopup({latlng:e})),this},closePopup:function(){return this._popup&&this._popup._close(),this},_openPopup:function(e){this._popup.setLatLng(e.latlng),this._map.openPopup(this._popup)}}),i.Browser.vml=!i.Browser.svg&&function(){try{var e=t.createElement("div");e.innerHTML='<v:shape adj="1"/>';var n=e.firstChild;return n.style.behavior="url(#default#VML)",n&&typeof n.adj=="object"}catch(r){return!1}}(),i.Path=i.Browser.svg||!i.Browser.vml?i.Path:i.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return t.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(e){return t.createElement("<lvml:"+e+' class="lvml">')}}catch(e){return function(e){return t.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var e=this._container=this._createElement("shape");i.DomUtil.addClass(e,"leaflet-vml-shape"+(this.options.className?" "+this.options.className:"")),this.options.clickable&&i.DomUtil.addClass(e,"leaflet-clickable"),e.coordsize="1 1",this._path=this._createElement("path"),e.appendChild(this._path),this._map._pathRoot.appendChild(e)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var e=this._stroke,t=this._fill,n=this.options,r=this._container;r.stroked=n.stroke,r.filled=n.fill,n.stroke?(e||(e=this._stroke=this._createElement("stroke"),e.endcap="round",r.appendChild(e)),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=i.Util.isArray(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",n.lineCap&&(e.endcap=n.lineCap.replace("butt","flat")),n.lineJoin&&(e.joinstyle=n.lineJoin)):e&&(r.removeChild(e),this._stroke=null),n.fill?(t||(t=this._fill=this._createElement("fill"),r.appendChild(t)),t.color=n.fillColor||n.color,t.opacity=n.fillOpacity):t&&(r.removeChild(t),this._fill=null)},_updatePath:function(){var e=this._container.style;e.display="none",this._path.v=this.getPathString()+" ",e.display=""}}),i.Map.include(i.Browser.svg||!i.Browser.vml?{}:{_initPathRoot:function(){if(this._pathRoot)return;var e=this._pathRoot=t.createElement("div");e.className="leaflet-vml-container",this._panes.overlayPane.appendChild(e),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}),i.Browser.canvas=function(){return!!t.createElement("canvas").getContext}(),i.Path=i.Path.SVG&&!e.L_PREFER_CANVAS||!i.Browser.canvas?i.Path:i.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(e){return i.setOptions(this,e),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(e){e.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&(this._map.off("click",this._onClick,this),this._map.off("mousemove",this._onMouseMove,this)),this._requestUpdate(),this._map=null},_requestUpdate:function(){this._map&&!i.Path._updateRequest&&(i.Path._updateRequest=i.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){i.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var e=this.options;e.stroke&&(this._ctx.lineWidth=e.weight,this._ctx.strokeStyle=e.color),e.fill&&(this._ctx.fillStyle=e.fillColor||e.color)},_drawPath:function(){var e,t,n,r,s,o;this._ctx.beginPath();for(e=0,n=this._parts.length;e<n;e++){for(t=0,r=this._parts[e].length;t<r;t++)s=this._parts[e][t],o=(t===0?"move":"line")+"To",this._ctx[o](s.x,s.y);this instanceof i.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(this._checkIfEmpty())return;var e=this._ctx,t=this.options;this._drawPath(),e.save(),this._updateStyle(),t.fill&&(e.globalAlpha=t.fillOpacity,e.fill()),t.stroke&&(e.globalAlpha=t.opacity,e.stroke()),e.restore()},_initEvents:function(){this.options.clickable&&(this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onClick,this))},_onClick:function(e){this._containsPoint(e.layerPoint)&&this.fire("click",e)},_onMouseMove:function(e){if(!this._map||this._map._animatingZoom)return;this._containsPoint(e.layerPoint)?(this._ctx.canvas.style.cursor="pointer",this._mouseInside=!0,this.fire("mouseover",e)):this._mouseInside&&(this._ctx.canvas.style.cursor="",this._mouseInside=!1,this.fire("mouseout",e))}}),i.Map.include(i.Path.SVG&&!e.L_PREFER_CANVAS||!i.Browser.canvas?{}:{_initPathRoot:function(){var e=this._pathRoot,n;e||(e=this._pathRoot=t.createElement("canvas"),e.style.position="absolute",n=this._canvasCtx=e.getContext("2d"),n.lineCap="round",n.lineJoin="round",this._panes.overlayPane.appendChild(e),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)return;this._updatePathViewport();var e=this._pathViewport,t=e.min,n=e.max.subtract(t),r=this._pathRoot;i.DomUtil.setPosition(r,t),r.width=n.x,r.height=n.y,r.getContext("2d").translate(-t.x,-t.y)}}),i.LineUtil={simplify:function(e,t){if(!t||!e.length)return e.slice();var n=t*t;return e=this._reducePoints(e,n),e=this._simplifyDP(e,n),e},pointToSegmentDistance:function(e,t,n){return Math.sqrt(this._sqClosestPointOnSegment(e,t,n,!0))},closestPointOnSegment:function(e,t,n){return this._sqClosestPointOnSegment(e,t,n)},_simplifyDP:function(e,t){var r=e.length,i=typeof Uint8Array!=n+""?Uint8Array:Array,s=new i(r);s[0]=s[r-1]=1,this._simplifyDPStep(e,s,t,0,r-1);var o,u=[];for(o=0;o<r;o++)s[o]&&u.push(e[o]);return u},_simplifyDPStep:function(e,t,n,r,i){var s=0,o,u,a;for(u=r+1;u<=i-1;u++)a=this._sqClosestPointOnSegment(e[u],e[r],e[i],!0),a>s&&(o=u,s=a);s>n&&(t[o]=1,this._simplifyDPStep(e,t,n,r,o),this._simplifyDPStep(e,t,n,o,i))},_reducePoints:function(e,t){var n=[e[0]];for(var r=1,i=0,s=e.length;r<s;r++)this._sqDist(e[r],e[i])>t&&(n.push(e[r]),i=r);return i<s-1&&n.push(e[s-1]),n},clipSegment:function(e,t,n,r){var i=r?this._lastCode:this._getBitCode(e,n),s=this._getBitCode(t,n),o,u,a;this._lastCode=s;for(;;){if(!(i|s))return[e,t];if(i&s)return!1;o=i||s,u=this._getEdgeIntersection(e,t,o,n),a=this._getBitCode(u,n),o===i?(e=u,i=a):(t=u,s=a)}},_getEdgeIntersection:function(e,t,n,r){var s=t.x-e.x,o=t.y-e.y,u=r.min,a=r.max;if(n&8)return new i.Point(e.x+s*(a.y-e.y)/o,a.y);if(n&4)return new i.Point(e.x+s*(u.y-e.y)/o,u.y);if(n&2)return new i.Point(a.x,e.y+o*(a.x-e.x)/s);if(n&1)return new i.Point(u.x,e.y+o*(u.x-e.x)/s)},_getBitCode:function(e,t){var n=0;return e.x<t.min.x?n|=1:e.x>t.max.x&&(n|=2),e.y<t.min.y?n|=4:e.y>t.max.y&&(n|=8),n},_sqDist:function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},_sqClosestPointOnSegment:function(e,t,n,r){var s=t.x,o=t.y,u=n.x-s,a=n.y-o,f=u*u+a*a,l;return f>0&&(l=((e.x-s)*u+(e.y-o)*a)/f,l>1?(s=n.x,o=n.y):l>0&&(s+=u*l,o+=a*l)),u=e.x-s,a=e.y-o,r?u*u+a*a:new i.Point(s,o)}},i.Polyline=i.Path.extend({initialize:function(e,t){i.Path.prototype.initialize.call(this,t),this._latlngs=this._convertLatLngs(e)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var e=0,t=this._latlngs.length;e<t;e++)this._originalPoints[e]=this._map.latLngToLayerPoint(this._latlngs[e])},getPathString:function(){for(var e=0,t=this._parts.length,n="";e<t;e++)n+=this._getPathPartStr(this._parts[e]);return n},getLatLngs:function(){return this._latlngs},setLatLngs:function(e){return this._latlngs=this._convertLatLngs(e),this.redraw()},addLatLng:function(e){return this._latlngs.push(i.latLng(e)),this.redraw()},spliceLatLngs:function(){var e=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs,!0),this.redraw(),e},closestLayerPoint:function(e){var t=Infinity,n=this._parts,r,s,o=null;for(var u=0,a=n.length;u<a;u++){var f=n[u];for(var l=1,c=f.length;l<c;l++){r=f[l-1],s=f[l];var h=i.LineUtil._sqClosestPointOnSegment(e,r,s,!0);h<t&&(t=h,o=i.LineUtil._sqClosestPointOnSegment(e,r,s))}}return o&&(o.distance=Math.sqrt(t)),o},getBounds:function(){return new i.LatLngBounds(this.getLatLngs())},_convertLatLngs:function(e,t){var n,r,s=t?e:[];for(n=0,r=e.length;n<r;n++){if(i.Util.isArray(e[n])&&typeof e[n][0]!="number")return;s[n]=i.latLng(e[n])}return s},_initEvents:function(){i.Path.prototype._initEvents.call(this)},_getPathPartStr:function(e){var t=i.Path.VML;for(var n=0,r=e.length,s="",o;n<r;n++)o=e[n],t&&o._round(),s+=(n?"L":"M")+o.x+" "+o.y;return s},_clipPoints:function(){var e=this._originalPoints,t=e.length,n,r,s;if(this.options.noClip){this._parts=[e];return}this._parts=[];var o=this._parts,u=this._map._pathViewport,a=i.LineUtil;for(n=0,r=0;n<t-1;n++){s=a.clipSegment(e[n],e[n+1],u,n);if(!s)continue;o[r]=o[r]||[],o[r].push(s[0]);if(s[1]!==e[n+1]||n===t-2)o[r].push(s[1]),r++}},_simplifyPoints:function(){var e=this._parts,t=i.LineUtil;for(var n=0,r=e.length;n<r;n++)e[n]=t.simplify(e[n],this.options.smoothFactor)},_updatePath:function(){if(!this._map)return;this._clipPoints(),this._simplifyPoints(),i.Path.prototype._updatePath.call(this)}}),i.polyline=function(e,t){return new i.Polyline(e,t)},i.PolyUtil={},i.PolyUtil.clipPolygon=function(e,t){var n,r=[1,4,2,8],s,o,u,a,f,l,c,h,p=i.LineUtil;for(s=0,l=e.length;s<l;s++)e[s]._code=p._getBitCode(e[s],t);for(u=0;u<4;u++){c=r[u],n=[];for(s=0,l=e.length,o=l-1;s<l;o=s++)a=e[s],f=e[o],a._code&c?f._code&c||(h=p._getEdgeIntersection(f,a,c,t),h._code=p._getBitCode(h,t),n.push(h)):(f._code&c&&(h=p._getEdgeIntersection(f,a,c,t),h._code=p._getBitCode(h,t),n.push(h)),n.push(a));e=n}return e},i.Polygon=i.Polyline.extend({options:{fill:!0},initialize:function(e,t){i.Polyline.prototype.initialize.call(this,e,t),this._initWithHoles(e)},_initWithHoles:function(e){var t,n,r;if(e&&i.Util.isArray(e[0])&&typeof e[0][0]!="number"){this._latlngs=this._convertLatLngs(e[0]),this._holes=e.slice(1);for(t=0,n=this._holes.length;t<n;t++)r=this._holes[t]=this._convertLatLngs(this._holes[t]),r[0].equals(r[r.length-1])&&r.pop()}e=this._latlngs,e.length>=2&&e[0].equals(e[e.length-1])&&e.pop()},projectLatlngs:function(){i.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[];if(!this._holes)return;var e,t,n,r;for(e=0,n=this._holes.length;e<n;e++){this._holePoints[e]=[];for(t=0,r=this._holes[e].length;t<r;t++)this._holePoints[e][t]=this._map.latLngToLayerPoint(this._holes[e][t])}},setLatLngs:function(e){return e&&i.Util.isArray(e[0])&&typeof e[0][0]!="number"?(this._initWithHoles(e),this.redraw()):i.Polyline.prototype.setLatLngs.call(this,e)},_clipPoints:function(){var e=this._originalPoints,t=[];this._parts=[e].concat(this._holePoints);if(this.options.noClip)return;for(var n=0,r=this._parts.length;n<r;n++){var s=i.PolyUtil.clipPolygon(this._parts[n],this._map._pathViewport);s.length&&t.push(s)}this._parts=t},_getPathPartStr:function(e){var t=i.Polyline.prototype._getPathPartStr.call(this,e);return t+(i.Browser.svg?"z":"x")}}),i.polygon=function(e,t){return new i.Polygon(e,t)},function(){function e(e){return i.FeatureGroup.extend({initialize:function(e,t){this._layers={},this._options=t,this.setLatLngs(e)},setLatLngs:function(t){var n=0,r=t.length;this.eachLayer(function(e){n<r?e.setLatLngs(t[n++]):this.removeLayer(e)},this);while(n<r)this.addLayer(new e(t[n++],this._options));return this},getLatLngs:function(){var e=[];return this.eachLayer(function(t){e.push(t.getLatLngs())}),e}})}i.MultiPolyline=e(i.Polyline),i.MultiPolygon=e(i.Polygon),i.multiPolyline=function(e,t){return new i.MultiPolyline(e,t)},i.multiPolygon=function(e,t){return new i.MultiPolygon(e,t)}}(),i.Rectangle=i.Polygon.extend({initialize:function(e,t){i.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(e),t)},setBounds:function(e){this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=i.latLngBounds(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}}),i.rectangle=function(e,t){return new i.Rectangle(e,t)},i.Circle=i.Path.extend({initialize:function(e,t,n){i.Path.prototype.initialize.call(this,n),this._latlng=i.latLng(e),this._mRadius=t},options:{fill:!0},setLatLng:function(e){return this._latlng=i.latLng(e),this.redraw()},setRadius:function(e){return this._mRadius=e,this.redraw()},projectLatlngs:function(){var e=this._getLngRadius(),t=this._latlng,n=this._map.latLngToLayerPoint([t.lat,t.lng-e]);this._point=this._map.latLngToLayerPoint(t),this._radius=Math.max(this._point.x-n.x,1)},getBounds:function(){var e=this._getLngRadius(),t=this._mRadius/40075017*360,n=this._latlng;return new i.LatLngBounds([n.lat-t,n.lng-e],[n.lat+t,n.lng+e])},getLatLng:function(){return this._latlng},getPathString:function(){var e=this._point,t=this._radius;return this._checkIfEmpty()?"":i.Browser.svg?"M"+e.x+","+(e.y-t)+"A"+t+","+t+",0,1,1,"+(e.x-.1)+","+(e.y-t)+" z":(e._round(),t=Math.round(t),"AL "+e.x+","+e.y+" "+t+","+t+" 0,"+23592600)},getRadius:function(){return this._mRadius},_getLatRadius:function(){return this._mRadius/40075017*360},_getLngRadius:function(){return this._getLatRadius()/Math.cos(i.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var e=this._map._pathViewport,t=this._radius,n=this._point;return n.x-t>e.max.x||n.y-t>e.max.y||n.x+t<e.min.x||n.y+t<e.min.y}}),i.circle=function(e,t,n){return new i.Circle(e,t,n)},i.CircleMarker=i.Circle.extend({options:{radius:10,weight:2},initialize:function(e,t){i.Circle.prototype.initialize.call(this,e,null,t),this._radius=this.options.radius},projectLatlngs:function(){this._point=this._map.latLngToLayerPoint(this._latlng)},_updateStyle:function(){i.Circle.prototype._updateStyle.call(this),this.setRadius(this.options.radius)},setLatLng:function(e){return i.Circle.prototype.setLatLng.call(this,e),this._popup&&this._popup._isOpen&&this._popup.setLatLng(e),this},setRadius:function(e){return this.options.radius=this._radius=e,this.redraw()},getRadius:function(){return this._radius}}),i.circleMarker=function(e,t){return new i.CircleMarker(e,t)},i.Polyline.include(i.Path.CANVAS?{_containsPoint:function(e,t){var n,r,s,o,u,a,f,l=this.options.weight/2;i.Browser.touch&&(l+=10);for(n=0,o=this._parts.length;n<o;n++){f=this._parts[n];for(r=0,u=f.length,s=u-1;r<u;s=r++){if(!t&&r===0)continue;a=i.LineUtil.pointToSegmentDistance(e,f[s],f[r]);if(a<=l)return!0}}return!1}}:{}),i.Polygon.include(i.Path.CANVAS?{_containsPoint:function(e){var t=!1,n,r,s,o,u,a,f,l;if(i.Polyline.prototype._containsPoint.call(this,e,!0))return!0;for(o=0,f=this._parts.length;o<f;o++){n=this._parts[o];for(u=0,l=n.length,a=l-1;u<l;a=u++)r=n[u],s=n[a],r.y>e.y!=s.y>e.y&&e.x<(s.x-r.x)*(e.y-r.y)/(s.y-r.y)+r.x&&(t=!t)}return t}}:{}),i.Circle.include(i.Path.CANVAS?{_drawPath:function(){var e=this._point;this._ctx.beginPath(),this._ctx.arc(e.x,e.y,this._radius,0,Math.PI*2,!1)},_containsPoint:function(e){var t=this._point,n=this.options.stroke?this.options.weight/2:0;return e.distanceTo(t)<=this._radius+n}}:{}),i.CircleMarker.include(i.Path.CANVAS?{_updateStyle:function(){i.Path.prototype._updateStyle.call(this)}}:{}),i.GeoJSON=i.FeatureGroup.extend({initialize:function(e,t){i.setOptions(this,t),this._layers={},e&&this.addData(e)},addData:function(e){var t=i.Util.isArray(e)?e:e.features,n,r,s;if(t){for(n=0,r=t.length;n<r;n++)s=t[n],(s.geometries||s.geometry||s.features||s.coordinates)&&this.addData(t[n]);return this}var o=this.options;if(o.filter&&!o.filter(e))return;var u=i.GeoJSON.geometryToLayer(e,o.pointToLayer,o.coordsToLatLng,o);return u.feature=i.GeoJSON.asFeature(e),u.defaultOptions=u.options,this.resetStyle(u),o.onEachFeature&&o.onEachFeature(e,u),this.addLayer(u)},resetStyle:function(e){var t=this.options.style;t&&(i.Util.extend(e.options,e.defaultOptions),this._setLayerStyle(e,t))},setStyle:function(e){this.eachLayer(function(t){this._setLayerStyle(t,e)},this)},_setLayerStyle:function(e,t){typeof t=="function"&&(t=t(e.feature)),e.setStyle&&e.setStyle(t)}}),i.extend(i.GeoJSON,{geometryToLayer:function(e,t,n,r){var s=e.type==="Feature"?e.geometry:e,o=s.coordinates,u=[],a,f,l,c;n=n||this.coordsToLatLng;switch(s.type){case"Point":return a=n(o),t?t(e,a):new i.Marker(a);case"MultiPoint":for(l=0,c=o.length;l<c;l++)a=n(o[l]),u.push(t?t(e,a):new i.Marker(a));return new i.FeatureGroup(u);case"LineString":return f=this.coordsToLatLngs(o,0,n),new i.Polyline(f,r);case"Polygon":if(o.length===2&&!o[1].length)throw Error("Invalid GeoJSON object.");return f=this.coordsToLatLngs(o,1,n),new i.Polygon(f,r);case"MultiLineString":return f=this.coordsToLatLngs(o,1,n),new i.MultiPolyline(f,r);case"MultiPolygon":return f=this.coordsToLatLngs(o,2,n),new i.MultiPolygon(f,r);case"GeometryCollection":for(l=0,c=s.geometries.length;l<c;l++)u.push(this.geometryToLayer({geometry:s.geometries[l],type:"Feature",properties:e.properties},t,n,r));return new i.FeatureGroup(u);default:throw Error("Invalid GeoJSON object.")}},coordsToLatLng:function(e){return new i.LatLng(e[1],e[0],e[2])},coordsToLatLngs:function(e,t,n){var r,i,s,o=[];for(i=0,s=e.length;i<s;i++)r=t?this.coordsToLatLngs(e[i],t-1,n):(n||this.coordsToLatLng)(e[i]),o.push(r);return o},latLngToCoords:function(e){var t=[e.lng,e.lat];return e.alt!==n&&t.push(e.alt),t},latLngsToCoords:function(e){var t=[];for(var n=0,r=e.length;n<r;n++)t.push(i.GeoJSON.latLngToCoords(e[n]));return t},getFeature:function(e,t){return e.feature?i.extend({},e.feature,{geometry:t}):i.GeoJSON.asFeature(t)},asFeature:function(e){return e.type==="Feature"?e:{type:"Feature",properties:{},geometry:e}}});var o={toGeoJSON:function(){return i.GeoJSON.getFeature(this,{type:"Point",coordinates:i.GeoJSON.latLngToCoords(this.getLatLng())})}};i.Marker.include(o),i.Circle.include(o),i.CircleMarker.include(o),i.Polyline.include({toGeoJSON:function(){return i.GeoJSON.getFeature(this,{type:"LineString",coordinates:i.GeoJSON.latLngsToCoords(this.getLatLngs())})}}),i.Polygon.include({toGeoJSON:function(){var e=[i.GeoJSON.latLngsToCoords(this.getLatLngs())],t,n,r;e[0].push(e[0][0]);if(this._holes)for(t=0,n=this._holes.length;t<n;t++)r=i.GeoJSON.latLngsToCoords(this._holes[t]),r.push(r[0]),e.push(r);return i.GeoJSON.getFeature(this,{type:"Polygon",coordinates:e})}}),function(){function e(e){return function(){var t=[];return this.eachLayer(function(e){t.push(e.toGeoJSON().geometry.coordinates)}),i.GeoJSON.getFeature(this,{type:e,coordinates:t})}}i.MultiPolyline.include({toGeoJSON:e("MultiLineString")}),i.MultiPolygon.include({toGeoJSON:e("MultiPolygon")}),i.LayerGroup.include({toGeoJSON:function(){var t=this.feature&&this.feature.geometry,n=[],r;if(t&&t.type==="MultiPoint")return e("MultiPoint").call(this);var s=t&&t.type==="GeometryCollection";return this.eachLayer(function(e){e.toGeoJSON&&(r=e.toGeoJSON(),n.push(s?r.geometry:i.GeoJSON.asFeature(r)))}),s?i.GeoJSON.getFeature(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}})}(),i.geoJson=function(e,t){return new i.GeoJSON(e,t)},i.DomEvent={addListener:function(e,t,n,r){var s=i.stamp(n),o="_leaflet_"+t+s,u,a,f;return e[o]?this:(u=function(t){return n.call(r||e,t||i.DomEvent._getEvent())},i.Browser.pointer&&t.indexOf("touch")===0?this.addPointerListener(e,t,u,s):(i.Browser.touch&&t==="dblclick"&&this.addDoubleTapListener&&this.addDoubleTapListener(e,u,s),"addEventListener"in e?t==="mousewheel"?(e.addEventListener("DOMMouseScroll",u,!1),e.addEventListener(t,u,!1)):t==="mouseenter"||t==="mouseleave"?(a=u,f=t==="mouseenter"?"mouseover":"mouseout",u=function(t){if(!i.DomEvent._checkMouse(e,t))return;return a(t)},e.addEventListener(f,u,!1)):t==="click"&&i.Browser.android?(a=u,u=function(e){return i.DomEvent._filterClick(e,a)},e.addEventListener(t,u,!1)):e.addEventListener(t,u,!1):"attachEvent"in e&&e.attachEvent("on"+t,u),e[o]=u,this))},removeListener:function(e,t,n){var r=i.stamp(n),s="_leaflet_"+t+r,o=e[s];return o?(i.Browser.pointer&&t.indexOf("touch")===0?this.removePointerListener(e,t,r):i.Browser.touch&&t==="dblclick"&&this.removeDoubleTapListener?this.removeDoubleTapListener(e,r):"removeEventListener"in e?t==="mousewheel"?(e.removeEventListener("DOMMouseScroll",o,!1),e.removeEventListener(t,o,!1)):t==="mouseenter"||t==="mouseleave"?e.removeEventListener(t==="mouseenter"?"mouseover":"mouseout",o,!1):e.removeEventListener(t,o,!1):"detachEvent"in e&&e.detachEvent("on"+t,o),e[s]=null,this):this},stopPropagation:function(e){return e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,i.DomEvent._skipped(e),this},disableScrollPropagation:function(e){var t=i.DomEvent.stopPropagation;return i.DomEvent.on(e,"mousewheel",t).on(e,"MozMousePixelScroll",t)},disableClickPropagation:function(e){var t=i.DomEvent.stopPropagation;for(var n=i.Draggable.START.length-1;n>=0;n--)i.DomEvent.on(e,i.Draggable.START[n],t);return i.DomEvent.on(e,"click",i.DomEvent._fakeStop).on(e,"dblclick",t)},preventDefault:function(e){return e.preventDefault?e.preventDefault():e.returnValue=!1,this},stop:function(e){return i.DomEvent.preventDefault(e).stopPropagation(e)},getMousePosition:function(e,t){if(!t)return new i.Point(e.clientX,e.clientY);var n=t.getBoundingClientRect();return new i.Point(e.clientX-n.left-t.clientLeft,e.clientY-n.top-t.clientTop)},getWheelDelta:function(e){var t=0;return e.wheelDelta&&(t=e.wheelDelta/120),e.detail&&(t=-e.detail/3),t},_skipEvents:{},_fakeStop:function(e){i.DomEvent._skipEvents[e.type]=!0},_skipped:function(e){var t=this._skipEvents[e.type];return this._skipEvents[e.type]=!1,t},_checkMouse:function(e,t){var n=t.relatedTarget;if(!n)return!0;try{while(n&&n!==e)n=n.parentNode}catch(r){return!1}return n!==e},_getEvent:function(){var t=e.event;if(!t){var n=arguments.callee.caller;while(n){t=n.arguments[0];if(t&&e.Event===t.constructor)break;n=n.caller}}return t},_filterClick:function(e,t){var n=e.timeStamp||e.originalEvent.timeStamp,r=i.DomEvent._lastClick&&n-i.DomEvent._lastClick;if(r&&r>100&&r<1e3||e.target._simulatedClick&&!e._simulated){i.DomEvent.stop(e);return}return i.DomEvent._lastClick=n,t(e)}},i.DomEvent.on=i.DomEvent.addListener,i.DomEvent.off=i.DomEvent.removeListener,i.Draggable=i.Class.extend({includes:i.Mixin.Events,statics:{START:i.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"}},initialize:function(e,t){this._element=e,this._dragStartTarget=t||e},enable:function(){if(this._enabled)return;for(var e=i.Draggable.START.length-1;e>=0;e--)i.DomEvent.on(this._dragStartTarget,i.Draggable.START[e],this._onDown,this);this._enabled=!0},disable:function(){if(!this._enabled)return;for(var e=i.Draggable.START.length-1;e>=0;e--)i.DomEvent.off(this._dragStartTarget,i.Draggable.START[e],this._onDown,this);this._enabled=!1,this._moved=!1},_onDown:function(e){this._moved=!1;if(e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)return;i.DomEvent.stopPropagation(e);if(i.Draggable._disabled)return;i.DomUtil.disableImageDrag(),i.DomUtil.disableTextSelection();if(this._moving)return;var n=e.touches?e.touches[0]:e;this._startPoint=new i.Point(n.clientX,n.clientY),this._startPos=this._newPos=i.DomUtil.getPosition(this._element),i.DomEvent.on(t,i.Draggable.MOVE[e.type],this._onMove,this).on(t,i.Draggable.END[e.type],this._onUp,this)},_onMove:function(e){if(e.touches&&e.touches.length>1){this._moved=!0;return}var n=e.touches&&e.touches.length===1?e.touches[0]:e,r=new i.Point(n.clientX,n.clientY),s=r.subtract(this._startPoint);if(!s.x&&!s.y)return;i.DomEvent.preventDefault(e),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=i.DomUtil.getPosition(this._element).subtract(s),i.DomUtil.addClass(t.body,"leaflet-dragging"),i.DomUtil.addClass(e.target||e.srcElement,"leaflet-drag-target")),this._newPos=this._startPos.add(s),this._moving=!0,i.Util.cancelAnimFrame(this._animRequest),this._animRequest=i.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget)},_updatePosition:function(){this.fire("predrag"),i.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(e){i.DomUtil.removeClass(t.body,"leaflet-dragging"),i.DomUtil.removeClass(e.target||e.srcElement,"leaflet-drag-target");for(var n in i.Draggable.MOVE)i.DomEvent.off(t,i.Draggable.MOVE[n],this._onMove).off(t,i.Draggable.END[n],this._onUp);i.DomUtil.enableImageDrag(),i.DomUtil.enableTextSelection(),this._moved&&this._moving&&(i.Util.cancelAnimFrame(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1}}),i.Handler=i.Class.extend({initialize:function(e){this._map=e},enable:function(){if(this._enabled)return;this._enabled=!0,this.addHooks()},disable:function(){if(!this._enabled)return;this._enabled=!1,this.removeHooks()},enabled:function(){return!!this._enabled}}),i.Map.mergeOptions({dragging:!0,inertia:!i.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:Infinity,inertiaThreshold:i.Browser.touch?32:18,easeLinearity:.25,worldCopyJump:!1}),i.Map.Drag=i.Handler.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new i.Draggable(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),e.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDrag,this),e.on("viewreset",this._onViewReset,this),e.whenReady(this._onViewReset,this))}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var e=this._map;e._panAnim&&e._panAnim.stop(),e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var e=this._lastTime=+(new Date),t=this._lastPos=this._draggable._newPos;this._positions.push(t),this._times.push(e),e-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var e=this._map.getSize()._divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(e).x,this._worldWidth=this._map.project([0,180]).x},_onPreDrag:function(){var e=this._worldWidth,t=Math.round(e/2),n=this._initialWorldOffset,r=this._draggable._newPos.x,i=(r-t+n)%e+t-n,s=(r+t+n)%e-t-n,o=Math.abs(i+n)<Math.abs(s+n)?i:s;this._draggable._newPos.x=o},_onDragEnd:function(e){var t=this._map,n=t.options,r=+(new Date)-this._lastTime,s=!n.inertia||r>n.inertiaThreshold||!this._positions[0];t.fire("dragend",e);if(s)t.fire("moveend");else{var o=this._lastPos.subtract(this._positions[0]),u=(this._lastTime+r-this._times[0])/1e3,a=n.easeLinearity,f=o.multiplyBy(a/u),l=f.distanceTo([0,0]),c=Math.min(n.inertiaMaxSpeed,l),h=f.multiplyBy(c/l),p=c/(n.inertiaDeceleration*a),d=h.multiplyBy(-p/2).round();!d.x||!d.y?t.fire("moveend"):(d=t._limitOffset(d,t.options.maxBounds),i.Util.requestAnimFrame(function(){t.panBy(d,{duration:p,easeLinearity:a,noMoveStart:!0})}))}}}),i.Map.addInitHook("addHandler","dragging",i.Map.Drag),i.Map.mergeOptions({doubleClickZoom:!0}),i.Map.DoubleClickZoom=i.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(e){var t=this._map,n=t.getZoom()+(e.originalEvent.shiftKey?-1:1);t.options.doubleClickZoom==="center"?t.setZoom(n):t.setZoomAround(e.containerPoint,n)}}),i.Map.addInitHook("addHandler","doubleClickZoom",i.Map.DoubleClickZoom),i.Map.mergeOptions({scrollWheelZoom:!0}),i.Map.ScrollWheelZoom=i.Handler.extend({addHooks:function(){i.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),i.DomEvent.on(this._map._container,"MozMousePixelScroll",i.DomEvent.preventDefault),this._delta=0},removeHooks:function(){i.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll),i.DomEvent.off(this._map._container,"MozMousePixelScroll",i.DomEvent.preventDefault)},_onWheelScroll:function(e){var t=i.DomEvent.getWheelDelta(e);this._delta+=t,this._lastMousePos=this._map.mouseEventToContainerPoint(e),this._startTime||(this._startTime=+(new Date));var n=Math.max(40-(+(new Date)-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(i.bind(this._performZoom,this),n),i.DomEvent.preventDefault(e),i.DomEvent.stopPropagation(e)},_performZoom:function(){var e=this._map,t=this._delta,n=e.getZoom();t=t>0?Math.ceil(t):Math.floor(t),t=Math.max(Math.min(t,4),-4),t=e._limitZoom(n+t)-n,this._delta=0,this._startTime=null;if(!t)return;e.options.scrollWheelZoom==="center"?e.setZoom(n+t):e.setZoomAround(this._lastMousePos,n+t)}}),i.Map.addInitHook("addHandler","scrollWheelZoom",i.Map.ScrollWheelZoom),i.extend(i.DomEvent,{_touchstart:i.Browser.msPointer?"MSPointerDown":i.Browser.pointer?"pointerdown":"touchstart",_touchend:i.Browser.msPointer?"MSPointerUp":i.Browser.pointer?"pointerup":"touchend",addDoubleTapListener:function(e,n,r){function p(e){var t;i.Browser.pointer?(h.push(e.pointerId),t=h.length):t=e.touches.length;if(t>1)return;var n=Date.now(),r=n-(s||n);a=e.touches?e.touches[0]:e,o=r>0&&r<=u,s=n}function d(e){if(i.Browser.pointer){var t=h.indexOf(e.pointerId);if(t===-1)return;h.splice(t,1)}if(o){if(i.Browser.pointer){var r={},u;for(var f in a)u=a[f],typeof u=="function"?r[f]=u.bind(a):r[f]=u;a=r}a.type="dblclick",n(a),s=null}}var s,o=!1,u=250,a,f="_leaflet_",l=this._touchstart,c=this._touchend,h=[];e[f+l+r]=p,e[f+c+r]=d;var v=i.Browser.pointer?t.documentElement:e;return e.addEventListener(l,p,!1),v.addEventListener(c,d,!1),i.Browser.pointer&&v.addEventListener(i.DomEvent.POINTER_CANCEL,d,!1),this},removeDoubleTapListener:function(e,n){var r="_leaflet_";return e.removeEventListener(this._touchstart,e[r+this._touchstart+n],!1),(i.Browser.pointer?t.documentElement:e).removeEventListener(this._touchend,e[r+this._touchend+n],!1),i.Browser.pointer&&t.documentElement.removeEventListener(i.DomEvent.POINTER_CANCEL,e[r+this._touchend+n],!1),this}}),i.extend(i.DomEvent,{POINTER_DOWN:i.Browser.msPointer?"MSPointerDown":"pointerdown",POINTER_MOVE:i.Browser.msPointer?"MSPointerMove":"pointermove",POINTER_UP:i.Browser.msPointer?"MSPointerUp":"pointerup",POINTER_CANCEL:i.Browser.msPointer?"MSPointerCancel":"pointercancel",_pointers:[],_pointerDocumentListener:!1,addPointerListener:function(e,t,n,r){switch(t){case"touchstart":return this.addPointerListenerStart(e,t,n,r);case"touchend":return this.addPointerListenerEnd(e,t,n,r);case"touchmove":return this.addPointerListenerMove(e,t,n,r);default:throw"Unknown touch event type"}},addPointerListenerStart:function(e,n,r,s){var o="_leaflet_",u=this._pointers,a=function(e){i.DomEvent.preventDefault(e);var t=!1;for(var n=0;n<u.length;n++)if(u[n].pointerId===e.pointerId){t=!0;break}t||u.push(e),e.touches=u.slice(),e.changedTouches=[e],r(e)};e[o+"touchstart"+s]=a,e.addEventListener(this.POINTER_DOWN,a,!1);if(!this._pointerDocumentListener){var f=function(e){for(var t=0;t<u.length;t++)if(u[t].pointerId===e.pointerId){u.splice(t,1);break}};t.documentElement.addEventListener(this.POINTER_UP,f,!1),t.documentElement.addEventListener(this.POINTER_CANCEL,f,!1),this._pointerDocumentListener=!0}return this},addPointerListenerMove:function(e,t,n,r){function o(e){if((e.pointerType===e.MSPOINTER_TYPE_MOUSE||e.pointerType==="mouse")&&e.buttons===0)return;for(var t=0;t<s.length;t++)if(s[t].pointerId===e.pointerId){s[t]=e;break}e.touches=s.slice(),e.changedTouches=[e],n(e)}var i="_leaflet_",s=this._pointers;return e[i+"touchmove"+r]=o,e.addEventListener(this.POINTER_MOVE,o,!1),this},addPointerListenerEnd:function(e,t,n,r){var i="_leaflet_",s=this._pointers,o=function(e){for(var t=0;t<s.length;t++)if(s[t].pointerId===e.pointerId){s.splice(t,1);break}e.touches=s.slice(),e.changedTouches=[e],n(e)};return e[i+"touchend"+r]=o,e.addEventListener(this.POINTER_UP,o,!1),e.addEventListener(this.POINTER_CANCEL,o,!1),this},removePointerListener:function(e,t,n){var r="_leaflet_",i=e[r+t+n];switch(t){case"touchstart":e.removeEventListener(this.POINTER_DOWN,i,!1);break;case"touchmove":e.removeEventListener(this.POINTER_MOVE,i,!1);break;case"touchend":e.removeEventListener(this.POINTER_UP,i,!1),e.removeEventListener(this.POINTER_CANCEL,i,!1)}return this}}),i.Map.mergeOptions({touchZoom:i.Browser.touch&&!i.Browser.android23,bounceAtZoomLimits:!0}),i.Map.TouchZoom=i.Handler.extend({addHooks:function(){i.DomEvent.on(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){i.DomEvent.off(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var n=this._map;if(!e.touches||e.touches.length!==2||n._animatingZoom||this._zooming)return;var r=n.mouseEventToLayerPoint(e.touches[0]),s=n.mouseEventToLayerPoint(e.touches[1]),o=n._getCenterLayerPoint();this._startCenter=r.add(s)._divideBy(2),this._startDist=r.distanceTo(s),this._moved=!1,this._zooming=!0,this._centerOffset=o.subtract(this._startCenter),n._panAnim&&n._panAnim.stop(),i.DomEvent.on(t,"touchmove",this._onTouchMove,this).on(t,"touchend",this._onTouchEnd,this),i.DomEvent.preventDefault(e)},_onTouchMove:function(e){var t=this._map;if(!e.touches||e.touches.length!==2||!this._zooming)return;var n=t.mouseEventToLayerPoint(e.touches[0]),r=t.mouseEventToLayerPoint(e.touches[1]);this._scale=n.distanceTo(r)/this._startDist,this._delta=n._add(r)._divideBy(2)._subtract(this._startCenter);if(this._scale===1)return;if(!t.options.bounceAtZoomLimits)if(t.getZoom()===t.getMinZoom()&&this._scale<1||t.getZoom()===t.getMaxZoom()&&this._scale>1)return;this._moved||(i.DomUtil.addClass(t._mapPane,"leaflet-touching"),t.fire("movestart").fire("zoomstart"),this._moved=!0),i.Util.cancelAnimFrame(this._animRequest),this._animRequest=i.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),i.DomEvent.preventDefault(e)},_updateOnMove:function(){var e=this._map,t=this._getScaleOrigin(),n=e.layerPointToLatLng(t),r=e.getScaleZoom(this._scale);e._animateZoom(n,r,this._startCenter,this._scale,this._delta)},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}var e=this._map;this._zooming=!1,i.DomUtil.removeClass(e._mapPane,"leaflet-touching"),i.Util.cancelAnimFrame(this._animRequest),i.DomEvent.off(t,"touchmove",this._onTouchMove).off(t,"touchend",this._onTouchEnd);var n=this._getScaleOrigin(),r=e.layerPointToLatLng(n),s=e.getZoom(),o=e.getScaleZoom(this._scale)-s,u=o>0?Math.ceil(o):Math.floor(o),a=e._limitZoom(s+u),f=e.getZoomScale(a)/this._scale;e._animateZoom(r,a,n,f)},_getScaleOrigin:function(){var e=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(e)}}),i.Map.addInitHook("addHandler","touchZoom",i.Map.TouchZoom),i.Map.mergeOptions({tap:!0,tapTolerance:15}),i.Map.Tap=i.Handler.extend({addHooks:function(){i.DomEvent.on(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){i.DomEvent.off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(e){if(!e.touches)return;i.DomEvent.preventDefault(e),this._fireClick=!0;if(e.touches.length>1){this._fireClick=!1,clearTimeout(this._holdTimeout);return}var n=e.touches[0],r=n.target;this._startPos=this._newPos=new i.Point(n.clientX,n.clientY),r.tagName&&r.tagName.toLowerCase()==="a"&&i.DomUtil.addClass(r,"leaflet-active"),this._holdTimeout=setTimeout(i.bind(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",n))},this),1e3),i.DomEvent.on(t,"touchmove",this._onMove,this).on(t,"touchend",this._onUp,this)},_onUp:function(e){clearTimeout(this._holdTimeout),i.DomEvent.off(t,"touchmove",this._onMove,this).off(t,"touchend",this._onUp,this);if(this._fireClick&&e&&e.changedTouches){var n=e.changedTouches[0],r=n.target;r&&r.tagName&&r.tagName.toLowerCase()==="a"&&i.DomUtil.removeClass(r,"leaflet-active"),this._isTapValid()&&this._simulateEvent("click",n)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(e){var t=e.touches[0];this._newPos=new i.Point(t.clientX,t.clientY)},_simulateEvent:function(n,r){var i=t.createEvent("MouseEvents");i._simulated=!0,r.target._simulatedClick=!0,i.initMouseEvent(n,!0,!0,e,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),r.target.dispatchEvent(i)}}),i.Browser.touch&&!i.Browser.pointer&&i.Map.addInitHook("addHandler","tap",i.Map.Tap),i.Map.mergeOptions({boxZoom:!0}),i.Map.BoxZoom=i.Handler.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._moved=!1},addHooks:function(){i.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){i.DomEvent.off(this._container,"mousedown",this._onMouseDown),this._moved=!1},moved:function(){return this._moved},_onMouseDown:function(e){this._moved=!1;if(!e.shiftKey||e.which!==1&&e.button!==1)return!1;i.DomUtil.disableTextSelection(),i.DomUtil.disableImageDrag(),this._startLayerPoint=this._map.mouseEventToLayerPoint(e),i.DomEvent.on(t,"mousemove",this._onMouseMove,this).on(t,"mouseup",this._onMouseUp,this).on(t,"keydown",this._onKeyDown,this)},_onMouseMove:function(e){this._moved||(this._box=i.DomUtil.create("div","leaflet-zoom-box",this._pane),i.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",this._map.fire("boxzoomstart"));var t=this._startLayerPoint,n=this._box,r=this._map.mouseEventToLayerPoint(e),s=r.subtract(t),o=new i.Point(Math.min(r.x,t.x),Math.min(r.y,t.y));i.DomUtil.setPosition(n,o),this._moved=!0,n.style.width=Math.max(0,Math.abs(s.x)-4)+"px",n.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_finish:function(){this._moved&&(this._pane.removeChild(this._box),this._container.style.cursor=""),i.DomUtil.enableTextSelection(),i.DomUtil.enableImageDrag(),i.DomEvent.off(t,"mousemove",this._onMouseMove).off(t,"mouseup",this._onMouseUp).off(t,"keydown",this._onKeyDown)},_onMouseUp:function(e){this._finish();var t=this._map,n=t.mouseEventToLayerPoint(e);if(this._startLayerPoint.equals(n))return;var r=new i.LatLngBounds(t.layerPointToLatLng(this._startLayerPoint),t.layerPointToLatLng(n));t.fitBounds(r),t.fire("boxzoomend",{boxZoomBounds:r})},_onKeyDown:function(e){e.keyCode===27&&this._finish()}}),i.Map.addInitHook("addHandler","boxZoom",i.Map.BoxZoom),i.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),i.Map.Keyboard=i.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,173]},initialize:function(e){this._map=e,this._setPanOffset(e.options.keyboardPanOffset),this._setZoomOffset(e.options.keyboardZoomOffset)},addHooks:function(){var e=this._map._container;e.tabIndex===-1&&(e.tabIndex="0"),i.DomEvent.on(e,"focus",this._onFocus,this).on(e,"blur",this._onBlur,this).on(e,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var e=this._map._container;i.DomEvent.off(e,"focus",this._onFocus,this).off(e,"blur",this._onBlur,this).off(e,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(this._focused)return;var n=t.body,r=t.documentElement,i=n.scrollTop||r.scrollTop,s=n.scrollLeft||r.scrollLeft;this._map._container.focus(),e.scrollTo(s,i)},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(e){var t=this._panKeys={},n=this.keyCodes,r,i;for(r=0,i=n.left.length;r<i;r++)t[n.left[r]]=[-1*e,0];for(r=0,i=n.right.length;r<i;r++)t[n.right[r]]=[e,0];for(r=0,i=n.down.length;r<i;r++)t[n.down[r]]=[0,e];for(r=0,i=n.up.length;r<i;r++)t[n.up[r]]=[0,-1*e]},_setZoomOffset:function(e){var t=this._zoomKeys={},n=this.keyCodes,r,i;for(r=0,i=n.zoomIn.length;r<i;r++)t[n.zoomIn[r]]=e;for(r=0,i=n.zoomOut.length;r<i;r++)t[n.zoomOut[r]]=-e},_addHooks:function(){i.DomEvent.on(t,"keydown",this._onKeyDown,this)},_removeHooks:function(){i.DomEvent.off(t,"keydown",this._onKeyDown,this)},_onKeyDown:function(e){var t=e.keyCode,n=this._map;if(t in this._panKeys){if(n._panAnim&&n._panAnim._inProgress)return;n.panBy(this._panKeys[t]),n.options.maxBounds&&n.panInsideBounds(n.options.maxBounds)}else{if(!(t in this._zoomKeys))return;n.setZoom(n.getZoom()+this._zoomKeys[t])}i.DomEvent.stop(e)}}),i.Map.addInitHook("addHandler","keyboard",i.Map.Keyboard),i.Handler.MarkerDrag=i.Handler.extend({initialize:function(e){this._marker=e},addHooks:function(){var e=this._marker._icon;this._draggable||(this._draggable=new i.Draggable(e,e)),this._draggable.on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this),this._draggable.enable(),i.DomUtil.addClass(this._marker._icon,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off("dragstart",this._onDragStart,this).off("drag",this._onDrag,this).off("dragend",this._onDragEnd,this),this._draggable.disable(),i.DomUtil.removeClass(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var e=this._marker,t=e._shadow,n=i.DomUtil.getPosition(e._icon),r=e._map.layerPointToLatLng(n);t&&i.DomUtil.setPosition(t,n),e._latlng=r,e.fire("move",{latlng:r}).fire("drag")},_onDragEnd:function(e){this._marker.fire("moveend").fire("dragend",e)}}),i.Control=i.Class.extend({options:{position:"topright"},initialize:function(e){i.setOptions(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var t=this._map;return t&&t.removeControl(this),this.options.position=e,t&&t.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this._map=e;var t=this._container=this.onAdd(e),n=this.getPosition(),r=e._controlCorners[n];return i.DomUtil.addClass(t,"leaflet-control"),n.indexOf("bottom")!==-1?r.insertBefore(t,r.firstChild):r.appendChild(t),this},removeFrom:function(e){var t=this.getPosition(),n=e._controlCorners[t];return n.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(e),this},_refocusOnMap:function(){this._map&&this._map.getContainer().focus()}}),i.control=function(e){return new i.Control(e)},i.Map.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.removeFrom(this),this},_initControlPos:function(){function r(r,s){var o=t+r+" "+t+s;e[r+s]=i.DomUtil.create("div",o,n)}var e=this._controlCorners={},t="leaflet-",n=this._controlContainer=i.DomUtil.create("div",t+"control-container",this._container);r("top","left"),r("top","right"),r("bottom","left"),r("bottom","right")},_clearControlPos:function(){this._container.removeChild(this._controlContainer)}}),i.Control.Zoom=i.Control.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"-",zoomOutTitle:"Zoom out"},onAdd:function(e){var t="leaflet-control-zoom",n=i.DomUtil.create("div",t+" leaflet-bar");return this._map=e,this._zoomInButton=this._createButton(this.options.zoomInText,this.options.zoomInTitle,t+"-in",n,this._zoomIn,this),this._zoomOutButton=this._createButton(this.options.zoomOutText,this.options.zoomOutTitle,t+"-out",n,this._zoomOut,this),this._updateDisabled(),e.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(e){e.off("zoomend zoomlevelschange",this._updateDisabled,this)},_zoomIn:function(e){this._map.zoomIn(e.shiftKey?3:1)},_zoomOut:function(e){this._map.zoomOut(e.shiftKey?3:1)},_createButton:function(e,t,n,r,s,o){var u=i.DomUtil.create("a",n,r);u.innerHTML=e,u.href="#",u.title=t;var a=i.DomEvent.stopPropagation;return i.DomEvent.on(u,"click",a).on(u,"mousedown",a).on(u,"dblclick",a).on(u,"click",i.DomEvent.preventDefault).on(u,"click",s,o).on(u,"click",this._refocusOnMap,o),u},_updateDisabled:function(){var e=this._map,t="leaflet-disabled";i.DomUtil.removeClass(this._zoomInButton,t),i.DomUtil.removeClass(this._zoomOutButton,t),e._zoom===e.getMinZoom()&&i.DomUtil.addClass(this._zoomOutButton,t),e._zoom===e.getMaxZoom()&&i.DomUtil.addClass(this._zoomInButton,t)}}),i.Map.mergeOptions({zoomControl:!0}),i.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new i.Control.Zoom,this.addControl(this.zoomControl))}),i.control.zoom=function(e){return new i.Control.Zoom(e)},i.Control.Attribution=i.Control.extend({options:{position:"bottomright",prefix:'<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(e){i.setOptions(this,e),this._attributions={}},onAdd:function(e){this._container=i.DomUtil.create("div","leaflet-control-attribution"),i.DomEvent.disableClickPropagation(this._container);for(var t in e._layers)e._layers[t].getAttribution&&this.addAttribution(e._layers[t].getAttribution());return e.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(e){e.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){if(!e)return;return this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this},removeAttribution:function(e){if(!e)return;return this._attributions[e]&&(this._attributions[e]--,this._update()),this},_update:function(){if(!this._map)return;var e=[];for(var t in this._attributions)this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(", ")),this._container.innerHTML=n.join(" | ")},_onLayerAdd:function(e){e.layer.getAttribution&&this.addAttribution(e.layer.getAttribution())},_onLayerRemove:function(e){e.layer.getAttribution&&this.removeAttribution(e.layer.getAttribution())}}),i.Map.mergeOptions({attributionControl:!0}),i.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new i.Control.Attribution).addTo(this))}),i.control.attribution=function(e){return new i.Control.Attribution(e)},i.Control.Scale=i.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(e){this._map=e;var t="leaflet-control-scale",n=i.DomUtil.create("div",t),r=this.options;return this._addScales(r,t,n),e.on(r.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),n},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,t,n){e.metric&&(this._mScale=i.DomUtil.create("div",t+"-line",n)),e.imperial&&(this._iScale=i.DomUtil.create("div",t+"-line",n))},_update:function(){var e=this._map.getBounds(),t=e.getCenter().lat,n=6378137*Math.PI*Math.cos(t*Math.PI/180),r=n*(e.getNorthEast().lng-e.getSouthWest().lng)/180,i=this._map.getSize(),s=this.options,o=0;i.x>0&&(o=r*(s.maxWidth/i.x)),this._updateScales(s,o)},_updateScales:function(e,t){e.metric&&t&&this._updateMetric(t),e.imperial&&t&&this._updateImperial(t)},_updateMetric:function(e){var t=this._getRoundNum(e);this._mScale.style.width=this._getScaleWidth(t/e)+"px",this._mScale.innerHTML=t<1e3?t+" m":t/1e3+" km"},_updateImperial:function(e){var t=e*3.2808399,n=this._iScale,r,i,s;t>5280?(r=t/5280,i=this._getRoundNum(r),n.style.width=this._getScaleWidth(i/r)+"px",n.innerHTML=i+" mi"):(s=this._getRoundNum(t),n.style.width=this._getScaleWidth(s/t)+"px",n.innerHTML=s+" ft")},_getScaleWidth:function(e){return Math.round(this.options.maxWidth*e)-10},_getRoundNum:function(e){var t=Math.pow(10,(Math.floor(e)+"").length-1),n=e/t;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1,t*n}}),i.control.scale=function(e){return new i.Control.Scale(e)},i.Control.Layers=i.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(e,t,n){i.setOptions(this,n),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var r in e)this._addLayer(e[r],r);for(r in t)this._addLayer(t[r],r,!0)},onAdd:function(e){return this._initLayout(),this._update(),e.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(e){e.off("layeradd",this._onLayerChange).off("layerremove",this._onLayerChange)},addBaseLayer:function(e,t){return this._addLayer(e,t),this._update(),this},addOverlay:function(e,t){return this._addLayer(e,t,!0),this._update(),this},removeLayer:function(e){var t=i.stamp(e);return delete this._layers[t],this._update(),this},_initLayout:function(){var e="leaflet-control-layers",t=this._container=i.DomUtil.create("div",e);t.setAttribute("aria-haspopup",!0),i.Browser.touch?i.DomEvent.on(t,"click",i.DomEvent.stopPropagation):i.DomEvent.disableClickPropagation(t).disableScrollPropagation(t);var n=this._form=i.DomUtil.create("form",e+"-list");if(this.options.collapsed){i.Browser.android||i.DomEvent.on(t,"mouseover",this._expand,this).on(t,"mouseout",this._collapse,this);var r=this._layersLink=i.DomUtil.create("a",e+"-toggle",t);r.href="#",r.title="Layers",i.Browser.touch?i.DomEvent.on(r,"click",i.DomEvent.stop).on(r,"click",this._expand,this):i.DomEvent.on(r,"focus",this._expand,this),i.DomEvent.on(n,"click",function(){setTimeout(i.bind(this._onInputClick,this),0)},this),this._map.on("click",this._collapse,this)}else this._expand();this._baseLayersList=i.DomUtil.create("div",e+"-base",n),this._separator=i.DomUtil.create("div",e+"-separator",n),this._overlaysList=i.DomUtil.create("div",e+"-overlays",n),t.appendChild(n)},_addLayer:function(e,t,n){var r=i.stamp(e);this._layers[r]={layer:e,name:t,overlay:n},this.options.autoZIndex&&e.setZIndex&&(this._lastZIndex++,e.setZIndex(this._lastZIndex))},_update:function(){if(!this._container)return;this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var e=!1,t=!1,n,r;for(n in this._layers)r=this._layers[n],this._addItem(r),t=t||r.overlay,e=e||!r.overlay;this._separator.style.display=t&&e?"":"none"},_onLayerChange:function(e){var t=this._layers[i.stamp(e.layer)];if(!t)return;this._handlingClick||this._update();var n=t.overlay?e.type==="layeradd"?"overlayadd":"overlayremove":e.type==="layeradd"?"baselayerchange":null;n&&this._map.fire(n,t)},_createRadioElement:function(e,n){var r='<input type="radio" class="leaflet-control-layers-selector" name="'+e+'"';n&&(r+=' checked="checked"'),r+="/>";var i=t.createElement("div");return i.innerHTML=r,i.firstChild},_addItem:function(e){var n=t.createElement("label"),r,s=this._map.hasLayer(e.layer);e.overlay?(r=t.createElement("input"),r.type="checkbox",r.className="leaflet-control-layers-selector",r.defaultChecked=s):r=this._createRadioElement("leaflet-base-layers",s),r.layerId=i.stamp(e.layer),i.DomEvent.on(r,"click",this._onInputClick,this);var o=t.createElement("span");o.innerHTML=" "+e.name,n.appendChild(r),n.appendChild(o);var u=e.overlay?this._overlaysList:this._baseLayersList;return u.appendChild(n),n},_onInputClick:function(){var e,t,n,r=this._form.getElementsByTagName("input"),i=r.length;this._handlingClick=!0;for(e=0;e<i;e++)t=r[e],n=this._layers[t.layerId],t.checked&&!this._map.hasLayer(n.layer)?this._map.addLayer(n.layer):!t.checked&&this._map.hasLayer(n.layer)&&this._map.removeLayer(n.layer);this._handlingClick=!1,this._refocusOnMap()},_expand:function(){i.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),i.control.layers=function(e,t,n){return new i.Control.Layers(e,t,n)},i.PosAnimation=i.Class.extend({includes:i.Mixin.Events,run:function(e,t,n,r){this.stop(),this._el=e,this._inProgress=!0,this._newPos=t,this.fire("start"),e.style[i.DomUtil.TRANSITION]="all "+(n||.25)+"s cubic-bezier(0,0,"+(r||.5)+",1)",i.DomEvent.on(e,i.DomUtil.TRANSITION_END,this._onTransitionEnd,this),i.DomUtil.setPosition(e,t),i.Util.falseFn(e.offsetWidth),this._stepTimer=setInterval(i.bind(this._onStep,this),50)},stop:function(){if(!this._inProgress)return;i.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),i.Util.falseFn(this._el.offsetWidth)},_onStep:function(){var e=this._getPos();if(!e){this._onTransitionEnd();return}this._el._leaflet_pos=e,this.fire("step")},_transformRe:/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,_getPos:function(){var t,n,r,s=this._el,o=e.getComputedStyle(s);if(i.Browser.any3d){r=o[i.DomUtil.TRANSFORM].match(this._transformRe);if(!r)return;t=parseFloat(r[1]),n=parseFloat(r[2])}else t=parseFloat(o.left),n=parseFloat(o.top);return new i.Point(t,n,!0)},_onTransitionEnd:function(){i.DomEvent.off(this._el,i.DomUtil.TRANSITION_END,this._onTransitionEnd,this);if(!this._inProgress)return;this._inProgress=!1,this._el.style[i.DomUtil.TRANSITION]="",this._el._leaflet_pos=this._newPos,clearInterval(this._stepTimer),this.fire("step").fire("end")}}),i.Map.include({setView:function(e,t,r){t=t===n?this._zoom:this._limitZoom(t),e=this._limitCenter(i.latLng(e),t,this.options.maxBounds),r=r||{},this._panAnim&&this._panAnim.stop();if(this._loaded&&!r.reset&&r!==!0){r.animate!==n&&(r.zoom=i.extend({animate:r.animate},r.zoom),r.pan=i.extend({animate:r.animate},r.pan));var s=this._zoom!==t?this._tryAnimatedZoom&&this._tryAnimatedZoom(e,t,r.zoom):this._tryAnimatedPan(e,r.pan);if(s)return clearTimeout(this._sizeTimer),this}return this._resetView(e,t),this},panBy:function(e,t){e=i.point(e).round(),t=t||{};if(!e.x&&!e.y)return this;this._panAnim||(this._panAnim=new i.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),t.noMoveStart||this.fire("movestart");if(t.animate!==!1){i.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var n=this._getMapPanePos().subtract(e);this._panAnim.run(this._mapPane,n,t.duration||.25,t.easeLinearity)}else this._rawPanBy(e),this.fire("move").fire("moveend");return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){i.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,t){var n=this._getCenterOffset(e)._floor();return(t&&t.animate)!==!0&&!this.getSize().contains(n)?!1:(this.panBy(n,t),!0)}}),i.PosAnimation=i.DomUtil.TRANSITION?i.PosAnimation:i.PosAnimation.extend({run:function(e,t,n,r){this.stop(),this._el=e,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(r||.5,.2),this._startPos=i.DomUtil.getPosition(e),this._offset=t.subtract(this._startPos),this._startTime=+(new Date),this.fire("start"),this._animate()},stop:function(){if(!this._inProgress)return;this._step(),this._complete()},_animate:function(){this._animId=i.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var e=+(new Date)-this._startTime,t=this._duration*1e3;e<t?this._runFrame(this._easeOut(e/t)):(this._runFrame(1),this._complete())},_runFrame:function(e){var t=this._startPos.add(this._offset.multiplyBy(e));i.DomUtil.setPosition(this._el,t),this.fire("step")},_complete:function(){i.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(e){return 1-Math.pow(1-e,this._easeOutPower)}}),i.Map.mergeOptions({zoomAnimation:!0,zoomAnimationThreshold:4}),i.DomUtil.TRANSITION&&i.Map.addInitHook(function(){this._zoomAnimated=this.options.zoomAnimation&&i.DomUtil.TRANSITION&&i.Browser.any3d&&!i.Browser.android23&&!i.Browser.mobileOpera,this._zoomAnimated&&i.DomEvent.on(this._mapPane,i.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),i.Map.include(i.DomUtil.TRANSITION?{_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(e,t,n){if(this._animatingZoom)return!0;n=n||{};if(!this._zoomAnimated||n.animate===!1||this._nothingToAnimate()||Math.abs(t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(t),i=this._getCenterOffset(e)._divideBy(1-1/r),s=this._getCenterLayerPoint()._add(i);return n.animate!==!0&&!this.getSize().contains(i)?!1:(this.fire("movestart").fire("zoomstart"),this._animateZoom(e,t,s,r,null,!0),!0)},_animateZoom:function(e,t,n,r,s,o){this._animatingZoom=!0,i.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this._animateToCenter=e,this._animateToZoom=t,i.Draggable&&(i.Draggable._disabled=!0),this.fire("zoomanim",{center:e,zoom:t,origin:n,scale:r,delta:s,backwards:o})},_onZoomTransitionEnd:function(){this._animatingZoom=!1,i.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),i.Draggable&&(i.Draggable._disabled=!1)}}:{}),i.TileLayer.include({_animateZoom:function(e){this._animating||(this._animating=!0,this._prepareBgBuffer());var t=this._bgBuffer,n=i.DomUtil.TRANSFORM,r=e.delta?i.DomUtil.getTranslateString(e.delta):t.style[n],s=i.DomUtil.getScaleString(e.scale,e.origin);t.style[n]=e.backwards?s+" "+r:r+" "+s},_endZoomAnim:function(){var e=this._tileContainer,t=this._bgBuffer;e.style.visibility="",e.parentNode.appendChild(e),i.Util.falseFn(t.offsetWidth),this._animating=!1},_clearBgBuffer:function(){var e=this._map;e&&!e._animatingZoom&&!e.touchZoom._zooming&&(this._bgBuffer.innerHTML="",this._bgBuffer.style[i.DomUtil.TRANSFORM]="")},_prepareBgBuffer:function(){var e=this._tileContainer,t=this._bgBuffer,n=this._getLoadedTilesPercentage(t),r=this._getLoadedTilesPercentage(e);if(t&&n>.5&&r<.5){e.style.visibility="hidden",this._stopLoadingImages(e);return}t.style.visibility="hidden",t.style[i.DomUtil.TRANSFORM]="",this._tileContainer=t,t=this._bgBuffer=e,this._stopLoadingImages(t),clearTimeout(this._clearBgBufferTimer)},_getLoadedTilesPercentage:function(e){var t=e.getElementsByTagName("img"),n,r,i=0;for(n=0,r=t.length;n<r;n++)t[n].complete&&i++;return i/r},_stopLoadingImages:function(e){var t=Array.prototype.slice.call(e.getElementsByTagName("img")),n,r,s;for(n=0,r=t.length;n<r;n++)s=t[n],s.complete||(s.onload=i.Util.falseFn,s.onerror=i.Util.falseFn,s.src=i.Util.emptyImageUrl,s.parentNode.removeChild(s))}}),i.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:Infinity,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(e){e=this._locateOptions=i.extend(this._defaultLocateOptions,e);if(!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var t=i.bind(this._handleGeolocationResponse,this),n=i.bind(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(t,n,e):navigator.geolocation.getCurrentPosition(t,n,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){var t=e.code,n=e.message||(t===1?"permission denied":t===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:t,message:"Geolocation error: "+n+"."})},_handleGeolocationResponse:function(e){var t=e.coords.latitude,n=e.coords.longitude,r=new i.LatLng(t,n),s=180*e.coords.accuracy/40075017,o=s/Math.cos(i.LatLng.DEG_TO_RAD*t),u=i.latLngBounds([t-s,n-o],[t+s,n+o]),a=this._locateOptions;if(a.setView){var f=Math.min(this.getBoundsZoom(u),a.maxZoom);this.setView(r,f)}var l={latlng:r,bounds:u,timestamp:e.timestamp};for(var c in e.coords)typeof e.coords[c]=="number"&&(l[c]=e.coords[c]);this.fire("locationfound",l)}})})(window,document);