/* leaflet, a javascript library for mobile-friendly interactive maps. http://leafletjs.com (c) 2010-2013, vladimir agafonkin, cloudmade */ (function(t,e,i){var n,o;typeof exports!=i+""?n=exports:(o=t.l,n={},n.noconflict=function(){return t.l=o,this},t.l=n),n.version="0.5.1",n.util={extend:function(t){var e,i,n,o,s=array.prototype.slice.call(arguments,1);for(i=0,n=s.length;n>i;i++){o=s[i]||{};for(e in o)o.hasownproperty(e)&&(t[e]=o[e])}return t},bind:function(t,e){var i=arguments.length>2?array.prototype.slice.call(arguments,2):null;return function(){return t.apply(e,i||arguments)}},stamp:function(){var t=0,e="_leaflet_id";return function(i){return i[e]=i[e]||++t,i[e]}}(),limitexecbyinterval:function(t,e,n){var o,s;return function a(){var r=arguments;return o?(s=!0,i):(o=!0,settimeout(function(){o=!1,s&&(a.apply(n,r),s=!1)},e),t.apply(n,r),i)}},falsefn:function(){return!1},formatnum:function(t,e){var i=math.pow(10,e||5);return math.round(t*i)/i},splitwords:function(t){return t.replace(/^\s+|\s+$/g,"").split(/\s+/)},setoptions:function(t,e){return t.options=n.extend({},t.options,e),t.options},getparamstring:function(t,e){var i=[];for(var n in t)t.hasownproperty(n)&&i.push(n+"="+t[n]);return(e&&-1!==e.indexof("?")?"&":"?")+i.join("&")},template:function(t,e){return t.replace(/\{ *([\w_]+) *\}/g,function(t,i){var n=e[i];if(!e.hasownproperty(i))throw error("no value provided for variable "+t);return n})},isarray:function(t){return"[object array]"===object.prototype.tostring.call(t)},emptyimageurl:"data:image/gif;base64,r0lgodlhaqabaad/acwaaaaaaqabaaacads="},function(){function e(e){var i,n,o=["webkit","moz","o","ms"];for(i=0;o.length>i&&!n;i++)n=t[o[i]+e];return n}function o(e){var i=+new date,n=math.max(0,16-(i-s));return s=i+n,t.settimeout(e,n)}var s=0,a=t.requestanimationframe||e("requestanimationframe")||o,r=t.cancelanimationframe||e("cancelanimationframe")||e("cancelrequestanimationframe")||function(e){t.cleartimeout(e)};n.util.requestanimframe=function(e,s,r,h){return e=n.bind(e,s),r&&a===o?(e(),i):a.call(t,e,h)},n.util.cancelanimframe=function(e){e&&r.call(t,e)}}(),n.extend=n.util.extend,n.bind=n.util.bind,n.stamp=n.util.stamp,n.setoptions=n.util.setoptions,n.class=function(){},n.class.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this._inithooks&&this.callinithooks()},i=function(){};i.prototype=this.prototype;var o=new i;o.constructor=e,e.prototype=o;for(var s in this)this.hasownproperty(s)&&"prototype"!==s&&(e[s]=this[s]);t.statics&&(n.extend(e,t.statics),delete t.statics),t.includes&&(n.util.extend.apply(null,[o].concat(t.includes)),delete t.includes),t.options&&o.options&&(t.options=n.extend({},o.options,t.options)),n.extend(o,t),o._inithooks=[];var a=this;return o.callinithooks=function(){if(!this._inithookscalled){a.prototype.callinithooks&&a.prototype.callinithooks.call(this),this._inithookscalled=!0;for(var t=0,e=o._inithooks.length;e>t;t++)o._inithooks[t].call(this)}},e},n.class.include=function(t){n.extend(this.prototype,t)},n.class.mergeoptions=function(t){n.extend(this.prototype.options,t)},n.class.addinithook=function(t){var e=array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};this.prototype._inithooks=this.prototype._inithooks||[],this.prototype._inithooks.push(i)};var s="_leaflet_events";n.mixin={},n.mixin.events={addeventlistener:function(t,e,i){var o,a,r,h=this[s]=this[s]||{};if("object"==typeof t){for(o in t)t.hasownproperty(o)&&this.addeventlistener(o,t[o],e);return this}for(t=n.util.splitwords(t),a=0,r=t.length;r>a;a++)h[t[a]]=h[t[a]]||[],h[t[a]].push({action:e,context:i||this});return this},haseventlisteners:function(t){return s in this&&t in this[s]&&this[s][t].length>0},removeeventlistener:function(t,e,i){var o,a,r,h,l,u=this[s];if("object"==typeof t){for(o in t)t.hasownproperty(o)&&this.removeeventlistener(o,t[o],e);return this}for(t=n.util.splitwords(t),a=0,r=t.length;r>a;a++)if(this.haseventlisteners(t[a]))for(h=u[t[a]],l=h.length-1;l>=0;l--)e&&h[l].action!==e||i&&h[l].context!==i||h.splice(l,1);return this},fireevent:function(t,e){if(!this.haseventlisteners(t))return this;for(var i=n.extend({type:t,target:this},e),o=this[s][t].slice(),a=0,r=o.length;r>a;a++)o[a].action.call(o[a].context||this,i);return this}},n.mixin.events.on=n.mixin.events.addeventlistener,n.mixin.events.off=n.mixin.events.removeeventlistener,n.mixin.events.fire=n.mixin.events.fireevent,function(){var o=!!t.activexobject,s=o&&!t.xmlhttprequest,a=o&&!e.queryselector,r=navigator.useragent.tolowercase(),h=-1!==r.indexof("webkit"),l=-1!==r.indexof("chrome"),u=-1!==r.indexof("android"),c=-1!==r.search("android [23]"),_=typeof orientation!=i+"",d=t.navigator&&t.navigator.mspointerenabled&&t.navigator.msmaxtouchpoints,p="devicepixelratio"in t&&t.devicepixelratio>1||"matchmedia"in t&&t.matchmedia("(min-resolution:144dpi)")&&t.matchmedia("(min-resolution:144dpi)").matches,m=e.documentelement,f=o&&"transition"in m.style,g="webkitcssmatrix"in t&&"m11"in new t.webkitcssmatrix,v="mozperspective"in m.style,y="otransition"in m.style,l=!t.l_disable_3d&&(f||g||v||y),p=!t.l_no_touch&&function(){var t="ontouchstart";if(d||t in m)return!0;var i=e.createelement("div"),n=!1;return i.setattribute?(i.setattribute(t,"return;"),"function"==typeof i[t]&&(n=!0),i.removeattribute(t),i=null,n):!1}();n.browser={ie:o,ie6:s,ie7:a,webkit:h,android:u,android23:c,chrome:l,ie3d:f,webkit3d:g,gecko3d:v,opera3d:y,any3d:l,mobile:_,mobilewebkit:_&&h,mobilewebkit3d:_&&g,mobileopera:_&&t.opera,touch:p,mstouch:d,retina:p}}(),n.point=function(t,e,i){this.x=i?math.round(t):t,this.y=i?math.round(e):e},n.point.prototype={clone:function(){return new n.point(this.x,this.y)},add:function(t){return this.clone()._add(n.point(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(n.point(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideby:function(t){return this.clone()._divideby(t)},_divideby:function(t){return this.x/=t,this.y/=t,this},multiplyby:function(t){return this.clone()._multiplyby(t)},_multiplyby:function(t){return this.x*=t,this.y*=t,this},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(t){t=n.point(t);var e=t.x-this.x,i=t.y-this.y;return math.sqrt(e*e+i*i)},equals:function(t){return t.x===this.x&&t.y===this.y},tostring:function(){return"point("+n.util.formatnum(this.x)+", "+n.util.formatnum(this.y)+")"}},n.point=function(t,e,i){return t instanceof n.point?t:n.util.isarray(t)?new n.point(t[0],t[1]):isnan(t)?t:new n.point(t,e,i)},n.bounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},n.bounds.prototype={extend:function(t){return t=n.point(t),this.min||this.max?(this.min.x=math.min(t.x,this.min.x),this.max.x=math.max(t.x,this.max.x),this.min.y=math.min(t.y,this.min.y),this.max.y=math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getcenter:function(t){return new n.point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getbottomleft:function(){return new n.point(this.min.x,this.max.y)},gettopright:function(){return new n.point(this.max.x,this.min.y)},getsize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return t="number"==typeof t[0]||t instanceof n.point?n.point(t):n.bounds(t),t instanceof n.bounds?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=n.bounds(t);var e=this.min,i=this.max,o=t.min,s=t.max,a=s.x>=e.x&&o.x<=i.x,r=s.y>=e.y&&o.y<=i.y;return a&&r},isvalid:function(){return!(!this.min||!this.max)}},n.bounds=function(t,e){return!t||t instanceof n.bounds?t:new n.bounds(t,e)},n.transformation=function(t,e,i,n){this._a=t,this._b=e,this._c=i,this._d=n},n.transformation.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new n.point((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}},n.domutil={get:function(t){return"string"==typeof t?e.getelementbyid(t):t},getstyle:function(t,i){var n=t.style[i];if(!n&&t.currentstyle&&(n=t.currentstyle[i]),(!n||"auto"===n)&&e.defaultview){var o=e.defaultview.getcomputedstyle(t,null);n=o?o[i]:null}return"auto"===n?null:n},getviewportoffset:function(t){var i,o=0,s=0,a=t,r=e.body,h=n.browser.ie7;do{if(o+=a.offsettop||0,s+=a.offsetleft||0,o+=parseint(n.domutil.getstyle(a,"bordertopwidth"),10)||0,s+=parseint(n.domutil.getstyle(a,"borderleftwidth"),10)||0,i=n.domutil.getstyle(a,"position"),a.offsetparent===r&&"absolute"===i)break;if("fixed"===i){o+=r.scrolltop||0,s+=r.scrollleft||0;break}a=a.offsetparent}while(a);a=t;do{if(a===r)break;o-=a.scrolltop||0,s-=a.scrollleft||0,n.domutil.documentisltr()||!n.browser.webkit&&!h||(s+=a.scrollwidth-a.clientwidth,h&&"hidden"!==n.domutil.getstyle(a,"overflow-y")&&"hidden"!==n.domutil.getstyle(a,"overflow")&&(s+=17)),a=a.parentnode}while(a);return new n.point(s,o)},documentisltr:function(){return n.domutil._docisltrcached||(n.domutil._docisltrcached=!0,n.domutil._docisltr="ltr"===n.domutil.getstyle(e.body,"direction")),n.domutil._docisltr},create:function(t,i,n){var o=e.createelement(t);return o.classname=i,n&&n.appendchild(o),o},disabletextselection:function(){e.selection&&e.selection.empty&&e.selection.empty(),this._onselectstart||(this._onselectstart=e.onselectstart||null,e.onselectstart=n.util.falsefn)},enabletextselection:function(){e.onselectstart===n.util.falsefn&&(e.onselectstart=this._onselectstart,this._onselectstart=null)},hasclass:function(t,e){return t.classname.length>0&®exp("(^|\\s)"+e+"(\\s|$)").test(t.classname)},addclass:function(t,e){n.domutil.hasclass(t,e)||(t.classname+=(t.classname?" ":"")+e)},removeclass:function(t,e){function i(t,i){return i===e?"":t}t.classname=t.classname.replace(/(\s+)\s*/g,i).replace(/(^\s+|\s+$)/,"")},setopacity:function(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="dximagetransform.microsoft.alpha";try{i=t.filters.item(n)}catch(o){}e=math.round(100*e),i?(i.enabled=100!==e,i.opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}},testprop:function(t){for(var i=e.documentelement.style,n=0;t.length>n;n++)if(t[n]in i)return t[n];return!1},gettranslatestring:function(t){var e=n.browser.webkit3d,i="translate"+(e?"3d":"")+"(",o=(e?",0":"")+")";return i+t.x+"px,"+t.y+"px"+o},getscalestring:function(t,e){var i=n.domutil.gettranslatestring(e.add(e.multiplyby(-1*t))),o=" scale("+t+") ";return i+o},setposition:function(t,e,i){t._leaflet_pos=e,!i&&n.browser.any3d?(t.style[n.domutil.transform]=n.domutil.gettranslatestring(e),n.browser.mobilewebkit3d&&(t.style.webkitbackfacevisibility="hidden")):(t.style.left=e.x+"px",t.style.top=e.y+"px")},getposition:function(t){return t._leaflet_pos}},n.domutil.transform=n.domutil.testprop(["transform","webkittransform","otransform","moztransform","mstransform"]),n.domutil.transition=n.domutil.testprop(["webkittransition","transition","otransition","moztransition","mstransition"]),n.domutil.transition_end="webkittransition"===n.domutil.transition||"otransition"===n.domutil.transition?n.domutil.transition+"end":"transitionend",n.latlng=function(t,e){var i=parsefloat(t),n=parsefloat(e);if(isnan(i)||isnan(n))throw error("invalid latlng object: ("+t+", "+e+")");this.lat=i,this.lng=n},n.extend(n.latlng,{deg_to_rad:math.pi/180,rad_to_deg:180/math.pi,max_margin:1e-9}),n.latlng.prototype={equals:function(t){if(!t)return!1;t=n.latlng(t);var e=math.max(math.abs(this.lat-t.lat),math.abs(this.lng-t.lng));return n.latlng.max_margin>=e},tostring:function(t){return"latlng("+n.util.formatnum(this.lat,t)+", "+n.util.formatnum(this.lng,t)+")"},distanceto:function(t){t=n.latlng(t);var e=6378137,i=n.latlng.deg_to_rad,o=(t.lat-this.lat)*i,s=(t.lng-this.lng)*i,a=this.lat*i,r=t.lat*i,h=math.sin(o/2),l=math.sin(s/2),u=h*h+l*l*math.cos(a)*math.cos(r);return 2*e*math.atan2(math.sqrt(u),math.sqrt(1-u))},wrap:function(t,e){var i=this.lng;return t=t||-180,e=e||180,i=(i+e)%(e-t)+(t>i||i===e?e:t),new n.latlng(this.lat,i)}},n.latlng=function(t,e){return t instanceof n.latlng?t:n.util.isarray(t)?new n.latlng(t[0],t[1]):isnan(t)?t:new n.latlng(t,e)},n.latlngbounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},n.latlngbounds.prototype={extend:function(t){return t="number"==typeof t[0]||"string"==typeof t[0]||t instanceof n.latlng?n.latlng(t):n.latlngbounds(t),t instanceof n.latlng?this._southwest||this._northeast?(this._southwest.lat=math.min(t.lat,this._southwest.lat),this._southwest.lng=math.min(t.lng,this._southwest.lng),this._northeast.lat=math.max(t.lat,this._northeast.lat),this._northeast.lng=math.max(t.lng,this._northeast.lng)):(this._southwest=new n.latlng(t.lat,t.lng),this._northeast=new n.latlng(t.lat,t.lng)):t instanceof n.latlngbounds&&(this.extend(t._southwest),this.extend(t._northeast)),this},pad:function(t){var e=this._southwest,i=this._northeast,o=math.abs(e.lat-i.lat)*t,s=math.abs(e.lng-i.lng)*t;return new n.latlngbounds(new n.latlng(e.lat-o,e.lng-s),new n.latlng(i.lat+o,i.lng+s))},getcenter:function(){return new n.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 n.latlng(this._northeast.lat,this._southwest.lng)},getsoutheast:function(){return new n.latlng(this._southwest.lat,this._northeast.lng)},contains:function(t){t="number"==typeof t[0]||t instanceof n.latlng?n.latlng(t):n.latlngbounds(t);var e,i,o=this._southwest,s=this._northeast;return t instanceof n.latlngbounds?(e=t.getsouthwest(),i=t.getnortheast()):e=i=t,e.lat>=o.lat&&i.lat<=s.lat&&e.lng>=o.lng&&i.lng<=s.lng},intersects:function(t){t=n.latlngbounds(t);var e=this._southwest,i=this._northeast,o=t.getsouthwest(),s=t.getnortheast(),a=s.lat>=e.lat&&o.lat<=i.lat,r=s.lng>=e.lng&&o.lng<=i.lng;return a&&r},tobboxstring:function(){var t=this._southwest,e=this._northeast;return[t.lng,t.lat,e.lng,e.lat].join(",")},equals:function(t){return t?(t=n.latlngbounds(t),this._southwest.equals(t.getsouthwest())&&this._northeast.equals(t.getnortheast())):!1},isvalid:function(){return!(!this._southwest||!this._northeast)}},n.latlngbounds=function(t,e){return!t||t instanceof n.latlngbounds?t:new n.latlngbounds(t,e)},n.projection={},n.projection.sphericalmercator={max_latitude:85.0511287798,project:function(t){var e=n.latlng.deg_to_rad,i=this.max_latitude,o=math.max(math.min(i,t.lat),-i),s=t.lng*e,a=o*e;return a=math.log(math.tan(math.pi/4+a/2)),new n.point(s,a)},unproject:function(t){var e=n.latlng.rad_to_deg,i=t.x*e,o=(2*math.atan(math.exp(t.y))-math.pi/2)*e;return new n.latlng(o,i)}},n.projection.lonlat={project:function(t){return new n.point(t.lng,t.lat)},unproject:function(t){return new n.latlng(t.y,t.x)}},n.crs={latlngtopoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointtolatlng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},scale:function(t){return 256*math.pow(2,t)}},n.crs.simple=n.extend({},n.crs,{projection:n.projection.lonlat,transformation:new n.transformation(1,0,-1,0),scale:function(t){return math.pow(2,t)}}),n.crs.epsg3857=n.extend({},n.crs,{code:"epsg:3857",projection:n.projection.sphericalmercator,transformation:new n.transformation(.5/math.pi,.5,-.5/math.pi,.5),project:function(t){var e=this.projection.project(t),i=6378137;return e.multiplyby(i)}}),n.crs.epsg900913=n.extend({},n.crs.epsg3857,{code:"epsg:900913"}),n.crs.epsg4326=n.extend({},n.crs,{code:"epsg:4326",projection:n.projection.lonlat,transformation:new n.transformation(1/360,.5,-1/360,.5)}),n.map=n.class.extend({includes:n.mixin.events,options:{crs:n.crs.epsg3857,fadeanimation:n.domutil.transition&&!n.browser.android23,trackresize:!0,markerzoomanimation:n.domutil.transition&&n.browser.any3d},initialize:function(t,e){e=n.setoptions(this,e),this._initcontainer(t),this._initlayout(),this.callinithooks(),this._initevents(),e.maxbounds&&this.setmaxbounds(e.maxbounds),e.center&&e.zoom!==i&&this.setview(n.latlng(e.center),e.zoom,!0),this._initlayers(e.layers)},setview:function(t,e){return this._resetview(n.latlng(t),this._limitzoom(e)),this},setzoom:function(t){return this.setview(this.getcenter(),t)},zoomin:function(t){return this.setzoom(this._zoom+(t||1))},zoomout:function(t){return this.setzoom(this._zoom-(t||1))},fitbounds:function(t){var e=this.getboundszoom(t);return this.setview(n.latlngbounds(t).getcenter(),e)},fitworld:function(){var t=new n.latlng(-60,-170),e=new n.latlng(85,179);return this.fitbounds(new n.latlngbounds(t,e))},panto:function(t){return this.setview(t,this._zoom)},panby:function(t){return this.fire("movestart"),this._rawpanby(n.point(t)),this.fire("move"),this.fire("moveend")},setmaxbounds:function(t){if(t=n.latlngbounds(t),this.options.maxbounds=t,!t)return this._boundsminzoom=null,this;var e=this.getboundszoom(t,!0);return this._boundsminzoom=e,this._loaded&&(e>this._zoom?this.setview(t.getcenter(),e):this.paninsidebounds(t)),this},paninsidebounds:function(t){t=n.latlngbounds(t);var e=this.getbounds(),i=this.project(e.getsouthwest()),o=this.project(e.getnortheast()),s=this.project(t.getsouthwest()),a=this.project(t.getnortheast()),r=0,h=0;return o.ya.x&&(r=a.x-o.x),i.y>s.y&&(h=s.y-i.y),i.x=r);return c&&e?null:e?r:r-1},getsize:function(){return(!this._size||this._sizechanged)&&(this._size=new n.point(this._container.clientwidth,this._container.clientheight),this._sizechanged=!1),this._size.clone()},getpixelbounds:function(){var t=this._gettopleftpoint();return new n.bounds(t,t.add(this.getsize()))},getpixelorigin:function(){return this._initialtopleftpoint},getpanes:function(){return this._panes},getcontainer:function(){return this._container},getzoomscale:function(t){var e=this.options.crs;return e.scale(t)/e.scale(this._zoom)},getscalezoom:function(t){return this._zoom+math.log(t)/math.ln2},project:function(t,e){return e=e===i?this._zoom:e,this.options.crs.latlngtopoint(n.latlng(t),e)},unproject:function(t,e){return e=e===i?this._zoom:e,this.options.crs.pointtolatlng(n.point(t),e)},layerpointtolatlng:function(t){var e=n.point(t).add(this._initialtopleftpoint);return this.unproject(e)},latlngtolayerpoint:function(t){var e=this.project(n.latlng(t))._round();return e._subtract(this._initialtopleftpoint)},containerpointtolayerpoint:function(t){return n.point(t).subtract(this._getmappanepos())},layerpointtocontainerpoint:function(t){return n.point(t).add(this._getmappanepos())},containerpointtolatlng:function(t){var e=this.containerpointtolayerpoint(n.point(t));return this.layerpointtolatlng(e)},latlngtocontainerpoint:function(t){return this.layerpointtocontainerpoint(this.latlngtolayerpoint(n.latlng(t)))},mouseeventtocontainerpoint:function(t){return n.domevent.getmouseposition(t,this._container)},mouseeventtolayerpoint:function(t){return this.containerpointtolayerpoint(this.mouseeventtocontainerpoint(t))},mouseeventtolatlng:function(t){return this.layerpointtolatlng(this.mouseeventtolayerpoint(t))},_initcontainer:function(t){var e=this._container=n.domutil.get(t);if(e._leaflet)throw error("map container is already initialized.");e._leaflet=!0},_initlayout:function(){var t=this._container;n.domutil.addclass(t,"leaflet-container"),n.browser.touch&&n.domutil.addclass(t,"leaflet-touch"),this.options.fadeanimation&&n.domutil.addclass(t,"leaflet-fade-anim");var e=n.domutil.getstyle(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initpanes(),this._initcontrolpos&&this._initcontrolpos()},_initpanes:function(){var t=this._panes={};this._mappane=t.mappane=this._createpane("leaflet-map-pane",this._container),this._tilepane=t.tilepane=this._createpane("leaflet-tile-pane",this._mappane),t.objectspane=this._createpane("leaflet-objects-pane",this._mappane),t.shadowpane=this._createpane("leaflet-shadow-pane"),t.overlaypane=this._createpane("leaflet-overlay-pane"),t.markerpane=this._createpane("leaflet-marker-pane"),t.popuppane=this._createpane("leaflet-popup-pane");var e=" leaflet-zoom-hide";this.options.markerzoomanimation||(n.domutil.addclass(t.markerpane,e),n.domutil.addclass(t.shadowpane,e),n.domutil.addclass(t.popuppane,e))},_createpane:function(t,e){return n.domutil.create("div",t,e||this._panes.objectspane)},_initlayers:function(t){t=t?n.util.isarray(t)?t:[t]:[],this._layers={},this._zoomboundlayers={},this._tilelayersnum=0;var e,i;for(e=0,i=t.length;i>e;e++)this.addlayer(t[e])},_resetview:function(t,e,i,o){var s=this._zoom!==e;o||(this.fire("movestart"),s&&this.fire("zoomstart")),this._zoom=e,this._initialtopleftpoint=this._getnewtopleftpoint(t),i?this._initialtopleftpoint._add(this._getmappanepos()):n.domutil.setposition(this._mappane,new n.point(0,0)),this._tilelayerstoload=this._tilelayersnum;var a=!this._loaded;this._loaded=!0,this.fire("viewreset",{hard:!i}),this.fire("move"),(s||o)&&this.fire("zoomend"),this.fire("moveend",{hard:!i}),a&&this.fire("load")},_rawpanby:function(t){n.domutil.setposition(this._mappane,this._getmappanepos().subtract(t))},_updatezoomlevels:function(){var t,e=1/0,n=-1/0;for(t in this._zoomboundlayers)if(this._zoomboundlayers.hasownproperty(t)){var o=this._zoomboundlayers[t];isnan(o.options.minzoom)||(e=math.min(e,o.options.minzoom)),isnan(o.options.maxzoom)||(n=math.max(n,o.options.maxzoom))}t===i?this._layersmaxzoom=this._layersminzoom=i:(this._layersmaxzoom=n,this._layersminzoom=e)},_initevents:function(){if(n.domevent){n.domevent.on(this._container,"click",this._onmouseclick,this);var e,i,o=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(e=0,i=o.length;i>e;e++)n.domevent.on(this._container,o[e],this._firemouseevent,this);this.options.trackresize&&n.domevent.on(t,"resize",this._onresize,this)}},_onresize:function(){n.util.cancelanimframe(this._resizerequest),this._resizerequest=n.util.requestanimframe(this.invalidatesize,this,!1,this._container)},_onmouseclick:function(t){!this._loaded||this.dragging&&this.dragging.moved()||(this.fire("preclick"),this._firemouseevent(t))},_firemouseevent:function(t){if(this._loaded){var e=t.type;if(e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.haseventlisteners(e)){"contextmenu"===e&&n.domevent.preventdefault(t);var i=this.mouseeventtocontainerpoint(t),o=this.containerpointtolayerpoint(i),s=this.layerpointtolatlng(o);this.fire(e,{latlng:s,layerpoint:o,containerpoint:i,originalevent:t})}}},_ontilelayerload:function(){this._tilelayerstoload--,this._tilelayersnum&&!this._tilelayerstoload&&this._tilebg&&(cleartimeout(this._cleartilebgtimer),this._cleartilebgtimer=settimeout(n.bind(this._cleartilebg,this),500))},whenready:function(t,e){return this._loaded?t.call(e||this,this):this.on("load",t,e),this},_getmappanepos:function(){return n.domutil.getposition(this._mappane)},_gettopleftpoint:function(){if(!this._loaded)throw error("set map center and zoom first.");return this._initialtopleftpoint.subtract(this._getmappanepos())},_getnewtopleftpoint:function(t,e){var i=this.getsize()._divideby(2);return this.project(t,e)._subtract(i)._round()},_latlngtonewlayerpoint:function(t,e,i){var n=this._getnewtopleftpoint(i,e).add(this._getmappanepos());return this.project(t,e)._subtract(n)},_getcenterlayerpoint:function(){return this.containerpointtolayerpoint(this.getsize()._divideby(2))},_getcenteroffset:function(t){return this.latlngtolayerpoint(t).subtract(this._getcenterlayerpoint())},_limitzoom:function(t){var e=this.getminzoom(),i=this.getmaxzoom();return math.max(e,math.min(i,t))}}),n.map=function(t,e){return new n.map(t,e)},n.projection.mercator={max_latitude:85.0840591556,r_minor:6356752.3142,r_major:6378137,project:function(t){var e=n.latlng.deg_to_rad,i=this.max_latitude,o=math.max(math.min(i,t.lat),-i),s=this.r_major,a=this.r_minor,r=t.lng*e*s,h=o*e,l=a/s,u=math.sqrt(1-l*l),c=u*math.sin(h);c=math.pow((1-c)/(1+c),.5*u);var _=math.tan(.5*(.5*math.pi-h))/c;return h=-a*math.log(_),new n.point(r,h)},unproject:function(t){for(var e,i=n.latlng.rad_to_deg,o=this.r_major,s=this.r_minor,a=t.x*i/o,r=s/o,h=math.sqrt(1-r*r),l=math.exp(-t.y/s),u=math.pi/2-2*math.atan(l),c=15,_=1e-7,d=c,p=.1;math.abs(p)>_&&--d>0;)e=h*math.sin(u),p=math.pi/2-2*math.atan(l*math.pow((1-e)/(1+e),.5*h))-u,u+=p;return new n.latlng(u*i,a)}},n.crs.epsg3395=n.extend({},n.crs,{code:"epsg:3395",projection:n.projection.mercator,transformation:function(){var t=n.projection.mercator,e=t.r_major,i=t.r_minor;return new n.transformation(.5/(math.pi*e),.5,-.5/(math.pi*i),.5)}()}),n.tilelayer=n.class.extend({includes:n.mixin.events,options:{minzoom:0,maxzoom:18,tilesize:256,subdomains:"abc",errortileurl:"",attribution:"",zoomoffset:0,opacity:1,unloadinvisibletiles:n.browser.mobile,updatewhenidle:n.browser.mobile},initialize:function(t,e){e=n.setoptions(this,e),e.detectretina&&n.browser.retina&&e.maxzoom>0&&(e.tilesize=math.floor(e.tilesize/2),e.zoomoffset++,e.minzoom>0&&e.minzoom--,this.options.maxzoom--),this._url=t;var i=this.options.subdomains;"string"==typeof i&&(this.options.subdomains=i.split(""))},onadd:function(t){this._map=t,this._initcontainer(),this._createtileproto(),t.on({viewreset:this._resetcallback,moveend:this._update},this),this.options.updatewhenidle||(this._limitedupdate=n.util.limitexecbyinterval(this._update,150,this),t.on("move",this._limitedupdate,this)),this._reset(),this._update()},addto:function(t){return t.addlayer(this),this},onremove:function(t){this._container.parentnode.removechild(this._container),t.off({viewreset:this._resetcallback,moveend:this._update},this),this.options.updatewhenidle||t.off("move",this._limitedupdate,this),this._container=null,this._map=null},bringtofront:function(){var t=this._map._panes.tilepane;return this._container&&(t.appendchild(this._container),this._setautozindex(t,math.max)),this},bringtoback:function(){var t=this._map._panes.tilepane;return this._container&&(t.insertbefore(this._container,t.firstchild),this._setautozindex(t,math.min)),this},getattribution:function(){return this.options.attribution},setopacity:function(t){return this.options.opacity=t,this._map&&this._updateopacity(),this},setzindex:function(t){return this.options.zindex=t,this._updatezindex(),this},seturl:function(t,e){return this._url=t,e||this.redraw(),this},redraw:function(){return this._map&&(this._map._panes.tilepane.empty=!1,this._reset(!0),this._update()),this},_updatezindex:function(){this._container&&this.options.zindex!==i&&(this._container.style.zindex=this.options.zindex)},_setautozindex:function(t,e){var i,n,o,s=t.children,a=-e(1/0,-1/0);for(n=0,o=s.length;o>n;n++)s[n]!==this._container&&(i=parseint(s[n].style.zindex,10),isnan(i)||(a=e(a,i)));this.options.zindex=this._container.style.zindex=(isfinite(a)?a:0)+e(1,-1)},_updateopacity:function(){n.domutil.setopacity(this._container,this.options.opacity);var t,e=this._tiles;if(n.browser.webkit)for(t in e)e.hasownproperty(t)&&(e[t].style.webkittransform+=" translate(0,0)")},_initcontainer:function(){var t=this._map._panes.tilepane;(!this._container||t.empty)&&(this._container=n.domutil.create("div","leaflet-layer"),this._updatezindex(),t.appendchild(this._container),1>this.options.opacity&&this._updateopacity())},_resetcallback:function(t){this._reset(t.hard)},_reset:function(t){var e=this._tiles;for(var i in e)e.hasownproperty(i)&&this.fire("tileunload",{tile:e[i]});this._tiles={},this._tilestoload=0,this.options.reusetiles&&(this._unusedtiles=[]),t&&this._container&&(this._container.innerhtml=""),this._initcontainer()},_update:function(){if(this._map){var t=this._map.getpixelbounds(),e=this._map.getzoom(),i=this.options.tilesize;if(!(e>this.options.maxzoom||this.options.minzoom>e)){var o=new n.point(math.floor(t.min.x/i),math.floor(t.min.y/i)),s=new n.point(math.floor(t.max.x/i),math.floor(t.max.y/i)),a=new n.bounds(o,s);this._addtilesfromcenterout(a),(this.options.unloadinvisibletiles||this.options.reusetiles)&&this._removeothertiles(a)}}},_addtilesfromcenterout:function(t){var i,o,s,a=[],r=t.getcenter();for(i=t.min.y;t.max.y>=i;i++)for(o=t.min.x;t.max.x>=o;o++)s=new n.point(o,i),this._tileshouldbeloaded(s)&&a.push(s);var h=a.length;if(0!==h){a.sort(function(t,e){return t.distanceto(r)-e.distanceto(r)});var l=e.createdocumentfragment();for(this._tilestoload||this.fire("loading"),this._tilestoload+=h,o=0;h>o;o++)this._addtile(a[o],l);this._container.appendchild(l)}},_tileshouldbeloaded:function(t){if(t.x+":"+t.y in this._tiles)return!1;if(!this.options.continuousworld){var e=this._getwraptilenum();if(this.options.nowrap&&(0>t.x||t.x>=e)||0>t.y||t.y>=e)return!1}return!0},_removeothertiles:function(t){var e,i,n,o;for(o in this._tiles)this._tiles.hasownproperty(o)&&(e=o.split(":"),i=parseint(e[0],10),n=parseint(e[1],10),(t.min.x>i||i>t.max.x||t.min.y>n||n>t.max.y)&&this._removetile(o))},_removetile:function(t){var e=this._tiles[t];this.fire("tileunload",{tile:e,url:e.src}),this.options.reusetiles?(n.domutil.removeclass(e,"leaflet-tile-loaded"),this._unusedtiles.push(e)):e.parentnode===this._container&&this._container.removechild(e),n.browser.android||(e.src=n.util.emptyimageurl),delete this._tiles[t]},_addtile:function(t,e){var i=this._gettilepos(t),o=this._gettile();n.domutil.setposition(o,i,n.browser.chrome||n.browser.android23),this._tiles[t.x+":"+t.y]=o,this._loadtile(o,t),o.parentnode!==this._container&&e.appendchild(o) },_getzoomforurl:function(){var t=this.options,e=this._map.getzoom();return t.zoomreverse&&(e=t.maxzoom-e),e+t.zoomoffset},_gettilepos:function(t){var e=this._map.getpixelorigin(),i=this.options.tilesize;return t.multiplyby(i).subtract(e)},gettileurl:function(t){return this._adjusttilepoint(t),n.util.template(this._url,n.extend({s:this._getsubdomain(t),z:this._getzoomforurl(),x:t.x,y:t.y},this.options))},_getwraptilenum:function(){return math.pow(2,this._getzoomforurl())},_adjusttilepoint:function(t){var e=this._getwraptilenum();this.options.continuousworld||this.options.nowrap||(t.x=(t.x%e+e)%e),this.options.tms&&(t.y=e-t.y-1)},_getsubdomain:function(t){var e=(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_createtileproto:function(){var t=this._tileimg=n.domutil.create("img","leaflet-tile");t.style.width=t.style.height=this.options.tilesize+"px",t.galleryimg="no"},_gettile:function(){if(this.options.reusetiles&&this._unusedtiles.length>0){var t=this._unusedtiles.pop();return this._resettile(t),t}return this._createtile()},_resettile:function(){},_createtile:function(){var t=this._tileimg.clonenode(!1);return t.onselectstart=t.onmousemove=n.util.falsefn,t},_loadtile:function(t,e){t._layer=this,t.onload=this._tileonload,t.onerror=this._tileonerror,t.src=this.gettileurl(e)},_tileloaded:function(){this._tilestoload--,this._tilestoload||this.fire("load")},_tileonload:function(){var t=this._layer;this.src!==n.util.emptyimageurl&&(n.domutil.addclass(this,"leaflet-tile-loaded"),t.fire("tileload",{tile:this,url:this.src})),t._tileloaded()},_tileonerror:function(){var t=this._layer;t.fire("tileerror",{tile:this,url:this.src});var e=t.options.errortileurl;e&&(this.src=e),t._tileloaded()}}),n.tilelayer=function(t,e){return new n.tilelayer(t,e)},n.tilelayer.wms=n.tilelayer.extend({defaultwmsparams:{service:"wms",request:"getmap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(t,e){this._url=t;var i=n.extend({},this.defaultwmsparams);i.width=i.height=e.detectretina&&n.browser.retina?2*this.options.tilesize:this.options.tilesize;for(var o in e)this.options.hasownproperty(o)||(i[o]=e[o]);this.wmsparams=i,n.setoptions(this,e)},onadd:function(t){var e=parsefloat(this.wmsparams.version)>=1.3?"crs":"srs";this.wmsparams[e]=t.options.crs.code,n.tilelayer.prototype.onadd.call(this,t)},gettileurl:function(t,e){this._adjusttilepoint(t);var i=this._map,o=i.options.crs,s=this.options.tilesize,a=t.multiplyby(s),r=a.add(new n.point(s,s)),h=o.project(i.unproject(a,e)),l=o.project(i.unproject(r,e)),u=[h.x,l.y,l.x,h.y].join(","),c=n.util.template(this._url,{s:this._getsubdomain(t)});return c+n.util.getparamstring(this.wmsparams,c)+"&bbox="+u},setparams:function(t,e){return n.extend(this.wmsparams,t),e||this.redraw(),this}}),n.tilelayer.wms=function(t,e){return new n.tilelayer.wms(t,e)},n.tilelayer.canvas=n.tilelayer.extend({options:{async:!1},initialize:function(t){n.setoptions(this,t)},redraw:function(){var t=this._tiles;for(var e in t)t.hasownproperty(e)&&this._redrawtile(t[e])},_redrawtile:function(t){this.drawtile(t,t._tilepoint,this._map._zoom)},_createtileproto:function(){var t=this._canvasproto=n.domutil.create("canvas","leaflet-tile");t.width=t.height=this.options.tilesize},_createtile:function(){var t=this._canvasproto.clonenode(!1);return t.onselectstart=t.onmousemove=n.util.falsefn,t},_loadtile:function(t,e){t._layer=this,t._tilepoint=e,this._redrawtile(t),this.options.async||this.tiledrawn(t)},drawtile:function(){},tiledrawn:function(t){this._tileonload.call(t)}}),n.tilelayer.canvas=function(t){return new n.tilelayer.canvas(t)},n.imageoverlay=n.class.extend({includes:n.mixin.events,options:{opacity:1},initialize:function(t,e,i){this._url=t,this._bounds=n.latlngbounds(e),n.setoptions(this,i)},onadd:function(t){this._map=t,this._image||this._initimage(),t._panes.overlaypane.appendchild(this._image),t.on("viewreset",this._reset,this),t.options.zoomanimation&&n.browser.any3d&&t.on("zoomanim",this._animatezoom,this),this._reset()},onremove:function(t){t.getpanes().overlaypane.removechild(this._image),t.off("viewreset",this._reset,this),t.options.zoomanimation&&t.off("zoomanim",this._animatezoom,this)},addto:function(t){return t.addlayer(this),this},setopacity:function(t){return this.options.opacity=t,this._updateopacity(),this},bringtofront:function(){return this._image&&this._map._panes.overlaypane.appendchild(this._image),this},bringtoback:function(){var t=this._map._panes.overlaypane;return this._image&&t.insertbefore(this._image,t.firstchild),this},_initimage:function(){this._image=n.domutil.create("img","leaflet-image-layer"),this._map.options.zoomanimation&&n.browser.any3d?n.domutil.addclass(this._image,"leaflet-zoom-animated"):n.domutil.addclass(this._image,"leaflet-zoom-hide"),this._updateopacity(),n.extend(this._image,{galleryimg:"no",onselectstart:n.util.falsefn,onmousemove:n.util.falsefn,onload:n.bind(this._onimageload,this),src:this._url})},_animatezoom:function(t){var e=this._map,i=this._image,o=e.getzoomscale(t.zoom),s=this._bounds.getnorthwest(),a=this._bounds.getsoutheast(),r=e._latlngtonewlayerpoint(s,t.zoom,t.center),h=e._latlngtonewlayerpoint(a,t.zoom,t.center)._subtract(r),l=r._add(h._multiplyby(.5*(1-1/o)));i.style[n.domutil.transform]=n.domutil.gettranslatestring(l)+" scale("+o+") "},_reset:function(){var t=this._image,e=this._map.latlngtolayerpoint(this._bounds.getnorthwest()),i=this._map.latlngtolayerpoint(this._bounds.getsoutheast())._subtract(e);n.domutil.setposition(t,e),t.style.width=i.x+"px",t.style.height=i.y+"px"},_onimageload:function(){this.fire("load")},_updateopacity:function(){n.domutil.setopacity(this._image,this.options.opacity)}}),n.imageoverlay=function(t,e,i){return new n.imageoverlay(t,e,i)},n.icon=n.class.extend({options:{classname:""},initialize:function(t){n.setoptions(this,t)},createicon:function(){return this._createicon("icon")},createshadow:function(){return this._createicon("shadow")},_createicon:function(t){var e=this._geticonurl(t);if(!e){if("icon"===t)throw error("iconurl not set in icon options (see the docs).");return null}var i=this._createimg(e);return this._seticonstyles(i,t),i},_seticonstyles:function(t,e){var i,o=this.options,s=n.point(o[e+"size"]);i="shadow"===e?n.point(o.shadowanchor||o.iconanchor):n.point(o.iconanchor),!i&&s&&(i=s.divideby(2,!0)),t.classname="leaflet-marker-"+e+" "+o.classname,i&&(t.style.marginleft=-i.x+"px",t.style.margintop=-i.y+"px"),s&&(t.style.width=s.x+"px",t.style.height=s.y+"px")},_createimg:function(t){var i;return n.browser.ie6?(i=e.createelement("div"),i.style.filter='progid:dximagetransform.microsoft.alphaimageloader(src="'+t+'")'):(i=e.createelement("img"),i.src=t),i},_geticonurl:function(t){return n.browser.retina&&this.options[t+"retinaurl"]?this.options[t+"retinaurl"]:this.options[t+"url"]}}),n.icon=function(t){return new n.icon(t)},n.icon.default=n.icon.extend({options:{iconsize:new n.point(25,41),iconanchor:new n.point(12,41),popupanchor:new n.point(1,-34),shadowsize:new n.point(41,41)},_geticonurl:function(t){var e=t+"url";if(this.options[e])return this.options[e];n.browser.retina&&"icon"===t&&(t+="@2x");var i=n.icon.default.imagepath;if(!i)throw error("couldn't autodetect l.icon.default.imagepath, set it manually.");return i+"/marker-"+t+".png"}}),n.icon.default.imagepath=function(){var t,i,n,o,s=e.getelementsbytagname("script"),a=/\/?leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(t=0,i=s.length;i>t;t++)if(n=s[t].src,o=n.match(a))return n.split(a)[0]+"/images"}(),n.marker=n.class.extend({includes:n.mixin.events,options:{icon:new n.icon.default,title:"",clickable:!0,draggable:!1,zindexoffset:0,opacity:1,riseonhover:!1,riseoffset:250},initialize:function(t,e){n.setoptions(this,e),this._latlng=n.latlng(t)},onadd:function(t){this._map=t,t.on("viewreset",this.update,this),this._initicon(),this.update(),t.options.zoomanimation&&t.options.markerzoomanimation&&t.on("zoomanim",this._animatezoom,this)},addto:function(t){return t.addlayer(this),this},onremove:function(t){this._removeicon(),this.fire("remove"),t.off({viewreset:this.update,zoomanim:this._animatezoom},this),this._map=null},getlatlng:function(){return this._latlng},setlatlng:function(t){return this._latlng=n.latlng(t),this.update(),this.fire("move",{latlng:this._latlng})},setzindexoffset:function(t){return this.options.zindexoffset=t,this.update(),this},seticon:function(t){return this._map&&this._removeicon(),this.options.icon=t,this._map&&(this._initicon(),this.update()),this},update:function(){if(this._icon){var t=this._map.latlngtolayerpoint(this._latlng).round();this._setpos(t)}return this},_initicon:function(){var t=this.options,e=this._map,i=e.options.zoomanimation&&e.options.markerzoomanimation,o=i?"leaflet-zoom-animated":"leaflet-zoom-hide",s=!1;this._icon||(this._icon=t.icon.createicon(),t.title&&(this._icon.title=t.title),this._initinteraction(),s=1>this.options.opacity,n.domutil.addclass(this._icon,o),t.riseonhover&&n.domevent.on(this._icon,"mouseover",this._bringtofront,this).on(this._icon,"mouseout",this._resetzindex,this)),this._shadow||(this._shadow=t.icon.createshadow(),this._shadow&&(n.domutil.addclass(this._shadow,o),s=1>this.options.opacity)),s&&this._updateopacity();var a=this._map._panes;a.markerpane.appendchild(this._icon),this._shadow&&a.shadowpane.appendchild(this._shadow)},_removeicon:function(){var t=this._map._panes;this.options.riseonhover&&n.domevent.off(this._icon,"mouseover",this._bringtofront).off(this._icon,"mouseout",this._resetzindex),t.markerpane.removechild(this._icon),this._shadow&&t.shadowpane.removechild(this._shadow),this._icon=this._shadow=null},_setpos:function(t){n.domutil.setposition(this._icon,t),this._shadow&&n.domutil.setposition(this._shadow,t),this._zindex=t.y+this.options.zindexoffset,this._resetzindex()},_updatezindex:function(t){this._icon.style.zindex=this._zindex+t},_animatezoom:function(t){var e=this._map._latlngtonewlayerpoint(this._latlng,t.zoom,t.center);this._setpos(e)},_initinteraction:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu"];n.domutil.addclass(t,"leaflet-clickable"),n.domevent.on(t,"click",this._onmouseclick,this);for(var i=0;e.length>i;i++)n.domevent.on(t,e[i],this._firemouseevent,this);n.handler.markerdrag&&(this.dragging=new n.handler.markerdrag(this),this.options.draggable&&this.dragging.enable())}},_onmouseclick:function(t){var e=this.dragging&&this.dragging.moved();(this.haseventlisteners(t.type)||e)&&n.domevent.stoppropagation(t),e||(this.dragging&&this.dragging._enabled||!this._map.dragging||!this._map.dragging.moved())&&this.fire(t.type,{originalevent:t})},_firemouseevent:function(t){this.fire(t.type,{originalevent:t}),"contextmenu"===t.type&&this.haseventlisteners(t.type)&&n.domevent.preventdefault(t),"mousedown"!==t.type&&n.domevent.stoppropagation(t)},setopacity:function(t){this.options.opacity=t,this._map&&this._updateopacity()},_updateopacity:function(){n.domutil.setopacity(this._icon,this.options.opacity),this._shadow&&n.domutil.setopacity(this._shadow,this.options.opacity)},_bringtofront:function(){this._updatezindex(this.options.riseoffset)},_resetzindex:function(){this._updatezindex(0)}}),n.marker=function(t,e){return new n.marker(t,e)},n.divicon=n.icon.extend({options:{iconsize:new n.point(12,12),classname:"leaflet-div-icon"},createicon:function(){var t=e.createelement("div"),i=this.options;return i.html&&(t.innerhtml=i.html),i.bgpos&&(t.style.backgroundposition=-i.bgpos.x+"px "+-i.bgpos.y+"px"),this._seticonstyles(t,"icon"),t},createshadow:function(){return null}}),n.divicon=function(t){return new n.divicon(t)},n.map.mergeoptions({closepopuponclick:!0}),n.popup=n.class.extend({includes:n.mixin.events,options:{minwidth:50,maxwidth:300,maxheight:null,autopan:!0,closebutton:!0,offset:new n.point(0,6),autopanpadding:new n.point(5,5),classname:"",zoomanimation:!0},initialize:function(t,e){n.setoptions(this,t),this._source=e,this._animated=n.browser.any3d&&this.options.zoomanimation},onadd:function(t){this._map=t,this._container||this._initlayout(),this._updatecontent();var e=t.options.fadeanimation;e&&n.domutil.setopacity(this._container,0),t._panes.popuppane.appendchild(this._container),t.on("viewreset",this._updateposition,this),this._animated&&t.on("zoomanim",this._zoomanimation,this),t.options.closepopuponclick&&t.on("preclick",this._close,this),this._update(),e&&n.domutil.setopacity(this._container,1)},addto:function(t){return t.addlayer(this),this},openon:function(t){return t.openpopup(this),this},onremove:function(t){t._panes.popuppane.removechild(this._container),n.util.falsefn(this._container.offsetwidth),t.off({viewreset:this._updateposition,preclick:this._close,zoomanim:this._zoomanimation},this),t.options.fadeanimation&&n.domutil.setopacity(this._container,0),this._map=null},setlatlng:function(t){return this._latlng=n.latlng(t),this._update(),this},setcontent:function(t){return this._content=t,this._update(),this},_close:function(){var t=this._map;t&&(t._popup=null,t.removelayer(this).fire("popupclose",{popup:this}))},_initlayout:function(){var t,e="leaflet-popup",i=e+" "+this.options.classname+" leaflet-zoom-"+(this._animated?"animated":"hide"),o=this._container=n.domutil.create("div",i);this.options.closebutton&&(t=this._closebutton=n.domutil.create("a",e+"-close-button",o),t.href="#close",t.innerhtml="×",n.domevent.on(t,"click",this._onclosebuttonclick,this));var s=this._wrapper=n.domutil.create("div",e+"-content-wrapper",o);n.domevent.disableclickpropagation(s),this._contentnode=n.domutil.create("div",e+"-content",s),n.domevent.on(this._contentnode,"mousewheel",n.domevent.stoppropagation),this._tipcontainer=n.domutil.create("div",e+"-tip-container",o),this._tip=n.domutil.create("div",e+"-tip",this._tipcontainer)},_update:function(){this._map&&(this._container.style.visibility="hidden",this._updatecontent(),this._updatelayout(),this._updateposition(),this._container.style.visibility="",this._adjustpan())},_updatecontent:function(){if(this._content){if("string"==typeof this._content)this._contentnode.innerhtml=this._content;else{for(;this._contentnode.haschildnodes();)this._contentnode.removechild(this._contentnode.firstchild);this._contentnode.appendchild(this._content)}this.fire("contentupdate")}},_updatelayout:function(){var t=this._contentnode,e=t.style;e.width="",e.whitespace="nowrap";var i=t.offsetwidth;i=math.min(i,this.options.maxwidth),i=math.max(i,this.options.minwidth),e.width=i+1+"px",e.whitespace="",e.height="";var o=t.offsetheight,s=this.options.maxheight,a="leaflet-popup-scrolled";s&&o>s?(e.height=s+"px",n.domutil.addclass(t,a)):n.domutil.removeclass(t,a),this._containerwidth=this._container.offsetwidth},_updateposition:function(){if(this._map){var t=this._map.latlngtolayerpoint(this._latlng),e=this._animated,i=this.options.offset;e&&n.domutil.setposition(this._container,t),this._containerbottom=-i.y-(e?0:t.y),this._containerleft=-math.round(this._containerwidth/2)+i.x+(e?0:t.x),this._container.style.bottom=this._containerbottom+"px",this._container.style.left=this._containerleft+"px"}},_zoomanimation:function(t){var e=this._map._latlngtonewlayerpoint(this._latlng,t.zoom,t.center);n.domutil.setposition(this._container,e)},_adjustpan:function(){if(this.options.autopan){var t=this._map,e=this._container.offsetheight,i=this._containerwidth,o=new n.point(this._containerleft,-e-this._containerbottom);this._animated&&o._add(n.domutil.getposition(this._container));var s=t.layerpointtocontainerpoint(o),a=this.options.autopanpadding,r=t.getsize(),h=0,l=0;0>s.x&&(h=s.x-a.x),s.x+i>r.x&&(h=s.x+i-r.x+a.x),0>s.y&&(l=s.y-a.y),s.y+e>r.y&&(l=s.y+e-r.y+a.y),(h||l)&&t.panby(new n.point(h,l))}},_onclosebuttonclick:function(t){this._close(),n.domevent.stop(t)}}),n.popup=function(t,e){return new n.popup(t,e)},n.marker.include({openpopup:function(){return this._popup&&this._map&&(this._popup.setlatlng(this._latlng),this._map.openpopup(this._popup)),this},closepopup:function(){return this._popup&&this._popup._close(),this},bindpopup:function(t,e){var i=n.point(this.options.icon.options.popupanchor)||new n.point(0,0);return i=i.add(n.popup.prototype.options.offset),e&&e.offset&&(i=i.add(e.offset)),e=n.extend({offset:i},e),this._popup||this.on("click",this.openpopup,this).on("remove",this.closepopup,this).on("move",this._movepopup,this),this._popup=new n.popup(e,this).setcontent(t),this},unbindpopup:function(){return this._popup&&(this._popup=null,this.off("click",this.openpopup).off("remove",this.closepopup).off("move",this._movepopup)),this},_movepopup:function(t){this._popup.setlatlng(t.latlng)}}),n.map.include({openpopup:function(t){return this.closepopup(),this._popup=t,this.addlayer(t).fire("popupopen",{popup:this._popup})},closepopup:function(){return this._popup&&this._popup._close(),this}}),n.layergroup=n.class.extend({initialize:function(t){this._layers={};var e,i;if(t)for(e=0,i=t.length;i>e;e++)this.addlayer(t[e])},addlayer:function(t){var e=n.stamp(t);return this._layers[e]=t,this._map&&this._map.addlayer(t),this},removelayer:function(t){var e=n.stamp(t);return delete this._layers[e],this._map&&this._map.removelayer(t),this},clearlayers:function(){return this.eachlayer(this.removelayer,this),this},invoke:function(t){var e,i,n=array.prototype.slice.call(arguments,1);for(e in this._layers)this._layers.hasownproperty(e)&&(i=this._layers[e],i[t]&&i[t].apply(i,n));return this},onadd:function(t){this._map=t,this.eachlayer(t.addlayer,t)},onremove:function(t){this.eachlayer(t.removelayer,t),this._map=null},addto:function(t){return t.addlayer(this),this},eachlayer:function(t,e){for(var i in this._layers)this._layers.hasownproperty(i)&&t.call(e,this._layers[i])},setzindex:function(t){return this.invoke("setzindex",t)}}),n.layergroup=function(t){return new n.layergroup(t)},n.featuregroup=n.layergroup.extend({includes:n.mixin.events,statics:{events:"click dblclick mouseover mouseout mousemove contextmenu"},addlayer:function(t){return this._layers[n.stamp(t)]?this:(t.on(n.featuregroup.events,this._propagateevent,this),n.layergroup.prototype.addlayer.call(this,t),this._popupcontent&&t.bindpopup&&t.bindpopup(this._popupcontent,this._popupoptions),this.fire("layeradd",{layer:t}))},removelayer:function(t){return t.off(n.featuregroup.events,this._propagateevent,this),n.layergroup.prototype.removelayer.call(this,t),this._popupcontent&&this.invoke("unbindpopup"),this.fire("layerremove",{layer:t})},bindpopup:function(t,e){return this._popupcontent=t,this._popupoptions=e,this.invoke("bindpopup",t,e)},setstyle:function(t){return this.invoke("setstyle",t)},bringtofront:function(){return this.invoke("bringtofront")},bringtoback:function(){return this.invoke("bringtoback")},getbounds:function(){var t=new n.latlngbounds;return this.eachlayer(function(e){t.extend(e instanceof n.marker?e.getlatlng():e.getbounds())}),t},_propagateevent:function(t){t.layer=t.target,t.target=this,this.fire(t.type,t)}}),n.featuregroup=function(t){return new n.featuregroup(t)},n.path=n.class.extend({includes:[n.mixin.events],statics:{clip_padding:n.browser.mobile?math.max(0,math.min(.5,(1280/math.max(t.innerwidth,t.innerheight)-1)/2)):.5},options:{stroke:!0,color:"#0033ff",dasharray:null,weight:5,opacity:.5,fill:!1,fillcolor:null,fillopacity:.2,clickable:!0},initialize:function(t){n.setoptions(this,t)},onadd:function(t){this._map=t,this._container||(this._initelements(),this._initevents()),this.projectlatlngs(),this._updatepath(),this._container&&this._map._pathroot.appendchild(this._container),this.fire("add"),t.on({viewreset:this.projectlatlngs,moveend:this._updatepath},this)},addto:function(t){return t.addlayer(this),this},onremove:function(t){t._pathroot.removechild(this._container),this.fire("remove"),this._map=null,n.browser.vml&&(this._container=null,this._stroke=null,this._fill=null),t.off({viewreset:this.projectlatlngs,moveend:this._updatepath},this)},projectlatlngs:function(){},setstyle:function(t){return n.setoptions(this,t),this._container&&this._updatestyle(),this},redraw:function(){return this._map&&(this.projectlatlngs(),this._updatepath()),this}}),n.map.include({_updatepathviewport:function(){var t=n.path.clip_padding,e=this.getsize(),i=n.domutil.getposition(this._mappane),o=i.multiplyby(-1)._subtract(e.multiplyby(t)._round()),s=o.add(e.multiplyby(1+2*t)._round());this._pathviewport=new n.bounds(o,s)}}),n.path.svg_ns="http://www.w3.org/2000/svg",n.browser.svg=!(!e.createelementns||!e.createelementns(n.path.svg_ns,"svg").createsvgrect),n.path=n.path.extend({statics:{svg:n.browser.svg},bringtofront:function(){var t=this._map._pathroot,e=this._container;return e&&t.lastchild!==e&&t.appendchild(e),this},bringtoback:function(){var t=this._map._pathroot,e=this._container,i=t.firstchild;return e&&i!==e&&t.insertbefore(e,i),this},getpathstring:function(){},_createelement:function(t){return e.createelementns(n.path.svg_ns,t)},_initelements:function(){this._map._initpathroot(),this._initpath(),this._initstyle()},_initpath:function(){this._container=this._createelement("g"),this._path=this._createelement("path"),this._container.appendchild(this._path)},_initstyle:function(){this.options.stroke&&(this._path.setattribute("stroke-linejoin","round"),this._path.setattribute("stroke-linecap","round")),this.options.fill&&this._path.setattribute("fill-rule","evenodd"),this._updatestyle()},_updatestyle:function(){this.options.stroke?(this._path.setattribute("stroke",this.options.color),this._path.setattribute("stroke-opacity",this.options.opacity),this._path.setattribute("stroke-width",this.options.weight),this.options.dasharray?this._path.setattribute("stroke-dasharray",this.options.dasharray):this._path.removeattribute("stroke-dasharray")):this._path.setattribute("stroke","none"),this.options.fill?(this._path.setattribute("fill",this.options.fillcolor||this.options.color),this._path.setattribute("fill-opacity",this.options.fillopacity)):this._path.setattribute("fill","none")},_updatepath:function(){var t=this.getpathstring();t||(t="m0 0"),this._path.setattribute("d",t)},_initevents:function(){if(this.options.clickable){(n.browser.svg||!n.browser.vml)&&this._path.setattribute("class","leaflet-clickable"),n.domevent.on(this._container,"click",this._onmouseclick,this);for(var t=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],e=0;t.length>e;e++)n.domevent.on(this._container,t[e],this._firemouseevent,this)}},_onmouseclick:function(t){this._map.dragging&&this._map.dragging.moved()||this._firemouseevent(t)},_firemouseevent:function(t){if(this.haseventlisteners(t.type)){var e=this._map,i=e.mouseeventtocontainerpoint(t),o=e.containerpointtolayerpoint(i),s=e.layerpointtolatlng(o);this.fire(t.type,{latlng:s,layerpoint:o,containerpoint:i,originalevent:t}),"contextmenu"===t.type&&n.domevent.preventdefault(t),"mousemove"!==t.type&&n.domevent.stoppropagation(t)}}}),n.map.include({_initpathroot:function(){this._pathroot||(this._pathroot=n.path.prototype._createelement("svg"),this._panes.overlaypane.appendchild(this._pathroot),this.options.zoomanimation&&n.browser.any3d?(this._pathroot.setattribute("class"," leaflet-zoom-animated"),this.on({zoomanim:this._animatepathzoom,zoomend:this._endpathzoom})):this._pathroot.setattribute("class"," leaflet-zoom-hide"),this.on("moveend",this._updatesvgviewport),this._updatesvgviewport())},_animatepathzoom:function(t){var e=this.getzoomscale(t.zoom),i=this._getcenteroffset(t.center)._multiplyby(-e)._add(this._pathviewport.min);this._pathroot.style[n.domutil.transform]=n.domutil.gettranslatestring(i)+" scale("+e+") ",this._pathzooming=!0},_endpathzoom:function(){this._pathzooming=!1},_updatesvgviewport:function(){if(!this._pathzooming){this._updatepathviewport();var t=this._pathviewport,e=t.min,i=t.max,o=i.x-e.x,s=i.y-e.y,a=this._pathroot,r=this._panes.overlaypane;n.browser.mobilewebkit&&r.removechild(a),n.domutil.setposition(a,e),a.setattribute("width",o),a.setattribute("height",s),a.setattribute("viewbox",[e.x,e.y,o,s].join(" ")),n.browser.mobilewebkit&&r.appendchild(a)}}}),n.path.include({bindpopup:function(t,e){return(!this._popup||e)&&(this._popup=new n.popup(e,this)),this._popup.setcontent(t),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(t){return this._popup&&(t=t||this._latlng||this._latlngs[math.floor(this._latlngs.length/2)],this._openpopup({latlng:t})),this},closepopup:function(){return this._popup&&this._popup._close(),this},_openpopup:function(t){this._popup.setlatlng(t.latlng),this._map.openpopup(this._popup)}}),n.browser.vml=!n.browser.svg&&function(){try{var t=e.createelement("div");t.innerhtml='';var i=t.firstchild;return i.style.behavior="url(#default#vml)",i&&"object"==typeof i.adj}catch(n){return!1}}(),n.path=n.browser.svg||!n.browser.vml?n.path:n.path.extend({statics:{vml:!0,clip_padding:.02},_createelement:function(){try{return e.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return e.createelement("')}}catch(t){return function(t){return e.createelement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initpath:function(){var t=this._container=this._createelement("shape");n.domutil.addclass(t,"leaflet-vml-shape"),this.options.clickable&&n.domutil.addclass(t,"leaflet-clickable"),t.coordsize="1 1",this._path=this._createelement("path"),t.appendchild(this._path),this._map._pathroot.appendchild(t)},_initstyle:function(){this._updatestyle()},_updatestyle:function(){var t=this._stroke,e=this._fill,i=this.options,n=this._container;n.stroked=i.stroke,n.filled=i.fill,i.stroke?(t||(t=this._stroke=this._createelement("stroke"),t.endcap="round",n.appendchild(t)),t.weight=i.weight+"px",t.color=i.color,t.opacity=i.opacity,t.dashstyle=i.dasharray?i.dasharray instanceof array?i.dasharray.join(" "):i.dasharray.replace(/ *, */g," "):""):t&&(n.removechild(t),this._stroke=null),i.fill?(e||(e=this._fill=this._createelement("fill"),n.appendchild(e)),e.color=i.fillcolor||i.color,e.opacity=i.fillopacity):e&&(n.removechild(e),this._fill=null)},_updatepath:function(){var t=this._container.style;t.display="none",this._path.v=this.getpathstring()+" ",t.display=""}}),n.map.include(n.browser.svg||!n.browser.vml?{}:{_initpathroot:function(){if(!this._pathroot){var t=this._pathroot=e.createelement("div");t.classname="leaflet-vml-container",this._panes.overlaypane.appendchild(t),this.on("moveend",this._updatepathviewport),this._updatepathviewport()}}}),n.browser.canvas=function(){return!!e.createelement("canvas").getcontext}(),n.path=n.path.svg&&!t.l_prefer_canvas||!n.browser.canvas?n.path:n.path.extend({statics:{canvas:!0,svg:!1},redraw:function(){return this._map&&(this.projectlatlngs(),this._requestupdate()),this},setstyle:function(t){return n.setoptions(this,t),this._map&&(this._updatestyle(),this._requestupdate()),this},onremove:function(t){t.off("viewreset",this.projectlatlngs,this).off("moveend",this._updatepath,this),this.options.clickable&&this._map.off("click",this._onclick,this),this._requestupdate(),this._map=null},_requestupdate:function(){this._map&&!n.path._updaterequest&&(n.path._updaterequest=n.util.requestanimframe(this._firemapmoveend,this._map))},_firemapmoveend:function(){n.path._updaterequest=null,this.fire("moveend")},_initelements:function(){this._map._initpathroot(),this._ctx=this._map._canvasctx},_updatestyle:function(){var t=this.options;t.stroke&&(this._ctx.linewidth=t.weight,this._ctx.strokestyle=t.color),t.fill&&(this._ctx.fillstyle=t.fillcolor||t.color)},_drawpath:function(){var t,e,i,o,s,a;for(this._ctx.beginpath(),t=0,i=this._parts.length;i>t;t++){for(e=0,o=this._parts[t].length;o>e;e++)s=this._parts[t][e],a=(0===e?"move":"line")+"to",this._ctx[a](s.x,s.y);this instanceof n.polygon&&this._ctx.closepath()}},_checkifempty:function(){return!this._parts.length},_updatepath:function(){if(!this._checkifempty()){var t=this._ctx,e=this.options;this._drawpath(),t.save(),this._updatestyle(),e.fill&&(t.globalalpha=e.fillopacity,t.fill()),e.stroke&&(t.globalalpha=e.opacity,t.stroke()),t.restore()}},_initevents:function(){this.options.clickable&&this._map.on("click",this._onclick,this)},_onclick:function(t){this._containspoint(t.layerpoint)&&this.fire("click",{latlng:t.latlng,layerpoint:t.layerpoint,containerpoint:t.containerpoint,originalevent:t})}}),n.map.include(n.path.svg&&!t.l_prefer_canvas||!n.browser.canvas?{}:{_initpathroot:function(){var t,i=this._pathroot;i||(i=this._pathroot=e.createelement("canvas"),i.style.position="absolute",t=this._canvasctx=i.getcontext("2d"),t.linecap="round",t.linejoin="round",this._panes.overlaypane.appendchild(i),this.options.zoomanimation&&(this._pathroot.classname="leaflet-zoom-animated",this.on("zoomanim",this._animatepathzoom),this.on("zoomend",this._endpathzoom)),this.on("moveend",this._updatecanvasviewport),this._updatecanvasviewport())},_updatecanvasviewport:function(){if(!this._pathzooming){this._updatepathviewport();var t=this._pathviewport,e=t.min,i=t.max.subtract(e),o=this._pathroot;n.domutil.setposition(o,e),o.width=i.x,o.height=i.y,o.getcontext("2d").translate(-e.x,-e.y)}}}),n.lineutil={simplify:function(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=this._reducepoints(t,i),t=this._simplifydp(t,i)},pointtosegmentdistance:function(t,e,i){return math.sqrt(this._sqclosestpointonsegment(t,e,i,!0))},closestpointonsegment:function(t,e,i){return this._sqclosestpointonsegment(t,e,i)},_simplifydp:function(t,e){var n=t.length,o=typeof uint8array!=i+""?uint8array:array,s=new o(n);s[0]=s[n-1]=1,this._simplifydpstep(t,s,e,0,n-1);var a,r=[];for(a=0;n>a;a++)s[a]&&r.push(t[a]);return r},_simplifydpstep:function(t,e,i,n,o){var s,a,r,h=0;for(a=n+1;o-1>=a;a++)r=this._sqclosestpointonsegment(t[a],t[n],t[o],!0),r>h&&(s=a,h=r);h>i&&(e[s]=1,this._simplifydpstep(t,e,i,n,s),this._simplifydpstep(t,e,i,s,o))},_reducepoints:function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;s>n;n++)this._sqdist(t[n],t[o])>e&&(i.push(t[n]),o=n);return s-1>o&&i.push(t[s-1]),i},clipsegment:function(t,e,i,n){var o,s,a,r=n?this._lastcode:this._getbitcode(t,i),h=this._getbitcode(e,i);for(this._lastcode=h;;){if(!(r|h))return[t,e];if(r&h)return!1;o=r||h,s=this._getedgeintersection(t,e,o,i),a=this._getbitcode(s,i),o===r?(t=s,r=a):(e=s,h=a)}},_getedgeintersection:function(t,e,o,s){var a=e.x-t.x,r=e.y-t.y,h=s.min,l=s.max;return 8&o?new n.point(t.x+a*(l.y-t.y)/r,l.y):4&o?new n.point(t.x+a*(h.y-t.y)/r,h.y):2&o?new n.point(l.x,t.y+r*(l.x-t.x)/a):1&o?new n.point(h.x,t.y+r*(h.x-t.x)/a):i},_getbitcode:function(t,e){var i=0;return t.xe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i},_sqdist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n},_sqclosestpointonsegment:function(t,e,i,o){var s,a=e.x,r=e.y,h=i.x-a,l=i.y-r,u=h*h+l*l;return u>0&&(s=((t.x-a)*h+(t.y-r)*l)/u,s>1?(a=i.x,r=i.y):s>0&&(a+=h*s,r+=l*s)),h=t.x-a,l=t.y-r,o?h*h+l*l:new n.point(a,r)}},n.polyline=n.path.extend({initialize:function(t,e){n.path.prototype.initialize.call(this,e),this._latlngs=this._convertlatlngs(t)},options:{smoothfactor:1,noclip:!1},projectlatlngs:function(){this._originalpoints=[];for(var t=0,e=this._latlngs.length;e>t;t++)this._originalpoints[t]=this._map.latlngtolayerpoint(this._latlngs[t])},getpathstring:function(){for(var t=0,e=this._parts.length,i="";e>t;t++)i+=this._getpathpartstr(this._parts[t]);return i},getlatlngs:function(){return this._latlngs},setlatlngs:function(t){return this._latlngs=this._convertlatlngs(t),this.redraw()},addlatlng:function(t){return this._latlngs.push(n.latlng(t)),this.redraw()},splicelatlngs:function(){var t=[].splice.apply(this._latlngs,arguments);return this._convertlatlngs(this._latlngs),this.redraw(),t},closestlayerpoint:function(t){for(var e,i,o=1/0,s=this._parts,a=null,r=0,h=s.length;h>r;r++)for(var l=s[r],u=1,c=l.length;c>u;u++){e=l[u-1],i=l[u]; var _=n.lineutil._sqclosestpointonsegment(t,e,i,!0);o>_&&(o=_,a=n.lineutil._sqclosestpointonsegment(t,e,i))}return a&&(a.distance=math.sqrt(o)),a},getbounds:function(){var t,e,i=new n.latlngbounds,o=this.getlatlngs();for(t=0,e=o.length;e>t;t++)i.extend(o[t]);return i},_convertlatlngs:function(t){var e,i;for(e=0,i=t.length;i>e;e++){if(n.util.isarray(t[e])&&"number"!=typeof t[e][0])return;t[e]=n.latlng(t[e])}return t},_initevents:function(){n.path.prototype._initevents.call(this)},_getpathpartstr:function(t){for(var e,i=n.path.vml,o=0,s=t.length,a="";s>o;o++)e=t[o],i&&e._round(),a+=(o?"l":"m")+e.x+" "+e.y;return a},_clippoints:function(){var t,e,o,s=this._originalpoints,a=s.length;if(this.options.noclip)return this._parts=[s],i;this._parts=[];var r=this._parts,h=this._map._pathviewport,l=n.lineutil;for(t=0,e=0;a-1>t;t++)o=l.clipsegment(s[t],s[t+1],h,t),o&&(r[e]=r[e]||[],r[e].push(o[0]),(o[1]!==s[t+1]||t===a-2)&&(r[e].push(o[1]),e++))},_simplifypoints:function(){for(var t=this._parts,e=n.lineutil,i=0,o=t.length;o>i;i++)t[i]=e.simplify(t[i],this.options.smoothfactor)},_updatepath:function(){this._map&&(this._clippoints(),this._simplifypoints(),n.path.prototype._updatepath.call(this))}}),n.polyline=function(t,e){return new n.polyline(t,e)},n.polyutil={},n.polyutil.clippolygon=function(t,e){var i,o,s,a,r,h,l,u,c,_=[1,4,2,8],d=n.lineutil;for(o=0,l=t.length;l>o;o++)t[o]._code=d._getbitcode(t[o],e);for(a=0;4>a;a++){for(u=_[a],i=[],o=0,l=t.length,s=l-1;l>o;s=o++)r=t[o],h=t[s],r._code&u?h._code&u||(c=d._getedgeintersection(h,r,u,e),c._code=d._getbitcode(c,e),i.push(c)):(h._code&u&&(c=d._getedgeintersection(h,r,u,e),c._code=d._getbitcode(c,e),i.push(c)),i.push(r));t=i}return t},n.polygon=n.polyline.extend({options:{fill:!0},initialize:function(t,e){n.polyline.prototype.initialize.call(this,t,e),t&&n.util.isarray(t[0])&&"number"!=typeof t[0][0]&&(this._latlngs=this._convertlatlngs(t[0]),this._holes=t.slice(1))},projectlatlngs:function(){if(n.polyline.prototype.projectlatlngs.call(this),this._holepoints=[],this._holes){var t,e,i,o;for(t=0,i=this._holes.length;i>t;t++)for(this._holepoints[t]=[],e=0,o=this._holes[t].length;o>e;e++)this._holepoints[t][e]=this._map.latlngtolayerpoint(this._holes[t][e])}},_clippoints:function(){var t=this._originalpoints,e=[];if(this._parts=[t].concat(this._holepoints),!this.options.noclip){for(var i=0,o=this._parts.length;o>i;i++){var s=n.polyutil.clippolygon(this._parts[i],this._map._pathviewport);s.length&&e.push(s)}this._parts=e}},_getpathpartstr:function(t){var e=n.polyline.prototype._getpathpartstr.call(this,t);return e+(n.browser.svg?"z":"x")}}),n.polygon=function(t,e){return new n.polygon(t,e)},function(){function t(t){return n.featuregroup.extend({initialize:function(t,e){this._layers={},this._options=e,this.setlatlngs(t)},setlatlngs:function(e){var i=0,n=e.length;for(this.eachlayer(function(t){n>i?t.setlatlngs(e[i++]):this.removelayer(t)},this);n>i;)this.addlayer(new t(e[i++],this._options));return this}})}n.multipolyline=t(n.polyline),n.multipolygon=t(n.polygon),n.multipolyline=function(t,e){return new n.multipolyline(t,e)},n.multipolygon=function(t,e){return new n.multipolygon(t,e)}}(),n.rectangle=n.polygon.extend({initialize:function(t,e){n.polygon.prototype.initialize.call(this,this._boundstolatlngs(t),e)},setbounds:function(t){this.setlatlngs(this._boundstolatlngs(t))},_boundstolatlngs:function(t){return t=n.latlngbounds(t),[t.getsouthwest(),t.getnorthwest(),t.getnortheast(),t.getsoutheast()]}}),n.rectangle=function(t,e){return new n.rectangle(t,e)},n.circle=n.path.extend({initialize:function(t,e,i){n.path.prototype.initialize.call(this,i),this._latlng=n.latlng(t),this._mradius=e},options:{fill:!0},setlatlng:function(t){return this._latlng=n.latlng(t),this.redraw()},setradius:function(t){return this._mradius=t,this.redraw()},projectlatlngs:function(){var t=this._getlngradius(),e=new n.latlng(this._latlng.lat,this._latlng.lng-t),i=this._map.latlngtolayerpoint(e);this._point=this._map.latlngtolayerpoint(this._latlng),this._radius=math.max(math.round(this._point.x-i.x),1)},getbounds:function(){var t=this._getlngradius(),e=360*(this._mradius/40075017),i=this._latlng,o=new n.latlng(i.lat-e,i.lng-t),s=new n.latlng(i.lat+e,i.lng+t);return new n.latlngbounds(o,s)},getlatlng:function(){return this._latlng},getpathstring:function(){var t=this._point,e=this._radius;return this._checkifempty()?"":n.browser.svg?"m"+t.x+","+(t.y-e)+"a"+e+","+e+",0,1,1,"+(t.x-.1)+","+(t.y-e)+" z":(t._round(),e=math.round(e),"al "+t.x+","+t.y+" "+e+","+e+" 0,"+23592600)},getradius:function(){return this._mradius},_getlatradius:function(){return 360*(this._mradius/40075017)},_getlngradius:function(){return this._getlatradius()/math.cos(n.latlng.deg_to_rad*this._latlng.lat)},_checkifempty:function(){if(!this._map)return!1;var t=this._map._pathviewport,e=this._radius,i=this._point;return i.x-e>t.max.x||i.y-e>t.max.y||i.x+ei;i++)for(l=this._parts[i],o=0,r=l.length,s=r-1;r>o;s=o++)if((e||0!==o)&&(h=n.lineutil.pointtosegmentdistance(t,l[s],l[o]),u>=h))return!0;return!1}}:{}),n.polygon.include(n.path.canvas?{_containspoint:function(t){var e,i,o,s,a,r,h,l,u=!1;if(n.polyline.prototype._containspoint.call(this,t,!0))return!0;for(s=0,h=this._parts.length;h>s;s++)for(e=this._parts[s],a=0,l=e.length,r=l-1;l>a;r=a++)i=e[a],o=e[r],i.y>t.y!=o.y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(u=!u);return u}}:{}),n.circle.include(n.path.canvas?{_drawpath:function(){var t=this._point;this._ctx.beginpath(),this._ctx.arc(t.x,t.y,this._radius,0,2*math.pi,!1)},_containspoint:function(t){var e=this._point,i=this.options.stroke?this.options.weight/2:0;return t.distanceto(e)<=this._radius+i}}:{}),n.geojson=n.featuregroup.extend({initialize:function(t,e){n.setoptions(this,e),this._layers={},t&&this.adddata(t)},adddata:function(t){var e,i,o=n.util.isarray(t)?t:t.features;if(o){for(e=0,i=o.length;i>e;e++)(o[e].geometries||o[e].geometry||o[e].features)&&this.adddata(o[e]);return this}var s=this.options;if(!s.filter||s.filter(t)){var a=n.geojson.geometrytolayer(t,s.pointtolayer);return a.feature=t,a.defaultoptions=a.options,this.resetstyle(a),s.oneachfeature&&s.oneachfeature(t,a),this.addlayer(a)}},resetstyle:function(t){var e=this.options.style;e&&(n.util.extend(t.options,t.defaultoptions),this._setlayerstyle(t,e))},setstyle:function(t){this.eachlayer(function(e){this._setlayerstyle(e,t)},this)},_setlayerstyle:function(t,e){"function"==typeof e&&(e=e(t.feature)),t.setstyle&&t.setstyle(e)}}),n.extend(n.geojson,{geometrytolayer:function(t,e){var i,o,s,a,r,h="feature"===t.type?t.geometry:t,l=h.coordinates,u=[];switch(h.type){case"point":return i=this.coordstolatlng(l),e?e(t,i):new n.marker(i);case"multipoint":for(s=0,a=l.length;a>s;s++)i=this.coordstolatlng(l[s]),r=e?e(t,i):new n.marker(i),u.push(r);return new n.featuregroup(u);case"linestring":return o=this.coordstolatlngs(l),new n.polyline(o);case"polygon":return o=this.coordstolatlngs(l,1),new n.polygon(o);case"multilinestring":return o=this.coordstolatlngs(l,1),new n.multipolyline(o);case"multipolygon":return o=this.coordstolatlngs(l,2),new n.multipolygon(o);case"geometrycollection":for(s=0,a=h.geometries.length;a>s;s++)r=this.geometrytolayer({geometry:h.geometries[s],type:"feature",properties:t.properties},e),u.push(r);return new n.featuregroup(u);default:throw error("invalid geojson object.")}},coordstolatlng:function(t,e){var i=parsefloat(t[e?0:1]),o=parsefloat(t[e?1:0]);return new n.latlng(i,o)},coordstolatlngs:function(t,e,i){var n,o,s,a=[];for(o=0,s=t.length;s>o;o++)n=e?this.coordstolatlngs(t[o],e-1,i):this.coordstolatlng(t[o],i),a.push(n);return a}}),n.geojson=function(t,e){return new n.geojson(t,e)},n.domevent={addlistener:function(t,e,o,s){var a,r,h,l=n.stamp(o),u="_leaflet_"+e+l;return t[u]?this:(a=function(e){return o.call(s||t,e||n.domevent._getevent())},n.browser.mstouch&&0===e.indexof("touch")?this.addmstouchlistener(t,e,a,l):(n.browser.touch&&"dblclick"===e&&this.adddoubletaplistener&&this.adddoubletaplistener(t,a,l),"addeventlistener"in t?"mousewheel"===e?(t.addeventlistener("dommousescroll",a,!1),t.addeventlistener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?(r=a,h="mouseenter"===e?"mouseover":"mouseout",a=function(e){return n.domevent._checkmouse(t,e)?r(e):i},t.addeventlistener(h,a,!1)):t.addeventlistener(e,a,!1):"attachevent"in t&&t.attachevent("on"+e,a),t[u]=a,this))},removelistener:function(t,e,i){var o=n.stamp(i),s="_leaflet_"+e+o,a=t[s];if(a)return n.browser.mstouch&&0===e.indexof("touch")?this.removemstouchlistener(t,e,o):n.browser.touch&&"dblclick"===e&&this.removedoubletaplistener?this.removedoubletaplistener(t,o):"removeeventlistener"in t?"mousewheel"===e?(t.removeeventlistener("dommousescroll",a,!1),t.removeeventlistener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?t.removeeventlistener("mouseenter"===e?"mouseover":"mouseout",a,!1):t.removeeventlistener(e,a,!1):"detachevent"in t&&t.detachevent("on"+e,a),t[s]=null,this},stoppropagation:function(t){return t.stoppropagation?t.stoppropagation():t.cancelbubble=!0,this},disableclickpropagation:function(t){for(var e=n.domevent.stoppropagation,i=n.draggable.start.length-1;i>=0;i--)n.domevent.addlistener(t,n.draggable.start[i],e);return n.domevent.addlistener(t,"click",e).addlistener(t,"dblclick",e)},preventdefault:function(t){return t.preventdefault?t.preventdefault():t.returnvalue=!1,this},stop:function(t){return n.domevent.preventdefault(t).stoppropagation(t)},getmouseposition:function(t,i){var o=e.body,s=e.documentelement,a=t.pagex?t.pagex:t.clientx+o.scrollleft+s.scrollleft,r=t.pagey?t.pagey:t.clienty+o.scrolltop+s.scrolltop,h=new n.point(a,r);return i?h._subtract(n.domutil.getviewportoffset(i)):h},getwheeldelta:function(t){var e=0;return t.wheeldelta&&(e=t.wheeldelta/120),t.detail&&(e=-t.detail/3),e},_checkmouse:function(t,e){var i=e.relatedtarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentnode}catch(n){return!1}return i!==t},_getevent:function(){var e=t.event;if(!e)for(var i=arguments.callee.caller;i&&(e=i.arguments[0],!e||t.event!==e.constructor);)i=i.caller;return e}},n.domevent.on=n.domevent.addlistener,n.domevent.off=n.domevent.removelistener,n.draggable=n.class.extend({includes:n.mixin.events,statics:{start:n.browser.touch?["touchstart","mousedown"]:["mousedown"],end:{mousedown:"mouseup",touchstart:"touchend",mspointerdown:"touchend"},move:{mousedown:"mousemove",touchstart:"touchmove",mspointerdown:"touchmove"},tap_tolerance:15},initialize:function(t,e,i){this._element=t,this._dragstarttarget=e||t,this._longpress=i&&!n.browser.mstouch},enable:function(){if(!this._enabled){for(var t=n.draggable.start.length-1;t>=0;t--)n.domevent.on(this._dragstarttarget,n.draggable.start[t],this._ondown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var t=n.draggable.start.length-1;t>=0;t--)n.domevent.off(this._dragstarttarget,n.draggable.start[t],this._ondown,this);this._enabled=!1,this._moved=!1}},_ondown:function(t){if(!(!n.browser.touch&&t.shiftkey||1!==t.which&&1!==t.button&&!t.touches||(n.domevent.preventdefault(t),n.domevent.stoppropagation(t),n.draggable._disabled))){if(this._simulateclick=!0,t.touches&&t.touches.length>1)return this._simulateclick=!1,cleartimeout(this._longpresstimeout),i;var o=t.touches&&1===t.touches.length?t.touches[0]:t,s=o.target;n.browser.touch&&"a"===s.tagname.tolowercase()&&n.domutil.addclass(s,"leaflet-active"),this._moved=!1,this._moving||(this._startpoint=new n.point(o.clientx,o.clienty),this._startpos=this._newpos=n.domutil.getposition(this._element),t.touches&&1===t.touches.length&&n.browser.touch&&this._longpress&&(this._longpresstimeout=settimeout(n.bind(function(){var t=this._newpos&&this._newpos.distanceto(this._startpos)||0;n.draggable.tap_tolerance>t&&(this._simulateclick=!1,this._onup(),this._simulateevent("contextmenu",o))},this),1e3)),n.domevent.on(e,n.draggable.move[t.type],this._onmove,this),n.domevent.on(e,n.draggable.end[t.type],this._onup,this))}},_onmove:function(t){if(!(t.touches&&t.touches.length>1)){var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new n.point(e.clientx,e.clienty),o=i.subtract(this._startpoint);(o.x||o.y)&&(n.domevent.preventdefault(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startpos=n.domutil.getposition(this._element).subtract(o),n.browser.touch||(n.domutil.disabletextselection(),this._setmovingcursor())),this._newpos=this._startpos.add(o),this._moving=!0,n.util.cancelanimframe(this._animrequest),this._animrequest=n.util.requestanimframe(this._updateposition,this,!0,this._dragstarttarget))}},_updateposition:function(){this.fire("predrag"),n.domutil.setposition(this._element,this._newpos),this.fire("drag")},_onup:function(t){var i;if(cleartimeout(this._longpresstimeout),this._simulateclick&&t.changedtouches){var o=t.changedtouches[0],s=o.target,a=this._newpos&&this._newpos.distanceto(this._startpos)||0;"a"===s.tagname.tolowercase()&&n.domutil.removeclass(s,"leaflet-active"),n.draggable.tap_tolerance>a&&(i=o)}n.browser.touch||(n.domutil.enabletextselection(),this._restorecursor());for(var r in n.draggable.move)n.draggable.move.hasownproperty(r)&&(n.domevent.off(e,n.draggable.move[r],this._onmove),n.domevent.off(e,n.draggable.end[r],this._onup));this._moved&&(n.util.cancelanimframe(this._animrequest),this.fire("dragend")),this._moving=!1,i&&(this._moved=!1,this._simulateevent("click",i))},_setmovingcursor:function(){n.domutil.addclass(e.body,"leaflet-dragging")},_restorecursor:function(){n.domutil.removeclass(e.body,"leaflet-dragging")},_simulateevent:function(i,n){var o=e.createevent("mouseevents");o.initmouseevent(i,!0,!0,t,1,n.screenx,n.screeny,n.clientx,n.clienty,!1,!1,!1,!1,0,null),n.target.dispatchevent(o)}}),n.handler=n.class.extend({initialize:function(t){this._map=t},enable:function(){this._enabled||(this._enabled=!0,this.addhooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removehooks())},enabled:function(){return!!this._enabled}}),n.map.mergeoptions({dragging:!0,inertia:!n.browser.android23,inertiadeceleration:3400,inertiamaxspeed:1/0,inertiathreshold:n.browser.touch?32:18,easelinearity:.25,longpress:!0,worldcopyjump:!1}),n.map.drag=n.handler.extend({addhooks:function(){if(!this._draggable){var t=this._map;this._draggable=new n.draggable(t._mappane,t._container,t.options.longpress),this._draggable.on({dragstart:this._ondragstart,drag:this._ondrag,dragend:this._ondragend},this),t.options.worldcopyjump&&(this._draggable.on("predrag",this._onpredrag,this),t.on("viewreset",this._onviewreset,this))}this._draggable.enable()},removehooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_ondragstart:function(){var t=this._map;t._pananim&&t._pananim.stop(),t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_ondrag:function(){if(this._map.options.inertia){var t=this._lasttime=+new date,e=this._lastpos=this._draggable._newpos;this._positions.push(e),this._times.push(t),t-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onviewreset:function(){var t=this._map.getsize()._divideby(2),e=this._map.latlngtolayerpoint(new n.latlng(0,0));this._initialworldoffset=e.subtract(t).x,this._worldwidth=this._map.project(new n.latlng(0,180)).x},_onpredrag:function(){var t=this._worldwidth,e=math.round(t/2),i=this._initialworldoffset,n=this._draggable._newpos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,a=math.abs(o+i)e.inertiathreshold||!this._positions[0];if(o)t.fire("moveend");else{var s=this._lastpos.subtract(this._positions[0]),a=(this._lasttime+i-this._times[0])/1e3,r=e.easelinearity,h=s.multiplyby(r/a),l=h.distanceto(new n.point(0,0)),u=math.min(e.inertiamaxspeed,l),c=h.multiplyby(u/l),_=u/(e.inertiadeceleration*r),d=c.multiplyby(-_/2).round();n.util.requestanimframe(function(){t.panby(d,_,r)})}t.fire("dragend"),e.maxbounds&&n.util.requestanimframe(this._paninsidemaxbounds,t,!0,t._container)},_paninsidemaxbounds:function(){this.paninsidebounds(this.options.maxbounds)}}),n.map.addinithook("addhandler","dragging",n.map.drag),n.map.mergeoptions({doubleclickzoom:!0}),n.map.doubleclickzoom=n.handler.extend({addhooks:function(){this._map.on("dblclick",this._ondoubleclick)},removehooks:function(){this._map.off("dblclick",this._ondoubleclick)},_ondoubleclick:function(t){this.setview(t.latlng,this._zoom+1)}}),n.map.addinithook("addhandler","doubleclickzoom",n.map.doubleclickzoom),n.map.mergeoptions({scrollwheelzoom:!0}),n.map.scrollwheelzoom=n.handler.extend({addhooks:function(){n.domevent.on(this._map._container,"mousewheel",this._onwheelscroll,this),this._delta=0},removehooks:function(){n.domevent.off(this._map._container,"mousewheel",this._onwheelscroll)},_onwheelscroll:function(t){var e=n.domevent.getwheeldelta(t);this._delta+=e,this._lastmousepos=this._map.mouseeventtocontainerpoint(t),this._starttime||(this._starttime=+new date);var i=math.max(40-(+new date-this._starttime),0);cleartimeout(this._timer),this._timer=settimeout(n.bind(this._performzoom,this),i),n.domevent.preventdefault(t),n.domevent.stoppropagation(t)},_performzoom:function(){var t=this._map,e=this._delta,i=t.getzoom();if(e=e>0?math.ceil(e):math.round(e),e=math.max(math.min(e,4),-4),e=t._limitzoom(i+e)-i,this._delta=0,this._starttime=null,e){var n=i+e,o=this._getcenterforscrollwheelzoom(n);t.setview(o,n)}},_getcenterforscrollwheelzoom:function(t){var e=this._map,i=e.getzoomscale(t),n=e.getsize()._divideby(2),o=this._lastmousepos._subtract(n)._multiplyby(1-1/i),s=e._gettopleftpoint()._add(n)._add(o);return e.unproject(s)}}),n.map.addinithook("addhandler","scrollwheelzoom",n.map.scrollwheelzoom),n.extend(n.domevent,{_touchstart:n.browser.mstouch?"mspointerdown":"touchstart",_touchend:n.browser.mstouch?"mspointerup":"touchend",adddoubletaplistener:function(t,i,o){function s(t){var e;if(n.browser.mstouch?(p.push(t.pointerid),e=p.length):e=t.touches.length,!(e>1)){var i=date.now(),o=i-(r||i);h=t.touches?t.touches[0]:t,l=o>0&&u>=o,r=i}}function a(t){if(n.browser.mstouch){var e=p.indexof(t.pointerid);if(-1===e)return;p.splice(e,1)}if(l){if(n.browser.mstouch){var o,s={};for(var a in h)o=h[a],s[a]="function"==typeof o?o.bind(h):o;h=s}h.type="dblclick",i(h),r=null}}var r,h,l=!1,u=250,c="_leaflet_",_=this._touchstart,d=this._touchend,p=[];t[c+_+o]=s,t[c+d+o]=a;var m=n.browser.mstouch?e.documentelement:t;return t.addeventlistener(_,s,!1),m.addeventlistener(d,a,!1),n.browser.mstouch&&m.addeventlistener("mspointercancel",a,!1),this},removedoubletaplistener:function(t,i){var o="_leaflet_";return t.removeeventlistener(this._touchstart,t[o+this._touchstart+i],!1),(n.browser.mstouch?e.documentelement:t).removeeventlistener(this._touchend,t[o+this._touchend+i],!1),n.browser.mstouch&&e.documentelement.removeeventlistener("mspointercancel",t[o+this._touchend+i],!1),this}}),n.extend(n.domevent,{_mstouches:[],_msdocumentlistener:!1,addmstouchlistener:function(t,e,i,n){switch(e){case"touchstart":return this.addmstouchlistenerstart(t,e,i,n);case"touchend":return this.addmstouchlistenerend(t,e,i,n);case"touchmove":return this.addmstouchlistenermove(t,e,i,n);default:throw"unknown touch event type"}},addmstouchlistenerstart:function(t,i,n,o){var s="_leaflet_",a=this._mstouches,r=function(t){for(var e=!1,i=0;a.length>i;i++)if(a[i].pointerid===t.pointerid){e=!0;break}e||a.push(t),t.touches=a.slice(),t.changedtouches=[t],n(t)};if(t[s+"touchstart"+o]=r,t.addeventlistener("mspointerdown",r,!1),!this._msdocumentlistener){var h=function(t){for(var e=0;a.length>e;e++)if(a[e].pointerid===t.pointerid){a.splice(e,1);break}};e.documentelement.addeventlistener("mspointerup",h,!1),e.documentelement.addeventlistener("mspointercancel",h,!1),this._msdocumentlistener=!0}return this},addmstouchlistenermove:function(t,e,i,n){function o(t){if(t.pointertype!==t.mspointer_type_mouse||0!==t.buttons){for(var e=0;a.length>e;e++)if(a[e].pointerid===t.pointerid){a[e]=t;break}t.touches=a.slice(),t.changedtouches=[t],i(t)}}var s="_leaflet_",a=this._mstouches;return t[s+"touchmove"+n]=o,t.addeventlistener("mspointermove",o,!1),this},addmstouchlistenerend:function(t,e,i,n){var o="_leaflet_",s=this._mstouches,a=function(t){for(var e=0;s.length>e;e++)if(s[e].pointerid===t.pointerid){s.splice(e,1);break}t.touches=s.slice(),t.changedtouches=[t],i(t)};return t[o+"touchend"+n]=a,t.addeventlistener("mspointerup",a,!1),t.addeventlistener("mspointercancel",a,!1),this},removemstouchlistener:function(t,e,i){var n="_leaflet_",o=t[n+e+i];switch(e){case"touchstart":t.removeeventlistener("mspointerdown",o,!1);break;case"touchmove":t.removeeventlistener("mspointermove",o,!1);break;case"touchend":t.removeeventlistener("mspointerup",o,!1),t.removeeventlistener("mspointercancel",o,!1)}return this}}),n.map.mergeoptions({touchzoom:n.browser.touch&&!n.browser.android23}),n.map.touchzoom=n.handler.extend({addhooks:function(){n.domevent.on(this._map._container,"touchstart",this._ontouchstart,this)},removehooks:function(){n.domevent.off(this._map._container,"touchstart",this._ontouchstart,this)},_ontouchstart:function(t){var i=this._map;if(t.touches&&2===t.touches.length&&!i._animatingzoom&&!this._zooming){var o=i.mouseeventtolayerpoint(t.touches[0]),s=i.mouseeventtolayerpoint(t.touches[1]),a=i._getcenterlayerpoint();this._startcenter=o.add(s)._divideby(2),this._startdist=o.distanceto(s),this._moved=!1,this._zooming=!0,this._centeroffset=a.subtract(this._startcenter),i._pananim&&i._pananim.stop(),n.domevent.on(e,"touchmove",this._ontouchmove,this).on(e,"touchend",this._ontouchend,this),n.domevent.preventdefault(t)}},_ontouchmove:function(t){if(t.touches&&2===t.touches.length){var e=this._map,i=e.mouseeventtolayerpoint(t.touches[0]),o=e.mouseeventtolayerpoint(t.touches[1]);this._scale=i.distanceto(o)/this._startdist,this._delta=i._add(o)._divideby(2)._subtract(this._startcenter),1!==this._scale&&(this._moved||(n.domutil.addclass(e._mappane,"leaflet-zoom-anim leaflet-touching"),e.fire("movestart").fire("zoomstart")._preparetilebg(),this._moved=!0),n.util.cancelanimframe(this._animrequest),this._animrequest=n.util.requestanimframe(this._updateonmove,this,!0,this._map._container),n.domevent.preventdefault(t))}},_updateonmove:function(){var t=this._map,e=this._getscaleorigin(),i=t.layerpointtolatlng(e);t.fire("zoomanim",{center:i,zoom:t.getscalezoom(this._scale)}),t._tilebg.style[n.domutil.transform]=n.domutil.gettranslatestring(this._delta)+" "+n.domutil.getscalestring(this._scale,this._startcenter)},_ontouchend:function(){if(this._moved&&this._zooming){var t=this._map;this._zooming=!1,n.domutil.removeclass(t._mappane,"leaflet-touching"),n.domevent.off(e,"touchmove",this._ontouchmove).off(e,"touchend",this._ontouchend);var i=this._getscaleorigin(),o=t.layerpointtolatlng(i),s=t.getzoom(),a=t.getscalezoom(this._scale)-s,r=a>0?math.ceil(a):math.floor(a),h=t._limitzoom(s+r);t.fire("zoomanim",{center:o,zoom:h}),t._runanimation(o,h,t.getzoomscale(h)/this._scale,i,!0)}},_getscaleorigin:function(){var t=this._centeroffset.subtract(this._delta).divideby(this._scale);return this._startcenter.add(t)}}),n.map.addinithook("addhandler","touchzoom",n.map.touchzoom),n.map.mergeoptions({boxzoom:!0}),n.map.boxzoom=n.handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlaypane},addhooks:function(){n.domevent.on(this._container,"mousedown",this._onmousedown,this)},removehooks:function(){n.domevent.off(this._container,"mousedown",this._onmousedown)},_onmousedown:function(t){return!t.shiftkey||1!==t.which&&1!==t.button?!1:(n.domutil.disabletextselection(),this._startlayerpoint=this._map.mouseeventtolayerpoint(t),this._box=n.domutil.create("div","leaflet-zoom-box",this._pane),n.domutil.setposition(this._box,this._startlayerpoint),this._container.style.cursor="crosshair",n.domevent.on(e,"mousemove",this._onmousemove,this).on(e,"mouseup",this._onmouseup,this).preventdefault(t),this._map.fire("boxzoomstart"),i)},_onmousemove:function(t){var e=this._startlayerpoint,i=this._box,o=this._map.mouseeventtolayerpoint(t),s=o.subtract(e),a=new n.point(math.min(o.x,e.x),math.min(o.y,e.y));n.domutil.setposition(i,a),i.style.width=math.max(0,math.abs(s.x)-4)+"px",i.style.height=math.max(0,math.abs(s.y)-4)+"px"},_onmouseup:function(t){this._pane.removechild(this._box),this._container.style.cursor="",n.domutil.enabletextselection(),n.domevent.off(e,"mousemove",this._onmousemove).off(e,"mouseup",this._onmouseup);var i=this._map,o=i.mouseeventtolayerpoint(t);if(!this._startlayerpoint.equals(o)){var s=new n.latlngbounds(i.layerpointtolatlng(this._startlayerpoint),i.layerpointtolatlng(o));i.fitbounds(s),i.fire("boxzoomend",{boxzoombounds:s})}}}),n.map.addinithook("addhandler","boxzoom",n.map.boxzoom),n.map.mergeoptions({keyboard:!0,keyboardpanoffset:80,keyboardzoomoffset:1}),n.map.keyboard=n.handler.extend({keycodes:{left:[37],right:[39],down:[40],up:[38],zoomin:[187,107,61],zoomout:[189,109,173]},initialize:function(t){this._map=t,this._setpanoffset(t.options.keyboardpanoffset),this._setzoomoffset(t.options.keyboardzoomoffset)},addhooks:function(){var t=this._map._container;-1===t.tabindex&&(t.tabindex="0"),n.domevent.on(t,"focus",this._onfocus,this).on(t,"blur",this._onblur,this).on(t,"mousedown",this._onmousedown,this),this._map.on("focus",this._addhooks,this).on("blur",this._removehooks,this)},removehooks:function(){this._removehooks();var t=this._map._container;n.domevent.off(t,"focus",this._onfocus,this).off(t,"blur",this._onblur,this).off(t,"mousedown",this._onmousedown,this),this._map.off("focus",this._addhooks,this).off("blur",this._removehooks,this)},_onmousedown:function(){this._focused||this._map._container.focus()},_onfocus:function(){this._focused=!0,this._map.fire("focus")},_onblur:function(){this._focused=!1,this._map.fire("blur")},_setpanoffset:function(t){var e,i,n=this._pankeys={},o=this.keycodes;for(e=0,i=o.left.length;i>e;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;i>e;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;i>e;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;i>e;e++)n[o.up[e]]=[0,-1*t]},_setzoomoffset:function(t){var e,i,n=this._zoomkeys={},o=this.keycodes;for(e=0,i=o.zoomin.length;i>e;e++)n[o.zoomin[e]]=t;for(e=0,i=o.zoomout.length;i>e;e++)n[o.zoomout[e]]=-t},_addhooks:function(){n.domevent.on(e,"keydown",this._onkeydown,this)},_removehooks:function(){n.domevent.off(e,"keydown",this._onkeydown,this)},_onkeydown:function(t){var e=t.keycode,i=this._map;if(this._pankeys.hasownproperty(e))i.panby(this._pankeys[e]),i.options.maxbounds&&i.paninsidebounds(i.options.maxbounds);else{if(!this._zoomkeys.hasownproperty(e))return;i.setzoom(i.getzoom()+this._zoomkeys[e])}n.domevent.stop(t)}}),n.map.addinithook("addhandler","keyboard",n.map.keyboard),n.handler.markerdrag=n.handler.extend({initialize:function(t){this._marker=t},addhooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new n.draggable(t,t).on("dragstart",this._ondragstart,this).on("drag",this._ondrag,this).on("dragend",this._ondragend,this)),this._draggable.enable()},removehooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_ondragstart:function(){this._marker.closepopup().fire("movestart").fire("dragstart")},_ondrag:function(){var t=this._marker,e=t._shadow,i=n.domutil.getposition(t._icon),o=t._map.layerpointtolatlng(i);e&&n.domutil.setposition(e,i),t._latlng=o,t.fire("move",{latlng:o}).fire("drag")},_ondragend:function(){this._marker.fire("moveend").fire("dragend")}}),n.handler.polyedit=n.handler.extend({options:{icon:new n.divicon({iconsize:new n.point(8,8),classname:"leaflet-div-icon leaflet-editing-icon"})},initialize:function(t,e){this._poly=t,n.setoptions(this,e)},addhooks:function(){this._poly._map&&(this._markergroup||this._initmarkers(),this._poly._map.addlayer(this._markergroup))},removehooks:function(){this._poly._map&&(this._poly._map.removelayer(this._markergroup),delete this._markergroup,delete this._markers)},updatemarkers:function(){this._markergroup.clearlayers(),this._initmarkers()},_initmarkers:function(){this._markergroup||(this._markergroup=new n.layergroup),this._markers=[];var t,e,i,o,s=this._poly._latlngs;for(t=0,i=s.length;i>t;t++)o=this._createmarker(s[t],t),o.on("click",this._onmarkerclick,this),this._markers.push(o);var a,r;for(t=0,e=i-1;i>t;e=t++)(0!==t||n.polygon&&this._poly instanceof n.polygon)&&(a=this._markers[e],r=this._markers[t],this._createmiddlemarker(a,r),this._updateprevnext(a,r))},_createmarker:function(t,e){var i=new n.marker(t,{draggable:!0,icon:this.options.icon});return i._origlatlng=t,i._index=e,i.on("drag",this._onmarkerdrag,this),i.on("dragend",this._fireedit,this),this._markergroup.addlayer(i),i},_fireedit:function(){this._poly.fire("edit")},_onmarkerdrag:function(t){var e=t.target;n.extend(e._origlatlng,e._latlng),e._middleleft&&e._middleleft.setlatlng(this._getmiddlelatlng(e._prev,e)),e._middleright&&e._middleright.setlatlng(this._getmiddlelatlng(e,e._next)),this._poly.redraw()},_onmarkerclick:function(t){if(!(3>this._poly._latlngs.length)){var e=t.target,i=e._index;this._markergroup.removelayer(e),this._markers.splice(i,1),this._poly.splicelatlngs(i,1),this._updateindexes(i,-1),this._updateprevnext(e._prev,e._next),e._middleleft&&this._markergroup.removelayer(e._middleleft),e._middleright&&this._markergroup.removelayer(e._middleright),e._prev&&e._next?this._createmiddlemarker(e._prev,e._next):e._prev?e._next||(e._prev._middleright=null):e._next._middleleft=null,this._poly.fire("edit")}},_updateindexes:function(t,e){this._markergroup.eachlayer(function(i){i._index>t&&(i._index+=e)})},_createmiddlemarker:function(t,e){var i,n,o,s=this._getmiddlelatlng(t,e),a=this._createmarker(s);a.setopacity(.6),t._middleright=e._middleleft=a,n=function(){var n=e._index;a._index=n,a.off("click",i).on("click",this._onmarkerclick,this),s.lat=a.getlatlng().lat,s.lng=a.getlatlng().lng,this._poly.splicelatlngs(n,0,s),this._markers.splice(n,0,a),a.setopacity(1),this._updateindexes(n,1),e._index++,this._updateprevnext(t,a),this._updateprevnext(a,e)},o=function(){a.off("dragstart",n,this),a.off("dragend",o,this),this._createmiddlemarker(t,a),this._createmiddlemarker(a,e)},i=function(){n.call(this),o.call(this),this._poly.fire("edit")},a.on("click",i,this).on("dragstart",n,this).on("dragend",o,this),this._markergroup.addlayer(a)},_updateprevnext:function(t,e){t&&(t._next=e),e&&(e._prev=t)},_getmiddlelatlng:function(t,e){var i=this._poly._map,n=i.latlngtolayerpoint(t.getlatlng()),o=i.latlngtolayerpoint(e.getlatlng());return i.layerpointtolatlng(n._add(o)._divideby(2))}}),n.polyline.addinithook(function(){n.handler.polyedit&&(this.editing=new n.handler.polyedit(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addhooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removehooks()})}),n.control=n.class.extend({options:{position:"topright"},initialize:function(t){n.setoptions(this,t)},getposition:function(){return this.options.position},setposition:function(t){var e=this._map;return e&&e.removecontrol(this),this.options.position=t,e&&e.addcontrol(this),this },addto:function(t){this._map=t;var e=this._container=this.onadd(t),i=this.getposition(),o=t._controlcorners[i];return n.domutil.addclass(e,"leaflet-control"),-1!==i.indexof("bottom")?o.insertbefore(e,o.firstchild):o.appendchild(e),this},removefrom:function(t){var e=this.getposition(),i=t._controlcorners[e];return i.removechild(this._container),this._map=null,this.onremove&&this.onremove(t),this}}),n.control=function(t){return new n.control(t)},n.map.include({addcontrol:function(t){return t.addto(this),this},removecontrol:function(t){return t.removefrom(this),this},_initcontrolpos:function(){function t(t,s){var a=i+t+" "+i+s;e[t+s]=n.domutil.create("div",a,o)}var e=this._controlcorners={},i="leaflet-",o=this._controlcontainer=n.domutil.create("div",i+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")}}),n.control.zoom=n.control.extend({options:{position:"topleft"},onadd:function(t){var e="leaflet-control-zoom",i="leaflet-bar",o=i+"-part",s=n.domutil.create("div",e+" "+i);return this._map=t,this._zoominbutton=this._createbutton("+","zoom in",e+"-in "+o+" "+o+"-top",s,this._zoomin,this),this._zoomoutbutton=this._createbutton("-","zoom out",e+"-out "+o+" "+o+"-bottom",s,this._zoomout,this),t.on("zoomend",this._updatedisabled,this),s},onremove:function(t){t.off("zoomend",this._updatedisabled,this)},_zoomin:function(t){this._map.zoomin(t.shiftkey?3:1)},_zoomout:function(t){this._map.zoomout(t.shiftkey?3:1)},_createbutton:function(t,e,i,o,s,a){var r=n.domutil.create("a",i,o);r.innerhtml=t,r.href="#",r.title=e;var h=n.domevent.stoppropagation;return n.domevent.on(r,"click",h).on(r,"mousedown",h).on(r,"dblclick",h).on(r,"click",n.domevent.preventdefault).on(r,"click",s,a),r},_updatedisabled:function(){var t=this._map,e="leaflet-control-zoom-disabled";n.domutil.removeclass(this._zoominbutton,e),n.domutil.removeclass(this._zoomoutbutton,e),t._zoom===t.getminzoom()&&n.domutil.addclass(this._zoomoutbutton,e),t._zoom===t.getmaxzoom()&&n.domutil.addclass(this._zoominbutton,e)}}),n.map.mergeoptions({zoomcontrol:!0}),n.map.addinithook(function(){this.options.zoomcontrol&&(this.zoomcontrol=new n.control.zoom,this.addcontrol(this.zoomcontrol))}),n.control.zoom=function(t){return new n.control.zoom(t)},n.control.attribution=n.control.extend({options:{position:"bottomright",prefix:'powered by leaflet'},initialize:function(t){n.setoptions(this,t),this._attributions={}},onadd:function(t){return this._container=n.domutil.create("div","leaflet-control-attribution"),n.domevent.disableclickpropagation(this._container),t.on("layeradd",this._onlayeradd,this).on("layerremove",this._onlayerremove,this),this._update(),this._container},onremove:function(t){t.off("layeradd",this._onlayeradd).off("layerremove",this._onlayerremove)},setprefix:function(t){return this.options.prefix=t,this._update(),this},addattribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):i},removeattribution:function(t){return t?(this._attributions[t]--,this._update(),this):i},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions.hasownproperty(e)&&this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerhtml=i.join(" — ")}},_onlayeradd:function(t){t.layer.getattribution&&this.addattribution(t.layer.getattribution())},_onlayerremove:function(t){t.layer.getattribution&&this.removeattribution(t.layer.getattribution())}}),n.map.mergeoptions({attributioncontrol:!0}),n.map.addinithook(function(){this.options.attributioncontrol&&(this.attributioncontrol=(new n.control.attribution).addto(this))}),n.control.attribution=function(t){return new n.control.attribution(t)},n.control.scale=n.control.extend({options:{position:"bottomleft",maxwidth:100,metric:!0,imperial:!0,updatewhenidle:!1},onadd:function(t){this._map=t;var e="leaflet-control-scale",i=n.domutil.create("div",e),o=this.options;return this._addscales(o,e,i),t.on(o.updatewhenidle?"moveend":"move",this._update,this),t.whenready(this._update,this),i},onremove:function(t){t.off(this.options.updatewhenidle?"moveend":"move",this._update,this)},_addscales:function(t,e,i){t.metric&&(this._mscale=n.domutil.create("div",e+"-line",i)),t.imperial&&(this._iscale=n.domutil.create("div",e+"-line",i))},_update:function(){var t=this._map.getbounds(),e=t.getcenter().lat,i=6378137*math.pi*math.cos(e*math.pi/180),n=i*(t.getnortheast().lng-t.getsouthwest().lng)/180,o=this._map.getsize(),s=this.options,a=0;o.x>0&&(a=n*(s.maxwidth/o.x)),this._updatescales(s,a)},_updatescales:function(t,e){t.metric&&e&&this._updatemetric(e),t.imperial&&e&&this._updateimperial(e)},_updatemetric:function(t){var e=this._getroundnum(t);this._mscale.style.width=this._getscalewidth(e/t)+"px",this._mscale.innerhtml=1e3>e?e+" m":e/1e3+" km"},_updateimperial:function(t){var e,i,n,o=3.2808399*t,s=this._iscale;o>5280?(e=o/5280,i=this._getroundnum(e),s.style.width=this._getscalewidth(i/e)+"px",s.innerhtml=i+" mi"):(n=this._getroundnum(o),s.style.width=this._getscalewidth(n/o)+"px",s.innerhtml=n+" ft")},_getscalewidth:function(t){return math.round(this.options.maxwidth*t)-10},_getroundnum:function(t){var e=math.pow(10,(math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),n.control.scale=function(t){return new n.control.scale(t)},n.control.layers=n.control.extend({options:{collapsed:!0,position:"topright",autozindex:!0},initialize:function(t,e,i){n.setoptions(this,i),this._layers={},this._lastzindex=0,this._handlingclick=!1;for(var o in t)t.hasownproperty(o)&&this._addlayer(t[o],o);for(o in e)e.hasownproperty(o)&&this._addlayer(e[o],o,!0)},onadd:function(t){return this._initlayout(),this._update(),t.on("layeradd",this._onlayerchange,this).on("layerremove",this._onlayerchange,this),this._container},onremove:function(t){t.off("layeradd",this._onlayerchange).off("layerremove",this._onlayerchange)},addbaselayer:function(t,e){return this._addlayer(t,e),this._update(),this},addoverlay:function(t,e){return this._addlayer(t,e,!0),this._update(),this},removelayer:function(t){var e=n.stamp(t);return delete this._layers[e],this._update(),this},_initlayout:function(){var t="leaflet-control-layers",e=this._container=n.domutil.create("div",t);n.browser.touch?n.domevent.on(e,"click",n.domevent.stoppropagation):(n.domevent.disableclickpropagation(e),n.domevent.on(e,"mousewheel",n.domevent.stoppropagation));var i=this._form=n.domutil.create("form",t+"-list");if(this.options.collapsed){n.domevent.on(e,"mouseover",this._expand,this).on(e,"mouseout",this._collapse,this);var o=this._layerslink=n.domutil.create("a",t+"-toggle",e);o.href="#",o.title="layers",n.browser.touch?n.domevent.on(o,"click",n.domevent.stoppropagation).on(o,"click",n.domevent.preventdefault).on(o,"click",this._expand,this):n.domevent.on(o,"focus",this._expand,this),this._map.on("movestart",this._collapse,this)}else this._expand();this._baselayerslist=n.domutil.create("div",t+"-base",i),this._separator=n.domutil.create("div",t+"-separator",i),this._overlayslist=n.domutil.create("div",t+"-overlays",i),e.appendchild(i)},_addlayer:function(t,e,i){var o=n.stamp(t);this._layers[o]={layer:t,name:e,overlay:i},this.options.autozindex&&t.setzindex&&(this._lastzindex++,t.setzindex(this._lastzindex))},_update:function(){if(this._container){this._baselayerslist.innerhtml="",this._overlayslist.innerhtml="";var t=!1,e=!1;for(var i in this._layers)if(this._layers.hasownproperty(i)){var n=this._layers[i];this._additem(n),e=e||n.overlay,t=t||!n.overlay}this._separator.style.display=e&&t?"":"none"}},_onlayerchange:function(t){var e=n.stamp(t.layer);this._layers[e]&&!this._handlingclick&&this._update()},_createradioelement:function(t,i){var n='t;t++)e=o[t],i=this._layers[e.layerid],e.checked&&!this._map.haslayer(i.layer)?(this._map.addlayer(i.layer),i.overlay||(n=i.layer)):!e.checked&&this._map.haslayer(i.layer)&&this._map.removelayer(i.layer);n&&(this._map.setzoom(this._map.getzoom()),this._map.fire("baselayerchange",{layer:n})),this._handlingclick=!1},_expand:function(){n.domutil.addclass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.classname=this._container.classname.replace(" leaflet-control-layers-expanded","")}}),n.control.layers=function(t,e,i){return new n.control.layers(t,e,i)},n.posanimation=n.class.extend({includes:n.mixin.events,run:function(t,e,i,o){this.stop(),this._el=t,this._inprogress=!0,this.fire("start"),t.style[n.domutil.transition]="all "+(i||.25)+"s cubic-bezier(0,0,"+(o||.5)+",1)",n.domevent.on(t,n.domutil.transition_end,this._ontransitionend,this),n.domutil.setposition(t,e),n.util.falsefn(t.offsetwidth),this._steptimer=setinterval(n.bind(this.fire,this,"step"),50)},stop:function(){this._inprogress&&(n.domutil.setposition(this._el,this._getpos()),this._ontransitionend(),n.util.falsefn(this._el.offsetwidth))},_transformre:/(-?[\d\.]+), (-?[\d\.]+)\)/,_getpos:function(){var e,i,o,s=this._el,a=t.getcomputedstyle(s);return n.browser.any3d?(o=a[n.domutil.transform].match(this._transformre),e=parsefloat(o[1]),i=parsefloat(o[2])):(e=parsefloat(a.left),i=parsefloat(a.top)),new n.point(e,i,!0)},_ontransitionend:function(){n.domevent.off(this._el,n.domutil.transition_end,this._ontransitionend,this),this._inprogress&&(this._inprogress=!1,this._el.style[n.domutil.transition]="",clearinterval(this._steptimer),this.fire("step").fire("end"))}}),n.map.include({setview:function(t,e,i){e=this._limitzoom(e);var n=this._zoom!==e;if(this._loaded&&!i&&this._layers){this._pananim&&this._pananim.stop();var o=n?this._zoomtoifclose&&this._zoomtoifclose(t,e):this._panbyifclose(t);if(o)return cleartimeout(this._sizetimer),this}return this._resetview(t,e),this},panby:function(t,e,i){if(t=n.point(t),!t.x&&!t.y)return this;this._pananim||(this._pananim=new n.posanimation,this._pananim.on({step:this._onpantransitionstep,end:this._onpantransitionend},this)),this.fire("movestart"),n.domutil.addclass(this._mappane,"leaflet-pan-anim");var o=n.domutil.getposition(this._mappane).subtract(t)._round();return this._pananim.run(this._mappane,o,e||.25,i),this},_onpantransitionstep:function(){this.fire("move")},_onpantransitionend:function(){n.domutil.removeclass(this._mappane,"leaflet-pan-anim"),this.fire("moveend")},_panbyifclose:function(t){var e=this._getcenteroffset(t)._floor();return this._offsetiswithinview(e)?(this.panby(e),!0):!1},_offsetiswithinview:function(t,e){var i=e||1,n=this.getsize();return math.abs(t.x)<=n.x*i&&math.abs(t.y)<=n.y*i}}),n.posanimation=n.domutil.transition?n.posanimation:n.posanimation.extend({run:function(t,e,i,o){this.stop(),this._el=t,this._inprogress=!0,this._duration=i||.25,this._easeoutpower=1/math.max(o||.5,.2),this._startpos=n.domutil.getposition(t),this._offset=e.subtract(this._startpos),this._starttime=+new date,this.fire("start"),this._animate()},stop:function(){this._inprogress&&(this._step(),this._complete())},_animate:function(){this._animid=n.util.requestanimframe(this._animate,this),this._step()},_step:function(){var t=+new date-this._starttime,e=1e3*this._duration;e>t?this._runframe(this._easeout(t/e)):(this._runframe(1),this._complete())},_runframe:function(t){var e=this._startpos.add(this._offset.multiplyby(t));n.domutil.setposition(this._el,e),this.fire("step")},_complete:function(){n.util.cancelanimframe(this._animid),this._inprogress=!1,this.fire("end")},_easeout:function(t){return 1-math.pow(1-t,this._easeoutpower)}}),n.map.mergeoptions({zoomanimation:n.domutil.transition&&!n.browser.android23&&!n.browser.mobileopera}),n.domutil.transition&&n.map.addinithook(function(){n.domevent.on(this._mappane,n.domutil.transition_end,this._catchtransitionend,this)}),n.map.include(n.domutil.transition?{_zoomtoifclose:function(t,e){if(this._animatingzoom)return!0;if(!this.options.zoomanimation)return!1;var i=this.getzoomscale(e),o=this._getcenteroffset(t)._divideby(1-1/i);if(!this._offsetiswithinview(o,1))return!1;n.domutil.addclass(this._mappane,"leaflet-zoom-anim"),this.fire("movestart").fire("zoomstart"),this.fire("zoomanim",{center:t,zoom:e});var s=this._getcenterlayerpoint().add(o);return this._preparetilebg(),this._runanimation(t,e,i,s),!0},_catchtransitionend:function(){this._animatingzoom&&this._onzoomtransitionend()},_runanimation:function(t,e,i,o,s){this._animatetocenter=t,this._animatetozoom=e,this._animatingzoom=!0,n.draggable&&(n.draggable._disabled=!0);var a=n.domutil.transform,r=this._tilebg;cleartimeout(this._cleartilebgtimer),n.util.falsefn(r.offsetwidth);var h=n.domutil.getscalestring(i,o),l=r.style[a];r.style[a]=s?l+" "+h:h+" "+l},_preparetilebg:function(){var t=this._tilepane,e=this._tilebg;if(e&&this._getloadedtilespercentage(e)>.5&&.5>this._getloadedtilespercentage(t))return t.style.visibility="hidden",t.empty=!0,this._stoploadingimages(t),i;e||(e=this._tilebg=this._createpane("leaflet-tile-pane",this._mappane),e.style.zindex=1),e.style[n.domutil.transform]="",e.style.visibility="hidden",e.empty=!0,t.empty=!1,this._tilepane=this._panes.tilepane=e;var o=this._tilebg=t;n.domutil.addclass(o,"leaflet-zoom-animated"),this._stoploadingimages(o)},_getloadedtilespercentage:function(t){var e,i,n=t.getelementsbytagname("img"),o=0;for(e=0,i=n.length;i>e;e++)n[e].complete&&o++;return o/i},_stoploadingimages:function(t){var e,i,o,s=array.prototype.slice.call(t.getelementsbytagname("img"));for(e=0,i=s.length;i>e;e++)o=s[e],o.complete||(o.onload=n.util.falsefn,o.onerror=n.util.falsefn,o.src=n.util.emptyimageurl,o.parentnode.removechild(o))},_onzoomtransitionend:function(){this._restoretilefront(),n.domutil.removeclass(this._mappane,"leaflet-zoom-anim"),n.util.falsefn(this._tilebg.offsetwidth),this._animatingzoom=!1,this._resetview(this._animatetocenter,this._animatetozoom,!0,!0),n.draggable&&(n.draggable._disabled=!1)},_restoretilefront:function(){this._tilepane.innerhtml="",this._tilepane.style.visibility="",this._tilepane.style.zindex=2,this._tilebg.style.zindex=1},_cleartilebg:function(){this._animatingzoom||this.touchzoom._zooming||(this._tilebg.innerhtml="")}}:{}),n.map.include({_defaultlocateoptions:{watch:!1,setview:!1,maxzoom:1/0,timeout:1e4,maximumage:0,enablehighaccuracy:!1},locate:function(t){if(t=this._locationoptions=n.extend(this._defaultlocateoptions,t),!navigator.geolocation)return this._handlegeolocationerror({code:0,message:"geolocation not supported."}),this;var e=n.bind(this._handlegeolocationresponse,this),i=n.bind(this._handlegeolocationerror,this);return t.watch?this._locationwatchid=navigator.geolocation.watchposition(e,i,t):navigator.geolocation.getcurrentposition(e,i,t),this},stoplocate:function(){return navigator.geolocation&&navigator.geolocation.clearwatch(this._locationwatchid),this},_handlegeolocationerror:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locationoptions.setview&&!this._loaded&&this.fitworld(),this.fire("locationerror",{code:e,message:"geolocation error: "+i+"."})},_handlegeolocationresponse:function(t){var e=180*t.coords.accuracy/4e7,i=2*e,o=t.coords.latitude,s=t.coords.longitude,a=new n.latlng(o,s),r=new n.latlng(o-e,s-i),h=new n.latlng(o+e,s+i),l=new n.latlngbounds(r,h),u=this._locationoptions;if(u.setview){var c=math.min(this.getboundszoom(l),u.maxzoom);this.setview(a,c)}this.fire("locationfound",{latlng:a,bounds:l,accuracy:t.coords.accuracy})}})})(this,document);