@nextgis/ngw-leaflet
Version:
Single-file bundle for rapid deployment of Leaflet-based web-gis applications with NextGIS services
5 lines • 341 kB
JavaScript
var NgwLeaflet=function(){"use strict";function t(){}function e(){e.init.call(this)}function i(t){return void 0===t._maxListeners?e.defaultMaxListeners:t._maxListeners}function o(e,o,n,r){var s,a,l,h;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((a=e._events)?(a.newListener&&(e.emit("newListener",o,n.listener?n.listener:n),a=e._events),l=a[o]):(a=e._events=new t,e._eventsCount=0),l){if("function"==typeof l?l=a[o]=r?[n,l]:[l,n]:r?l.unshift(n):l.push(n),!l.warned&&(s=i(e))&&s>0&&l.length>s){l.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+o+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=o,c.count=l.length,h=c,"function"==typeof console.warn?console.warn(h):console.log(h)}}else l=a[o]=n,++e._eventsCount;return e}function n(t,e,i){var o=!1;function n(){t.removeListener(e,n),o||(o=!0,i.apply(t,arguments))}return n.listener=i,n}function r(t){var e=this._events;if(e){var i=e[t];if("function"==typeof i)return 1;if(i)return i.length}return 0}function s(t,e){for(var i=new Array(e);e--;)i[e]=t[e];return i}t.prototype=Object.create(null),e.EventEmitter=e,e.usingDomains=!1,e.prototype.domain=void 0,e.prototype._events=void 0,e.prototype._maxListeners=void 0,e.defaultMaxListeners=10,e.init=function(){this.domain=null,e.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new t,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},e.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},e.prototype.getMaxListeners=function(){return i(this)},e.prototype.emit=function(t){var e,i,o,n,r,a,l,h="error"===t;if(a=this._events)h=h&&null==a.error;else if(!h)return!1;if(l=this.domain,h){if(e=arguments[1],!l){if(e instanceof Error)throw e;var c=new Error('Uncaught, unspecified "error" event. ('+e+")");throw c.context=e,c}return e||(e=new Error('Uncaught, unspecified "error" event')),e.domainEmitter=this,e.domain=l,e.domainThrown=!1,l.emit("error",e),!1}if(!(i=a[t]))return!1;var u="function"==typeof i;switch(o=arguments.length){case 1:!function(t,e,i){if(e)t.call(i);else for(var o=t.length,n=s(t,o),r=0;r<o;++r)n[r].call(i)}(i,u,this);break;case 2:!function(t,e,i,o){if(e)t.call(i,o);else for(var n=t.length,r=s(t,n),a=0;a<n;++a)r[a].call(i,o)}(i,u,this,arguments[1]);break;case 3:!function(t,e,i,o,n){if(e)t.call(i,o,n);else for(var r=t.length,a=s(t,r),l=0;l<r;++l)a[l].call(i,o,n)}(i,u,this,arguments[1],arguments[2]);break;case 4:!function(t,e,i,o,n,r){if(e)t.call(i,o,n,r);else for(var a=t.length,l=s(t,a),h=0;h<a;++h)l[h].call(i,o,n,r)}(i,u,this,arguments[1],arguments[2],arguments[3]);break;default:for(n=new Array(o-1),r=1;r<o;r++)n[r-1]=arguments[r];!function(t,e,i,o){if(e)t.apply(i,o);else for(var n=t.length,r=s(t,n),a=0;a<n;++a)r[a].apply(i,o)}(i,u,this,n)}return!0},e.prototype.on=e.prototype.addListener=function(t,e){return o(this,t,e,!1)},e.prototype.prependListener=function(t,e){return o(this,t,e,!0)},e.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,n(this,t,e)),this},e.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,n(this,t,e)),this},e.prototype.removeListener=function(e,i){var o,n,r,s,a;if("function"!=typeof i)throw new TypeError('"listener" argument must be a function');if(!(n=this._events))return this;if(!(o=n[e]))return this;if(o===i||o.listener&&o.listener===i)0===--this._eventsCount?this._events=new t:(delete n[e],n.removeListener&&this.emit("removeListener",e,o.listener||i));else if("function"!=typeof o){for(r=-1,s=o.length;s-- >0;)if(o[s]===i||o[s].listener&&o[s].listener===i){a=o[s].listener,r=s;break}if(r<0)return this;if(1===o.length){if(o[0]=void 0,0===--this._eventsCount)return this._events=new t,this;delete n[e]}else!function(t,e){for(var i=e,o=i+1,n=t.length;o<n;i+=1,o+=1)t[i]=t[o];t.pop()}(o,r);n.removeListener&&this.emit("removeListener",e,a||i)}return this},e.prototype.off=function(t,e){return this.removeListener(t,e)},e.prototype.removeAllListeners=function(e){var i,o;if(!(o=this._events))return this;if(!o.removeListener)return 0===arguments.length?(this._events=new t,this._eventsCount=0):o[e]&&(0===--this._eventsCount?this._events=new t:delete o[e]),this;if(0===arguments.length){for(var n,r=Object.keys(o),s=0;s<r.length;++s)"removeListener"!==(n=r[s])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=new t,this._eventsCount=0,this}if("function"==typeof(i=o[e]))this.removeListener(e,i);else if(i)do{this.removeListener(e,i[i.length-1])}while(i[0]);return this},e.prototype.listeners=function(t){var e,i=this._events;return i&&(e=i[t])?"function"==typeof e?[e.listener||e]:function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(e):[]},e.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):r.call(t,e)},e.prototype.listenerCount=r,e.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var a,l={exports:{}};
/* @preserve
* Leaflet 1.7.1, a JS library for interactive maps. http://leafletjs.com
* (c) 2010-2019 Vladimir Agafonkin, (c) 2010-2011 CloudMade
*/var h=(a||(a=1,function(t){var e="1.7.1";function i(t){var e,i,o,n;for(i=1,o=arguments.length;i<o;i++)for(e in n=arguments[i])t[e]=n[e];return t}var o=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function n(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var o=i.call(arguments,2);return function(){return t.apply(e,o.length?o.concat(i.call(arguments)):arguments)}}var r=0;function s(t){return t._leaflet_id=t._leaflet_id||++r,t._leaflet_id}function a(t,e,i){var o,n,r,s;return s=function(){o=!1,n&&(r.apply(i,n),n=!1)},r=function(){o?n=arguments:(t.apply(i,arguments),setTimeout(s,e),o=!0)},r}function l(t,e,i){var o=e[1],n=e[0],r=o-n;return t===o&&i?t:((t-n)%r+r)%r+n}function h(){return!1}function c(t,e){var i=Math.pow(10,void 0===e?6:e);return Math.round(t*i)/i}function u(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function p(t){return u(t).split(/\s+/)}function d(t,e){for(var i in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?o(t.options):{}),e)t.options[i]=e[i];return t.options}function f(t,e,i){var o=[];for(var n in t)o.push(encodeURIComponent(i?n.toUpperCase():n)+"="+encodeURIComponent(t[n]));return(e&&-1!==e.indexOf("?")?"&":"?")+o.join("&")}var m=/\{ *([\w_-]+) *\}/g;function y(t,e){return t.replace(m,function(t,i){var o=e[i];if(void 0===o)throw new Error("No value provided for variable "+t);return"function"==typeof o&&(o=o(e)),o})}var _=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function g(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var v="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function b(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var w=0;function x(t){var e=+new Date,i=Math.max(0,16-(e-w));return w=e+i,window.setTimeout(t,i)}var P=window.requestAnimationFrame||b("RequestAnimationFrame")||x,O=window.cancelAnimationFrame||b("CancelAnimationFrame")||b("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function M(t,e,i){if(!i||P!==x)return P.call(window,n(t,e));t.call(e)}function C(t){t&&O.call(window,t)}var A={extend:i,create:o,bind:n,lastId:r,stamp:s,throttle:a,wrapNum:l,falseFn:h,formatNum:c,trim:u,splitWords:p,setOptions:d,getParamString:f,template:y,isArray:_,indexOf:g,emptyImageUrl:v,requestFn:P,cancelFn:O,requestAnimFrame:M,cancelAnimFrame:C};function k(){}function E(t){if("undefined"!=typeof L&&L&&L.Mixin){t=_(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}k.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},n=e.__super__=this.prototype,r=o(n);for(var s in r.constructor=e,e.prototype=r,this)Object.prototype.hasOwnProperty.call(this,s)&&"prototype"!==s&&"__super__"!==s&&(e[s]=this[s]);return t.statics&&(i(e,t.statics),delete t.statics),t.includes&&(E(t.includes),i.apply(null,[r].concat(t.includes)),delete t.includes),r.options&&(t.options=i(o(r.options),t.options)),i(r,t),r._initHooks=[],r.callInitHooks=function(){if(!this._initHooksCalled){n.callInitHooks&&n.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=r._initHooks.length;t<e;t++)r._initHooks[t].call(this)}},e},k.include=function(t){return i(this.prototype,t),this},k.mergeOptions=function(t){return i(this.prototype.options,t),this},k.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var T={on:function(t,e,i){if("object"==typeof t)for(var o in t)this._on(o,t[o],e);else for(var n=0,r=(t=p(t)).length;n<r;n++)this._on(t[n],e,i);return this},off:function(t,e,i){if(t)if("object"==typeof t)for(var o in t)this._off(o,t[o],e);else for(var n=0,r=(t=p(t)).length;n<r;n++)this._off(t[n],e,i);else delete this._events;return this},_on:function(t,e,i){this._events=this._events||{};var o=this._events[t];o||(this._events[t]=o=[]),i===this&&(i=void 0);for(var n={fn:e,ctx:i},r=o,s=0,a=r.length;s<a;s++)if(r[s].fn===e&&r[s].ctx===i)return;r.push(n)},_off:function(t,e,i){var o,n,r;if(this._events&&(o=this._events[t]))if(e){if(i===this&&(i=void 0),o)for(n=0,r=o.length;n<r;n++){var s=o[n];if(s.ctx===i&&s.fn===e)return s.fn=h,this._firingCount&&(this._events[t]=o=o.slice()),void o.splice(n,1)}}else{for(n=0,r=o.length;n<r;n++)o[n].fn=h;delete this._events[t]}},fire:function(t,e,o){if(!this.listens(t,o))return this;var n=i({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var r=this._events[t];if(r){this._firingCount=this._firingCount+1||1;for(var s=0,a=r.length;s<a;s++){var l=r[s];l.fn.call(l.ctx||this,n)}this._firingCount--}}return o&&this._propagateEvent(n),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var o in this._eventParents)if(this._eventParents[o].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"==typeof t){for(var o in t)this.once(o,t[o],e);return this}var r=n(function(){this.off(t,e,i).off(t,r,i)},this);return this.on(t,e,i).on(t,r,i)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[s(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[s(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,i({layer:t.target,propagatedFrom:t.target},t),!0)}};T.addEventListener=T.on,T.removeEventListener=T.clearAllEventListeners=T.off,T.addOneTimeEventListener=T.once,T.fireEvent=T.fire,T.hasEventListeners=T.listens;var I=k.extend(T);function S(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var z=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function j(t,e,i){return t instanceof S?t:_(t)?new S(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new S(t.x,t.y):new S(t,e,i)}function B(t,e){if(t)for(var i=e?[t,e]:t,o=0,n=i.length;o<n;o++)this.extend(i[o])}function Z(t,e){return!t||t instanceof B?t:new B(t,e)}function R(t,e){if(t)for(var i=e?[t,e]:t,o=0,n=i.length;o<n;o++)this.extend(i[o])}function N(t,e){return t instanceof R?t:new R(t,e)}function D(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function F(t,e,i){return t instanceof D?t:_(t)&&"object"!=typeof t[0]?3===t.length?new D(t[0],t[1],t[2]):2===t.length?new D(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new D(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new D(t,e,i)}S.prototype={clone:function(){return new S(this.x,this.y)},add:function(t){return this.clone()._add(j(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(j(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new S(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new S(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=z(this.x),this.y=z(this.y),this},distanceTo:function(t){var e=(t=j(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=j(t)).x===this.x&&t.y===this.y},contains:function(t){return t=j(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+c(this.x)+", "+c(this.y)+")"}},B.prototype={extend:function(t){return t=j(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 S((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new S(this.min.x,this.max.y)},getTopRight:function(){return new S(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t="number"==typeof t[0]||t instanceof S?j(t):Z(t))instanceof B?(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=Z(t);var e=this.min,i=this.max,o=t.min,n=t.max;return n.x>=e.x&&o.x<=i.x&&n.y>=e.y&&o.y<=i.y},overlaps:function(t){t=Z(t);var e=this.min,i=this.max,o=t.min,n=t.max;return n.x>e.x&&o.x<i.x&&n.y>e.y&&o.y<i.y},isValid:function(){return!(!this.min||!this.max)}},R.prototype={extend:function(t){var e,i,o=this._southWest,n=this._northEast;if(t instanceof D)e=t,i=t;else{if(!(t instanceof R))return t?this.extend(F(t)||N(t)):this;if(i=t._northEast,!(e=t._southWest)||!i)return this}return o||n?(o.lat=Math.min(e.lat,o.lat),o.lng=Math.min(e.lng,o.lng),n.lat=Math.max(i.lat,n.lat),n.lng=Math.max(i.lng,n.lng)):(this._southWest=new D(e.lat,e.lng),this._northEast=new D(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,o=Math.abs(e.lat-i.lat)*t,n=Math.abs(e.lng-i.lng)*t;return new R(new D(e.lat-o,e.lng-n),new D(i.lat+o,i.lng+n))},getCenter:function(){return new D((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 D(this.getNorth(),this.getWest())},getSouthEast:function(){return new D(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof D||"lat"in t?F(t):N(t);var e,i,o=this._southWest,n=this._northEast;return t instanceof R?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=o.lat&&i.lat<=n.lat&&e.lng>=o.lng&&i.lng<=n.lng},intersects:function(t){t=N(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),n=t.getNorthEast();return n.lat>=e.lat&&o.lat<=i.lat&&n.lng>=e.lng&&o.lng<=i.lng},overlaps:function(t){t=N(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),n=t.getNorthEast();return n.lat>e.lat&&o.lat<i.lat&&n.lng>e.lng&&o.lng<i.lng},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=N(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},D.prototype={equals:function(t,e){return!!t&&(t=F(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+c(this.lat,t)+", "+c(this.lng,t)+")"},distanceTo:function(t){return q.distance(this,F(t))},wrap:function(){return q.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return N([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new D(this.lat,this.lng,this.alt)}};var U,W={latLngToPoint:function(t,e){var i=this.projection.project(t),o=this.scale(e);return this.transformation._transform(i,o)},pointToLatLng:function(t,e){var i=this.scale(e),o=this.transformation.untransform(t,i);return this.projection.unproject(o)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t);return new B(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?l(t.lng,this.wrapLng,!0):t.lng;return new D(this.wrapLat?l(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),o=e.lat-i.lat,n=e.lng-i.lng;if(0===o&&0===n)return t;var r=t.getSouthWest(),s=t.getNorthEast();return new R(new D(r.lat-o,r.lng-n),new D(s.lat-o,s.lng-n))}},q=i({},W,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,o=t.lat*i,n=e.lat*i,r=Math.sin((e.lat-t.lat)*i/2),s=Math.sin((e.lng-t.lng)*i/2),a=r*r+Math.cos(o)*Math.cos(n)*s*s,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),H=6378137,V={R:H,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),n=Math.sin(o*e);return new S(this.R*t.lng*e,this.R*Math.log((1+n)/(1-n))/2)},unproject:function(t){var e=180/Math.PI;return new D((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:(U=H*Math.PI,new B([-U,-U],[U,U]))};function G(t,e,i,o){if(_(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=o}function J(t,e,i,o){return new G(t,e,i,o)}G.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return t.x=(e=e||1)*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return new S((t.x/(e=e||1)-this._b)/this._a,(t.y/e-this._d)/this._c)}};var K=i({},q,{code:"EPSG:3857",projection:V,transformation:function(){var t=.5/(Math.PI*V.R);return J(t,.5,-t,.5)}()}),Y=i({},K,{code:"EPSG:900913"});function Q(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function X(t,e){var i,o,n,r,s,a,l="";for(i=0,n=t.length;i<n;i++){for(o=0,r=(s=t[i]).length;o<r;o++)l+=(o?"L":"M")+(a=s[o]).x+" "+a.y;l+=e?Et?"z":"x":""}return l||"M0 0"}var $=document.documentElement.style,tt="ActiveXObject"in window,et=tt&&!document.addEventListener,it="msLaunchUri"in navigator&&!("documentMode"in document),ot=It("webkit"),nt=It("android"),rt=It("android 2")||It("android 3"),st=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=nt&&It("Google")&&st<537&&!("AudioNode"in window),lt=!!window.opera,ht=!it&&It("chrome"),ct=It("gecko")&&!ot&&!lt&&!tt,ut=!ht&&It("safari"),pt=It("phantom"),dt="OTransition"in $,ft=0===navigator.platform.indexOf("Win"),mt=tt&&"transition"in $,yt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!rt,_t="MozPerspective"in $,gt=!window.L_DISABLE_3D&&(mt||yt||_t)&&!dt&&!pt,vt="undefined"!=typeof orientation||It("mobile"),bt=vt&&ot,wt=vt&&yt,xt=!window.PointerEvent&&window.MSPointerEvent,Lt=!(!window.PointerEvent&&!xt),Pt=!window.L_NO_TOUCH&&(Lt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Ot=vt&<,Mt=vt&&ct,Ct=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,At=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",h,e),window.removeEventListener("testPassiveEventSupport",h,e)}catch(i){}return t}(),kt=!!document.createElement("canvas").getContext,Et=!(!document.createElementNS||!Q("svg").createSVGRect),Tt=!Et&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(i){return!1}}();function It(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var St={ie:tt,ielt9:et,edge:it,webkit:ot,android:nt,android23:rt,androidStock:at,opera:lt,chrome:ht,gecko:ct,safari:ut,phantom:pt,opera12:dt,win:ft,ie3d:mt,webkit3d:yt,gecko3d:_t,any3d:gt,mobile:vt,mobileWebkit:bt,mobileWebkit3d:wt,msPointer:xt,pointer:Lt,touch:Pt,mobileOpera:Ot,mobileGecko:Mt,retina:Ct,passiveEvents:At,canvas:kt,svg:Et,vml:Tt},zt=xt?"MSPointerDown":"pointerdown",jt=xt?"MSPointerMove":"pointermove",Bt=xt?"MSPointerUp":"pointerup",Zt=xt?"MSPointerCancel":"pointercancel",Rt={},Nt=!1;function Dt(t,e,i,o){return"touchstart"===e?Ut(t,i,o):"touchmove"===e?Gt(t,i,o):"touchend"===e&&Jt(t,i,o),this}function Ft(t,e,i){var o=t["_leaflet_"+e+i];return"touchstart"===e?t.removeEventListener(zt,o,!1):"touchmove"===e?t.removeEventListener(jt,o,!1):"touchend"===e&&(t.removeEventListener(Bt,o,!1),t.removeEventListener(Zt,o,!1)),this}function Ut(t,e,i){var o=n(function(t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&qe(t),Vt(t,e)});t["_leaflet_touchstart"+i]=o,t.addEventListener(zt,o,!1),Nt||(document.addEventListener(zt,Wt,!0),document.addEventListener(jt,qt,!0),document.addEventListener(Bt,Ht,!0),document.addEventListener(Zt,Ht,!0),Nt=!0)}function Wt(t){Rt[t.pointerId]=t}function qt(t){Rt[t.pointerId]&&(Rt[t.pointerId]=t)}function Ht(t){delete Rt[t.pointerId]}function Vt(t,e){for(var i in t.touches=[],Rt)t.touches.push(Rt[i]);t.changedTouches=[t],e(t)}function Gt(t,e,i){var o=function(t){t.pointerType===(t.MSPOINTER_TYPE_MOUSE||"mouse")&&0===t.buttons||Vt(t,e)};t["_leaflet_touchmove"+i]=o,t.addEventListener(jt,o,!1)}function Jt(t,e,i){var o=function(t){Vt(t,e)};t["_leaflet_touchend"+i]=o,t.addEventListener(Bt,o,!1),t.addEventListener(Zt,o,!1)}var Kt=xt?"MSPointerDown":Lt?"pointerdown":"touchstart",Yt=xt?"MSPointerUp":Lt?"pointerup":"touchend",Qt="_leaflet_";function Xt(t,e,i){var o,n,r=!1,s=250;function a(t){if(Lt){if(!t.isPrimary)return;if("mouse"===t.pointerType)return}else if(t.touches.length>1)return;var e=Date.now(),i=e-(o||e);n=t.touches?t.touches[0]:t,r=i>0&&i<=s,o=e}function l(t){if(r&&!n.cancelBubble){if(Lt){if("mouse"===t.pointerType)return;var i,s,a={};for(s in n)a[s]=(i=n[s])&&i.bind?i.bind(n):i;n=a}n.type="dblclick",n.button=0,e(n),o=null}}return t[Qt+Kt+i]=a,t[Qt+Yt+i]=l,t[Qt+"dblclick"+i]=e,t.addEventListener(Kt,a,!!At&&{passive:!1}),t.addEventListener(Yt,l,!!At&&{passive:!1}),t.addEventListener("dblclick",e,!1),this}function $t(t,e){var i=t[Qt+Yt+e],o=t[Qt+"dblclick"+e];return t.removeEventListener(Kt,t[Qt+Kt+e],!!At&&{passive:!1}),t.removeEventListener(Yt,i,!!At&&{passive:!1}),t.removeEventListener("dblclick",o,!1),this}var te,ee,ie,oe,ne,re=xe(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),se=xe(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ae="webkitTransition"===se||"OTransition"===se?se+"End":"transitionend";function le(t){return"string"==typeof t?document.getElementById(t):t}function he(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var o=document.defaultView.getComputedStyle(t,null);i=o?o[e]:null}return"auto"===i?null:i}function ce(t,e,i){var o=document.createElement(t);return o.className=e||"",i&&i.appendChild(o),o}function ue(t){var e=t.parentNode;e&&e.removeChild(t)}function pe(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function de(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function fe(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function me(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=ve(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function ye(t,e){if(void 0!==t.classList)for(var i=p(e),o=0,n=i.length;o<n;o++)t.classList.add(i[o]);else if(!me(t,e)){var r=ve(t);ge(t,(r?r+" ":"")+e)}}function _e(t,e){void 0!==t.classList?t.classList.remove(e):ge(t,u((" "+ve(t)+" ").replace(" "+e+" "," ")))}function ge(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function ve(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function be(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&we(t,e)}function we(t,e){var i=!1,o="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(o)}catch(n){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+o+"(opacity="+e+")"}function xe(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Le(t,e,i){var o=e||new S(0,0);t.style[re]=(mt?"translate("+o.x+"px,"+o.y+"px)":"translate3d("+o.x+"px,"+o.y+"px,0)")+(i?" scale("+i+")":"")}function Pe(t,e){t._leaflet_pos=e,gt?Le(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Oe(t){return t._leaflet_pos||new S(0,0)}if("onselectstart"in document)te=function(){ze(window,"selectstart",qe)},ee=function(){Be(window,"selectstart",qe)};else{var Me=xe(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);te=function(){if(Me){var t=document.documentElement.style;ie=t[Me],t[Me]="none"}},ee=function(){Me&&(document.documentElement.style[Me]=ie,ie=void 0)}}function Ce(){ze(window,"dragstart",qe)}function Ae(){Be(window,"dragstart",qe)}function ke(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Ee(),oe=t,ne=t.style.outline,t.style.outline="none",ze(window,"keydown",Ee))}function Ee(){oe&&(oe.style.outline=ne,oe=void 0,ne=void 0,Be(window,"keydown",Ee))}function Te(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function Ie(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Se={TRANSFORM:re,TRANSITION:se,TRANSITION_END:ae,get:le,getStyle:he,create:ce,remove:ue,empty:pe,toFront:de,toBack:fe,hasClass:me,addClass:ye,removeClass:_e,setClass:ge,getClass:ve,setOpacity:be,testProp:xe,setTransform:Le,setPosition:Pe,getPosition:Oe,disableTextSelection:te,enableTextSelection:ee,disableImageDrag:Ce,enableImageDrag:Ae,preventOutline:ke,restoreOutline:Ee,getSizedParentNode:Te,getScale:Ie};function ze(t,e,i,o){if("object"==typeof e)for(var n in e)Ne(t,n,e[n],i);else for(var r=0,s=(e=p(e)).length;r<s;r++)Ne(t,e[r],i,o);return this}var je="_leaflet_events";function Be(t,e,i,o){if("object"==typeof e)for(var n in e)De(t,n,e[n],i);else if(e)for(var r=0,s=(e=p(e)).length;r<s;r++)De(t,e[r],i,o);else{for(var a in t[je])De(t,a,t[je][a]);delete t[je]}return this}function Ze(){if(Lt)return!(it||ut)}var Re={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Ne(t,e,i,o){var n=e+s(i)+(o?"_"+s(o):"");if(t[je]&&t[je][n])return this;var r=function(e){return i.call(o||t,e||window.event)},a=r;Lt&&0===e.indexOf("touch")?Dt(t,e,r,n):Pt&&"dblclick"===e&&!Ze()?Xt(t,r,n):"addEventListener"in t?"touchstart"===e||"touchmove"===e||"wheel"===e||"mousewheel"===e?t.addEventListener(Re[e]||e,r,!!At&&{passive:!1}):"mouseenter"===e||"mouseleave"===e?t.addEventListener(Re[e],r=function(e){e=e||window.event,Xe(t,e)&&a(e)},!1):t.addEventListener(e,a,!1):"attachEvent"in t&&t.attachEvent("on"+e,r),t[je]=t[je]||{},t[je][n]=r}function De(t,e,i,o){var n=e+s(i)+(o?"_"+s(o):""),r=t[je]&&t[je][n];if(!r)return this;Lt&&0===e.indexOf("touch")?Ft(t,e,n):Pt&&"dblclick"===e&&!Ze()?$t(t,n):"removeEventListener"in t?t.removeEventListener(Re[e]||e,r,!1):"detachEvent"in t&&t.detachEvent("on"+e,r),t[je][n]=null}function Fe(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Qe(t),this}function Ue(t){return Ne(t,"wheel",Fe),this}function We(t){return ze(t,"mousedown touchstart dblclick",Fe),Ne(t,"click",Ye),this}function qe(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function He(t){return qe(t),Fe(t),this}function Ve(t,e){if(!e)return new S(t.clientX,t.clientY);var i=Ie(e),o=i.boundingClientRect;return new S((t.clientX-o.left)/i.x-e.clientLeft,(t.clientY-o.top)/i.y-e.clientTop)}var Ge=ft&&ht?2*window.devicePixelRatio:ct?window.devicePixelRatio:1;function Je(t){return it?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Ge:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}var Ke={};function Ye(t){Ke[t.type]=!0}function Qe(t){var e=Ke[t.type];return Ke[t.type]=!1,e}function Xe(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(o){return!1}return i!==t}var $e={on:ze,off:Be,stopPropagation:Fe,disableScrollPropagation:Ue,disableClickPropagation:We,preventDefault:qe,stop:He,getMousePosition:Ve,getWheelDelta:Je,fakeStop:Ye,skipped:Qe,isExternalTarget:Xe,addListener:ze,removeListener:Be},ti=I.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=Oe(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=M(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),Pe(this._el,i),this.fire("step")},_complete:function(){C(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),ei=I.extend({options:{crs:K,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=d(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=n(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(F(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=se&>&&!Ot&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),ze(this._proxy,ae,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,o){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(F(t),e,this.options.maxBounds),o=o||{},this._stop(),this._loaded&&!o.reset&&!0!==o&&(void 0!==o.animate&&(o.zoom=i({animate:o.animate},o.zoom),o.pan=i({animate:o.animate,duration:o.duration},o.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,o.zoom):this._tryAnimatedPan(t,o.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return this.setZoom(this._zoom+(t=t||(gt?this.options.zoomDelta:1)),e)},zoomOut:function(t,e){return this.setZoom(this._zoom-(t=t||(gt?this.options.zoomDelta:1)),e)},setZoomAround:function(t,e,i){var o=this.getZoomScale(e),n=this.getSize().divideBy(2),r=(t instanceof S?t:this.latLngToContainerPoint(t)).subtract(n).multiplyBy(1-1/o),s=this.containerPointToLatLng(n.add(r));return this.setView(s,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():N(t);var i=j(e.paddingTopLeft||e.padding||[0,0]),o=j(e.paddingBottomRight||e.padding||[0,0]),n=this.getBoundsZoom(t,!1,i.add(o));if((n="number"==typeof e.maxZoom?Math.min(e.maxZoom,n):n)===1/0)return{center:t.getCenter(),zoom:n};var r=o.subtract(i).divideBy(2),s=this.project(t.getSouthWest(),n),a=this.project(t.getNorthEast(),n);return{center:this.unproject(s.add(a).divideBy(2).add(r),n),zoom:n}},fitBounds:function(t,e){if(!(t=N(t)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=j(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ti,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){ye(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!gt)return this.setView(t,e,i);this._stop();var o=this.project(this.getCenter()),n=this.project(t),r=this.getSize(),s=this._zoom;t=F(t),e=void 0===e?s:e;var a=Math.max(r.x,r.y),l=a*this.getZoomScale(s,e),h=n.distanceTo(o)||1,c=1.42,u=c*c;function p(t){var e=(l*l-a*a+(t?-1:1)*u*u*h*h)/(2*(t?l:a)*u*h),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function d(t){return(Math.exp(t)-Math.exp(-t))/2}function f(t){return(Math.exp(t)+Math.exp(-t))/2}function m(t){return d(t)/f(t)}var y=p(0);function _(t){return a*(f(y)/f(y+c*t))}function g(t){return a*(f(y)*m(y+c*t)-d(y))/u}function v(t){return 1-Math.pow(1-t,1.5)}var b=Date.now(),w=(p(1)-y)/c,x=i.duration?1e3*i.duration:1e3*w*.8;function L(){var i=(Date.now()-b)/x,r=v(i)*w;i<=1?(this._flyToFrame=M(L,this),this._move(this.unproject(o.add(n.subtract(o).multiplyBy(g(r)/h)),s),this.getScaleZoom(a/_(r),s),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),L.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return(t=N(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),o=this._limitCenter(i,this._zoom,N(t));return i.equals(o)||this.panTo(o,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=j((e=e||{}).paddingTopLeft||e.padding||[0,0]),o=j(e.paddingBottomRight||e.padding||[0,0]),n=this.getCenter(),r=this.project(n),s=this.project(t),a=this.getPixelBounds(),l=a.getSize().divideBy(2),h=Z([a.min.add(i),a.max.subtract(o)]);if(!h.contains(s)){this._enforcingBounds=!0;var c=r.subtract(s),u=j(s.x+c.x,s.y+c.y);(s.x<h.min.x||s.x>h.max.x)&&(u.x=r.x-c.x,c.x>0?u.x+=l.x-i.x:u.x-=l.x-o.x),(s.y<h.min.y||s.y>h.max.y)&&(u.y=r.y-c.y,c.y>0?u.y+=l.y-i.y:u.y-=l.y-o.y),this.panTo(this.unproject(u),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=i({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),r=e.divideBy(2).round(),s=o.divideBy(2).round(),a=r.subtract(s);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(n(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:o})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=i({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=n(this._handleGeolocationResponse,this),o=n(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,o,t):navigator.geolocation.getCurrentPosition(e,o,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=new D(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),o=this._locateOptions;if(o.setView){var n=this.getBoundsZoom(i);this.setView(e,o.maxZoom?Math.min(n,o.maxZoom):n)}var r={latlng:e,bounds:i,timestamp:t.timestamp};for(var s in t.coords)"number"==typeof t.coords[s]&&(r[s]=t.coords[s]);this.fire("locationfound",r)},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(e){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ue(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(C(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ue(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=ce("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new R(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=N(t),i=j(i||[0,0]);var o=this.getZoom()||0,n=this.getMinZoom(),r=this.getMaxZoom(),s=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),h=Z(this.project(a,o),this.project(s,o)).getSize(),c=gt?this.options.zoomSnap:1,u=l.x/h.x,p=l.y/h.y,d=e?Math.max(u,p):Math.min(u,p);return o=this.getScaleZoom(d,o),c&&(o=Math.round(o/(c/100))*(c/100),o=e?Math.ceil(o/c)*c:Math.floor(o/c)*c),Math.max(n,Math.min(r,o))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new S(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new B(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs,o=i.zoom(t*i.scale(e=void 0===e?this._zoom:e));return isNaN(o)?1/0:o},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(F(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(j(t),e)},layerPointToLatLng:function(t){var e=j(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(F(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(F(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(N(t))},distance:function(t,e){return this.options.crs.distance(F(t),F(e))},containerPointToLayerPoint:function(t){return j(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return j(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(j(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(F(t)))},mouseEventToContainerPoint:function(t){return Ve(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=le(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");ze(e,"scroll",this._onScroll,this),this._containerId=s(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&>,ye(t,"leaflet-container"+(Pt?" leaflet-touch":"")+(Ct?" leaflet-retina":"")+(et?" leaflet-oldie":"")+(ut?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=he(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._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Pe(this._mapPane,new S(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ye(t.markerPane,"leaflet-zoom-hide"),ye(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){Pe(this._mapPane,new S(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,!1)._move(t,e)._moveEnd(o),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return C(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Pe(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[s(this._container)]=this;var e=t?Be:ze;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),gt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){C(this._resizeRequest),this._resizeRequest=M(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,o=[],n="mouseout"===e||"mouseover"===e,r=t.target||t.srcElement,a=!1;r;){if((i=this._targets[s(r)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){a=!0;break}if(i&&i.listens(e,!0)){if(n&&!Xe(r,t))break;if(o.push(i),n)break}if(r===this._container)break;r=r.parentNode}return o.length||a||n||!Xe(r,t)||(o=[this]),o},_handleDOMEvent:function(t){if(this._loaded&&!Qe(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||ke(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,o){if("click"===t.type){var n=i({},t);n.type="preclick",this._fireDOMEvent(n,n.type,o)}if(!t._stopped&&(o=(o||[]).concat(this._findEventTargets(t,e))).length){var r=o[0];"contextmenu"===e&&r.listens(e,!0)&&qe(t);var s={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var a=r.getLatLng&&(!r._radius||r._radius<=10);s.containerPoint=a?this.latLngToContainerPoint(r.getLatLng()):this.mouseEventToContainerPoint(t),s.layerPoint=this.containerPointToLayerPoint(s.containerPoint),s.latlng=a?r.getLatLng():this.layerPointToLatLng(s.layerPoint)}for(var l=0;l<o.length;l++)if(o[l].fire(e,s,!0),s.originalEvent._stopped||!1===o[l].options.bubblingMouseEvents&&-1!==g(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Oe(this._mapPane)||new S(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var o=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(o)},_latLngBoundsToNewLayerBounds:function(t,e,i){var o=this._getNewPixelOrigin(i,e);return Z([this.project(t.getSouthWest(),e)._subtract(o),this.project(t.getNorthWest(),e)._subtract(o),this.project(t.getSouthEast(),e)._subtract(o),this.project(t.getNorthEast(),e)._subtract(o)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var o=this.project(t,e),n=this.getSize().divideBy(2),r=new B(o.subtract(n),o.add(n)),s=this._getBoundsOffset(r,i,e);return s.round().equals([0,0])?t:this.unproject(o.add(s),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),o=new B(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(o,e))},_getBoundsOffset:function(t,e,i){var o=Z(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),n=o.min.subtract(t.min),r=o.max.subtract(t.max);return new S(this._rebound(n.x,-r.x),this._rebound(n.y,-r.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),o=gt?this.options.zoomSnap:1;return o&&(t=Math.round(t/o)*o),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){_e(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=ce("div","leaflet-proxy leaflet-zoom-animated");this._panes