vue2-leaflet-imageoverlay-rotated
Version:
ImageOverlay plugin extension for vue2-leaflet package
6 lines • 202 kB
JavaScript
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["Vue2LeafletImageOverlayRotated"]=e():t["Vue2LeafletImageOverlayRotated"]=e()})("undefined"!==typeof self?self:this,function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s="+xUi")}({"+rLv":function(t,e,i){var n=i("dyZX").document;t.exports=n&&n.documentElement},"+xUi":function(t,e,i){"use strict";i.r(e);i("HrLf"),i("xfY5");var n=i("4R65"),o=i.n(n),s=i("RY4O");i("2Spj");o.a.ImageOverlay.Rotated=o.a.ImageOverlay.extend({initialize:function(t,e,i){console.log({image:t,latlngs:e,options:i}),"string"===typeof t?this._url=t:this._rawImage=t,this._topLeft=o.a.latLng(e.topleft),this._topRight=o.a.latLng(e.topright),this._bottomLeft=o.a.latLng(e.bottomleft),o.a.Util.setOptions(this,i)},onAdd:function(t){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(o.a.DomUtil.addClass(this._rawImage,"leaflet-interactive"),this.addInteractiveTarget(this._rawImage)),t.on("zoomend resetview",this._reset,this),this.getPane().appendChild(this._image),this._reset()},onRemove:function(t){t.off("zoomend resetview",this._reset,this),o.a.ImageOverlay.prototype.onRemove.call(this,t)},_initImage:function(){var t=this._rawImage;this._url&&(t=o.a.DomUtil.create("img"),t.style.display="none",this.options.crossOrigin&&(t.crossOrigin=""),t.src=this._url,this._rawImage=t),o.a.DomUtil.addClass(t,"leaflet-image-layer"),this._image=o.a.DomUtil.create("div","leaflet-image-layer ".concat(this._zoomAnimated?"leaflet-zoom-animated":""));var e=this._image;this._updateZIndex(),e.appendChild(t),e.onselectstart=o.a.Util.falseFn,e.onmousemove=o.a.Util.falseFn,t.onload=function(){this._reset(),t.style.display="block",this.fire("load")}.bind(this),t.alt=this.options.alt},_reset:function(){var t=this._image,e=this._map.latLngToLayerPoint(this._topLeft),i=this._map.latLngToLayerPoint(this._topRight),n=this._map.latLngToLayerPoint(this._bottomLeft),s=i.subtract(e).add(n),r=o.a.bounds([e,i,n,s]),a=r.getSize(),h=e.subtract(r.min),u=i.subtract(e),l=n.subtract(e),c=Math.atan2(u.y,u.x),d=Math.atan2(l.x,l.y);this._bounds=o.a.latLngBounds(this._map.layerPointToLatLng(r.min),this._map.layerPointToLatLng(r.max)),o.a.DomUtil.setPosition(t,r.min),t.style.width="".concat(a.x,"px"),t.style.height="".concat(a.y,"px");var p=this._rawImage.width,f=this._rawImage.height;if(p&&f){var m=e.distanceTo(i)/(p*Math.cos(c)),_=e.distanceTo(n)/(f*Math.cos(d));this._rawImage.style.transformOrigin="0 0",this._rawImage.style.transform="translate(".concat(h.x,"px, ").concat(h.y,"px)")+"skew(".concat(d,"rad, ").concat(c,"rad) ")+"scale(".concat(m,", ").concat(_,") ")}},reposition:function(t){this._topLeft=o.a.latLng(t.topleft),this._topRight=o.a.latLng(t.topright),this._bottomLeft=o.a.latLng(t.bottomleft),this._reset()},setUrl:function(t){return this._url=t,this._rawImage&&(this._rawImage.src=t),this}}),o.a.imageOverlay.rotated=function(t,e,i){return new o.a.ImageOverlay.Rotated(t,e,i)};var r,a,h={url:{type:String},latlngs:{},opacity:{type:Number,default:1},alt:{type:String,default:""},interactive:{type:Boolean,default:!1},crossOrigin:{type:Boolean,default:!1},errorOverlayUrl:{type:String,default:""},visible:{type:Boolean,custom:!0,default:!0}},u={name:"LImageOverlayRotated",props:h,data:function(){return{ready:!1}},mounted:function(){var t={opacity:this.opacity,alt:this.alt,interactive:this.interactive,crossOrigin:this.crossOrigin,errorOverlayUrl:this.errorOverlayUrl};this.mapObject=o.a.imageOverlay.rotated(this.url,this.latlngs,t),o.a.DomEvent.on(this.mapObject,this.$listeners),Object(s["propsBinder"])(this,this.mapObject,h),this.parentContainer=Object(s["findRealParent"])(this.$parent),this.parentContainer.addLayer(this,!this.visible)},beforeDestroy:function(){this.parentContainer.removeLayer(this)},methods:{setVisible:function(t,e){t!==e&&this.mapObject&&(t?this.parentContainer.addLayer(this):this.parentContainer.removeLayer(this))},getBounds:function(){return this.mapObject.getBounds()}},render:function(){return null}},l=u;function c(t,e,i,n,o,s,r,a){var h,u="function"===typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=i,u._compiled=!0),n&&(u.functional=!0),s&&(u._scopeId="data-v-"+s),r?(h=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},u._ssrRegister=h):o&&(h=a?function(){o.call(this,this.$root.$options.shadowRoot)}:o),h)if(u.functional){u._injectStyles=h;var l=u.render;u.render=function(t,e){return h.call(e),l(t,e)}}else{var c=u.beforeCreate;u.beforeCreate=c?[].concat(c,h):[h]}return{exports:t,options:u}}var d=c(l,r,a,!1,null,null,null),p=d.exports;e["default"]=p},"/e88":function(t,e){t.exports="\t\n\v\f\r \u2028\u2029\ufeff"},"0/R4":function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},"2OiF":function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},"2Spj":function(t,e,i){var n=i("XKFU");n(n.P,"Function",{bind:i("8MEG")})},"4R4u":function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},"4R65":function(t,e,i){
/* @preserve
* Leaflet 1.3.1, a JS library for interactive maps. http://leafletjs.com
* (c) 2010-2017 Vladimir Agafonkin, (c) 2010-2011 CloudMade
*/
(function(t,i){i(e)})(0,function(t){"use strict";var e="1.3.1",i=Object.freeze;function n(t){var e,i,n,o;for(i=1,n=arguments.length;i<n;i++)for(e in o=arguments[i],o)t[e]=o[e];return t}Object.freeze=function(t){return t};var o=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function s(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var n=i.call(arguments,2);return function(){return t.apply(e,n.length?n.concat(i.call(arguments)):arguments)}}var r=0;function a(t){return t._leaflet_id=t._leaflet_id||++r,t._leaflet_id}function h(t,e,i){var n,o,s,r;return r=function(){n=!1,o&&(s.apply(i,o),o=!1)},s=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(r,e),n=!0)},s}function u(t,e,i){var n=e[1],o=e[0],s=n-o;return t===n&&i?t:((t-o)%s+s)%s+o}function l(){return!1}function c(t,e){var i=Math.pow(10,void 0===e?6:e);return Math.round(t*i)/i}function d(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function p(t){return d(t).split(/\s+/)}function f(t,e){for(var i in t.hasOwnProperty("options")||(t.options=t.options?o(t.options):{}),e)t.options[i]=e[i];return t.options}function m(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")}var _=/\{ *([\w_-]+) *\}/g;function y(t,e){return t.replace(_,function(t,i){var n=e[i];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"===typeof n&&(n=n(e)),n})}var g=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function v(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var b="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function x(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var w=0;function O(t){var e=+new Date,i=Math.max(0,16-(e-w));return w=e+i,window.setTimeout(t,i)}var P=window.requestAnimationFrame||x("RequestAnimationFrame")||O,S=window.cancelAnimationFrame||x("CancelAnimationFrame")||x("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function T(t,e,i){if(!i||P!==O)return P.call(window,s(t,e));t.call(e)}function C(t){t&&S.call(window,t)}var j=(Object.freeze||Object)({freeze:i,extend:n,create:o,bind:s,lastId:r,stamp:a,throttle:h,wrapNum:u,falseFn:l,formatNum:c,trim:d,splitWords:p,setOptions:f,getParamString:m,template:y,isArray:g,indexOf:v,emptyImageUrl:b,requestFn:P,cancelFn:S,requestAnimFrame:T,cancelAnimFrame:C});function M(){}function z(t){if("undefined"!==typeof L&&L&&L.Mixin){t=g(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)}}M.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=e.__super__=this.prototype,s=o(i);for(var r in s.constructor=e,e.prototype=s,this)this.hasOwnProperty(r)&&"prototype"!==r&&"__super__"!==r&&(e[r]=this[r]);return t.statics&&(n(e,t.statics),delete t.statics),t.includes&&(z(t.includes),n.apply(null,[s].concat(t.includes)),delete t.includes),s.options&&(t.options=n(o(s.options),t.options)),n(s,t),s._initHooks=[],s.callInitHooks=function(){if(!this._initHooksCalled){i.callInitHooks&&i.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=s._initHooks.length;t<e;t++)s._initHooks[t].call(this)}},e},M.include=function(t){return n(this.prototype,t),this},M.mergeOptions=function(t){return n(this.prototype.options,t),this},M.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 E={on:function(t,e,i){if("object"===typeof t)for(var n in t)this._on(n,t[n],e);else{t=p(t);for(var o=0,s=t.length;o<s;o++)this._on(t[o],e,i)}return this},off:function(t,e,i){if(t)if("object"===typeof t)for(var n in t)this._off(n,t[n],e);else{t=p(t);for(var o=0,s=t.length;o<s;o++)this._off(t[o],e,i)}else delete this._events;return this},_on:function(t,e,i){this._events=this._events||{};var n=this._events[t];n||(n=[],this._events[t]=n),i===this&&(i=void 0);for(var o={fn:e,ctx:i},s=n,r=0,a=s.length;r<a;r++)if(s[r].fn===e&&s[r].ctx===i)return;s.push(o)},_off:function(t,e,i){var n,o,s;if(this._events&&(n=this._events[t],n))if(e){if(i===this&&(i=void 0),n)for(o=0,s=n.length;o<s;o++){var r=n[o];if(r.ctx===i&&r.fn===e)return r.fn=l,this._firingCount&&(this._events[t]=n=n.slice()),void n.splice(o,1)}}else{for(o=0,s=n.length;o<s;o++)n[o].fn=l;delete this._events[t]}},fire:function(t,e,i){if(!this.listens(t,i))return this;var o=n({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var s=this._events[t];if(s){this._firingCount=this._firingCount+1||1;for(var r=0,a=s.length;r<a;r++){var h=s[r];h.fn.call(h.ctx||this,o)}this._firingCount--}}return i&&this._propagateEvent(o),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var n in this._eventParents)if(this._eventParents[n].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"===typeof t){for(var n in t)this.once(n,t[n],e);return this}var o=s(function(){this.off(t,e,i).off(t,o,i)},this);return this.on(t,e,i).on(t,o,i)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[a(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[a(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,n({layer:t.target,propagatedFrom:t.target},t),!0)}};E.addEventListener=E.on,E.removeEventListener=E.clearAllEventListeners=E.off,E.addOneTimeEventListener=E.once,E.fireEvent=E.fire,E.hasEventListeners=E.listens;var A=M.extend(E);function k(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var B=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function Z(t,e,i){return t instanceof k?t:g(t)?new k(t[0],t[1]):void 0===t||null===t?t:"object"===typeof t&&"x"in t&&"y"in t?new k(t.x,t.y):new k(t,e,i)}function I(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function R(t,e){return!t||t instanceof I?t:new I(t,e)}function N(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function D(t,e){return t instanceof N?t:new N(t,e)}function F(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 W(t,e,i){return t instanceof F?t:g(t)&&"object"!==typeof t[0]?3===t.length?new F(t[0],t[1],t[2]):2===t.length?new F(t[0],t[1]):null:void 0===t||null===t?t:"object"===typeof t&&"lat"in t?new F(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new F(t,e,i)}k.prototype={clone:function(){return new k(this.x,this.y)},add:function(t){return this.clone()._add(Z(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(Z(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 k(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new k(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=B(this.x),this.y=B(this.y),this},distanceTo:function(t){t=Z(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=Z(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=Z(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)+")"}},I.prototype={extend:function(t){return t=Z(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 k((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new k(this.min.x,this.max.y)},getTopRight:function(){return new k(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 k?Z(t):R(t),t instanceof I?(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=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>=e.x&&n.x<=i.x,r=o.y>=e.y&&n.y<=i.y;return s&&r},overlaps:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>e.x&&n.x<i.x,r=o.y>e.y&&n.y<i.y;return s&&r},isValid:function(){return!(!this.min||!this.max)}},N.prototype={extend:function(t){var e,i,n=this._southWest,o=this._northEast;if(t instanceof F)e=t,i=t;else{if(!(t instanceof N))return t?this.extend(W(t)||D(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return n||o?(n.lat=Math.min(e.lat,n.lat),n.lng=Math.min(e.lng,n.lng),o.lat=Math.max(i.lat,o.lat),o.lng=Math.max(i.lng,o.lng)):(this._southWest=new F(e.lat,e.lng),this._northEast=new F(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,o=Math.abs(e.lng-i.lng)*t;return new N(new F(e.lat-n,e.lng-o),new F(i.lat+n,i.lng+o))},getCenter:function(){return new F((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 F(this.getNorth(),this.getWest())},getSouthEast:function(){return new F(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 F||"lat"in t?W(t):D(t);var e,i,n=this._southWest,o=this._northEast;return t instanceof N?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=D(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=e.lat&&n.lat<=i.lat,r=o.lng>=e.lng&&n.lng<=i.lng;return s&&r},overlaps:function(t){t=D(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>e.lat&&n.lat<i.lat,r=o.lng>e.lng&&n.lng<i.lng;return s&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=D(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},F.prototype={equals:function(t,e){if(!t)return!1;t=W(t);var i=Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng));return i<=(void 0===e?1e-9:e)},toString:function(t){return"LatLng("+c(this.lat,t)+", "+c(this.lng,t)+")"},distanceTo:function(t){return V.distance(this,W(t))},wrap:function(){return V.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return D([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new F(this.lat,this.lng,this.alt)}};var U={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)},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),n=this.transformation.transform(e.min,i),o=this.transformation.transform(e.max,i);return new I(n,o)},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?u(t.lng,this.wrapLng,!0):t.lng,i=this.wrapLat?u(t.lat,this.wrapLat,!0):t.lat,n=t.alt;return new F(i,e,n)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,o=e.lng-i.lng;if(0===n&&0===o)return t;var s=t.getSouthWest(),r=t.getNorthEast(),a=new F(s.lat-n,s.lng-o),h=new F(r.lat-n,r.lng-o);return new N(a,h)}},V=n({},U,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,s=Math.sin((e.lat-t.lat)*i/2),r=Math.sin((e.lng-t.lng)*i/2),a=s*s+Math.cos(n)*Math.cos(o)*r*r,h=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*h}}),H={R:6378137,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),o=Math.sin(n*e);return new k(this.R*t.lng*e,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var e=180/Math.PI;return new F((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:function(){var t=6378137*Math.PI;return new I([-t,-t],[t,t])}()};function $(t,e,i,n){if(g(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=n}function G(t,e,i,n){return new $(t,e,i,n)}$.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 k((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};var q=n({},V,{code:"EPSG:3857",projection:H,transformation:function(){var t=.5/(Math.PI*H.R);return G(t,.5,-t,.5)}()}),J=n({},q,{code:"EPSG:900913"});function K(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Y(t,e){var i,n,o,s,r,a,h="";for(i=0,o=t.length;i<o;i++){for(r=t[i],n=0,s=r.length;n<s;n++)a=r[n],h+=(n?"L":"M")+a.x+" "+a.y;h+=e?Ct?"z":"x":""}return h||"M0 0"}var X=document.documentElement.style,Q="ActiveXObject"in window,tt=Q&&!document.addEventListener,et="msLaunchUri"in navigator&&!("documentMode"in document),it=Mt("webkit"),nt=Mt("android"),ot=Mt("android 2")||Mt("android 3"),st=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),rt=nt&&Mt("Google")&&st<537&&!("AudioNode"in window),at=!!window.opera,ht=Mt("chrome"),ut=Mt("gecko")&&!it&&!at&&!Q,lt=!ht&&Mt("safari"),ct=Mt("phantom"),dt="OTransition"in X,pt=0===navigator.platform.indexOf("Win"),ft=Q&&"transition"in X,mt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ot,_t="MozPerspective"in X,yt=!window.L_DISABLE_3D&&(ft||mt||_t)&&!dt&&!ct,gt="undefined"!==typeof orientation||Mt("mobile"),vt=gt&&it,bt=gt&&mt,xt=!window.PointerEvent&&window.MSPointerEvent,Lt=!(!window.PointerEvent&&!xt),wt=!window.L_NO_TOUCH&&(Lt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Ot=gt&&at,Pt=gt&&ut,St=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Tt=function(){return!!document.createElement("canvas").getContext}(),Ct=!(!document.createElementNS||!K("svg").createSVGRect),jt=!Ct&&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(t){return!1}}();function Mt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var zt=(Object.freeze||Object)({ie:Q,ielt9:tt,edge:et,webkit:it,android:nt,android23:ot,androidStock:rt,opera:at,chrome:ht,gecko:ut,safari:lt,phantom:ct,opera12:dt,win:pt,ie3d:ft,webkit3d:mt,gecko3d:_t,any3d:yt,mobile:gt,mobileWebkit:vt,mobileWebkit3d:bt,msPointer:xt,pointer:Lt,touch:wt,mobileOpera:Ot,mobileGecko:Pt,retina:St,canvas:Tt,svg:Ct,vml:jt}),Et=xt?"MSPointerDown":"pointerdown",At=xt?"MSPointerMove":"pointermove",kt=xt?"MSPointerUp":"pointerup",Bt=xt?"MSPointerCancel":"pointercancel",Zt=["INPUT","SELECT","OPTION"],It={},Rt=!1,Nt=0;function Dt(t,e,i,n){return"touchstart"===e?Wt(t,i,n):"touchmove"===e?Gt(t,i,n):"touchend"===e&&qt(t,i,n),this}function Ft(t,e,i){var n=t["_leaflet_"+e+i];return"touchstart"===e?t.removeEventListener(Et,n,!1):"touchmove"===e?t.removeEventListener(At,n,!1):"touchend"===e&&(t.removeEventListener(kt,n,!1),t.removeEventListener(Bt,n,!1)),this}function Wt(t,e,i){var n=s(function(t){if("mouse"!==t.pointerType&&t.MSPOINTER_TYPE_MOUSE&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){if(!(Zt.indexOf(t.target.tagName)<0))return;he(t)}$t(t,e)});t["_leaflet_touchstart"+i]=n,t.addEventListener(Et,n,!1),Rt||(document.documentElement.addEventListener(Et,Ut,!0),document.documentElement.addEventListener(At,Vt,!0),document.documentElement.addEventListener(kt,Ht,!0),document.documentElement.addEventListener(Bt,Ht,!0),Rt=!0)}function Ut(t){It[t.pointerId]=t,Nt++}function Vt(t){It[t.pointerId]&&(It[t.pointerId]=t)}function Ht(t){delete It[t.pointerId],Nt--}function $t(t,e){for(var i in t.touches=[],It)t.touches.push(It[i]);t.changedTouches=[t],e(t)}function Gt(t,e,i){var n=function(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&$t(t,e)};t["_leaflet_touchmove"+i]=n,t.addEventListener(At,n,!1)}function qt(t,e,i){var n=function(t){$t(t,e)};t["_leaflet_touchend"+i]=n,t.addEventListener(kt,n,!1),t.addEventListener(Bt,n,!1)}var Jt=xt?"MSPointerDown":Lt?"pointerdown":"touchstart",Kt=xt?"MSPointerUp":Lt?"pointerup":"touchend",Yt="_leaflet_";function Xt(t,e,i){var n,o,s=!1,r=250;function a(t){var e;if(Lt){if(!et||"mouse"===t.pointerType)return;e=Nt}else e=t.touches.length;if(!(e>1)){var i=Date.now(),a=i-(n||i);o=t.touches?t.touches[0]:t,s=a>0&&a<=r,n=i}}function h(t){if(s&&!o.cancelBubble){if(Lt){if(!et||"mouse"===t.pointerType)return;var i,r,a={};for(r in o)i=o[r],a[r]=i&&i.bind?i.bind(o):i;o=a}o.type="dblclick",e(o),n=null}}return t[Yt+Jt+i]=a,t[Yt+Kt+i]=h,t[Yt+"dblclick"+i]=e,t.addEventListener(Jt,a,!1),t.addEventListener(Kt,h,!1),t.addEventListener("dblclick",e,!1),this}function Qt(t,e){var i=t[Yt+Jt+e],n=t[Yt+Kt+e],o=t[Yt+"dblclick"+e];return t.removeEventListener(Jt,i,!1),t.removeEventListener(Kt,n,!1),et||t.removeEventListener("dblclick",o,!1),this}function te(t,e,i,n){if("object"===typeof e)for(var o in e)ne(t,o,e[o],i);else{e=p(e);for(var s=0,r=e.length;s<r;s++)ne(t,e[s],i,n)}return this}var ee="_leaflet_events";function ie(t,e,i,n){if("object"===typeof e)for(var o in e)oe(t,o,e[o],i);else if(e){e=p(e);for(var s=0,r=e.length;s<r;s++)oe(t,e[s],i,n)}else{for(var a in t[ee])oe(t,a,t[ee][a]);delete t[ee]}return this}function ne(t,e,i,n){var o=e+a(i)+(n?"_"+a(n):"");if(t[ee]&&t[ee][o])return this;var s=function(e){return i.call(n||t,e||window.event)},r=s;Lt&&0===e.indexOf("touch")?Dt(t,e,s,o):!wt||"dblclick"!==e||!Xt||Lt&&ht?"addEventListener"in t?"mousewheel"===e?t.addEventListener("onwheel"in t?"wheel":"mousewheel",s,!1):"mouseenter"===e||"mouseleave"===e?(s=function(e){e=e||window.event,ye(t,e)&&r(e)},t.addEventListener("mouseenter"===e?"mouseover":"mouseout",s,!1)):("click"===e&&nt&&(s=function(t){ge(t,r)}),t.addEventListener(e,s,!1)):"attachEvent"in t&&t.attachEvent("on"+e,s):Xt(t,s,o),t[ee]=t[ee]||{},t[ee][o]=s}function oe(t,e,i,n){var o=e+a(i)+(n?"_"+a(n):""),s=t[ee]&&t[ee][o];if(!s)return this;Lt&&0===e.indexOf("touch")?Ft(t,e,o):!wt||"dblclick"!==e||!Qt||Lt&&ht?"removeEventListener"in t?"mousewheel"===e?t.removeEventListener("onwheel"in t?"wheel":"mousewheel",s,!1):t.removeEventListener("mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,s,!1):"detachEvent"in t&&t.detachEvent("on"+e,s):Qt(t,o),t[ee][o]=null}function se(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,_e(t),this}function re(t){return ne(t,"mousewheel",se),this}function ae(t){return te(t,"mousedown touchstart dblclick",se),ne(t,"click",me),this}function he(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function ue(t){return he(t),se(t),this}function le(t,e){if(!e)return new k(t.clientX,t.clientY);var i=e.getBoundingClientRect(),n=i.width/e.offsetWidth||1,o=i.height/e.offsetHeight||1;return new k(t.clientX/n-i.left-e.clientLeft,t.clientY/o-i.top-e.clientTop)}var ce=pt&&ht?2*window.devicePixelRatio:ut?window.devicePixelRatio:1;function de(t){return et?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/ce: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 pe,fe={};function me(t){fe[t.type]=!0}function _e(t){var e=fe[t.type];return fe[t.type]=!1,e}function ye(t,e){var i=e.relatedTarget;if(!i)return!0;try{while(i&&i!==t)i=i.parentNode}catch(t){return!1}return i!==t}function ge(t,e){var i=t.timeStamp||t.originalEvent&&t.originalEvent.timeStamp,n=pe&&i-pe;n&&n>100&&n<500||t.target._simulatedClick&&!t._simulated?ue(t):(pe=i,e(t))}var ve,be,xe,Le,we,Oe=(Object.freeze||Object)({on:te,off:ie,stopPropagation:se,disableScrollPropagation:re,disableClickPropagation:ae,preventDefault:he,stop:ue,getMousePosition:le,getWheelDelta:de,fakeStop:me,skipped:_e,isExternalTarget:ye,addListener:te,removeListener:ie}),Pe=We(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]),Se=We(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Te="webkitTransition"===Se||"OTransition"===Se?Se+"End":"transitionend";function Ce(t){return"string"===typeof t?document.getElementById(t):t}function je(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i}function Me(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function ze(t){var e=t.parentNode;e&&e.removeChild(t)}function Ee(t){while(t.firstChild)t.removeChild(t.firstChild)}function Ae(t){var e=t.parentNode;e.lastChild!==t&&e.appendChild(t)}function ke(t){var e=t.parentNode;e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function Be(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=Ne(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function Ze(t,e){if(void 0!==t.classList)for(var i=p(e),n=0,o=i.length;n<o;n++)t.classList.add(i[n]);else if(!Be(t,e)){var s=Ne(t);Re(t,(s?s+" ":"")+e)}}function Ie(t,e){void 0!==t.classList?t.classList.remove(e):Re(t,d((" "+Ne(t)+" ").replace(" "+e+" "," ")))}function Re(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function Ne(t){return void 0===t.className.baseVal?t.className:t.className.baseVal}function De(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&Fe(t,e)}function Fe(t,e){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(t){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}function We(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Ue(t,e,i){var n=e||new k(0,0);t.style[Pe]=(ft?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(i?" scale("+i+")":"")}function Ve(t,e){t._leaflet_pos=e,yt?Ue(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function He(t){return t._leaflet_pos||new k(0,0)}if("onselectstart"in document)ve=function(){te(window,"selectstart",he)},be=function(){ie(window,"selectstart",he)};else{var $e=We(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ve=function(){if($e){var t=document.documentElement.style;xe=t[$e],t[$e]="none"}},be=function(){$e&&(document.documentElement.style[$e]=xe,xe=void 0)}}function Ge(){te(window,"dragstart",he)}function qe(){ie(window,"dragstart",he)}function Je(t){while(-1===t.tabIndex)t=t.parentNode;t.style&&(Ke(),Le=t,we=t.style.outline,t.style.outline="none",te(window,"keydown",Ke))}function Ke(){Le&&(Le.style.outline=we,Le=void 0,we=void 0,ie(window,"keydown",Ke))}var Ye=(Object.freeze||Object)({TRANSFORM:Pe,TRANSITION:Se,TRANSITION_END:Te,get:Ce,getStyle:je,create:Me,remove:ze,empty:Ee,toFront:Ae,toBack:ke,hasClass:Be,addClass:Ze,removeClass:Ie,setClass:Re,getClass:Ne,setOpacity:De,testProp:We,setTransform:Ue,setPosition:Ve,getPosition:He,disableTextSelection:ve,enableTextSelection:be,disableImageDrag:Ge,enableImageDrag:qe,preventOutline:Je,restoreOutline:Ke}),Xe=A.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=He(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=T(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(),Ve(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)}}),Qe=A.extend({options:{crs:q,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=f(this,e),this._initContainer(t),this._initLayout(),this._onResize=s(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(W(e.center),e.zoom,{reset:!0}),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this.callInitHooks(),this._zoomAnimated=Se&&yt&&!Ot&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),te(this._proxy,Te,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,i){if(e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(W(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i){void 0!==i.animate&&(i.zoom=n({animate:i.animate},i.zoom),i.pan=n({animate:i.animate,duration:i.duration},i.pan));var o=this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan);if(o)return clearTimeout(this._sizeTimer),this}return 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 t=t||(yt?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(yt?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),o=this.getSize().divideBy(2),s=t instanceof k?t:this.latLngToContainerPoint(t),r=s.subtract(o).multiplyBy(1-1/n),a=this.containerPointToLatLng(o.add(r));return this.setView(a,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():D(t);var i=Z(e.paddingTopLeft||e.padding||[0,0]),n=Z(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,i.add(n));if(o="number"===typeof e.maxZoom?Math.min(e.maxZoom,o):o,o===1/0)return{center:t.getCenter(),zoom:o};var s=n.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),o),a=this.project(t.getNorthEast(),o),h=this.unproject(r.add(a).divideBy(2).add(s),o);return{center:h,zoom:o}},fitBounds:function(t,e){if(t=D(t),!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(t=Z(t).round(),e=e||{},!t.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 Xe,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){Ze(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(i=i||{},!1===i.animate||!yt)return this.setView(t,e,i);this._stop();var n=this.project(this.getCenter()),o=this.project(t),s=this.getSize(),r=this._zoom;t=W(t),e=void 0===e?r:e;var a=Math.max(s.x,s.y),h=a*this.getZoomScale(r,e),u=o.distanceTo(n)||1,l=1.42,c=l*l;function d(t){var e=t?-1:1,i=t?h:a,n=h*h-a*a+e*c*c*u*u,o=2*i*c*u,s=n/o,r=Math.sqrt(s*s+1)-s,l=r<1e-9?-18:Math.log(r);return l}function p(t){return(Math.exp(t)-Math.exp(-t))/2}function f(t){return(Math.exp(t)+Math.exp(-t))/2}function m(t){return p(t)/f(t)}var _=d(0);function y(t){return a*(f(_)/f(_+l*t))}function g(t){return a*(f(_)*m(_+l*t)-p(_))/c}function v(t){return 1-Math.pow(1-t,1.5)}var b=Date.now(),x=(d(1)-_)/l,L=i.duration?1e3*i.duration:1e3*x*.8;function w(){var i=(Date.now()-b)/L,s=v(i)*x;i<=1?(this._flyToFrame=T(w,this),this._move(this.unproject(n.add(o.subtract(n).multiplyBy(g(s)/u)),r),this.getScaleZoom(a/y(s),r),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),w.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=D(t),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(),n=this._limitCenter(i,this._zoom,D(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},invalidateSize:function(t){if(!this._loaded)return this;t=n({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),o=e.divideBy(2).round(),r=i.divideBy(2).round(),a=o.subtract(r);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(s(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):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=n({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=s(this._handleGeolocationResponse,this),i=s(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&&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=t.coords.latitude,i=t.coords.longitude,n=new F(e,i),o=n.toBounds(t.coords.accuracy),s=this._locateOptions;if(s.setView){var r=this.getBoundsZoom(o);this.setView(n,s.maxZoom?Math.min(r,s.maxZoom):r)}var a={latlng:n,bounds:o,timestamp:t.timestamp};for(var h in t.coords)"number"===typeof t.coords[h]&&(a[h]=t.coords[h]);this.fire("locationfound",a)},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._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(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ze(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ze(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i="leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),n=Me("div",i,e||this._mapPane);return t&&(this._panes[t]=n),n},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(),e=this.unproject(t.getBottomLeft()),i=this.unproject(t.getTopRight());return new N(e,i)},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=D(t),i=Z(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),h=this.getSize().subtract(i),u=R(this.project(a,n),this.project(r,n)).getSize(),l=yt?this.options.zoomSnap:1,c=h.x/u.x,d=h.y/u.y,p=e?Math.max(c,d):Math.min(c,d);return n=this.getScaleZoom(p,n),l&&(n=Math.round(n/(l/100))*(l/100),n=e?Math.ceil(n/l)*l:Math.floor(n/l)*l),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new k(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 I(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;e=void 0===e?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(W(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(Z(t),e)},layerPointToLatLng:function(t){var e=Z(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(W(t))._round();return e._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(W(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(D(t))},distance:function(t,e){return this.options.crs.distance(W(t),W(e))},containerPointToLayerPoint:function(t){return Z(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return Z(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(Z(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(W(t)))},mouseEventToContainerPoint:function(t){return le(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=Ce(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");te(e,"scroll",this._onScroll,this),this._containerId=a(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&yt,Ze(t,"leaflet-container"+(wt?" leaflet-touch":"")+(St?" leaflet-retina":"")+(tt?" leaflet-oldie":"")+(lt?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=je(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),Ve(this._mapPane,new k(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Ze(t.markerPane,"leaflet-zoom-hide"),Ze(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){Ve(this._mapPane,new k(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var n=this._zoom!==e;this._moveStart(n,!1)._move(t,e)._moveEnd(n),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 n=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(n||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){Ve(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[a(this._container)]=this;var e=t?ie:te;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),yt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){C(this._resizeRequest),this._resizeRequest=T(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){var i,n=[],o="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,r=!1;while(s){if(i=this._targets[a(s)],i&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){r=!0;break}if(i&&i.listens(e,!0)){if(o&&!ye(s,t))break;if(n.push(i),o)break}if(s===this._container)break;s=s.parentNode}return n.length||r||o||!ye(s,t)||(n=[this]),n},_handleDOMEvent:function(t){if(this._loaded&&!_e(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e||Je(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if("click"===t.type){var o=n({},t);o.type="preclick",this._fireDOMEvent(o,o.type,i)}if(!t._stopped&&(i=(i||[]).concat(this._findEventTargets(t,e)),i.length)){var s=i[0];"contextmenu"===e&&s.listens(e,!0)&&he(t);var r={originalEvent:t};if("keypress"!==t.type){var a=s.getLatLng&&(!s._radius||s._radius<=10);r.containerPoint=a?this.latLngToContainerPoint(s.getLatLng()):this.mouseEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=a?s.getLatLng():this.layerPointToLatLng(r.layerPoint)}for(var h=0;h<i.length;h++)if(i[h].fire(e,r,!0),r.originalEvent._stopped||!1===i[h].options.bubblingMouseEvents&&-1!==v(this._mouseEvents,e))return}},_draggableMoved:function(t){return t=t.dragging&&t.dragging.enabled()?t:this,t.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 He(this._mapPane)||new k(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){var i=t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin();return i.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 n=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(n)},_latLngBoundsToNewLayerBounds:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return R([this.project(t.getSouthWest(),e)._subtract(n),this.project(t.getNorthWest(),e)._subtract(n),this.project(t.getSouthEast(),e)._subtract(n),this.project(t.getNorthEast(),e)._subtract(n)])},_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 n=this.project(t,e),o=this.getSize().divideBy(2),s=new I(n.subtract(o),n.add(o)),r=this._getBoundsOffset(s,i,e);return r.round().equals([0,0])?t:this.unproject(n.add(r),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new I(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=R(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),o=n.min.subtract(t.min),s=n.max.subtract(t.max),r=this._rebound(o.x,-s.x),a=this._rebound(o.y,-s.y);return new k(r,a)},_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(),n=yt?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Mat