(self.webpackChunkulogger_server=self.webpackChunkulogger_server||[]).push([[521],{9003:function(t,e,i){"use strict";i.r(e),i.d(e,{Feature:function(){return Xn},Map:function(){return _a},Overlay:function(){return Tl},View:function(){return fs},control:function(){return gu},geom:function(){return yu},layer:function(){return vu},proj:function(){return mu},source:function(){return xu},style:function(){return Su}});var n=function(){function t(t){this.propagationStopped,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.propagationStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),r="propertychange",o=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function s(t,e){return t>e?1:t0){for(r=1;r0)},e.prototype.removeEventListener=function(t,e){var i=this.listeners_&&this.listeners_[t];if(i){var n=i.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=f,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t]))}},e}(o),S="change",C="error",w="contextmenu",E="click",b="dblclick",T="keydown",R="keypress",O="load",P="resize",I="touchmove",M="wheel";function F(t,e,i,n,r){if(n&&n!==t&&(i=i.bind(n)),r){var o=i;i=function(){t.removeEventListener(e,i),o.apply(this,arguments)}}var s={target:t,type:e,listener:i};return t.addEventListener(e,i),s}function L(t,e,i,n){return F(t,e,i,n,!0)}function A(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),_(t))}var D=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var k=function(t){function e(){var e=t.call(this)||this;return e.revision_=0,e}return D(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(S)},e.prototype.getRevision=function(){return this.revision_},e.prototype.on=function(t,e){if(Array.isArray(t)){for(var i=t.length,n=new Array(i),r=0;r0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:xt}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var i=e.viewState.rotation;if(i!=this.rotation_){var n="rotate("+i+"rad)";if(this.autoHide_){var r=this.element.classList.contains(pt);r||0!==i?r&&0!==i&&this.element.classList.remove(pt):this.element.classList.add(pt)}this.label_.style.transform=n}this.rotation_=i}},e}(ct),bt={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},Tt={};Tt[bt.DEGREES]=2*Math.PI*6370997/360,Tt[bt.FEET]=.3048,Tt[bt.METERS]=1,Tt[bt.USFEET]=1200/3937;var Rt=bt,Ot=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Tt[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}();function Pt(t,e,i){return Math.min(Math.max(t,e),i)}var It="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},Mt="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function Ft(t,e,i,n,r,o){var s=r-i,a=o-n;if(0!==s||0!==a){var l=((t-i)*s+(e-n)*a)/(s*s+a*a);l>1?(i=r,n=o):l>0&&(i+=s*l,n+=a*l)}return Lt(t,e,i,n)}function Lt(t,e,i,n){var r=i-t,o=n-e;return r*r+o*o}function At(t){return t*Math.PI/180}function Dt(t,e){var i=t%e;return i*e<0?i+e:i}function kt(t,e,i){return t+i*(e-t)}var jt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Gt=6378137,zt=Math.PI*Gt,Wt=[-zt,-zt,zt,zt],Xt=[-180,-85,180,85],Nt=function(t){function e(e){return t.call(this,{code:e,units:Rt.METERS,extent:Wt,global:!0,worldExtent:Xt,getPointResolution:function(t,e){return t/It(e[1]/Gt)}})||this}return jt(e,t),e}(Ot),Kt=[new Nt("EPSG:3857"),new Nt("EPSG:102100"),new Nt("EPSG:102113"),new Nt("EPSG:900913"),new Nt("urn:ogc:def:crs:EPSG:6.18:3:3857"),new Nt("urn:ogc:def:crs:EPSG::3857"),new Nt("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Yt(t,e,i){var n=t.length,r=i>1?i:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(n));for(var s=zt,a=0;as?l=s:l<-s&&(l=-s),o[a+1]=l}return o}function Zt(t,e,i){var n=t.length,r=i>1?i:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(n));for(var s=0;sr&&(l|=ae),ao&&(l|=se),l===re&&(l=oe),l}function Se(){return[1/0,1/0,-1/0,-1/0]}function Ce(t,e,i,n,r){return r?(r[0]=t,r[1]=e,r[2]=i,r[3]=n,r):[t,e,i,n]}function we(t){return Ce(1/0,1/0,-1/0,-1/0,t)}function Ee(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function be(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function Te(t,e){for(var i=0,n=e.length;ie[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Ne(t){return t[2]1)for(var o=t[2]-t[0],s=t[3]-t[1],a=0;a=s)break;++d}f=this.scaleBar_?this.createScaleBar(c,u,l):u.toFixed(p<0?-p:0)+" "+l,this.renderedHTML_!=f&&(this.innerElement_.innerHTML=f,this.renderedHTML_=f),this.renderedWidth_!=c&&(this.innerElement_.style.width=c+"px",this.renderedWidth_=c),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,i){for(var n="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),r=[],o=t/this.scaleBarSteps_,s="#ffffff",a=0;a
'+this.createMarker("relative",a)+(a%2==0||2===this.scaleBarSteps_?this.createStepText(a,t,!1,e,i):"")+""),a===this.scaleBarSteps_-1&&r.push(this.createStepText(a+1,t,!0,e,i)),s="#ffffff"===s?"#000000":"#ffffff";return'
'+(this.scaleBarText_?'
'+n+"
":"")+r.join("")+"
"},e.prototype.createMarker=function(t,e){return'
'},e.prototype.createStepText=function(t,e,i,n,r){var o=(0===t?0:Math.round(n/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+r);return'
'+o+"
"},e.prototype.getScaleForResolution=function(){var t=qe(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||Si,i=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*i*39.37*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(ct),wi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ei=function(t){function e(e){var i=this,n=e||{};i=t.call(this,{element:document.createElement("div"),target:n.target})||this;var r=void 0!==n.className?n.className:"ol-zoom",o=void 0!==n.delta?n.delta:1,s=void 0!==n.zoomInLabel?n.zoomInLabel:"+",a=void 0!==n.zoomOutLabel?n.zoomOutLabel:"−",l=void 0!==n.zoomInTipLabel?n.zoomInTipLabel:"Zoom in",h=void 0!==n.zoomOutTipLabel?n.zoomOutTipLabel:"Zoom out",u=document.createElement("button");u.className=r+"-in",u.setAttribute("type","button"),u.title=l,u.appendChild("string"==typeof s?document.createTextNode(s):s),u.addEventListener(E,i.handleClick_.bind(i,o),!1);var c=document.createElement("button");c.className=r+"-out",c.setAttribute("type","button"),c.title=h,c.appendChild("string"==typeof a?document.createTextNode(a):a),c.addEventListener(E,i.handleClick_.bind(i,-o),!1);var p=r+" "+"ol-unselectable "+dt,f=i.element;return f.className=p,f.appendChild(u),f.appendChild(c),i.duration_=void 0!==n.duration?n.duration:250,i}return wi(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var i=e.getZoom();if(void 0!==i){var n=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:xt})):e.setZoom(n)}}},e}(ct),bi="XY",Ti="XYZ",Ri="XYM",Oi="XYZM",Pi="Point",Ii="LineString",Mi="LinearRing",Fi="Polygon",Li="MultiPoint",Ai="MultiLineString",Di="MultiPolygon",ki="GeometryCollection",ji="Circle";new Array(6);function Gi(t,e,i,n,r,o,s){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t[4]=o,t[5]=s,t}function zi(t,e){var i=e[0],n=e[1];return e[0]=t[0]*i+t[2]*n+t[4],e[1]=t[1]*i+t[3]*n+t[5],e}function Wi(t,e,i,n,r,o,s,a){var l=Math.sin(o),h=Math.cos(o);return t[0]=n*h,t[1]=r*l,t[2]=-n*l,t[3]=r*h,t[4]=s*n*h-a*n*l+e,t[5]=s*r*l+a*r*h+i,t}function Xi(t,e){var i,n=(i=e)[0]*i[3]-i[1]*i[2];pe(0!==n,32);var r=e[0],o=e[1],s=e[2],a=e[3],l=e[4],h=e[5];return t[0]=a/n,t[1]=-o/n,t[2]=-s/n,t[3]=r/n,t[4]=(s*h-a*l)/n,t[5]=-(r*h-o*l)/n,t}function Ni(t){return"matrix("+t.join(", ")+")"}function Ki(t,e,i,n,r,o){for(var s=o||[],a=0,l=e;l1)a=i;else{if(p>0){for(var f=0;fr&&(r=h),o=a,s=l}return r}function $i(t,e,i,n,r){for(var o=0,s=i.length;o0;){for(var c=h.pop(),p=h.pop(),f=0,d=t[p],_=t[p+1],g=t[c],y=t[c+1],v=p+n;vf&&(u=v,f=m)}f>r&&(l[(u-e)/n]=1,p+n0&&_>f)&&(d<0&&g0&&g>d)?(a=c,l=p):(o[s++]=a,o[s++]=l,h=a,u=l,a=c,l=p)}}return o[s++]=a,o[s++]=l,s}function ln(t,e,i,n,r,o,s,a){for(var l=0,h=i.length;lo&&(h-a)*(o-l)-(r-a)*(u-l)>0&&s++:u<=o&&(h-a)*(o-l)-(r-a)*(u-l)<0&&s--,a=h,l=u}return 0!==s}function xn(t,e,i,n,r,o){if(0===i.length)return!1;if(!mn(t,e,i[0],n,r,o))return!1;for(var s=1,a=i.length;sS&&xn(t,e,i,n,u=(c+p)/2,_)&&(x=u,S=C),c=p}return isNaN(x)&&(x=r[o]),a?(a.push(x,_,S),a):[x,_,S]}function Cn(t,e,i,n,r){for(var o,s=[t[e],t[e+1]],a=[];e+n=r[0]&&o[2]<=r[2]||(o[1]>=r[1]&&o[3]<=r[3]||Cn(t,e,i,n,(function(t,e){return function(t,e,i){var n=!1,r=xe(t,e),o=xe(t,i);if(r===oe||o===oe)n=!0;else{var s=t[0],a=t[1],l=t[2],h=t[3],u=e[0],c=e[1],p=i[0],f=i[1],d=(f-c)/(p-u),_=void 0,g=void 0;o&se&&!(r&se)&&(n=(_=p-(f-h)/d)>=s&&_<=l),n||!(o&ae)||r&ae||(n=(g=f-(p-l)*d)>=a&&g<=h),n||!(o&le)||r&le||(n=(_=p-(f-a)/d)>=s&&_<=l),n||!(o&he)||r&he||(n=(g=f-(p-s)*d)>=a&&g<=h)}return n}(r,t,e)})))))}function En(t,e,i,n,r){if(!function(t,e,i,n,r){return!!(wn(t,e,i,n,r)||mn(t,e,i,n,r[0],r[1])||mn(t,e,i,n,r[0],r[3])||mn(t,e,i,n,r[2],r[1])||mn(t,e,i,n,r[2],r[3]))}(t,e,i[0],n,r))return!1;if(1===i.length)return!0;for(var o=1,s=i.length;oo||(h==o&&l>=s||(r=a,o=h,s=l))}return r}(t,e,i,n),a=s-n;a=i&&(l=e);var h=t[a],u=t[a+1],c=t[s],p=t[s+1],f=t[l],d=t[l+1];return c*d+h*p+u*f-(u*c+p*f+h*d)<0}function Rn(t,e,i,n,r){for(var o=void 0!==r&&r,s=0,a=i.length;s>1)],e))<0?a=n+1:(l=n,h=!r);return h?a:~a}(d,v);m<0?(h=(v-d[-m-2])/(d[-m-1]-d[-m-2]),l=e+(-m-2)*n):l=e+m*n}var x=a>1?a:2,S=o||new Array(x);for(_=0;_>1;r=1024){var r=0;for(var o in t)0==(3&r++)&&(delete t[o],--e)}n=function(t){var e,i,n,r,o;er.exec(t)&&(t=ir(t));if(tr.exec(t)){var s=t.length-1,a=void 0;a=s<=4?1:2;var l=4===s||8===s;e=parseInt(t.substr(1+0*a,a),16),i=parseInt(t.substr(1+1*a,a),16),n=parseInt(t.substr(1+2*a,a),16),r=l?parseInt(t.substr(1+3*a,a),16):255,1==a&&(e=(e<<4)+e,i=(i<<4)+i,n=(n<<4)+n,l&&(r=(r<<4)+r)),o=[e,i,n,r/255]}else 0==t.indexOf("rgba(")?or(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),or(o)):pe(!1,14);return o}(i),t[i]=n,++e}return n}}();function rr(t){return Array.isArray(t)?t:nr(t)}function or(t){return t[0]=Pt(t[0]+.5|0,0,255),t[1]=Pt(t[1]+.5|0,0,255),t[2]=Pt(t[2]+.5|0,0,255),t[3]=Pt(t[3],0,1),t}function sr(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+i+","+n+","+(void 0===t[3]?1:t[3])+")"}var ar=function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,i){var n=lr(t,e,i);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,i,n){var r=lr(t,e,i);this.cache_[r]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}();function lr(t,e,i){return e+":"+t+":"+(i?function(t){return"string"==typeof t?t:sr(t)}(i):"null")}var hr=new ar,ur=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),cr=function(t){function e(e,i,n,r){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=n,o.resolution=i,o.state=r,o}return ur(e,t),e.prototype.changed=function(){this.dispatchEvent(S)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return j()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){j()},e}(x),pr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();!function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,n,Un)||this;return a.src_=r,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.state=Un,a.imageLoadFunction_=s,a}pr(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Jn,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=ke(this.extent)/this.image_.height),this.state=qn,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=Un&&this.state!=Jn||(this.state=Hn,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=fr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(cr);function fr(t,e,i){var n=t;if(n.src&&it){var r=n.decode(),o=!0;return r.then((function(){o&&e()})).catch((function(t){o&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():i())})),function(){o=!1}}var s=[L(n,O,e),L(n,C,i)];return function(){s.forEach(A)}}var dr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),_r=null,gr=function(t){function e(e,i,n,r,o,s){var a=t.call(this)||this;return a.hitDetectionImage_=null,a.image_=e||new Image,null!==r&&(a.image_.crossOrigin=r),a.canvas_={},a.color_=s,a.unlisten_=null,a.imageState_=o,a.size_=n,a.src_=i,a.tainted_,a}return dr(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===qn){_r||(_r=rt(1,1)),_r.drawImage(this.image_,0,0);try{_r.getImageData(0,0,1,1),this.tainted_=!1}catch(t){_r=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(S)},e.prototype.handleImageError_=function(){this.imageState_=Jn,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=qn,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],i=rt(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==Un){this.imageState_=Hn;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=fr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var i=e.getContext("2d");if(i.scale(t,t),i.drawImage(this.image_,0,0),this.isTainted_()){var n=this.color_;return i.globalCompositeOperation="multiply",i.fillStyle="rgb("+n[0]+","+n[1]+","+n[2]+")",i.fillRect(0,0,e.width,e.height),i.globalCompositeOperation="destination-in",void i.drawImage(this.image_,0,0)}for(var r=i.getImageData(0,0,e.width,e.height),o=r.data,s=this.color_[0]/255,a=this.color_[1]/255,l=this.color_[2]/255,h=0,u=o.length;h0,6);var c=void 0!==n.src?Un:qn;return i.color_=void 0!==n.color?rr(n.color):null,i.iconImage_=function(t,e,i,n,r,o){var s=hr.get(e,n,o);return s||(s=new gr(t,e,i,n,r,o),hr.set(e,n,o,s)),s}(l,u,h,i.crossOrigin_,c,i.color_),i.offset_=void 0!==n.offset?n.offset:[0,0],i.offsetOrigin_=void 0!==n.offsetOrigin?n.offsetOrigin:Bn,i.origin_=null,i.size_=void 0!==n.size?n.size:null,i}return yr(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==Nn||this.anchorYUnits_==Nn){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Nn&&(t[0]*=e[0]),this.anchorYUnits_==Nn&&(t[1]*=e[1])}if(this.anchorOrigin_!=Bn){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Vn&&this.anchorOrigin_!=Zn||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Yn&&this.anchorOrigin_!=Zn||(t[1]=-t[1]+e[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_,e=this.getDisplacement();if(this.offsetOrigin_!=Bn){var i=this.getSize(),n=this.iconImage_.getSize();if(!i||!n)return null;t=t.slice(),this.offsetOrigin_!=Vn&&this.offsetOrigin_!=Zn||(t[0]=n[0]-i[0]-t[0]),this.offsetOrigin_!=Yn&&this.offsetOrigin_!=Zn||(t[1]=n[1]-i[1]-t[1])}return t[0]+=e[0],t[1]+=e[1],this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(S,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(S,t)},e}($n),mr="opacity",xr="visible",Sr="extent",Cr="zIndex",wr="maxResolution",Er="minResolution",br="maxZoom",Tr="minZoom",Rr="source",Or=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Pr=function(t){function e(e){var i=t.call(this)||this,n=d({},e);return n[mr]=void 0!==e.opacity?e.opacity:1,pe("number"==typeof n[mr],64),n[xr]=void 0===e.visible||e.visible,n[Cr]=e.zIndex,n[wr]=void 0!==e.maxResolution?e.maxResolution:1/0,n[Er]=void 0!==e.minResolution?e.minResolution:0,n[Tr]=void 0!==e.minZoom?e.minZoom:-1/0,n[br]=void 0!==e.maxZoom?e.maxZoom:1/0,i.className_=void 0!==n.className?e.className:"ol-layer",delete n.className,i.setProperties(n),i.state_=null,i}return Or(e,t),e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},i=this.getZIndex();return e.opacity=Pt(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==i?i:!1===e.managed?1/0:0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return j()},e.prototype.getLayerStatesArray=function(t){return j()},e.prototype.getExtent=function(){return this.get(Sr)},e.prototype.getMaxResolution=function(){return this.get(wr)},e.prototype.getMinResolution=function(){return this.get(Er)},e.prototype.getMinZoom=function(){return this.get(Tr)},e.prototype.getMaxZoom=function(){return this.get(br)},e.prototype.getOpacity=function(){return this.get(mr)},e.prototype.getSourceState=function(){return j()},e.prototype.getVisible=function(){return this.get(xr)},e.prototype.getZIndex=function(){return this.get(Cr)},e.prototype.setExtent=function(t){this.set(Sr,t)},e.prototype.setMaxResolution=function(t){this.set(wr,t)},e.prototype.setMinResolution=function(t){this.set(Er,t)},e.prototype.setMaxZoom=function(t){this.set(br,t)},e.prototype.setMinZoom=function(t){this.set(Tr,t)},e.prototype.setOpacity=function(t){pe("number"==typeof t,64),this.set(mr,t)},e.prototype.setVisible=function(t){this.set(xr,t)},e.prototype.setZIndex=function(t){this.set(Cr,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(B),Ir="prerender",Mr="postrender",Fr="precompose",Lr="postcompose",Ar="rendercomplete",Dr="undefined",kr="ready",jr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Gr(t,e){if(!t.visible)return!1;var i=e.resolution;if(i=t.maxResolution)return!1;var n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}var zr=function(t){function e(e){var i=this,n=d({},e);delete n.source,(i=t.call(this,n)||this).mapPrecomposeKey_=null,i.mapRenderKey_=null,i.sourceChangeKey_=null,i.renderer_=null,e.render&&(i.render=e.render),e.map&&i.setMap(e.map),i.addEventListener(Z(Rr),i.handleSourcePropertyChange_);var r=e.source?e.source:null;return i.setSource(r),i}return jr(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(Rr)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Dr},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(A(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=F(t,S,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_.getFeatures(t)},e.prototype.render=function(t,e){var i=this.getRenderer();if(i.prepareFrame(t))return i.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(A(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(A(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=F(t,Fr,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);pe(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=F(this,S,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Rr,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.setSource(null),t.prototype.disposeInternal.call(this)},e}(Pr);function Wr(t,e){for(var i=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){i=!1;break}return i}function Xr(t,e){var i=Math.cos(e),n=Math.sin(e),r=t[0]*i-t[1]*n,o=t[1]*i+t[0]*n;return t[0]=r,t[1]=o,t}function Nr(t,e){if(e.canWrapX()){var i=We(e.getExtent()),n=function(t,e,i){var n=e.getExtent(),r=0;if(e.canWrapX()&&(t[0]n[2])){var o=i||We(n);r=Math.floor((t[0]-n[0])/o)}return r}(t,e,i);n&&(t[0]-=n*i)}return t}var Kr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Yr(t,e){hr.expire()}var Zr=function(t){function e(e){var i=t.call(this)||this;return i.map_=e,i.declutterTree_=null,i}return Kr(e,t),e.prototype.dispatchRenderEvent=function(t,e){j()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;Wi(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Xi(n,i)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r,o,s,a){var l,h=e.viewState;function u(t,e,i){return r.call(o,e,t?i:null)}var c=h.projection,p=Nr(t.slice(),c),f=[[0,0]];if(c.canWrapX()&&n){var d=We(c.getExtent());f.push([-d,0],[d,0])}var _,g=e.layerStatesArray,y=g.length;this.declutterTree_&&(_=this.declutterTree_.all().map((function(t){return t.value})));for(var v=[],m=0;m=0;--x){var S=g[x],C=S.layer;if(C.hasRenderer()&&Gr(S,h)&&s.call(a,C)){var w=C.getRenderer(),E=C.getSource();if(w&&E){var b=E.getWrapX()?p:t,T=u.bind(null,S.managed);v[0]=b[0]+f[m][0],v[1]=b[1]+f[m][1],l=w.forEachFeatureAtCoordinate(v,e,i,T,_)}if(l)return l}}},e.prototype.forEachLayerAtPixel=function(t,e,i,n,r){return j()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,n,r,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,n,c,this,r,o)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){this.declutterTree_=function(t,e){e&&e.clear();for(var i=t.declutterItems,n=i.length-1;n>=0;--n)for(var r=i[n],o=r.items,s=0,a=o.length;s=0;--a){var l=s[a],h=l.layer;if(h.hasRenderer()&&Gr(l,o)&&r(h)){var u=h.getRenderer().getDataAtPixel(t,e,i);if(u){var c=n(h,u);if(c)return c}}}},e}(Zr),xo="add",So="remove",Co=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),wo="length",Eo=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.element=i,r.index=n,r}return Co(e,t),e}(n),bo=function(t){function e(e,i){var n=t.call(this)||this,r=i||{};if(n.unique_=!!r.unique,n.array_=e||[],n.unique_)for(var o=0,s=n.array_.length;o0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;ethis.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(A(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(I,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(A(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(A),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(x),Go="layergroup",zo="size",Wo="target",Xo="view",No=1/0,Ko=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,_(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(i);return delete this.queuedElements_[n],i},t.prototype.enqueue=function(t){pe(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=No&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,n=e.length,r=e[t],o=i[t],s=t;t>1;){var a=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),h=lt;){var s=this.getParentIndex_(e);if(!(n[s]>o))break;i[e]=i[s],n[e]=n[s],e=s}i[e]=r,n[e]=o},t.prototype.reprioritize=function(){var t,e,i,n=this.priorityFunction_,r=this.elements_,o=this.priorities_,s=0,a=r.length;for(e=0;e0;)n=(i=this.dequeue()[0]).getKey(),i.getState()!==Yo||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++r,i.load())},e}(Ko);var Jo=0,Qo=1,$o="center",ts="resolution",es="rotation",is=256;function ns(t,e,i){return function(n,r,o,s){if(n){var a=e?0:o[0]*r,l=e?0:o[1]*r,h=t[0]+a/2,u=t[2]-a/2,c=t[1]+l/2,p=t[3]-l/2;h>u&&(u=h=(u+h)/2),c>p&&(p=c=(p+c)/2);var f=Pt(n[0],h,u),d=Pt(n[1],c,p),_=30*r;return s&&i&&(f+=-_*Math.log(1+Math.max(0,h-n[0])/_)+_*Math.log(1+Math.max(0,n[0]-u)/_),d+=-_*Math.log(1+Math.max(0,c-n[1])/_)+_*Math.log(1+Math.max(0,n[1]-p)/_)),[f,d]}}}function rs(t){return t}function os(t,e,i,n){var r=We(e)/i[0],o=ke(e)/i[1];return n?Math.min(t,Math.max(r,o)):Math.min(t,Math.min(r,o))}function ss(t,e,i){var n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(n=Math.max(n,i),n/=Math.log(1+50*Math.max(0,i/t-1))/50+1),Pt(n,i/2,2*e)}function as(t,e,i,n,r){return function(o,s,a,l){if(void 0!==o){var h=n?os(t,n,a,r):t;return(void 0===i||i)&&l?ss(o,h,e):Pt(o,e,h)}}}function ls(t){return void 0!==t?0:void 0}function hs(t){return void 0!==t?t:void 0}var us=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function cs(t,e){setTimeout((function(){t(e)}),0)}function ps(t){return!(t.sourceCenter&&t.targetCenter&&!Wr(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}var fs=function(t){function e(e){var i=t.call(this)||this,n=d({},e);return i.hints_=[0,0],i.animations_=[],i.updateAnimationKey_,i.projection_=Qe(n.projection,"EPSG:3857"),i.viewportSize_=[100,100],i.targetCenter_=null,i.targetResolution_,i.targetRotation_,i.cancelAnchor_=void 0,n.center&&(n.center=ui(n.center,i.projection_)),n.extent&&(n.extent=pi(n.extent,i.projection_)),i.applyOptions_(n),i}return us(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,i,n,r=28,o=2,s=void 0!==t.minZoom?t.minZoom:0,l=void 0!==t.maxZoom?t.maxZoom:r,h=void 0!==t.zoomFactor?t.zoomFactor:o,u=void 0!==t.multiWorld&&t.multiWorld,c=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,p=void 0!==t.showFullExtent&&t.showFullExtent,f=Qe(t.projection,"EPSG:3857"),d=f.getExtent(),_=t.constrainOnlyCenter,g=t.extent;u||g||!f.isGlobal()||(_=!1,g=d);if(void 0!==t.resolutions){var y=t.resolutions;i=y[s],n=void 0!==y[l]?y[l]:y[y.length-1],e=t.constrainResolution?function(t,e,i,n){return function(r,o,s,l){if(void 0!==r){var h=t[0],u=t[t.length-1],c=i?os(h,i,s,n):h;if(l)return void 0===e||e?ss(r,c,u):Pt(r,u,c);var p=Math.min(c,r),f=Math.floor(a(t,p,o));return t[f]>c&&f1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i),!this.isDef()){var n=arguments[i-1];return n.center&&this.setCenterInternal(n.center),void 0!==n.zoom&&this.setZoom(n.zoom),void 0!==n.rotation&&this.setRotation(n.rotation),void(e&&cs(e,!0))}for(var r=Date.now(),o=this.targetCenter_.slice(),s=this.targetResolution_,a=this.targetRotation_,l=[],h=0;h0},e.prototype.getInteracting=function(){return this.hints_[Qo]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(Jo,-this.hints_[Jo]);for(var e=0,i=this.animations_.length;e=0;--i){for(var n=this.animations_[i],r=!0,o=0,s=n.length;o0?l/a.duration:1;h>=1?(a.complete=!0,h=1):r=!1;var u=a.easing(h);if(a.sourceCenter){var c=a.sourceCenter[0],p=a.sourceCenter[1],f=c+u*(a.targetCenter[0]-c),d=p+u*(a.targetCenter[1]-p);this.targetCenter_=[f,d]}if(a.sourceResolution&&a.targetResolution){var _=1===u?a.targetResolution:a.sourceResolution+u*(a.targetResolution-a.sourceResolution);if(a.anchor){var g=this.getViewportSize_(this.getRotation()),y=this.constraints_.resolution(_,0,g,!0);this.targetCenter_=this.calculateCenterZoom(y,a.anchor)}this.targetResolution_=_,this.applyTargetState_(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var v=1===u?Dt(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+u*(a.targetRotation-a.sourceRotation);if(a.anchor){var m=this.constraints_.rotation(v,!0);this.targetCenter_=this.calculateCenterRotate(m,a.anchor)}this.targetRotation_=v}if(this.applyTargetState_(!0),e=!0,!a.complete)break}}if(r){this.animations_[i]=null,this.setHint(Jo,-1);var x=n[0].callback;x&&cs(x,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var i,n,r,o=this.getCenterInternal();return void 0!==o&&(Xr(i=[o[0]-e[0],o[1]-e[1]],t-this.getRotation()),r=e,(n=i)[0]+=+r[0],n[1]+=+r[1]),i},e.prototype.calculateCenterZoom=function(t,e){var i,n=this.getCenterInternal(),r=this.getResolution();void 0!==n&&void 0!==r&&(i=[e[0]-t*(e[0]-n[0])/r,e[1]-t*(e[1]-n[1])/r]);return i},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var i=e[0],n=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(n*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?hi(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get($o)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return ci(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSize_(),i=this.getCenterInternal();pe(i,1);var n=this.getResolution();pe(void 0!==n,2);var r=this.getRotation();return pe(void 0!==r,3),De(i,n,r,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(ts)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(pi(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var i=e||this.getViewportSize_(),n=We(t)/i[0],r=ke(t)/i[1];return Math.max(n,r)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,r=Math.log(i/n)/Math.log(e);return function(t){return i/Math.pow(e,t*r)}},e.prototype.getRotation=function(){return this.get(es)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,r=Math.log(i/n)/e;return function(t){return Math.log(i/t)/e/r}},e.prototype.getState=function(){var t=this.getCenterInternal(),e=this.getProjection(),i=this.getResolution(),n=this.getRotation();return{center:t.slice(0),projection:void 0!==e?e:null,resolution:i,rotation:n,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,n=this.minZoom_||0;if(this.resolutions_){var r=a(this.resolutions_,t,1);n=r,e=this.resolutions_[r],i=r==this.resolutions_.length-1?2:e/this.resolutions_[r+1]}else e=this.maxResolution_,i=this.zoomFactor_;return n+Math.log(e/t)/Math.log(i)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=Pt(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,Pt(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var i,n=d({size:this.getViewportSize_()},e||{});if(pe(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))pe(!Ne(t),25),i=Fn(r=pi(t,this.getProjection()));else if(t.getType()===ji){var r;(i=Fn(r=pi(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),Le(r))}else{var o=li();i=o?t.clone().transform(o,this.getProjection()):t}this.fitInternal(i,n)},e.prototype.fitInternal=function(t,e){var i=e||{},n=i.size;n||(n=this.getViewportSize_());var r,o=void 0!==i.padding?i.padding:[0,0,0,0],s=void 0!==i.nearest&&i.nearest;r=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;for(var a=t.getFlatCoordinates(),l=this.getRotation(),h=Math.cos(-l),u=Math.sin(-l),c=1/0,p=1/0,d=-1/0,_=-1/0,g=t.getStride(),y=0,v=a.length;y=0;s--){var a=o[s];if(a.getActive())if(!a.handleEvent(t))break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,n=i;if(t){var r=t.viewHints;if(r[Jo]||r[Qo]){var o=!it&&Date.now()-t.time>8;i=o?0:8,n=o?0:2}}e.getTilesLoading()0&&t[1]>0}(e)&&i&&i.isDef()){var o=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),s=i.getState();r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterItems:n?n.declutterItems:[],extent:De(s.center,s.resolution,s.rotation,e),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:e,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:s,viewHints:o,wantedTiles:{}}}if(this.frameState_=r,this.renderer_.renderFrame(r),r){if(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),n)(!this.previousExtent_||!Ne(this.previousExtent_)&&!Ee(r.extent,this.previousExtent_))&&(this.dispatchEvent(new Io(U,this,n)),this.previousExtent_=we(this.previousExtent_));this.previousExtent_&&!r.viewHints[Jo]&&!r.viewHints[Qo]&&!Ee(r.extent,this.previousExtent_)&&(this.dispatchEvent(new Io(H,this,r)),_e(r.extent,this.previousExtent_))}this.dispatchEvent(new Io(V,this,r)),this.postRenderTimeoutHandle_=setTimeout(this.handlePostRender.bind(this),0)},e.prototype.setLayerGroup=function(t){this.set(Go,t)},e.prototype.setSize=function(t){this.set(zo,t)},e.prototype.setTarget=function(t){this.set(Wo,t)},e.prototype.setView=function(t){this.set(Xo,t)},e.prototype.updateSize=function(){var t=this.getTargetElement();if(t){var e=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(e.borderLeftWidth)-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)-parseFloat(e.borderRightWidth),t.offsetHeight-parseFloat(e.borderTopWidth)-parseFloat(e.paddingTop)-parseFloat(e.paddingBottom)-parseFloat(e.borderBottomWidth)])}else this.setSize(void 0);this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,i=getComputedStyle(this.viewport_);i.width&&i.height&&(e=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(e)}},e}(B),gs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ys=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this).ulElement_=document.createElement("ul"),i.collapsed_=void 0===n.collapsed||n.collapsed,i.overrideCollapsible_=void 0!==n.collapsible,i.collapsible_=void 0===n.collapsible||n.collapsible,i.collapsible_||(i.collapsed_=!1);var r=void 0!==n.className?n.className:"ol-attribution",o=void 0!==n.tipLabel?n.tipLabel:"Attributions",s=void 0!==n.collapseLabel?n.collapseLabel:"»";"string"==typeof s?(i.collapseLabel_=document.createElement("span"),i.collapseLabel_.textContent=s):i.collapseLabel_=s;var a=void 0!==n.label?n.label:"i";"string"==typeof a?(i.label_=document.createElement("span"),i.label_.textContent=a):i.label_=a;var l=i.collapsible_&&!i.collapsed_?i.collapseLabel_:i.label_,h=document.createElement("button");h.setAttribute("type","button"),h.title=o,h.appendChild(l),h.addEventListener(E,i.handleClick_.bind(i),!1);var u=r+" "+"ol-unselectable "+dt+(i.collapsed_&&i.collapsible_?" ol-collapsed":"")+(i.collapsible_?"":" ol-uncollapsible"),c=i.element;return c.className=u,c.appendChild(i.ulElement_),c.appendChild(h),i.renderedAttributions_=[],i.renderedVisible_=!0,i}return gs(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},i=[],n=t.layerStatesArray,r=0,o=n.length;r0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!u(e,this.renderedAttributions_)){ht(this.ulElement_);for(var n=0,r=e.length;n0}}else if(t.type==Lo.POINTERDOWN){var n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==Lo.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===Lo.POINTERDOWN||e===Lo.POINTERDRAG||e===Lo.POINTERUP}(t)){var e=t.originalEvent,i=e.pointerId.toString();t.type==Lo.POINTERUP?delete this.trackedPointers_[i]:(t.type==Lo.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=g(this.trackedPointers_)}},e}(Ss);function Rs(t){var e=arguments;return function(t){for(var i=!0,n=0,r=e.length;n0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(Ts),zs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ws=function(t){function e(e){var i=this,n=e||{};return(i=t.call(this,{stopDown:p})||this).condition_=n.condition?n.condition:Os,i.lastAngle_=void 0,i.duration_=void 0!==n.duration?n.duration:250,i}return zs(e,t),e.prototype.handleDragEvent=function(t){if(Ds(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==ls){var n=e.getSize(),r=t.pixel,o=Math.atan2(n[1]/2-r[1],r[0]-n[0]/2);if(void 0!==this.lastAngle_){var s=o-this.lastAngle_;i.adjustRotationInternal(-s)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!Ds(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!Ds(t)&&(!(!Ms(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(Ts),Xs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ns=function(t){function e(e){var i=t.call(this)||this;return i.geometry_=null,i.element_=document.createElement("div"),i.element_.style.position="absolute",i.element_.style.pointerEvents="auto",i.element_.className="ol-box "+e,i.map_=null,i.startPixel_=null,i.endPixel_=null,i}return Xs(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+i,n.top=Math.min(t[1],e[1])+i,n.width=Math.abs(e[0]-t[0])+i,n.height=Math.abs(e[1]-t[1])+i},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new Mn([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(o),Ks=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ys="boxstart",Zs="boxdrag",Bs="boxend",Vs=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.coordinate=i,r.mapBrowserEvent=n,r}return Ks(e,t),e}(n),Us=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.box_=new Ns(n.className||"ol-dragbox"),i.minArea_=void 0!==n.minArea?n.minArea:64,n.onBoxEnd&&(i.onBoxEnd=n.onBoxEnd),i.startPixel_=null,i.condition_=n.condition?n.condition:Ms,i.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:i.defaultBoxEndCondition,i}return Ks(e,t),e.prototype.defaultBoxEndCondition=function(t,e,i){var n=i[0]-e[0],r=i[1]-e[1];return n*n+r*r>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Vs(Zs,t.coordinate,t))},e.prototype.handleUpEvent=function(t){return this.box_.setMap(null),this.boxEndCondition_(t,this.startPixel_,t.pixel)&&(this.onBoxEnd(t),this.dispatchEvent(new Vs(Bs,t.coordinate,t))),!1},e.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Vs(Ys,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(Ts),Hs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),qs=function(t){function e(e){var i=this,n=e||{},r=n.condition?n.condition:Ls;return(i=t.call(this,{condition:r,className:n.className||"ol-dragzoom",minArea:n.minArea})||this).duration_=void 0!==n.duration?n.duration:200,i.out_=void 0!==n.out&&n.out,i}return Hs(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap(),i=e.getView(),n=e.getSize(),r=this.getGeometry().getExtent();if(this.out_){var o=i.calculateExtentInternal(n),s=function(t,e){return Te(we(e),t)}([e.getPixelFromCoordinateInternal(Me(r)),e.getPixelFromCoordinateInternal(ze(r))]);!function(t,e){var i=(t[2]-t[0])/2*(e-1),n=(t[3]-t[1])/2*(e-1);t[0]-=i,t[2]+=i,t[1]-=n,t[3]+=n}(o,1/i.getResolutionForExtentInternal(s,n)),r=o}var a=i.getConstrainedResolution(i.getResolutionForExtentInternal(r,n)),l=i.getConstrainedCenter(Le(r),a);i.animateInternal({resolution:a,center:l,duration:this.duration_,easing:xt})},e}(Us),Js=37,Qs=38,$s=39,ta=40,ea=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ia=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.defaultCondition_=function(t){return Fs(t)&&As(t)},i.condition_=void 0!==n.condition?n.condition:i.defaultCondition_,i.duration_=void 0!==n.duration?n.duration:100,i.pixelDelta_=void 0!==n.pixelDelta?n.pixelDelta:128,i}return ea(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==T){var i=t.originalEvent.keyCode;if(this.condition_(t)&&(i==ta||i==Js||i==$s||i==Qs)){var n=t.map.getView(),r=n.getResolution()*this.pixelDelta_,o=0,s=0;i==ta?s=-r:i==Js?o=-r:i==$s?o=r:s=r;var a=[o,s];Xr(a,n.getRotation()),function(t,e,i){var n=t.getCenterInternal();if(n){var r=[n[0]+e[0],n[1]+e[1]];t.animateInternal({duration:void 0!==i?i:250,easing:Ct,center:t.getConstrainedCenter(r)})}}(n,a,this.duration_),t.preventDefault(),e=!0}}return!e},e}(Ss),na=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ra=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.condition_=n.condition?n.condition:As,i.delta_=n.delta?n.delta:1,i.duration_=void 0!==n.duration?n.duration:100,i}return na(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==T||t.type==R){var i=t.originalEvent.charCode;if(this.condition_(t)&&(i=="+".charCodeAt(0)||i=="-".charCodeAt(0))){var n=t.map,r=i=="+".charCodeAt(0)?this.delta_:-this.delta_;xs(n.getView(),r,void 0,this.duration_),t.preventDefault(),e=!0}}return!e},e}(Ss),oa=function(){function t(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]0&&this.points_[i+2]>t;)i-=3;var n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;var r=this.points_[e]-this.points_[i],o=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(o,r),this.initialVelocity_=Math.sqrt(r*r+o*o)/n,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),sa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),aa="trackpad",la="wheel",ha=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,n)||this).totalDelta_=0,i.lastDelta_=0,i.maxDelta_=void 0!==n.maxDelta?n.maxDelta:1,i.duration_=void 0!==n.duration?n.duration:250,i.timeout_=void 0!==n.timeout?n.timeout:80,i.useAnchor_=void 0===n.useAnchor||n.useAnchor,i.constrainResolution_=void 0!==n.constrainResolution&&n.constrainResolution;var r=n.condition?n.condition:Is;return i.condition_=n.onFocusOnly?Rs(Ps,r):r,i.lastAnchor_=null,i.startTime_=void 0,i.timeoutId_,i.mode_=void 0,i.trackpadEventGap_=400,i.trackpadTimeoutId_,i.deltaPerZoom_=300,i}return sa(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==M)return!0;t.preventDefault();var e,i=t.map,n=t.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==M&&(e=n.deltaY,J&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=tt),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var r=Date.now();void 0===this.startTime_&&(this.startTime_=r),(!this.mode_||r-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?aa:la);var o=i.getView();if(this.mode_===aa&&!o.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),o.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=r,!1;this.totalDelta_+=e;var s=Math.max(this.timeout_-(r-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),s),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var i=-Pt(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),xs(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(Ss),ua=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ca=function(t){function e(e){var i=this,n=e||{},r=n;return r.stopDown||(r.stopDown=p),(i=t.call(this,r)||this).anchor_=null,i.lastAngle_=void 0,i.rotating_=!1,i.rotationDelta_=0,i.threshold_=void 0!==n.threshold?n.threshold:.3,i.duration_=void 0!==n.duration?n.duration:250,i}return ua(e,t),e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],n=this.targetPointers[1],r=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(void 0!==this.lastAngle_){var o=r-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=r;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==ls){var l=s.getViewport().getBoundingClientRect(),h=bs(this.targetPointers);h[0]-=l.left,h[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(h),this.rotating_&&(s.render(),a.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Ts),pa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),fa=function(t){function e(e){var i=this,n=e||{},r=n;return r.stopDown||(r.stopDown=p),(i=t.call(this,r)||this).anchor_=null,i.duration_=void 0!==n.duration?n.duration:400,i.lastDistance_=void 0,i.lastScaleDelta_=1,i}return pa(e,t),e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],n=this.targetPointers[1],r=i.clientX-n.clientX,o=i.clientY-n.clientY,s=Math.sqrt(r*r+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,l=a.getView();1!=e&&(this.lastScaleDelta_=e);var h=a.getViewport().getBoundingClientRect(),u=bs(this.targetPointers);u[0]-=h.left,u[1]-=h.top,this.anchor_=a.getCoordinateFromPixelInternal(u),a.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Ts);var da=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),_a=function(t){function e(e){return(e=d({},e)).controls||(e.controls=function(t){var e=t||{},i=new bo;return(void 0===e.zoom||e.zoom)&&i.push(new Ei(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new Et(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new ys(e.attributionOptions)),i}()),e.interactions||(e.interactions=function(t){var e=t||{},i=new bo,n=new oa(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new Ws),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new ws({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new Gs({onFocusOnly:e.onFocusOnly,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new ca),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new fa({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new ia),i.push(new ra({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new ha({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new qs({duration:e.zoomDuration})),i}({onFocusOnly:!0})),t.call(this,e)||this}return da(e,t),e.prototype.createRenderer=function(){return new mo(this)},e}(_s),ga=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ya=function(t){function e(e,i,n){var r=t.call(this)||this,o=n||{};return r.tileCoord=e,r.state=i,r.interimTile=null,r.hifi=!0,r.key="",r.transition_=void 0===o.transition?250:o.transition,r.transitionStarts_={},r}return ga(e,t),e.prototype.changed=function(){this.dispatchEvent(S)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==Bo)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==Bo){t.interimTile=null;break}t.getState()==Zo?e=t:t.getState()==Yo?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==Vo&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){j()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var n=e-i+1e3/60;return n>=this.transition_?1:mt(n/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(x),va=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var ma,xa=function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,s)||this;return a.crossOrigin_=r,a.src_=n,a.image_=new Image,null!==r&&(a.image_.crossOrigin=r),a.unlisten_=null,a.tileLoadFunction_=o,a}return va(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.getKey=function(){return this.src_},e.prototype.handleImageError_=function(){var t;this.state=Vo,this.unlistenImage_(),this.image_=((t=rt(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=Bo:this.state=Uo,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Vo&&(this.state=Yo,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Yo&&(this.state=Zo,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=fr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(ya),Sa=function(){function t(t,e,i,n,r,o){this.sourceProj_=t,this.targetProj_=e;var s={},a=ei(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&We(n)==We(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?We(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?We(this.targetProj_.getExtent()):null;var l=Ge(i),h=ze(i),u=Fe(i),c=Me(i),p=this.transformInv_(l),f=this.transformInv_(h),d=this.transformInv_(u),_=this.transformInv_(c),g=10+(o?Math.max(0,Math.ceil(Mt(Ie(i)/(o*o*256*256)))):0);if(this.addQuad_(l,h,u,c,p,f,d,_,g),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach((function(t,e,i){y=Math.min(y,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-y>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-y>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-y>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-y>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i.5&&u<1,f=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)f=We(fe([t,e,i,n]))/this.targetWorldWidth_>.25||f;!p&&this.sourceProj_.isGlobal()&&u&&(f=u>.25||f)}if(!(!f&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3]))||Xe(h,this.maxSourceExtent_)){var d=0;if(!(f||isFinite(r[0])&&isFinite(r[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)f=!0;else if(1!=(d=(isFinite(r[0])&&isFinite(r[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=d&&4!=d&&8!=d)return;if(l>0){if(!f){var _=[(t[0]+i[0])/2,(t[1]+i[1])/2],g=this.transformInv_(_),y=void 0;if(p)y=(Dt(r[0],c)+Dt(s[0],c))/2-Dt(g[0],c);else y=(r[0]+s[0])/2-g[0];var v=(r[1]+s[1])/2-g[1];f=y*y+v*v>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var m=[(e[0]+i[0])/2,(e[1]+i[1])/2],x=this.transformInv_(m),S=[(n[0]+t[0])/2,(n[1]+t[1])/2],C=this.transformInv_(S);this.addQuad_(t,e,m,S,r,o,x,C,l-1),this.addQuad_(S,m,i,n,C,x,s,a,l-1)}else{var w=[(t[0]+e[0])/2,(t[1]+e[1])/2],E=this.transformInv_(w),b=[(i[0]+n[0])/2,(i[1]+n[1])/2],T=this.transformInv_(b);this.addQuad_(t,w,b,n,r,E,T,a,l-1),this.addQuad_(w,e,i,b,E,o,s,T,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&d)&&this.addTriangle_(t,i,n,r,s,a),0==(14&d)&&this.addTriangle_(t,i,e,r,s,o),d&&(0==(13&d)&&this.addTriangle_(e,n,t,o,a,r),0==(7&d)&&this.addTriangle_(e,n,i,o,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,n){var r=e.source;be(t,r[0]),be(t,r[1]),be(t,r[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),Ca={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function wa(t,e,i,n,r){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(n,r),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(i,r)),t.restore()}function Ea(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function ba(t,e,i,n){var r=ii(i,e,t),o=qe(e,n,i),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var l=t.getExtent();if(!l||ye(l,r)){var h=qe(t,o,r)/o;isFinite(h)&&h>0&&(o/=h)}return o}function Ta(t,e,i,n,r,o,s,a,l,h,u,c){var p=rt(Math.round(i*t),Math.round(i*e));if(d(p,c),0===l.length)return p.canvas;function f(t){return Math.round(t*i)/i}p.scale(i,i),p.globalCompositeOperation="lighter";var _=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){var n,r;n=_,(r=t.extent)[0]n[2]&&(n[2]=r[2]),r[1]n[3]&&(n[3]=r[3])}));var g=We(_),y=ke(_),v=rt(Math.round(i*g/n),Math.round(i*y/n));d(v,c);var m=i/n;l.forEach((function(t,e,i){var n=t.extent[0]-_[0],r=-(t.extent[3]-_[3]),o=We(t.extent),s=ke(t.extent);t.image.width>0&&t.image.height>0&&v.drawImage(t.image,h,h,t.image.width-2*h,t.image.height-2*h,n*m,r*m,o*m,s*m)}));var x=Ge(s);return a.getTriangles().forEach((function(t,e,r){var s=t.source,a=t.target,l=s[0][0],h=s[0][1],u=s[1][0],d=s[1][1],g=s[2][0],y=s[2][1],m=f((a[0][0]-x[0])/o),S=f(-(a[0][1]-x[1])/o),C=f((a[1][0]-x[0])/o),w=f(-(a[1][1]-x[1])/o),E=f((a[2][0]-x[0])/o),b=f(-(a[2][1]-x[1])/o),T=l,R=h;l=0,h=0;var O=function(t){for(var e=t.length,i=0;ir&&(r=s,n=o)}if(0===r)return null;var a=t[n];t[n]=t[i],t[i]=a;for(var l=i+1;l=0;p--){c[p]=t[p][e]/t[p][p];for(var f=p-1;f>=0;f--)t[f][e]-=t[f][p]*c[p]}return c}([[u-=T,d-=R,0,0,C-m],[g-=T,y-=R,0,0,E-m],[0,0,u,d,w-S],[0,0,g,y,b-S]]);if(O){if(p.save(),p.beginPath(),function(){if(void 0===ma){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",wa(t,4,5,4,0),wa(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;ma=Ea(e,0)||Ea(e,4)||Ea(e,8)}return ma}()||c===Ca){p.moveTo(C,w);for(var P=m-C,I=S-w,M=0;M<4;M++)p.lineTo(C+f((M+1)*P/4),w+f(M*I/3)),3!=M&&p.lineTo(C+f((M+1)*P/4),w+f((M+1)*I/3));p.lineTo(E,b)}else p.moveTo(C,w),p.lineTo(m,S),p.lineTo(E,b);p.clip(),p.transform(O[0],O[2],O[1],O[3],m,S),p.translate(_[0]-T,_[3]-R),p.scale(n/i,-n/i),p.drawImage(v.canvas,0,0),p.restore()}})),u&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,a.getTriangles().forEach((function(t,e,i){var n=t.target,r=(n[0][0]-x[0])/o,s=-(n[0][1]-x[1])/o,a=(n[1][0]-x[0])/o,l=-(n[1][1]-x[1])/o,h=(n[2][0]-x[0])/o,u=-(n[2][1]-x[1])/o;p.beginPath(),p.moveTo(a,l),p.lineTo(r,s),p.lineTo(h,u),p.closePath(),p.stroke()})),p.restore()),p.canvas}var Ra=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Oa=function(t){function e(e,i,n,r,o,s,a,l,h,u,c,p){var f=t.call(this,o,Yo)||this;f.renderEdges_=void 0!==c&&c,f.contextOptions_=p,f.pixelRatio_=a,f.gutter_=l,f.canvas_=null,f.sourceTileGrid_=i,f.targetTileGrid_=r,f.wrappedTileCoord_=s||o,f.sourceTiles_=[],f.sourcesListenerKeys_=null,f.sourceZ_=0;var d=r.getTileCoordExtent(f.wrappedTileCoord_),_=f.targetTileGrid_.getExtent(),g=f.sourceTileGrid_.getExtent(),y=_?je(d,_):d;if(0===Ie(y))return f.state=Uo,f;var v=e.getExtent();v&&(g=g?je(g,v):v);var m=r.getResolution(f.wrappedTileCoord_[0]),x=function(t,e,i,n){var r=Le(i),o=ba(t,e,r,n);return(!isFinite(o)||o<=0)&&Pe(i,(function(i){return o=ba(t,e,i,n),isFinite(o)&&o>0})),o}(e,n,y,m);if(!isFinite(x)||x<=0)return f.state=Uo,f;var S=void 0!==u?u:.5;if(f.triangulation_=new Sa(e,n,y,g,x*S,m),0===f.triangulation_.getTriangles().length)return f.state=Uo,f;f.sourceZ_=i.getZForResolution(x);var C=f.triangulation_.calculateSourceExtent();if(g&&(e.canWrapX()?(C[1]=Pt(C[1],g[1],g[3]),C[3]=Pt(C[3],g[1],g[3])):C=je(C,g)),Ie(C)){for(var w=i.getTileRangeForExtentAndZ(C,f.sourceZ_),E=w.minX;E<=w.maxX;E++)for(var b=w.minY;b<=w.maxY;b++){var T=h(f.sourceZ_,E,b,a);T&&f.sourceTiles_.push(T)}0===f.sourceTiles_.length&&(f.state=Uo)}else f.state=Uo;return f}return Ra(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,n){e&&e.getState()==Bo&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=Vo;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n="number"==typeof i?i:i[0],r="number"==typeof i?i:i[1],o=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Ta(n,r,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=Bo}this.changed()},e.prototype.load=function(){if(this.state==Yo){this.state=Zo,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,n){var r=e.getState();if(r==Yo||r==Zo){t++;var o=F(e,S,(function(i){var n=e.getState();n!=Bo&&n!=Vo&&n!=Uo||(A(o),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(o)}}.bind(this)),this.sourceTiles_.forEach((function(t,e,i){t.getState()==Yo&&t.load()})),0===t&&setTimeout(this.reproject_.bind(this),0)}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(A),this.sourcesListenerKeys_=null},e}(ya),Pa=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var i=this.entries_[t];return pe(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},t.prototype.remove=function(t){var e=this.entries_[t];return pe(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){pe(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function Ia(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function Ma(t,e,i){return t+"/"+e+"/"+i}function Fa(t){return Ma(t[0],t[1],t[2])}var La=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Aa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return La(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=function(t){return t.split("/").map(Number)}(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Fa(e.tileCoord)),e.release())}.bind(this))}},e}(Pa),Da="tileloadstart",ka="tileloadend",ja="tileloaderror",Ga=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function za(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var Wa=function(t){function e(e){var i=t.call(this)||this;return i.projection_=He(e.projection),i.attributions_=za(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:kr,i.wrapX_=void 0!==e.wrapX&&e.wrapX,i}return Ga(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolutions=function(){return j()},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getContextOptions=function(){},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=za(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(B),Xa=function(){function t(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function Na(t,e,i,n,r){return void 0!==r?(r.minX=t,r.maxX=e,r.minY=i,r.maxY=n,r):new Xa(t,e,i,n)}var Ka=Xa,Ya=[0,0,0],Za=function(){function t(t){var e,i,n,r;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,pe((e=this.resolutions_,i=!0,n=function(t,e){return e-t}||s,e.every((function(t,r){if(0===r)return!0;var o=n(e[r-1],t);return!(o>0||i&&0===o)}))),17),!t.origins)for(var o=0,a=this.resolutions_.length-1;o=this.minZoom;){if(e(a,2===this.zoomFactor_?Na(r=Math.floor(r/2),r,o=Math.floor(o/2),o,i):this.getTileRangeForExtentAndZ(s,a,i)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]0?n:Math.max(s/a[0],o/a[1]),h=r+1,u=new Array(h),c=0;ci||i>e.getMaxZoom())return!1;var o,s=e.getExtent();return!(o=s?e.getTileRangeForExtentAndZ(s,i):e.getFullTileRange(i))||o.containsXY(n,r)}(t,n)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)},e.prototype.useTile=function(t,e,i,n){},e}(Wa),Ja=function(t){function e(e,i){var n=t.call(this,e)||this;return n.tile=i,n}return Ha(e,t),e}(n),Qa=qa;function $a(t,e){var i=/\{z\}/g,n=/\{x\}/g,r=/\{y\}/g,o=/\{-y\}/g;return function(s,a,l){return s?t.replace(i,s[0].toString()).replace(n,s[1].toString()).replace(r,s[2].toString()).replace(o,(function(){var t=s[0],i=e.getFullTileRange(t);return pe(i,55),(i.getHeight()-s[2]-1).toString()})):void 0}}function tl(t,e){for(var i=t.length,n=new Array(i),r=0;rOpenStreetMap contributors.'];var r=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",o=void 0!==n.url?n.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:i,cacheSize:n.cacheSize,crossOrigin:r,imageSmoothing:n.imageSmoothing,opaque:void 0===n.opaque||n.opaque,maxZoom:void 0!==n.maxZoom?n.maxZoom:19,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,url:o,wrapX:n.wrapX,attributionsCollapsible:!1})||this}return ll(e,t),e}(al),ul="bottom-left",cl="bottom-center",pl="bottom-right",fl="center-left",dl="center-center",_l="center-right",gl="top-left",yl="top-center",vl="top-right";function ml(t){return(ml="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var xl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Sl="element",Cl="map",wl="offset",El="position",bl="positioning",Tl=function(t){function e(e){var i=t.call(this)||this;i.options=e,i.id=e.id,i.insertFirst=void 0===e.insertFirst||e.insertFirst,i.stopEvent=void 0===e.stopEvent||e.stopEvent,i.element=document.createElement("div"),i.element.className=void 0!==e.className?e.className:"ol-overlay-container ol-selectable",i.element.style.position="absolute",i.element.style.pointerEvents="auto";var n=e.autoPan;return n&&"object"!==ml(n)&&(n={animation:e.autoPanAnimation,margin:e.autoPanMargin}),i.autoPan=n||!1,i.rendered={transform_:"",visible:!0},i.mapPostrenderListenerKey=null,i.addEventListener(Z(Sl),i.handleElementChanged),i.addEventListener(Z(Cl),i.handleMapChanged),i.addEventListener(Z(wl),i.handleOffsetChanged),i.addEventListener(Z(El),i.handlePositionChanged),i.addEventListener(Z(bl),i.handlePositioningChanged),void 0!==e.element&&i.setElement(e.element),i.setOffset(void 0!==e.offset?e.offset:[0,0]),i.setPositioning(void 0!==e.positioning?e.positioning:gl),void 0!==e.position&&i.setPosition(e.position),i}return xl(e,t),e.prototype.getElement=function(){return this.get(Sl)},e.prototype.getId=function(){return this.id},e.prototype.getMap=function(){return this.get(Cl)},e.prototype.getOffset=function(){return this.get(wl)},e.prototype.getPosition=function(){return this.get(El)},e.prototype.getPositioning=function(){return this.get(bl)},e.prototype.handleElementChanged=function(){ht(this.element);var t=this.getElement();t&&this.element.appendChild(t)},e.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(lt(this.element),A(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=F(t,V,this.render,this),this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}},e.prototype.render=function(){this.updatePixelPosition()},e.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},e.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},e.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},e.prototype.setElement=function(t){this.set(Sl,t)},e.prototype.setMap=function(t){this.set(Cl,t)},e.prototype.setOffset=function(t){this.set(wl,t)},e.prototype.setPosition=function(t){this.set(El,t)},e.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},e.prototype.panIntoView=function(t){var e=this.getMap();if(e&&e.getTargetElement()&&this.get(El)){var i=this.getRect(e.getTargetElement(),e.getSize()),n=this.getElement(),r=this.getRect(n,[ot(n),st(n)]),o=t||{},s=void 0===o.margin?20:o.margin;if(!ve(i,r)){var a=r[0]-i[0],l=i[2]-r[2],h=r[1]-i[1],u=i[3]-r[3],c=[0,0];if(a<0?c[0]=a-s:l<0&&(c[0]=Math.abs(l)+s),h<0?c[1]=h-s:u<0&&(c[1]=Math.abs(u)+s),0!==c[0]||0!==c[1]){var p=e.getView().getCenterInternal(),f=e.getPixelFromCoordinateInternal(p),d=[f[0]+c[0],f[1]+c[1]],_=o.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(d),duration:_.duration,easing:_.easing})}}}},e.prototype.getRect=function(t,e){var i=t.getBoundingClientRect(),n=i.left+window.pageXOffset,r=i.top+window.pageYOffset;return[n,r,n+e[0],r+e[1]]},e.prototype.setPositioning=function(t){this.set(bl,t)},e.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},e.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(t&&t.isRendered()&&e){var i=t.getPixelFromCoordinate(e),n=t.getSize();this.updateRenderedPosition(i,n)}else this.setVisible(!1)},e.prototype.updateRenderedPosition=function(t,e){var i=this.element.style,n=this.getOffset(),r=this.getPositioning();this.setVisible(!0);var o=Math.round(t[0]+n[0])+"px",s=Math.round(t[1]+n[1])+"px",a="0%",l="0%";r==pl||r==_l||r==vl?a="-100%":r!=cl&&r!=dl&&r!=yl||(a="-50%"),r==ul||r==cl||r==pl?l="-100%":r!=fl&&r!=dl&&r!=_l||(l="-50%");var h="translate("+a+", "+l+") translate("+o+", "+s+")";this.rendered.transform_!=h&&(this.rendered.transform_=h,i.transform=h,i.msTransform=h)},e.prototype.getOptions=function(){return this.options},e}(B),Rl=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}();function Ol(t){return Array.isArray(t)?sr(t):t}var Pl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Il=function(t){function e(e){var i=this,n=void 0!==e.rotateWithView&&e.rotateWithView;return(i=t.call(this,{opacity:1,rotateWithView:n,rotation:void 0!==e.rotation?e.rotation:0,scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_={},i.hitDetectionCanvas_=null,i.fill_=void 0!==e.fill?e.fill:null,i.origin_=[0,0],i.points_=e.points,i.radius_=void 0!==e.radius?e.radius:e.radius1,i.radius2_=e.radius2,i.angle_=void 0!==e.angle?e.angle:0,i.stroke_=void 0!==e.stroke?e.stroke:null,i.anchor_=null,i.size_=null,i.imageSize_=null,i.hitDetectionImageSize_=null,i.render(),i}return Pl(e,t),e.prototype.clone=function(){var t=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},e.prototype.getAnchor=function(){return this.anchor_},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionCanvas_){var t=this.createRenderOptions();this.createHitDetectionCanvas_(t)}return this.hitDetectionCanvas_},e.prototype.getImage=function(t){if(!this.canvas_[t||1]){var e=this.createRenderOptions(),i=rt(e.size*t||1,e.size*t||1);this.draw_(e,i,0,0,t||1),this.canvas_[t||1]=i.canvas}return this.canvas_[t||1]},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.imageSize_},e.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},e.prototype.getImageState=function(){return qn},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.createRenderOptions=function(){var t,e=qr,i=Qr,n=0,r=null,o=0,s=0;return this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=$r),t=Ol(t),void 0===(s=this.stroke_.getWidth())&&(s=1),r=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),void 0===(i=this.stroke_.getLineJoin())&&(i=Qr),void 0===(e=this.stroke_.getLineCap())&&(e=qr),void 0===(n=this.stroke_.getMiterLimit())&&(n=10)),{strokeStyle:t,strokeWidth:s,size:2*(this.radius_+s)+1,lineCap:e,lineDash:r,lineDashOffset:o,lineJoin:i,miterLimit:n}},e.prototype.render=function(){var t=this.createRenderOptions(),e=rt(t.size,t.size);this.draw_(t,e,0,0,1),this.canvas_[1]=e.canvas;var i=e.canvas.width,n=i,r=this.getDisplacement();this.hitDetectionImageSize_=[t.size,t.size],this.createHitDetectionCanvas_(t),this.anchor_=[i/2-r[0],i/2+r[1]],this.size_=[i,i],this.imageSize_=[n,n]},e.prototype.draw_=function(t,e,i,n,r){var o,s,a;e.setTransform(r,0,0,r,0,0),e.translate(i,n),e.beginPath();var l=this.points_;if(l===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var h=void 0!==this.radius2_?this.radius2_:this.radius_;for(h!==this.radius_&&(l*=2),o=0;o<=l;o++)s=2*o*Math.PI/l-Math.PI/2+this.angle_,a=o%2==0?this.radius_:h,e.lineTo(t.size/2+a*Math.cos(s),t.size/2+a*Math.sin(s))}if(this.fill_){var u=this.fill_.getColor();null===u&&(u=Hr),e.fillStyle=Ol(u),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke()),e.closePath()},e.prototype.createHitDetectionCanvas_=function(t){if(this.hitDetectionCanvas_=this.getImage(1),this.fill_){var e=this.fill_.getColor(),i=0;if("string"==typeof e&&(e=rr(e)),null===e?i=1:Array.isArray(e)&&(i=4===e.length?e[3]:1),0===i){var n=rt(t.size,t.size);this.hitDetectionCanvas_=n.canvas,this.drawHitDetectionCanvas_(t,n,0,0)}}},e.prototype.drawHitDetectionCanvas_=function(t,e,i,n){e.translate(i,n),e.beginPath();var r=this.points_;if(r===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var o=void 0!==this.radius2_?this.radius2_:this.radius_;o!==this.radius_&&(r*=2);var s=void 0,a=void 0,l=void 0;for(s=0;s<=r;s++)l=2*s*Math.PI/r-Math.PI/2+this.angle_,a=s%2==0?this.radius_:o,e.lineTo(t.size/2+a*Math.cos(l),t.size/2+a*Math.sin(l))}e.fillStyle=Hr,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.stroke()),e.closePath()},e}($n),Ml=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Fl=function(t){function e(e){var i=e||{};return t.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,displacement:void 0!==i.displacement?i.displacement:[0,0]})||this}return Ml(e,t),e.prototype.clone=function(){var t=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(Il),Ll=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}();function Al(t){return(Al="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Dl=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=Gl,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"===Al(e)&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=Gl,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var kl=null;function jl(t,e){if(!kl){var i=new Ll({color:"rgba(255,255,255,0.4)"}),n=new Rl({color:"#3399CC",width:1.25});kl=[new Dl({image:new Fl({fill:i,stroke:n,radius:5}),fill:i,stroke:n})]}return kl}function Gl(t){return t.getGeometry()}var zl=Dl,Wl="preload",Xl="useInterimTilesOnError",Nl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Kl=function(t){function e(e){var i=this,n=e||{},r=d({},n);return delete r.preload,delete r.useInterimTilesOnError,(i=t.call(this,r)||this).setPreload(void 0!==n.preload?n.preload:0),i.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),i}return Nl(e,t),e.prototype.getPreload=function(){return this.get(Wl)},e.prototype.setPreload=function(t){this.set(Wl,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Xl)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Xl,t)},e}(zr),Yl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Zl=function(t){function e(e){var i=t.call(this)||this;return i.boundHandleImageChange_=i.handleImageChange_.bind(i),i.layer_=e,i}return Yl(e,t),e.prototype.getFeatures=function(t){return j()},e.prototype.prepareFrame=function(t){return j()},e.prototype.renderFrame=function(t,e){return j()},e.prototype.loadedTileCallback=function(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i},e.prototype.createLoadedTileFinder=function(t,e,i){return function(n,r){var o=this.loadedTileCallback.bind(this,i,n);return t.forEachLoadedTile(e,n,r,o)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r){},e.prototype.getDataAtPixel=function(t,e,i){return j()},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===qn&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=qn&&e!=Jn&&t.addEventListener(S,this.boundHandleImageChange_),e==Un&&(t.load(),e=t.getState()),e==qn},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==kr&&t.changed()},e}(k),Bl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Vl=function(t){function e(e){var i=t.call(this,e)||this;return i.container=null,i.renderedResolution,i.tempTransform=[1,0,0,1,0,0],i.pixelTransform=[1,0,0,1,0,0],i.inversePixelTransform=[1,0,0,1,0,0],i.context=null,i.containerReused=!1,i}return Bl(e,t),e.prototype.useContainer=function(t,e,i){var n,r,o=this.getLayer().getClassName();t&&""===t.style.opacity&&t.className===o&&((a=t.firstElementChild)instanceof HTMLCanvasElement&&(r=a.getContext("2d")));if(!r||0!==r.canvas.width&&r.canvas.style.transform!==e?this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1):(this.container=t,this.context=r,this.containerReused=!0),!this.container){(n=document.createElement("div")).className=o;var s=n.style;s.position="absolute",s.width="100%",s.height="100%";var a=(r=rt()).canvas;n.appendChild(a),(s=a.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=n,this.context=r}},e.prototype.clip=function(t,e,i){var n=e.pixelRatio,r=e.size[0]*n/2,o=e.size[1]*n/2,s=e.viewState.rotation,a=Ge(i),l=ze(i),h=Fe(i),u=Me(i);zi(e.coordinateToPixelTransform,a),zi(e.coordinateToPixelTransform,l),zi(e.coordinateToPixelTransform,h),zi(e.coordinateToPixelTransform,u),t.save(),_o(t,-s,r,o),t.beginPath(),t.moveTo(a[0]*n,a[1]*n),t.lineTo(l[0]*n,l[1]*n),t.lineTo(h[0]*n,h[1]*n),t.lineTo(u[0]*n,u[1]*n),t.clip(),_o(t,s,r,o)},e.prototype.clipUnrotated=function(t,e,i){var n=Ge(i),r=ze(i),o=Fe(i),s=Me(i);zi(e.coordinateToPixelTransform,n),zi(e.coordinateToPixelTransform,r),zi(e.coordinateToPixelTransform,o),zi(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;zi(a,n),zi(a,r),zi(a,o),zi(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,i){var n=this.getLayer();if(n.hasListener(t)){var r=new Vr(t,this.inversePixelTransform,i,e);n.dispatchEvent(r)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(Ir,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Mr,t,e)},e.prototype.getRenderTransform=function(t,e,i,n,r,o,s){var a=r/2,l=o/2,h=n/e,u=-h,c=-t[0]+s,p=-t[1];return Wi(this.tempTransform,a,l,h,u,-i,c,p)},e.prototype.getDataAtPixel=function(t,e,i){var n,r=zi(this.inversePixelTransform,t.slice()),o=this.context;try{var s=Math.round(r[0]),a=Math.round(r[1]),l=document.createElement("canvas"),h=l.getContext("2d");l.width=1,l.height=1,h.clearRect(0,0,1,1),h.drawImage(o.canvas,s,a,1,1,0,0,1,1),n=h.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?new Uint8Array:n}return 0===n[3]?null:n},e}(Zl),Ul=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Hl=function(t){function e(e){var i=t.call(this,e)||this;return i.extentChanged=!0,i.renderedExtent_=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.newTiles_=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.tmpTileRange_=new Ka(0,0,0,0),i}return Ul(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return i==Bo||i==Uo||i==Vo&&!n},e.prototype.getTile=function(t,e,i,n){var r=n.pixelRatio,o=n.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,i,r,o);return a.getState()==Vo&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(Bo)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.loadedTileCallback=function(e,i,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,i,n)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],n=t.viewState,r=n.projection,o=n.resolution,a=n.center,l=n.rotation,h=t.pixelRatio,u=this.getLayer(),c=u.getSource(),p=c.getRevision(),f=c.getTileGridForProjection(r),_=f.getZForResolution(o,c.zDirection),g=f.getResolution(_),y=t.extent,v=i.extent&&pi(i.extent,r);v&&(y=je(y,pi(i.extent,r)));var m=c.getTilePixelRatio(h),x=Math.round(t.size[0]*m),S=Math.round(t.size[1]*m);if(l){var C=Math.round(Math.sqrt(x*x+S*S));x=C,S=C}var w=g*x/2/m,E=g*S/2/m,b=[a[0]-w,a[1]-E,a[0]+w,a[1]+E],T=f.getTileRangeForExtentAndZ(y,_),R={};R[_]={};var O=this.createLoadedTileFinder(c,r,R),P=this.tmpExtent,I=this.tmpTileRange_;this.newTiles_=!1;for(var M=T.minX;M<=T.maxX;++M)for(var F=T.minY;F<=T.maxY;++F){var L=this.getTile(_,M,F,t);if(this.isDrawableTile(L)){var A=z(this);if(L.getState()==Bo){R[_][L.tileCoord.toString()]=L;var D=L.inTransition(A);this.newTiles_||!D&&-1!==this.renderedTiles.indexOf(L)||(this.newTiles_=!0)}if(1===L.getAlpha(A,t.time))continue}var k=f.getTileCoordChildTileRange(L.tileCoord,I,P),j=!1;k&&(j=O(_+1,k)),j||f.forEachTileCoordParentTileRange(L.tileCoord,O,I,P)}var G=g/o;Wi(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/m,1/m,l,-x/2,-S/2);var W=function(t){return et?Ni(t):(yo||(yo=rt(1,1).canvas),yo.style.transform=Ni(t),yo.style.transform)}(this.pixelTransform);this.useContainer(e,W,i.opacity);var X=this.context,N=X.canvas;Xi(this.inversePixelTransform,this.pixelTransform),Wi(this.tempTransform,x/2,S/2,G,G,0,-x/2,-S/2),N.width!=x||N.height!=S?(N.width=x,N.height=S):this.containerReused||X.clearRect(0,0,x,S),v&&this.clipUnrotated(X,t,v),d(X,c.getContextOptions()),this.preRender(X,t),this.renderedTiles.length=0;var K,Y,Z,B=Object.keys(R).map(Number);B.sort(s),1!==i.opacity||this.containerReused&&!c.getOpaque(t.viewState.projection)?(K=[],Y=[]):B=B.reverse();for(var V=B.length-1;V>=0;--V){var U=B[V],H=c.getTilePixelSize(U,h,r),q=f.getResolution(U)/g,J=H[0]*q*G,Q=H[1]*q*G,$=f.getTileCoordForCoordAndZ(Ge(b),U),tt=f.getTileCoordExtent($),it=zi(this.tempTransform,[m*(tt[0]-b[0])/g,m*(b[3]-tt[3])/g]),nt=m*c.getGutterForProjection(r),ot=R[U];for(var st in ot){var at=(L=ot[st]).tileCoord,lt=it[0]-($[1]-at[1])*J,ht=Math.round(lt+J),ut=it[1]-($[2]-at[2])*Q,ct=Math.round(ut+Q),pt=ht-(M=Math.round(lt)),ft=ct-(F=Math.round(ut)),dt=_===U;if(!(D=dt&&1!==L.getAlpha(z(this),t.time)))if(K){X.save(),Z=[M,F,M+pt,F,M+pt,F+ft,M,F+ft];for(var _t=0,gt=K.length;_t=200&&a.status<300){var o=e.getType(),l=void 0;o==lh||o==hh?l=a.responseText:o==uh?(l=a.responseXML)||(l=(new DOMParser).parseFromString(a.responseText,"application/xml")):o==ah&&(l=a.response),l?i.call(this,e.readFeatures(l,{extent:r,featureProjection:s}),e.readProjection(l)):n.call(this)}else n.call(this)}.bind(this),a.onerror=function(){n.call(this)}.bind(this),a.send()}}(t,e,(function(t,e){"function"==typeof this.addFeatures&&this.addFeatures(t)}),f)}var fh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),dh=function(t){function e(e,i){var n=t.call(this,e)||this;return n.feature=i,n}return fh(e,t),e}(n),_h=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,{attributions:n.attributions,projection:void 0,state:kr,wrapX:void 0===n.wrapX||n.wrapX})||this).loader_=f,i.format_=n.format,i.overlaps_=void 0===n.overlaps||n.overlaps,i.url_=n.url,void 0!==n.loader?i.loader_=n.loader:void 0!==i.url_&&(pe(i.format_,7),i.loader_=ph(i.url_,i.format_)),i.strategy_=void 0!==n.strategy?n.strategy:sh;var r,o,s=void 0===n.useSpatialIndex||n.useSpatialIndex;return i.featuresRtree_=s?new eh:null,i.loadedExtentsRtree_=new eh,i.nullGeometryFeatures_={},i.idIndex_={},i.uidIndex_={},i.featureChangeKeys_={},i.featuresCollection_=null,Array.isArray(n.features)?o=n.features:n.features&&(o=(r=n.features).getArray()),s||void 0!==r||(r=new bo(o)),void 0!==o&&i.addFeaturesInternal(o),void 0!==r&&i.bindFeaturesCollection_(r),i}return fh(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=z(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var n=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new dh(ih,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[F(e,S,this.handleFeatureChange_,this),F(e,r,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,n=e.getId();return void 0!==n&&(n.toString()in this.idIndex_?i=!1:this.idIndex_[n.toString()]=e),i&&(pe(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],n=[],r=0,o=t.length;rthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,i=[Eh.SET_FILL_STYLE,e];return"string"!=typeof e&&i.push(!0),i},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[Eh.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,n=t.lineCap,r=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||r!=t.currentLineDash&&!u(t.currentLineDash,r)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=r,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[Eh.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=_e(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;de(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(bh),Oh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ph=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r)||this;return o.declutterGroups_=null,o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o}return Oh(e,t),e.prototype.drawCoordinates_=function(t,e,i,n){return this.appendFlatCoordinates(t,e,i,n,!1,!1)},e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),r=this.coordinates.length,o=this.drawCoordinates_(i,0,i.length,n);this.instructions.push([Eh.DRAW_IMAGE,r,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.hitDetectionInstructions.push([Eh.DRAW_IMAGE,r,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),r=this.coordinates.length,o=this.drawCoordinates_(i,0,i.length,n);this.instructions.push([Eh.DRAW_IMAGE,r,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.hitDetectionInstructions.push([Eh.DRAW_IMAGE,r,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),n=t.getSize(),r=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.declutterGroups_=e,this.hitDetectionImage_=r,this.image_=o,this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0]},e}(Rh),Ih=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Mh=function(t){function e(e,i,n,r){return t.call(this,e,i,n,r)||this}return Ih(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,n){var r=this.coordinates.length,o=this.appendFlatCoordinates(t,e,i,n,!1,!1),s=[Eh.MOVE_TO_LINE_TO,r,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},e.prototype.drawLineString=function(t,e){var i=this.state,n=i.strokeStyle,r=i.lineWidth;if(void 0!==n&&void 0!==r){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Eh.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],Ch);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(Sh),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,n=i.strokeStyle,r=i.lineWidth;if(void 0!==n&&void 0!==r){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Eh.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],Ch);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),l=0,h=0,u=o.length;ht&&(y>g&&(g=y,d=v,_=o),y=0,v=o-r)),s=a,u=p,c=f),l=m,h=x}return(y+=a)>g?[v,o]:[d,_]}var kh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),jh={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Gh={Circle:Lh,Default:Rh,Image:Ph,LineString:Mh,Polygon:Lh,Text:function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r)||this;return o.declutterGroups_,o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o}return kh(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var i=this.textFillState_,n=this.textStrokeState_,r=this.textState_;if(""!==this.text_&&r&&(i||n)){var o,s,a=this.coordinates.length,l=t.getType(),h=null,u=2,c=t.getStride();if(r.placement===Ah){if(!Xe(this.getBufferedMaxExtent(),t.getExtent()))return;var p=void 0;if(h=t.getFlatCoordinates(),l==Ii)p=[h.length];else if(l==Ai)p=t.getEnds();else if(l==Fi)p=t.getEnds().slice(0,1);else if(l==Di){var f=t.getEndss();for(p=[],o=0,s=f.length;od[d.length-n]}else p=t[e]>t[i-n];for(var _,g,y=r.length,v=t[e],m=t[e+1],x=t[e+=n],S=t[e+1],C=0,w=Math.sqrt(Math.pow(x-v,2)+Math.pow(S-m,2)),E=!1,b=0;b0?-Math.PI:Math.PI),void 0!==g){var M=I-g;if(E=E||0!==M,M+=M>Math.PI?-2*Math.PI:M<-Math.PI?2*Math.PI:0,Math.abs(M)>s)return null}g=I;var F=P/w,L=kt(v,x,F),A=kt(m,S,F);f[_]=[L,A,R/2,I,T],o+=R}return E?f:[[f[0][0],f[0][1],f[0][2],f[0][3],r]]}var Vh=[1/0,1/0,-1/0,-1/0],Uh=[1,0,0,1,0,0],Hh=[],qh=[],Jh=[],Qh=[],$h=function(){function t(t,e,i,n,r){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.declutterItems=[],this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderBuffer_=r,this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,i,n){var r=t+e+i+n;if(this.labels_[r])return this.labels_[r];var o=n?this.strokeStates[n]:null,s=i?this.fillStates[i]:null,a=this.textStates[e],l=this.pixelRatio,h=[a.scale[0]*l,a.scale[1]*l],u=jh[a.textAlign||to],c=n&&o.lineWidth?o.lineWidth:0,p=t.split("\n"),f=p.length,d=[],_=function(t,e,i){for(var n=e.length,r=0,o=0;or.width?r.width-u:_,S=l+c>r.height?r.height-c:l,C=g[3]+x*f[0]+g[1],w=g[0]+S*f[1]+g[2],E=i-g[3],b=n-g[0];(m||0!==p)&&(Hh[0]=E,Qh[0]=E,Hh[1]=b,qh[1]=b,qh[0]=E+C,Jh[0]=qh[0],Jh[1]=b+w,Qh[1]=Jh[1]);var T=null;if(0!==p){var R=i+o,O=n+s;T=Wi(Uh,R,O,1,1,p,-R,-O),zi(Uh,Hh),zi(Uh,qh),zi(Uh,Jh),zi(Uh,Qh),Ce(Math.min(Hh[0],qh[0],Jh[0],Qh[0]),Math.min(Hh[1],qh[1],Jh[1],Qh[1]),Math.max(Hh[0],qh[0],Jh[0],Qh[0]),Math.max(Hh[1],qh[1],Jh[1],Qh[1]),Vh)}else Ce(E,b,E+C,b+w,Vh);var P=0,I=0;if(a){var M=this.renderBuffer_;M[0]=Math.max(M[0],We(Vh)),P=M[0],M[1]=Math.max(M[1],ke(Vh)),I=M[1]}var F=t.canvas,L=v?v[2]*f[0]/2:0,A=Vh[0]-L<=(F.width+P)/e&&Vh[2]+L>=-P/e&&Vh[1]-L<=(F.height+I)/e&&Vh[3]+L>=-I/e;if(d&&(i=Math.round(i),n=Math.round(n)),a){if(!A&&1==a[0])return!1;var D=A?[t,T?T.slice(0):null,h,r,u,c,x,S,i,n,f,Vh.slice()]:null;D&&(m&&D.push(y,v,Hh.slice(0),qh.slice(0),Jh.slice(0),Qh.slice(0)),a.push(D))}else A&&(m&&this.replayTextBackground_(t,Hh,qh,Jh,Qh,y,v,!1),go(t,T,h,r,u,c,x,S,i,n,f));return!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=zi(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.renderDeclutter=function(t,e,i,n){for(var r=[],o=1,s=t.length;o12&&this.replayTextBackground_(c[0],c[14],c[15],c[16],c[17],c[12],c[13],!0),go.apply(void 0,c),f!==i&&(p.globalAlpha=f)}}return t.length=1,n},t.prototype.drawLabelWithPointPlacement_=function(t,e,i,n){var r=this.textStates[e],o=this.createLabel(t,e,n,i),s=this.strokeStates[i],a=this.pixelRatio,l=jh[r.textAlign||to],h=jh[r.textBaseline||eo],u=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:l*(o.width/a-2*r.scale[0])+2*(.5-l)*u,anchorY:h*o.height/a+2*(.5-h)*u}},t.prototype.execute_=function(t,e,i,n,r,o,s){var a,l,h;this.declutterItems.length=0,this.pixelCoordinates_&&u(i,this.renderedTransform_)?a=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),a=Ki(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),l=this.renderedTransform_,h=i,l[0]=h[0],l[1]=h[1],l[2]=h[2],l[3]=h[3],l[4]=h[4],l[5]=h[5]);for(var c,p,f,d,_,g,y,v,m,x,S,C,w,E,b,T,R,O=0,P=n.length,I=0,M=0,F=0,L=null,A=null,D=this.coordinateCache_,k=this.viewRotation_,j=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,G={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:k},z=this.instructions!=n||this.overlaps?0:200;Oz&&(this.fill_(t),M=0),F>z&&(t.stroke(),F=0),M||F||(t.beginPath(),d=NaN,_=NaN),++O;break;case Eh.CIRCLE:var X=a[I=W[1]],N=a[I+1],K=a[I+2]-X,Y=a[I+3]-N,Z=Math.sqrt(K*K+Y*Y);t.moveTo(X+Z,N),t.arc(X,N,Z,0,2*Math.PI,!0),++O;break;case Eh.CLOSE_PATH:t.closePath(),++O;break;case Eh.CUSTOM:I=W[1],c=W[2];var B=W[3],V=W[4],U=6==W.length?W[5]:void 0;G.geometry=B,G.feature=b,O in D||(D[O]=[]);var H=D[O];U?U(a,I,c,2,H):(H[0]=a[I],H[1]=a[I+1],H.length=2),V(H,G),++O;break;case Eh.DRAW_IMAGE:I=W[1],c=W[2],x=W[3],p=W[4],f=W[5],m=o?null:W[6];var q=W[7],J=W[8],Q=W[9],$=W[10],tt=W[11],et=W[12],it=W[13],nt=W[14];if(!x&&W.length>=19){S=W[18],C=W[19],w=W[20],E=W[21];var rt=this.drawLabelWithPointPlacement_(S,C,w,E);x=rt.label,W[3]=x;var ot=W[22];p=(rt.anchorX-ot)*this.pixelRatio,W[4]=p;var st=W[23];f=(rt.anchorY-st)*this.pixelRatio,W[5]=f,q=x.height,W[7]=q,nt=x.width,W[14]=nt}var at=void 0;W.length>24&&(at=W[24]);var lt=void 0,ht=void 0,ut=void 0;W.length>16?(lt=W[15],ht=W[16],ut=W[17]):(lt=io,ht=!1,ut=!1),tt&&j?et+=k:tt||j||(et-=k);for(var ct=0,pt=0;I=o;)nu(i,t+r,t+o),nu(i,t+o,t+r),nu(i,t-o,t+r),nu(i,t-r,t+o),nu(i,t-r,t-o),nu(i,t-o,t-r),nu(i,t+o,t-r),nu(i,t+r,t-o),2*((s+=1+2*++o)-r)+1>0&&(s+=1-2*(r-=1));return iu[t]=i,i}(n);function f(t){for(var e=u.getImageData(0,0,a,a).data,i=0;i0){var s=void 0;return(!o||c!=Nh&&c!=Zh||-1!==o.indexOf(t))&&(s=r(t)),s||void u.clearRect(0,0,a,a)}}var d,_,g,y,v,m=Object.keys(this.executorsByZIndex_).map(Number);for(m.sort(s),d=m.length-1;d>=0;--d){var x=m[d].toString();for(g=this.executorsByZIndex_[x],_=tu.length-1;_>=0;--_)if(void 0!==(y=g[c=tu[_]])&&(v=y.executeHitDetection(u,l,i,f,h)))return v}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],n=e[1],r=e[2],o=e[3],s=[i,n,i,o,r,o,r,n];return Ki(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return y(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,n,r,o,a){var l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(s),this.maxExtent_&&(t.save(),this.clip(t,i));var h,u,c,p,f,d,_=o||tu;for(h=0,u=l.length;h=r)for(n=r;n0&&(a.width=0),this.container;var h=Math.round(t.size[0]*i),u=Math.round(t.size[1]*i);a.width!=h||a.height!=u?(a.width=h,a.height=u,a.style.transform!==r&&(a.style.transform=r)):this.containerReused||o.clearRect(0,0,h,u),this.preRender(o,t);var c=t.extent,p=t.viewState,f=p.center,d=p.resolution,_=p.projection,g=p.rotation,y=_.getExtent(),v=this.getLayer().getSource(),m=!1;if(n.extent&&this.clipping){var x=pi(n.extent,_);(m=!ve(x,t.extent)&&Xe(x,t.extent))&&this.clipUnrotated(o,t,x)}var S=t.viewHints,C=!(S[Jo]||S[Qo]),w=this.getRenderTransform(f,d,g,i,h,u,0),E=this.getLayer().getDeclutter()?{}:null;if(l.execute(o,1,w,g,C,void 0,E),v.getWrapX()&&_.canWrapX()&&!ve(y,c)){for(var b=c[0],T=We(y),R=0,O=void 0;by[2];){O=T*++R;var I=this.getRenderTransform(f,d,g,i,h,u,O);l.execute(o,1,I,g,C,void 0,E),b-=T}}if(E){var M=t.viewHints;!function(t,e,i,n,r,o){for(var a=Object.keys(t).map(Number).sort(s),l=0,h=a.length;l0&&(c=d,o.push({items:d.declutterItems,opacity:n}))}}(E,o,g,1,!(M[Jo]||M[Qo]),t.declutterItems)}m&&o.restore(),this.postRender(o,t);var F=n.opacity,L=this.container;return F!==parseFloat(L.style.opacity)&&(L.style.opacity=1===F?"":String(F)),this.renderedRotation_!==p.rotation&&(this.renderedRotation_=p.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e,i){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var n=[this.context.canvas.width,this.context.canvas.height];zi(this.pixelTransform,n);var r=this.renderedCenter_,o=this.renderedResolution_,a=this.renderedRotation_,l=this.renderedProjection_,h=this.renderedExtent_,u=this.getLayer(),c=[],p=n[0]/2,f=n[1]/2;c.push(this.getRenderTransform(r,o,a,.5,p,f,0).slice());var d=u.getSource(),_=l.getExtent();if(d.getWrapX()&&l.canWrapX()&&!ve(_,h)){for(var g=h[0],y=We(_),v=0,m=void 0;g<_[0];)m=y*--v,c.push(this.getRenderTransform(r,o,a,.5,p,f,m).slice()),g+=y;for(v=0,g=h[2];g>_[2];)m=y*++v,c.push(this.getRenderTransform(r,o,a,.5,p,f,m).slice()),g-=y}this.hitDetectionImageData_=function(t,e,i,n,r,o,a){var l=rt(t[0]/2,t[1]/2);l.imageSmoothingEnabled=!1;for(var h=l.canvas,u=new su(l,.5,r,null,a),c=i.length,p=Math.floor(16777215/c),f={},d=1;d<=c;++d){var _=i[d-1],g=_.getStyleFunction()||n;if(n){var y=g(_,o);if(y){Array.isArray(y)||(y=[y]);for(var v="#"+("000000"+(d*p).toString(16)).slice(-6),m=0,x=y.length;m=i[2])){var r=We(i),o=Math.floor((n[0]-i[0])/r)*r;t[0]-=o,t[2]-=o}return t}(y[0],h);S[0]v[0]&&S[2]>v[2]&&y.push([S[0]-m,S[1],S[2]-m,S[3]])}if(!this.dirty_&&this.renderedResolution_==u&&this.renderedRevision_==p&&this.renderedRenderOrder_==d&&ve(this.renderedExtent_,g))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var C,w=new zh(hu(u,c),g,u,c,e.getDeclutter()),E=li();if(E){for(var b=0,T=y.length;b180)&&(i[0]=Dt(n+180,360)-180),i}},xu={OSM:hl,Vector:_h,XYZ:al},Su={Icon:vr,Stroke:Rl,Style:zl}},338:function(t,e,i){var n,r,o;function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}o=function(){"use strict";function t(t,i,r,o,s){e(t,i,r||0,o||t.length-1,s||n)}function e(t,n,r,o,s){for(;o>r;){if(o-r>600){var a=o-r+1,l=n-r+1,h=Math.log(a),u=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*u*(a-u)/a)*(l-a/2<0?-1:1);e(t,n,Math.max(r,Math.floor(n-l*u/a+c)),Math.min(o,Math.floor(n+(a-l)*u/a+c)),s)}var p=t[n],f=r,d=o;for(i(t,r,n),s(t[o],p)>0&&i(t,r,o);f0;)d--}0===s(t[r],p)?i(t,r,d):i(t,++d,o),d<=n&&(r=d+1),n<=d&&(o=d-1)}}function i(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function n(t,e){return te?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function _(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,i,n,r,o){for(var s=[i,n];s.length;)if(!((n=s.pop())-(i=s.pop())<=r)){var a=i+Math.ceil((n-i)/r/2)*r;t(e,a,i,n,o),s.push(i,a,a,n)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var e=this.data,i=[];if(!d(t,e))return i;for(var n=this.toBBox,r=[];e;){for(var o=0;o=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},r.prototype._split=function(t,e){var i=t[e],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);var o=this._chooseSplitIndex(i,r,n),a=_(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,s(i,this.toBBox),s(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},r.prototype._splitRoot=function(t,e){this.data=_([t,e]),this.data.height=t.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,e,i){for(var n,r,o,s,l,h,u,p=1/0,f=1/0,d=e;d<=i-e;d++){var _=a(t,0,d,this.toBBox),g=a(t,d,i,this.toBBox),y=(r=_,o=g,s=void 0,l=void 0,h=void 0,u=void 0,s=Math.max(r.minX,o.minX),l=Math.max(r.minY,o.minY),h=Math.min(r.maxX,o.maxX),u=Math.min(r.maxY,o.maxY),Math.max(0,h-s)*Math.max(0,u-l)),v=c(_)+c(g);y=e;f--){var d=t.children[f];l(s,t.leaf?r(d):d),h+=p(s)}return h},r.prototype._adjustParentBBoxes=function(t,e,i){for(var n=i;n>=0;n--)l(e[n],t)},r.prototype._condense=function(t){for(var e=t.length-1,i=void 0;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children).splice(i.indexOf(t[e]),1):this.clear():s(t[e],this.toBBox)},r},"object"===s(e)?t.exports=o():void 0===(r="function"==typeof(n=o)?n.call(e,i,e,t):n)||(t.exports=r)}}]); //# sourceMappingURL=521.bundle.js.map