0?-Math.PI:Math.PI),void 0!==g){var L=b-g;if(T=T||0!==L,L+=L>Math.PI?-2*Math.PI:L<-Math.PI?2*Math.PI:0,Math.abs(L)>s)return null}g=b;var M=P/S,A=yt(v,x,M),F=yt(m,E,M);f[_]=[A,F,w/2,b,R],o+=w}return T?f:[[f[0][0],f[0][1],f[0][2],f[0][3],r]]}var xo=[1/0,1/0,-1/0,-1/0],Eo=[1,0,0,1,0,0],Co=[],So=[],To=[],Oo=[],Ro=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],h=this.pixelRatio,l=[a.scale[0]*h,a.scale[1]*h],u=Jr[a.textAlign||"center"],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:_,E=h+c>r.height?r.height-c:h,C=g[3]+x*f[0]+g[1],S=g[0]+E*f[1]+g[2],T=i-g[3],O=n-g[0];(m||0!==p)&&(Co[0]=T,Oo[0]=T,Co[1]=O,So[1]=O,So[0]=T+C,To[0]=So[0],To[1]=O+S,Oo[1]=To[1]);var R=null;if(0!==p){var w=i+o,I=n+s;R=mi(Eo,w,I,1,1,p,-w,-I),vi(Eo,Co),vi(Eo,So),vi(Eo,To),vi(Eo,Oo),ue(Math.min(Co[0],So[0],To[0],Oo[0]),Math.min(Co[1],So[1],To[1],Oo[1]),Math.max(Co[0],So[0],To[0],Oo[0]),Math.max(Co[1],So[1],To[1],Oo[1]),xo)}else ue(T,O,T+C,O+S,xo);var P=0,b=0;if(a){var L=this.renderBuffer_;L[0]=Math.max(L[0],Pe(xo)),P=L[0],L[1]=Math.max(L[1],Oe(xo)),b=L[1]}var M=t.canvas,A=v?v[2]*f[0]/2:0,F=xo[0]-A<=(M.width+P)/e&&xo[2]+A>=-P/e&&xo[1]-A<=(M.height+b)/e&&xo[3]+A>=-b/e;if(d&&(i=Math.round(i),n=Math.round(n)),a){if(!F&&1==a[0])return!1;var D=F?[t,R?R.slice(0):null,l,r,u,c,x,E,i,n,f,xo.slice()]:null;D&&(m&&D.push(y,v,Co.slice(0),So.slice(0),To.slice(0),Oo.slice(0)),a.push(D))}else F&&(m&&this.replayTextBackground_(t,Co,So,To,Oo,y,v,!1),Vn(t,R,l,r,u,c,x,E,i,n,f));return!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=vi(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),Vn.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,h=Jr[r.textAlign||"center"],l=Jr[r.textBaseline||"middle"],u=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:h*(o.width/a-2*r.scale[0])+2*(.5-h)*u,anchorY:l*o.height/a+2*(.5-l)*u}},t.prototype.execute_=function(t,e,i,n,r,o,s){var a,h,l;this.declutterItems.length=0,this.pixelCoordinates_&&u(i,this.renderedTransform_)?a=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),a=Ci(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),h=this.renderedTransform_,l=i,h[0]=l[0],h[1]=l[1],h[2]=l[2],h[3]=l[3],h[4]=l[4],h[5]=l[5]);for(var c,p,f,d,_,g,y,v,m,x,E,C,S,T,O,R,w,I=0,P=n.length,b=0,L=0,M=0,A=null,F=null,D=this.coordinateCache_,k=this.viewRotation_,G=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,N={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:k},j=this.instructions!=n||this.overlaps?0:200;Ij&&(this.fill_(t),L=0),M>j&&(t.stroke(),M=0),L||M||(t.beginPath(),d=NaN,_=NaN),++I;break;case Nr.CIRCLE:var X=a[b=Y[1]],z=a[b+1],W=a[b+2]-X,K=a[b+3]-z,B=Math.sqrt(W*W+K*K);t.moveTo(X+B,z),t.arc(X,z,B,0,2*Math.PI,!0),++I;break;case Nr.CLOSE_PATH:t.closePath(),++I;break;case Nr.CUSTOM:b=Y[1],c=Y[2];var Z=Y[3],U=Y[4],V=6==Y.length?Y[5]:void 0;N.geometry=Z,N.feature=O,I in D||(D[I]=[]);var H=D[I];V?V(a,b,c,2,H):(H[0]=a[b],H[1]=a[b+1],H.length=2),U(H,N),++I;break;case Nr.DRAW_IMAGE:b=Y[1],c=Y[2],x=Y[3],p=Y[4],f=Y[5],m=o?null:Y[6];var q=Y[7],J=Y[8],Q=Y[9],$=Y[10],tt=Y[11],et=Y[12],it=Y[13],nt=Y[14];if(!x&&Y.length>=19){E=Y[18],C=Y[19],S=Y[20],T=Y[21];var rt=this.drawLabelWithPointPlacement_(E,C,S,T);x=rt.label,Y[3]=x;var ot=Y[22];p=(rt.anchorX-ot)*this.pixelRatio,Y[4]=p;var st=Y[23];f=(rt.anchorY-st)*this.pixelRatio,Y[5]=f,q=x.height,Y[7]=q,nt=x.width,Y[14]=nt}var at=void 0;Y.length>24&&(at=Y[24]);var ht=void 0,lt=void 0,ut=void 0;Y.length>16?(ht=Y[15],lt=Y[16],ut=Y[17]):(ht=Dn,lt=!1,ut=!1),tt&&G?et+=k:tt||G||(et-=k);for(var ct=0,pt=0;b=o;)bo(i,t+r,t+o),bo(i,t+o,t+r),bo(i,t-o,t+r),bo(i,t-r,t+o),bo(i,t-r,t-o),bo(i,t-o,t-r),bo(i,t+o,t-r),bo(i,t+r,t-o),2*((s+=1+2*++o)-r)+1>0&&(s+=1-2*(r-=1));return Po[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!=to.IMAGE&&c!=to.TEXT||-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],_=wo.length-1;_>=0;--_)if(void 0!==(y=g[c=wo[_]])&&(v=y.executeHitDetection(u,h,i,f,l)))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 Ci(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 h=Object.keys(this.executorsByZIndex_).map(Number);h.sort(s),this.maxExtent_&&(t.save(),this.clip(t,i));var l,u,c,p,f,d,_=o||wo;for(l=0,u=h.length;l=r)for(n=r;nthis.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=jo(t,e,i);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,i,n){var r=jo(t,e,i);this.cache_[r]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}();function jo(t,e,i){return e+":"+t+":"+(i?function(t){return"string"==typeof t?t:yr(t)}(i):"null")}var Yo=new No,Xo=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)}}(),zo=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 Xo(e,t),e.prototype.changed=function(){this.dispatchEvent(E.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return w()},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(){w()},e}(x),Wo=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 Ko(t,e,i){var n=t;if(n.src&&Z){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=[S(n,E.LOAD,e),S(n,E.ERROR,i)];return function(){s.forEach(T)}}!function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,n,Pn.IDLE)||this;return a.src_=r,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.state=Pn.IDLE,a.imageLoadFunction_=s,a}Wo(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Pn.ERROR,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=Oe(this.extent)/this.image_.height),this.state=Pn.LOADED,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=Pn.IDLE&&this.state!=Pn.ERROR||(this.state=Pn.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Ko(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)}}(zo);var Bo=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)}}(),Zo=null,Uo=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 Bo(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Pn.LOADED){Zo||(Zo=V(1,1)),Zo.drawImage(this.image_,0,0);try{Zo.getImageData(0,0,1,1),this.tainted_=!1}catch(t){Zo=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(E.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=Pn.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Pn.LOADED,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=V(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_==Pn.IDLE){this.imageState_=Pn.LOADING;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Ko(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,h=this.color_[2]/255,l=0,u=o.length;l0,6);var c=void 0!==n.src?Pn.IDLE:Pn.LOADED;return i.color_=void 0!==n.color?_r(n.color):null,i.iconImage_=function(t,e,i,n,r,o){var s=Yo.get(e,n,o);return s||(s=new Uo(t,e,i,n,r,o),Yo.set(e,n,o,s)),s}(h,u,l,i.crossOrigin_,c,i.color_),i.offset_=void 0!==n.offset?n.offset:[0,0],i.offsetOrigin_=void 0!==n.offsetOrigin?n.offsetOrigin:Go.TOP_LEFT,i.origin_=null,i.size_=void 0!==n.size?n.size:null,i}return Vo(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_==ko.FRACTION||this.anchorYUnits_==ko.FRACTION){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==ko.FRACTION&&(t[0]*=e[0]),this.anchorYUnits_==ko.FRACTION&&(t[1]*=e[1])}if(this.anchorOrigin_!=Go.TOP_LEFT){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Go.TOP_RIGHT&&this.anchorOrigin_!=Go.BOTTOM_RIGHT||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Go.BOTTOM_LEFT&&this.anchorOrigin_!=Go.BOTTOM_RIGHT||(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_!=Go.TOP_LEFT){var i=this.getSize(),n=this.iconImage_.getSize();if(!i||!n)return null;t=t.slice(),this.offsetOrigin_!=Go.TOP_RIGHT&&this.offsetOrigin_!=Go.BOTTOM_RIGHT||(t[0]=n[0]-i[0]-t[0]),this.offsetOrigin_!=Go.BOTTOM_LEFT&&this.offsetOrigin_!=Go.BOTTOM_RIGHT||(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(E.CHANGE,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(E.CHANGE,t)},e}(hr);var qo=.5,Jo={Point:function(t,e,i,n){var r=i.getImage();if(r){if(r.getImageState()!=Pn.LOADED)return;var o=t.getBuilder(i.getZIndex(),to.IMAGE);o.setImageStyle(r,t.addDeclutter(!1)),o.drawPoint(e,n)}var s=i.getText();if(s){var a=t.getBuilder(i.getZIndex(),to.TEXT);a.setTextStyle(s,t.addDeclutter(!!r)),a.drawText(e,n)}},LineString:function(t,e,i,n){var r=i.getStroke();if(r){var o=t.getBuilder(i.getZIndex(),to.LINE_STRING);o.setFillStrokeStyle(null,r),o.drawLineString(e,n)}var s=i.getText();if(s){var a=t.getBuilder(i.getZIndex(),to.TEXT);a.setTextStyle(s,t.addDeclutter(!1)),a.drawText(e,n)}},Polygon:function(t,e,i,n){var r=i.getFill(),o=i.getStroke();if(r||o){var s=t.getBuilder(i.getZIndex(),to.POLYGON);s.setFillStrokeStyle(r,o),s.drawPolygon(e,n)}var a=i.getText();if(a){var h=t.getBuilder(i.getZIndex(),to.TEXT);h.setTextStyle(a,t.addDeclutter(!1)),h.drawText(e,n)}},MultiPoint:function(t,e,i,n){var r=i.getImage();if(r){if(r.getImageState()!=Pn.LOADED)return;var o=t.getBuilder(i.getZIndex(),to.IMAGE);o.setImageStyle(r,t.addDeclutter(!1)),o.drawMultiPoint(e,n)}var s=i.getText();if(s){var a=t.getBuilder(i.getZIndex(),to.TEXT);a.setTextStyle(s,t.addDeclutter(!!r)),a.drawText(e,n)}},MultiLineString:function(t,e,i,n){var r=i.getStroke();if(r){var o=t.getBuilder(i.getZIndex(),to.LINE_STRING);o.setFillStrokeStyle(null,r),o.drawMultiLineString(e,n)}var s=i.getText();if(s){var a=t.getBuilder(i.getZIndex(),to.TEXT);a.setTextStyle(s,t.addDeclutter(!1)),a.drawText(e,n)}},MultiPolygon:function(t,e,i,n){var r=i.getFill(),o=i.getStroke();if(o||r){var s=t.getBuilder(i.getZIndex(),to.POLYGON);s.setFillStrokeStyle(r,o),s.drawMultiPolygon(e,n)}var a=i.getText();if(a){var h=t.getBuilder(i.getZIndex(),to.TEXT);h.setTextStyle(a,t.addDeclutter(!1)),h.drawText(e,n)}},GeometryCollection:function(t,e,i,n){var r,o,s=e.getGeometriesArray();for(r=0,o=s.length;r0&&(a.width=0),this.container;var l=Math.round(t.size[0]*i),u=Math.round(t.size[1]*i);a.width!=l||a.height!=u?(a.width=l,a.height=u,a.style.transform!==r&&(a.style.transform=r)):this.containerReused||o.clearRect(0,0,l,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=si(n.extent,_);(m=!se(x,t.extent)&&be(x,t.extent))&&this.clipUnrotated(o,t,x)}var E=t.viewHints,C=!(E[Mo]||E[Ao]),S=this.getRenderTransform(f,d,g,i,l,u,0),T=this.getLayer().getDeclutter()?{}:null;if(h.execute(o,1,S,g,C,void 0,T),v.getWrapX()&&_.canWrapX()&&!se(y,c)){for(var O=c[0],R=Pe(y),w=0,I=void 0;Oy[2];){I=R*++w;var b=this.getRenderTransform(f,d,g,i,l,u,I);h.execute(o,1,b,g,C,void 0,T),O-=R}}if(T){var L=t.viewHints;!function(t,e,i,n,r,o){for(var a=Object.keys(t).map(Number).sort(s),h=0,l=a.length;h0&&(c=d,o.push({items:d.declutterItems,opacity:n}))}}(T,o,g,1,!(L[Mo]||L[Ao]),t.declutterItems)}m&&o.restore(),this.postRender(o,t);var M=n.opacity,A=this.container;return M!==parseFloat(A.style.opacity)&&(A.style.opacity=1===M?"":String(M)),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];vi(this.pixelTransform,n);var r=this.renderedCenter_,o=this.renderedResolution_,a=this.renderedRotation_,h=this.renderedProjection_,l=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(),_=h.getExtent();if(d.getWrapX()&&h.canWrapX()&&!se(_,l)){for(var g=l[0],y=Pe(_),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=l[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 h=V(t[0]/2,t[1]/2);h.imageSmoothingEnabled=!1;for(var l=h.canvas,u=new Do(h,.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=Pe(i),o=Math.floor((n[0]-i[0])/r)*r;t[0]-=o,t[2]-=o}return t}(y[0],l);E[0]v[0]&&E[2]>v[2]&&y.push([E[0]-m,E[1],E[2]-m,E[3]])}if(!this.dirty_&&this.renderedResolution_==u&&this.renderedRevision_==p&&this.renderedRenderOrder_==d&&se(this.renderedExtent_,g))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var C,S=new $r(ts(u,c),g,u,c,e.getDeclutter()),T=ii();if(T){for(var O=0,R=y.length;Ot)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){w()},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:ui(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),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)}}();var ls,us=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 hs(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.getKey=function(){return this.src_},e.prototype.handleImageError_=function(){var t;this.state=er.ERROR,this.unlistenImage_(),this.image_=((t=V(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=er.LOADED:this.state=er.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==er.ERROR&&(this.state=er.IDLE,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==er.IDLE&&(this.state=er.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Ko(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(as),cs=.5,ps=10,fs=function(){function t(t,e,i,n,r,o){this.sourceProj_=t,this.targetProj_=e;var s={},a=He(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()&&Pe(n)==Pe(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Pe(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Pe(this.targetProj_.getExtent()):null;var h=we(i),l=Ie(i),u=Ee(i),c=xe(i),p=this.transformInv_(h),f=this.transformInv_(l),d=this.transformInv_(u),_=this.transformInv_(c),g=ps+(o?Math.max(0,Math.ceil(pt(me(i)/(o*o*256*256)))):0);if(this.addQuad_(h,l,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(h>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)f=Pe(ee([t,e,i,n]))/this.targetWorldWidth_>.25||f;!p&&this.sourceProj_.isGlobal()&&u&&(f=u>.25||f)}if(!(!f&&this.maxSourceExtent_&&isFinite(l[0])&&isFinite(l[1])&&isFinite(l[2])&&isFinite(l[3]))||be(l,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(h>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(h>0){if(!f){var _=[(t[0]+i[0])/2,(t[1]+i[1])/2],g=this.transformInv_(_),y=void 0;if(p)y=(gt(r[0],c)+gt(s[0],c))/2-gt(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),E=[(n[0]+t[0])/2,(n[1]+t[1])/2],C=this.transformInv_(E);this.addQuad_(t,e,m,E,r,o,x,C,h-1),this.addQuad_(E,m,i,n,C,x,s,a,h-1)}else{var S=[(t[0]+e[0])/2,(t[1]+e[1])/2],T=this.transformInv_(S),O=[(i[0]+n[0])/2,(i[1]+n[1])/2],R=this.transformInv_(O);this.addQuad_(t,S,O,n,r,T,R,a,h-1),this.addQuad_(S,e,i,O,T,o,s,R,h-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;de(t,r[0]),de(t,r[1]),de(t,r[2])}),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),ds={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function _s(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 gs(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function ys(t,e,i,n){var r=qe(i,e,t),o=Ke(e,n,i),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var h=t.getExtent();if(!h||oe(h,r)){var l=Ke(t,o,r)/o;isFinite(l)&&l>0&&(o/=l)}return o}function vs(t,e,i,n,r,o,s,a,h,l,u,c){var p=V(Math.round(i*t),Math.round(i*e));if(d(p,c),0===h.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];h.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=Pe(_),y=Oe(_),v=V(Math.round(i*g/n),Math.round(i*y/n));d(v,c);var m=i/n;h.forEach(function(t,e,i){var n=t.extent[0]-_[0],r=-(t.extent[3]-_[3]),o=Pe(t.extent),s=Oe(t.extent);t.image.width>0&&t.image.height>0&&v.drawImage(t.image,l,l,t.image.width-2*l,t.image.height-2*l,n*m,r*m,o*m,s*m)});var x=we(s);return a.getTriangles().forEach(function(t,e,r){var s=t.source,a=t.target,h=s[0][0],l=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),E=f(-(a[0][1]-x[1])/o),C=f((a[1][0]-x[0])/o),S=f(-(a[1][1]-x[1])/o),T=f((a[2][0]-x[0])/o),O=f(-(a[2][1]-x[1])/o),R=h,w=l;h=0,l=0;var I=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 h=i+1;h=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-=R,d-=w,0,0,C-m],[g-=R,y-=w,0,0,T-m],[0,0,u,d,S-E],[0,0,g,y,O-E]]);if(I){if(p.save(),p.beginPath(),function(){if(void 0===ls){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",_s(t,4,5,4,0),_s(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;ls=gs(e,0)||gs(e,4)||gs(e,8)}return ls}()||c===ds){p.moveTo(C,S);for(var P=m-C,b=E-S,L=0;L<4;L++)p.lineTo(C+f((L+1)*P/4),S+f(L*b/3)),3!=L&&p.lineTo(C+f((L+1)*P/4),S+f((L+1)*b/3));p.lineTo(T,O)}else p.moveTo(C,S),p.lineTo(m,E),p.lineTo(T,O);p.clip(),p.transform(I[0],I[2],I[1],I[3],m,E),p.translate(_[0]-R,_[3]-w),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,h=-(n[1][1]-x[1])/o,l=(n[2][0]-x[0])/o,u=-(n[2][1]-x[1])/o;p.beginPath(),p.moveTo(a,h),p.lineTo(r,s),p.lineTo(l,u),p.closePath(),p.stroke()}),p.restore()),p.canvas}var ms=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)}}(),xs=function(t){function e(e,i,n,r,o,s,a,h,l,u,c,p){var f=t.call(this,o,er.IDLE)||this;f.renderEdges_=void 0!==c&&c,f.contextOptions_=p,f.pixelRatio_=a,f.gutter_=h,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=_?Re(d,_):d;if(0===me(y))return f.state=er.EMPTY,f;var v=e.getExtent();v&&(g=g?Re(g,v):v);var m=r.getResolution(f.wrappedTileCoord_[0]),x=function(t,e,i,n){var r=Ce(i),o=ys(t,e,r,n);return(!isFinite(o)||o<=0)&&ve(i,function(i){return o=ys(t,e,i,n),isFinite(o)&&o>0}),o}(e,n,y,m);if(!isFinite(x)||x<=0)return f.state=er.EMPTY,f;var E=void 0!==u?u:cs;if(f.triangulation_=new fs(e,n,y,g,x*E,m),0===f.triangulation_.getTriangles().length)return f.state=er.EMPTY,f;f.sourceZ_=i.getZForResolution(x);var C=f.triangulation_.calculateSourceExtent();if(g&&(e.canWrapX()?(C[1]=ut(C[1],g[1],g[3]),C[3]=ut(C[3],g[1],g[3])):C=Re(C,g)),me(C)){for(var S=i.getTileRangeForExtentAndZ(C,f.sourceZ_),T=S.minX;T<=S.maxX;T++)for(var O=S.minY;O<=S.maxY;O++){var R=l(f.sourceZ_,T,O,a);R&&f.sourceTiles_.push(R)}0===f.sourceTiles_.length&&(f.state=er.EMPTY)}else f.state=er.EMPTY;return f}return ms(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()==er.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=er.ERROR;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_=vs(n,r,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=er.LOADED}this.changed()},e.prototype.load=function(){if(this.state==er.IDLE){this.state=er.LOADING,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,n){var r=e.getState();if(r==er.IDLE||r==er.LOADING){t++;var o=C(e,E.CHANGE,function(i){var n=e.getState();n!=er.LOADED&&n!=er.ERROR&&n!=er.EMPTY||(T(o),0===--t&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(o)}}.bind(this)),this.sourceTiles_.forEach(function(t,e,i){t.getState()==er.IDLE&&t.load()}),0===t&&setTimeout(this.reproject_.bind(this),0)}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(T),this.sourcesListenerKeys_=null},e}(as),Es=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 lt(void 0!==i,15),i===this.newest_?i.value_:(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 lt(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){lt(!(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 Cs(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function Ss(t,e,i){return t+"/"+e+"/"+i}function Ts(t){return Ss(t[0],t[1],t[2])}var Os=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)}}(),Rs=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Os(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(Ts(e.tileCoord)),e.release())}.bind(this))}},e}(Es),ws="tileloadstart",Is="tileloadend",Ps="tileloaderror",bs=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 Ls(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var Ms=function(t){function e(e){var i=t.call(this)||this;return i.projection_=We(e.projection),i.attributions_=Ls(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:Ot.READY,i.wrapX_=void 0!==e.wrapX&&e.wrapX,i}return bs(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 w()},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_=Ls(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(k),As=42,Fs=256,Ds=[0,0,0],ks=function(){function t(t){var e,i,n,r;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,lt((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_?$n(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]),l=r+1,u=new Array(l),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}(Ms),zs=function(t){function e(e,i){var n=t.call(this,e)||this;return n.tile=i,n}return Ys(e,t),e}(n),Ws=Xs;function Ks(t,e){var i=/\{z\}/g,n=/\{x\}/g,r=/\{y\}/g,o=/\{-y\}/g;return function(s,a,h){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 lt(i,55),(i.getHeight()-s[2]-1).toString()}):void 0}}function Bs(t,e){for(var i=t.length,n=new Array(i),r=0;rOpenStreetMap contributors.',ea=function(t){function e(e){var i,n=e||{};i=void 0!==n.attributions?n.attributions:[ta];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 $s(e,t),e}(Qs),ia={ADD:"add",REMOVE:"remove"},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="length",oa=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.element=i,r.index=n,r}return na(e,t),e}(n),sa=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;e=200&&a.status<300){var o=e.getType(),h=void 0;o==fa.JSON||o==fa.TEXT?h=a.responseText:o==fa.XML?(h=a.responseXML)||(h=(new DOMParser).parseFromString(a.responseText,"application/xml")):o==fa.ARRAY_BUFFER&&(h=a.response),h?i.call(this,e.readFeatures(h,{extent:r,featureProjection:s}),e.readProjection(h)):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 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){var n=t.call(this,e)||this;return n.feature=i,n}return ga(e,t),e}(n),va=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,{attributions:n.attributions,projection:void 0,state:Ot.READY,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_&&(lt(i.format_,7),i.loader_=_a(i.url_,i.format_)),i.strategy_=void 0!==n.strategy?n.strategy:pa;var r,o,s=void 0===n.useSpatialIndex||n.useSpatialIndex;return i.featuresRtree_=s?new aa:null,i.loadedExtentsRtree_=new aa,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 sa(o)),void 0!==o&&i.addFeaturesInternal(o),void 0!==r&&i.bindFeaturesCollection_(r),i}return ga(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=P(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 ya(ha,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[C(e,E.CHANGE,this.handleFeatureChange_,this),C(e,r.PROPERTYCHANGE,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&&(lt(!(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;r=0;--x){var E=g[x],C=E.layer;if(C.hasRenderer()&&wt(E,l)&&s.call(a,C)){var S=C.getRenderer(),T=C.getSource();if(S&&T){var O=T.getWrapX()?p:t,R=u.bind(null,E.managed);v[0]=O[0]+f[m][0],v[1]=O[1]+f[m][1],h=S.forEachFeatureAtCoordinate(v,e,i,R,_)}if(h)return h}}},e.prototype.forEachLayerAtPixel=function(t,e,i,n,r){return w()},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 h=s[a],l=h.layer;if(l.hasRenderer()&&wt(h,o)&&r(l)){var u=l.getRenderer().getDataAtPixel(t,e,i);if(u){var c=n(l,u);if(c)return c}}}},e}(Oa),Ia=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)}}(),Pa={LAYERS:"layers"},ba=function(t){function e(e){var i=this,n=e||{},r=d({},n);delete r.layers;var o=n.layers;return(i=t.call(this,r)||this).layersListenerKeys_=[],i.listenerKeys_={},i.addEventListener(D(Pa.LAYERS),i.handleLayersChanged_),o?Array.isArray(o)?o=new sa(o.slice(),{unique:!0}):lt("function"==typeof o.getArray,43):o=new sa(void 0,{unique:!0}),i.setLayers(o),i}return Ia(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(T),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(C(t,ia.ADD,this.handleLayersAdd_,this),C(t,ia.REMOVE,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(T);_(this.listenerKeys_);for(var i=t.getArray(),n=0,o=i.length;nthis.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(T(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(E.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(T(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(T),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(x),Na={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},ja=1/0,Ya=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){lt(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=ja&&(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),h=this.getRightChildIndex_(t),l=ht;){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()!==er.IDLE||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++r,i.load())},e}(Ya);var Wa="center",Ka="resolution",Ba="rotation";function Za(t,e,i){return function(n,r,o,s){if(n){var a=e?0:o[0]*r,h=e?0:o[1]*r,l=t[0]+a/2,u=t[2]-a/2,c=t[1]+h/2,p=t[3]-h/2;l>u&&(u=l=(u+l)/2),c>p&&(p=c=(p+c)/2);var f=ut(n[0],l,u),d=ut(n[1],c,p),_=30*r;return s&&i&&(f+=-_*Math.log(1+Math.max(0,l-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 Ua(t){return t}function Va(t,e,i,n){var r=Pe(e)/i[0],o=Oe(e)/i[1];return n?Math.min(t,Math.max(r,o)):Math.min(t,Math.min(r,o))}function Ha(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),ut(n,i/2,2*e)}function qa(t,e,i,n,r){return function(o,s,a,h){if(void 0!==o){var l=n?Va(t,n,a,r):t;return(void 0===i||i)&&h?Ha(o,l,e):ut(o,e,l)}}}function Ja(t){return void 0!==t?0:void 0}function Qa(t){return void 0!==t?t:void 0}var $a=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)}}(),th=0;function eh(t,e){setTimeout(function(){t(e)},0)}function ih(t){return!(t.sourceCenter&&t.targetCenter&&!ke(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}var nh=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_=Ze(n.projection,"EPSG:3857"),i.viewportSize_=[100,100],i.targetCenter_=null,i.targetResolution_,i.targetRotation_,i.cancelAnchor_=void 0,n.center&&(n.center=ri(n.center,i.projection_)),n.extent&&(n.extent=si(n.extent,i.projection_)),i.applyOptions_(n),i}return $a(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,i,n,r=void 0!==t.minZoom?t.minZoom:th,o=void 0!==t.maxZoom?t.maxZoom:28,s=void 0!==t.zoomFactor?t.zoomFactor:2,h=void 0!==t.multiWorld&&t.multiWorld,l=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,u=void 0!==t.showFullExtent&&t.showFullExtent,c=Ze(t.projection,"EPSG:3857"),p=c.getExtent(),f=t.constrainOnlyCenter,d=t.extent;h||d||!c.isGlobal()||(f=!1,d=p);if(void 0!==t.resolutions){var _=t.resolutions;i=_[r],n=void 0!==_[o]?_[o]:_[_.length-1],e=t.constrainResolution?function(t,e,i,n){return function(r,o,s,h){if(void 0!==r){var l=t[0],u=t[t.length-1],c=i?Va(l,i,s,n):l;if(h)return void 0===e||e?Ha(r,c,u):ut(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&&eh(e,!0))}for(var r=Date.now(),o=this.targetCenter_.slice(),s=this.targetResolution_,a=this.targetRotation_,h=[],l=0;l0},e.prototype.getInteracting=function(){return this.hints_[Ao]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(Mo,-this.hints_[Mo]);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?h/a.duration:1;l>=1?(a.complete=!0,l=1):r=!1;var u=a.easing(l);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?gt(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(Mo,-1);var x=n[0].callback;x&&eh(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&&(Ge(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?ni(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(Wa)},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 oi(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSize_(),i=this.getCenterInternal();lt(i,1);var n=this.getResolution();lt(void 0!==n,2);var r=this.getRotation();return lt(void 0!==r,3),Te(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(Ka)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(si(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var i=e||this.getViewportSize_(),n=Pe(t)/i[0],r=Oe(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(Ba)},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=ut(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,ut(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(lt(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))lt(!Le(t),25),i=Cn(r=si(t,this.getProjection()));else if(t.getType()===Ae.CIRCLE){var r;(i=Cn(r=si(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),Ce(r))}else{var o=ii();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(),h=this.getRotation(),l=Math.cos(-h),u=Math.sin(-h),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[Mo]||r[Ao]){var o=!Z&&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:Te(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_||!Le(this.previousExtent_)&&!fe(r.extent,this.previousExtent_))&&(this.dispatchEvent(new Ma(N,this,n)),this.previousExtent_=ce(this.previousExtent_));this.previousExtent_&&!r.viewHints[Mo]&&!r.viewHints[Ao]&&!fe(r.extent,this.previousExtent_)&&(this.dispatchEvent(new Ma(j,this,r)),ne(r.extent,this.previousExtent_))}this.dispatchEvent(new Ma(G,this,r)),this.postRenderTimeoutHandle_=setTimeout(this.handlePostRender.bind(this),0)},e.prototype.setLayerGroup=function(t){this.set(Na.LAYERGROUP,t)},e.prototype.setSize=function(t){this.set(Na.SIZE,t)},e.prototype.setTarget=function(t){this.set(Na.TARGET,t)},e.prototype.setView=function(t){this.set(Na.VIEW,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}(k),sh=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)}}(),ah=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;var r=void 0!==n.className?n.className:"ol-rotate",o=void 0!==n.label?n.label:"⇧";i.label_=null,"string"==typeof o?(i.label_=document.createElement("span"),i.label_.className="ol-compass",i.label_.textContent=o):(i.label_=o,i.label_.classList.add("ol-compass"));var s=n.tipLabel?n.tipLabel:"Reset rotation",a=document.createElement("button");a.className=r+"-reset",a.setAttribute("type","button"),a.title=s,a.appendChild(i.label_),a.addEventListener(E.CLICK,i.handleClick_.bind(i),!1);var h=r+" "+tt+" "+et,l=i.element;return l.className=h,l.appendChild(a),i.callResetNorth_=n.resetNorth?n.resetNorth:void 0,i.duration_=void 0!==n.duration?n.duration:250,i.autoHide_=void 0===n.autoHide||n.autoHide,i.rotation_=void 0,i.autoHide_&&i.element.classList.add($),i}return sh(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap().getView();if(t){var e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:ci}):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($);r||0!==i?r&&0!==i&&this.element.classList.remove($):this.element.classList.add($)}this.label_.style.transform=n}this.rotation_=i}},e}(Q);var hh="active",lh=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 uh(t,e,i,n){var r=t.getZoom();if(void 0!==r){var o=t.getConstrainedZoom(r+e),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:i,duration:void 0!==n?n:250,easing:ci})}}var ch=function(t){function e(e){var i=t.call(this)||this;return e&&e.handleEvent&&(i.handleEvent=e.handleEvent),i.map_=null,i.setActive(!0),i}return lh(e,t),e.prototype.getActive=function(){return this.get(hh)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(hh,t)},e.prototype.setMap=function(t){this.map_=t},e}(k),ph=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)}}(),fh=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.delta_=n.delta?n.delta:1,i.duration_=void 0!==n.duration?n.duration:250,i}return ph(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Da.DBLCLICK){var i=t.originalEvent,n=t.map,r=t.coordinate,o=i.shiftKey?-this.delta_:this.delta_;uh(n.getView(),o,r,this.duration_),t.preventDefault(),e=!0}return!e},e}(ch),dh=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 _h(t){for(var e=t.length,i=0,n=0,r=0;r0}}else if(t.type==Da.POINTERDOWN){var n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==Da.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===Da.POINTERDOWN||e===Da.POINTERDRAG||e===Da.POINTERUP}(t)){var e=t.originalEvent,i=e.pointerId.toString();t.type==Da.POINTERUP?delete this.trackedPointers_[i]:t.type==Da.POINTERDOWN?this.trackedPointers_[i]=e:i in this.trackedPointers_&&(this.trackedPointers_[i]=e),this.targetPointers=g(this.trackedPointers_)}},e}(ch);function yh(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}(gh),Ph=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)}}(),bh=function(t){function e(e){var i=this,n=e||{};return(i=t.call(this,{stopDown:p})||this).condition_=n.condition?n.condition:vh,i.lastAngle_=void 0,i.duration_=void 0!==n.duration?n.duration:250,i}return Ph(e,t),e.prototype.handleDragEvent=function(t){if(Oh(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==Ja){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!Oh(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!Oh(t)&&(!(!Eh(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(gh),Lh=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){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 Lh(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i=this.element_.style;i.left=Math.min(t[0],e[0])+"px",i.top=Math.min(t[1],e[1])+"px",i.width=Math.abs(e[0]-t[0])+"px",i.height=Math.abs(e[1]-t[1])+"px"},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 En([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(o),Ah=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)}}(),Fh="boxstart",Dh="boxdrag",kh="boxend",Gh=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.coordinate=i,r.mapBrowserEvent=n,r}return Ah(e,t),e}(n),Nh=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.box_=new Mh(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:Eh,i.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:i.defaultBoxEndCondition,i}return Ah(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 Gh(Dh,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 Gh(kh,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 Gh(Fh,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(gh),jh=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)}}(),Yh=function(t){function e(e){var i=this,n=e||{},r=n.condition?n.condition:Sh;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 jh(e,t),e.prototype.onBoxEnd=function(t){var e,i,n=this.getMap(),r=n.getView(),o=n.getSize(),s=this.getGeometry().getExtent();if(this.out_){var a=r.calculateExtentInternal(o),h=(e=[n.getPixelFromCoordinateInternal(xe(s)),n.getPixelFromCoordinateInternal(Ie(s))],_e(ce(i),e));!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}(a,1/r.getResolutionForExtentInternal(h,o)),s=a}var l=r.getConstrainedResolution(r.getResolutionForExtentInternal(s,o)),u=r.getConstrainedCenter(Ce(s),l);r.animateInternal({resolution:l,center:u,duration:this.duration_,easing:ci})},e}(Nh),Xh=37,zh=38,Wh=39,Kh=40,Bh=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)}}(),Zh=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.defaultCondition_=function(t){return Ch(t)&&Th(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 Bh(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==E.KEYDOWN){var i=t.originalEvent.keyCode;if(this.condition_(t)&&(i==Kh||i==Xh||i==Wh||i==zh)){var n=t.map.getView(),r=n.getResolution()*this.pixelDelta_,o=0,s=0;i==Kh?s=-r:i==Xh?o=-r:i==Wh?o=r:s=r;var a=[o,s];Ge(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:fi,center:t.getConstrainedCenter(r)})}}(n,a,this.duration_),t.preventDefault(),e=!0}}return!e},e}(ch),Uh=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)}}(),Vh=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.condition_=n.condition?n.condition:Th,i.delta_=n.delta?n.delta:1,i.duration_=void 0!==n.duration?n.duration:100,i}return Uh(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==E.KEYDOWN||t.type==E.KEYPRESS){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_;uh(n.getView(),r,void 0,this.duration_),t.preventDefault(),e=!0}}return!e},e}(ch),Hh=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}(),qh=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="trackpad",Qh="wheel",$h=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:xh;return i.condition_=n.onFocusOnly?yh(mh,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 qh(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!==E.WHEEL)return!0;t.preventDefault();var e,i=t.map,n=t.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==E.WHEEL&&(e=n.deltaY,X&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=K),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?Jh:Qh);var o=i.getView();if(this.mode_===Jh&&!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=-ut(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),uh(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}(ch),tl=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)}}(),el=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 tl(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!==Ja){var h=s.getViewport().getBoundingClientRect(),l=_h(this.targetPointers);l[0]-=h.left,l[1]-=h.top,this.anchor_=s.getCoordinateFromPixelInternal(l),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}(gh),il=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)}}(),nl=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 il(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,h=a.getView();1!=e&&(this.lastScaleDelta_=e);var l=a.getViewport().getBoundingClientRect(),u=_h(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=a.getCoordinateFromPixelInternal(u),a.render(),h.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}(gh);var rl=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)}}(),ol=function(t){function e(e){return(e=d({},e)).controls||(e.controls=function(t){var e=t||{},i=new sa;return(void 0===e.zoom||e.zoom)&&i.push(new _i(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new ah(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new bt(e.attributionOptions)),i}()),e.interactions||(e.interactions=function(t){var e=t||{},i=new sa,n=new Hh(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new bh),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new fh({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new Ih({onFocusOnly:e.onFocusOnly,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new el),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new nl({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new Zh),i.push(new Vh({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new $h({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new Yh({duration:e.zoomDuration})),i}({onFocusOnly:!0})),t.call(this,e)||this}return rl(e,t),e.prototype.createRenderer=function(){return new wa(this)},e}(oh);const sl={control:{Attribution:bt,MousePosition:li,Zoom:_i},coordinate:{createStringXY:function(t){return function(e){return function(t,e){return function(t,e,i){return t?e.replace("{x}",t[0].toFixed(i)).replace("{y}",t[1].toFixed(i)):""}(t,"{x}, {y}",e)}(e,t)}}},extent:{boundingExtent:ee},geom:{LineString:en,LinearRing:sn,MultiLineString:hn,MultiPoint:pn,MultiPolygon:Tn,Point:un,Polygon:En},layer:{Tile:sr,Vector:os},proj:{fromLonLat:function(t,e){return qe(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")},get:We,transformExtent:Je},source:{OSM:ea,Vector:va},style:{Circle:Cr,Fill:Sr,Stroke:Tr,Style:Pr,Text:xa},Feature:Ca,Map:ol,View:nh};e.default=sl}}).default});
//# sourceMappingURL=OpenLayers.js.map