/usr/share/phpmyadmin/js/vendor/openlayers
NameSizeModeActions
theme/-0755rm
OpenLayers.js3013140644editdlrm
OpenLayers.js.map18430040644editdlrm
Edit: /usr/share/phpmyadmin/js/vendor/openlayers/OpenLayers.js (301314B)
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ol=e():t.ol=e()}(window,function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=14)}({14:function(t,e,i){"use strict";i.r(e);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:"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),E={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function C(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 S(t,e,i,n){return C(t,e,i,n,!0)}function T(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),_(t))}var O=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 R=function(t){function e(){var e=t.call(this)||this;return e.revision_=0,e}return O(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(E.CHANGE)},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;r1?(i=r,n=o):h>0&&(i+=s*h,n+=a*h)}return dt(t,e,i,n)}function dt(t,e,i,n){var r=i-t,o=n-e;return r*r+o*o}function _t(t){return t*Math.PI/180}function gt(t,e){var i=t%e;return i*e<0?i+e:i}function yt(t,e,i){return t+i*(e-t)}var vt=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)}}(),mt=function(t){function e(e){var i=t.call(this)||this,n=d({},e);return n[st.OPACITY]=void 0!==e.opacity?e.opacity:1,lt("number"==typeof n[st.OPACITY],64),n[st.VISIBLE]=void 0===e.visible||e.visible,n[st.Z_INDEX]=e.zIndex,n[st.MAX_RESOLUTION]=void 0!==e.maxResolution?e.maxResolution:1/0,n[st.MIN_RESOLUTION]=void 0!==e.minResolution?e.minResolution:0,n[st.MIN_ZOOM]=void 0!==e.minZoom?e.minZoom:-1/0,n[st.MAX_ZOOM]=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 vt(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=ut(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 w()},e.prototype.getLayerStatesArray=function(t){return w()},e.prototype.getExtent=function(){return this.get(st.EXTENT)},e.prototype.getMaxResolution=function(){return this.get(st.MAX_RESOLUTION)},e.prototype.getMinResolution=function(){return this.get(st.MIN_RESOLUTION)},e.prototype.getMinZoom=function(){return this.get(st.MIN_ZOOM)},e.prototype.getMaxZoom=function(){return this.get(st.MAX_ZOOM)},e.prototype.getOpacity=function(){return this.get(st.OPACITY)},e.prototype.getSourceState=function(){return w()},e.prototype.getVisible=function(){return this.get(st.VISIBLE)},e.prototype.getZIndex=function(){return this.get(st.Z_INDEX)},e.prototype.setExtent=function(t){this.set(st.EXTENT,t)},e.prototype.setMaxResolution=function(t){this.set(st.MAX_RESOLUTION,t)},e.prototype.setMinResolution=function(t){this.set(st.MIN_RESOLUTION,t)},e.prototype.setMaxZoom=function(t){this.set(st.MAX_ZOOM,t)},e.prototype.setMinZoom=function(t){this.set(st.MIN_ZOOM,t)},e.prototype.setOpacity=function(t){lt("number"==typeof t,64),this.set(st.OPACITY,t)},e.prototype.setVisible=function(t){this.set(st.VISIBLE,t)},e.prototype.setZIndex=function(t){this.set(st.Z_INDEX,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(k),xt="prerender",Et="postrender",Ct="precompose",St="postcompose",Tt="rendercomplete",Ot={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"},Rt=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 wt(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 It=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(D(st.SOURCE),i.handleSourcePropertyChange_);var r=e.source?e.source:null;return i.setSource(r),i}return Rt(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(st.SOURCE)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Ot.UNDEFINED},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(T(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=C(t,E.CHANGE,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_&&(T(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(T(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=C(t,Ct,function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);lt(!e.some(function(t){return t.layer===i.layer}),67),e.push(i)},this),this.mapRenderKey_=C(this,E.CHANGE,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(st.SOURCE,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}(mt),Pt=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)}}(),bt=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 h=i.collapsible_&&!i.collapsed_?i.collapseLabel_:i.label_,l=document.createElement("button");l.setAttribute("type","button"),l.title=o,l.appendChild(h),l.addEventListener(E.CLICK,i.handleClick_.bind(i),!1);var u=r+" "+tt+" "+et+(i.collapsed_&&i.collapsible_?" "+it:"")+(i.collapsible_?"":" ol-uncollapsible"),c=i.element;return c.className=u,c.appendChild(i.ulElement_),c.appendChild(l),i.renderedAttributions_=[],i.renderedVisible_=!0,i}return Pt(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_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var n=0,r=e.length;n1?i:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(n));for(var s=Nt,a=0;as?h=s:h<-s&&(h=-s),o[a+1]=h}return o}function Kt(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&&(h|=te.RIGHT),ao&&(h|=te.ABOVE),h===te.UNKNOWN&&(h=te.INTERSECTING),h}function le(){return[1/0,1/0,-1/0,-1/0]}function ue(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 ce(t){return ue(1/0,1/0,-1/0,-1/0,t)}function pe(t,e,i,n,r){return ge(ce(r),t,e,i,n)}function fe(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function de(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function _e(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 Le(t){return t[2]1)for(var o=t[2]-t[0],s=t[3]-t[1],a=0;a=0;--n)if(t[n]!=e[n]){i=!1;break}return i}function Ge(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 Ne(t,e){if(e.canWrapX()){var i=Pe(e.getExtent()),n=je(t,e,i);n&&(t[0]-=n*i)}return t}function je(t,e,i){var n=e.getExtent(),r=0;if(e.canWrapX()&&(t[0]n[2])){var o=i||Pe(n);r=Math.floor((t[0]-n[0])/o)}return r}function Ye(t,e,i){var n;if(void 0!==e){for(var r=0,o=t.length;r0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:ci})):e.setZoom(n)}}},e}(Q),gi={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};new Array(6);function yi(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 vi(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 mi(t,e,i,n,r,o,s,a){var h=Math.sin(o),l=Math.cos(o);return t[0]=n*l,t[1]=r*h,t[2]=-n*h,t[3]=r*l,t[4]=s*n*l-a*n*h+e,t[5]=s*r*h+a*r*l+i,t}function xi(t,e){var i,n=(i=e)[0]*i[3]-i[1]*i[2];lt(0!==n,32);var r=e[0],o=e[1],s=e[2],a=e[3],h=e[4],l=e[5];return t[0]=a/n,t[1]=-o/n,t[2]=-s/n,t[3]=r/n,t[4]=(s*l-a*h)/n,t[5]=-(r*l-o*h)/n,t}function Ei(t){return"matrix("+t.join(", ")+")"}function Ci(t,e,i,n,r,o){for(var s=o||[],a=0,h=e;h1)a=i;else{if(p>0){for(var f=0;fr&&(r=l),o=a,s=h}return r}function Mi(t,e,i,n,r){for(var o=0,s=i.length;o0;){for(var c=l.pop(),p=l.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&&(h[(u-e)/n]=1,p+n0&&_>f)&&(d<0&&g0&&g>d)?(a=c,h=p):(o[s++]=a,o[s++]=h,l=a,u=h,a=c,h=p)}}return o[s++]=a,o[s++]=h,s}function Xi(t,e,i,n,r,o,s,a){for(var h=0,l=i.length;h>1)],e))<0?a=n+1:(h=n,l=!r);return l?a:~a}(d,v);m<0?(l=(v-d[-m-2])/(d[-m-1]-d[-m-2]),h=e+(-m-2)*n):h=e+m*n}var x=a>1?a:2,E=o||new Array(x);for(_=0;_>1;ro&&(l-a)*(o-h)-(r-a)*(u-h)>0&&s++:u<=o&&(l-a)*(o-h)-(r-a)*(u-h)<0&&s--,a=l,h=u}return 0!==s}function qi(t,e,i,n,r,o){if(0===i.length)return!1;if(!Hi(t,e,i[0],n,r,o))return!1;for(var s=1,a=i.length;s=r[0]&&o[2]<=r[2]||(o[1]>=r[1]&&o[3]<=r[3]||zi(t,e,i,n,function(t,e){return function(t,e,i){var n=!1,r=he(t,e),o=he(t,i);if(r===te.INTERSECTING||o===te.INTERSECTING)n=!0;else{var s=t[0],a=t[1],h=t[2],l=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&te.ABOVE&&!(r&te.ABOVE)&&(n=(_=p-(f-l)/d)>=s&&_<=h),n||!(o&te.RIGHT)||r&te.RIGHT||(n=(g=f-(p-h)*d)>=a&&g<=l),n||!(o&te.BELOW)||r&te.BELOW||(n=(_=p-(f-a)/d)>=s&&_<=h),n||!(o&te.LEFT)||r&te.LEFT||(n=(g=f-(p-s)*d)>=a&&g<=l)}return n}(r,t,e)}))))}function Qi(t,e,i,n,r){if(!function(t,e,i,n,r){return!!(Ji(t,e,i,n,r)||Hi(t,e,i,n,r[0],r[1])||Hi(t,e,i,n,r[0],r[3])||Hi(t,e,i,n,r[2],r[1])||Hi(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;oE&&qi(t,e,i,n,u=(c+p)/2,_)&&(x=u,E=C),c=p}return isNaN(x)&&(x=r[o]),a?(a.push(x,_,E),a):[x,_,E]}function dn(t,e,i,n){for(;eo||(l==o&&h>=s||(r=a,o=l,s=h))}return r}(t,e,i,n),a=s-n;a=i&&(h=e);var l=t[a],u=t[a+1],c=t[s],p=t[s+1],f=t[h],d=t[h+1];return c*d+l*p+u*f-(u*c+p*f+l*d)<0}function gn(t,e,i,n,r){for(var o=void 0!==r&&r,s=0,a=i.length;sthis.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 $n(t,e,i,n,r){return void 0!==r?(r.minX=t,r.maxX=e,r.minY=i,r.maxY=n,r):new Qn(t,e,i,n)}var tr=Qn,er={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},ir=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)}}(),nr=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 tr(0,0,0,0),i}return ir(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return i==er.LOADED||i==er.EMPTY||i==er.ERROR&&!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()==er.ERROR&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(er.LOADED)),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,h=n.rotation,l=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&&si(i.extent,r);v&&(y=Re(y,si(i.extent,r)));var m=c.getTilePixelRatio(l),x=Math.round(t.size[0]*m),E=Math.round(t.size[1]*m);if(h){var C=Math.round(Math.sqrt(x*x+E*E));x=C,E=C}var S=g*x/2/m,T=g*E/2/m,O=[a[0]-S,a[1]-T,a[0]+S,a[1]+T],R=f.getTileRangeForExtentAndZ(y,_),w={};w[_]={};var I=this.createLoadedTileFinder(c,r,w),b=this.tmpExtent,L=this.tmpTileRange_;this.newTiles_=!1;for(var M=R.minX;M<=R.maxX;++M)for(var A=R.minY;A<=R.maxY;++A){var F=this.getTile(_,M,A,t);if(this.isDrawableTile(F)){var D=P(this);if(F.getState()==er.LOADED){w[_][F.tileCoord.toString()]=F;var k=F.inTransition(D);this.newTiles_||!k&&-1!==this.renderedTiles.indexOf(F)||(this.newTiles_=!0)}if(1===F.getAlpha(D,t.time))continue}var G=f.getTileCoordChildTileRange(F.tileCoord,L,b),N=!1;G&&(N=I(_+1,G)),N||f.forEachTileCoordParentTileRange(F.tileCoord,I,L,b)}var j=g/o;mi(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/m,1/m,h,-x/2,-E/2);var Y,X=(Y=this.pixelTransform,B?Ei(Y):(Hn||(Hn=V(1,1).canvas),Hn.style.transform=Ei(Y),Hn.style.transform));this.useContainer(e,X,i.opacity);var z=this.context,W=z.canvas;xi(this.inversePixelTransform,this.pixelTransform),mi(this.tempTransform,x/2,E/2,j,j,0,-x/2,-E/2),W.width!=x||W.height!=E?(W.width=x,W.height=E):this.containerReused||z.clearRect(0,0,x,E),v&&this.clipUnrotated(z,t,v),d(z,c.getContextOptions()),this.preRender(z,t),this.renderedTiles.length=0;var K,Z,U,H=Object.keys(w).map(Number);H.sort(s),1!==i.opacity||this.containerReused&&!c.getOpaque(t.viewState.projection)?(K=[],Z=[]):H=H.reverse();for(var q=H.length-1;q>=0;--q){var J=H[q],Q=c.getTilePixelSize(J,l,r),$=f.getResolution(J)/g,tt=Q[0]*$*j,et=Q[1]*$*j,it=f.getTileCoordForCoordAndZ(we(O),J),nt=f.getTileCoordExtent(it),rt=vi(this.tempTransform,[m*(nt[0]-O[0])/g,m*(O[3]-nt[3])/g]),ot=m*c.getGutterForProjection(r),st=w[J];for(var at in st){var ht=(F=st[at]).tileCoord,lt=rt[0]-(it[1]-ht[1])*tt,ut=Math.round(lt+tt),ct=rt[1]-(it[2]-ht[2])*et,pt=Math.round(ct+et),ft=ut-(M=Math.round(lt)),dt=pt-(A=Math.round(ct)),_t=_===J;if(!(k=_t&&1!==F.getAlpha(P(this),t.time)))if(K){z.save(),U=[M,A,M+ft,A,M+ft,A+dt,M,A+dt];for(var gt=0,yt=K.length;gt=1024){var i=0;for(var n in pr)0==(3&i++)&&(delete pr[n],--fr)}e=function(t){var e,i,n,r,o;if(ur.exec(t)&&(t=cr(t)),lr.exec(t)){var s=t.length-1,a=void 0;a=s<=4?1:2;var h=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=h?parseInt(t.substr(1+3*a,a),16):255,1==a&&(e=(e<<4)+e,i=(i<<4)+i,n=(n<<4)+n,h&&(r=(r<<4)+r)),o=[e,i,n,r/255]}else 0==t.indexOf("rgba(")?gr(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),gr(o)):lt(!1,14);return o}(t),pr[t]=e,++fr}return e});function _r(t){return Array.isArray(t)?t:dr(t)}function gr(t){return t[0]=ut(t[0]+.5|0,0,255),t[1]=ut(t[1]+.5|0,0,255),t[2]=ut(t[2]+.5|0,0,255),t[3]=ut(t[3],0,1),t}function yr(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])+")"}function vr(t){return Array.isArray(t)?yr(t):t}var mr=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)}}(),xr=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 mr(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=V(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 Pn.LOADED},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="round",i="round",n=0,r=null,o=0,s=0;return this.stroke_&&(null===(t=this.stroke_.getColor())&&(t="#000"),t=vr(t),void 0===(s=this.stroke_.getWidth())&&(s=1),r=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),void 0===(i=this.stroke_.getLineJoin())&&(i="round"),void 0===(e=this.stroke_.getLineCap())&&(e="round"),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=V(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 h=this.points_;if(h===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var l=void 0!==this.radius2_?this.radius2_:this.radius_;for(l!==this.radius_&&(h*=2),o=0;o<=h;o++)s=2*o*Math.PI/h-Math.PI/2+this.angle_,a=o%2==0?this.radius_:l,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="#000"),e.fillStyle=vr(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=_r(e)),null===e?i=1:Array.isArray(e)&&(i=4===e.length?e[3]:1),0===i){var n=V(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,h=void 0;for(s=0;s<=r;s++)h=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(h),t.size/2+a*Math.sin(h))}e.fillStyle="#000",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}(hr),Er=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){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 Er(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}(xr),Sr=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}(),Tr=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}(),Or=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=Ir,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"==typeof 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_=Ir,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var Rr=null;function wr(t,e){if(!Rr){var i=new Sr({color:"rgba(255,255,255,0.4)"}),n=new Tr({color:"#3399CC",width:1.25});Rr=[new Or({image:new Cr({fill:i,stroke:n,radius:5}),fill:i,stroke:n})]}return Rr}function Ir(t){return t.getGeometry()}var Pr=Or,br=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)}}(),Lr="renderOrder",Mr=function(t){function e(e){var i=this,n=e||{},r=d({},n);return delete r.style,delete r.renderBuffer,delete r.updateWhileAnimating,delete r.updateWhileInteracting,(i=t.call(this,r)||this).declutter_=void 0!==n.declutter&&n.declutter,i.renderBuffer_=void 0!==n.renderBuffer?n.renderBuffer:100,i.style_=null,i.styleFunction_=void 0,i.setStyle(n.style),i.updateWhileAnimating_=void 0!==n.updateWhileAnimating&&n.updateWhileAnimating,i.updateWhileInteracting_=void 0!==n.updateWhileInteracting&&n.updateWhileInteracting,i}return br(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(Lr)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.setRenderOrder=function(t){this.set(Lr,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:wr,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var i;Array.isArray(t)?i=t:(lt("function"==typeof t.getZIndex,41),i=[t]),e=function(){return i}}return e}(this.style_),this.changed()},e}(It),Ar={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},Fr=[Ar.FILL],Dr=[Ar.STROKE],kr=[Ar.BEGIN_PATH],Gr=[Ar.CLOSE_PATH],Nr=Ar,jr=function(){function t(){}return t.prototype.drawCustom=function(t,e,i){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}(),Yr=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)}}(),Xr=function(t){function e(e,i,n,r){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=i,o.pixelRatio=r,o.maxLineWidth=0,o.resolution=n,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return Yr(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map(function(t){return t*e})},e.prototype.appendFlatCoordinates=function(t,e,i,n,r,o){var s=this.coordinates.length,a=this.getBufferedMaxExtent();o&&(e+=n);var h,l,u,c=t[e],p=t[e+1],f=this.tmpCoordinate_,d=!0;for(h=e+n;hthis.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=[Nr.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[Nr.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,h=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!=h)&&(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=h)},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=[Nr.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=ne(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;ie(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(jr),zr=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)}}(),Wr=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 zr(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([Nr.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([Nr.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([Nr.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([Nr.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}(Xr),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)}}(),Br=function(t){function e(e,i,n,r){return t.call(this,e,i,n,r)||this}return Kr(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=[Nr.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([Nr.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],kr);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(Dr),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([Nr.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],kr);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),h=0,l=0,u=o.length;lt&&(y>g&&(g=y,d=v,_=o),y=0,v=o-r)),s=a,u=p,c=f),h=m,l=x}return(y+=a)>g?[v,o]:[d,_]}var qr=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)}}(),Jr={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Qr={Circle:Ur,Default:Xr,Image:Wr,LineString:Br,Polygon:Ur,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 qr(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,h=t.getType(),l=null,u=2,c=t.getStride();if(r.placement===Vr.LINE){if(!be(this.getBufferedMaxExtent(),t.getExtent()))return;var p=void 0;if(l=t.getFlatCoordinates(),h==Ae.LINE_STRING)p=[l.length];else if(h==Ae.MULTI_LINE_STRING)p=t.getEnds();else if(h==Ae.POLYGON)p=t.getEnds().slice(0,1);else if(h==Ae.MULTI_POLYGON){var f=t.getEndss();for(p=[],o=0,s=f.length;on;){if(r-n>600){var s=r-n+1,a=i-n+1,h=Math.log(s),l=.5*Math.exp(2*h/3),u=.5*Math.sqrt(h*l*(s-l)/s)*(a-s/2<0?-1:1),c=Math.max(n,Math.floor(i-a*l/s+u)),p=Math.min(r,Math.floor(i+(s-a)*l/s+u));t(e,i,c,p,o)}var f=e[i],d=n,_=r;for(io(e,n,i),o(e[r],f)>0&&io(e,n,r);d<_;){for(io(e,d,_),d++,_--;o(e[d],f)<0;)d++;for(;o(e[_],f)>0;)_--}0===o(e[n],f)?io(e,n,_):io(e,++_,r),_<=i&&(n=_+1),i<=_&&(r=_-1)}}(t,e,i||0,n||t.length-1,r||no)}function io(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function no(t,e){return te?1:0}class ro{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const i=[];if(!go(t,e))return i;const n=this.toBBox,r=[];for(;e;){for(let o=0;o=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)}_split(t,e){const i=t[e],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);const o=this._chooseSplitIndex(i,r,n),s=yo(i.children.splice(o,i.children.length-o));s.height=i.height,s.leaf=i.leaf,so(i,this.toBBox),so(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(i,s)}_splitRoot(t,e){this.data=yo([t,e]),this.data.height=t.height+1,this.data.leaf=!1,so(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let n,r=1/0,o=1/0;for(let s=e;s<=i-e;s++){const e=ao(t,0,s,this.toBBox),a=ao(t,s,i,this.toBBox),h=fo(e,a),l=co(e)+co(a);h=e;n--){const e=t.children[n];ho(s,t.leaf?r(e):e),a+=po(s)}return a}_adjustParentBBoxes(t,e,i){for(let n=i;n>=0;n--)ho(e[n],t)}_condense(t){for(let e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():so(t[i],this.toBBox)}}function oo(t,e,i){if(!i)return e.indexOf(t);for(let n=0;n=t.minX&&e.maxY>=t.minY}function yo(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function vo(t,e,i,n,r){const o=[e,i];for(;o.length;){if((i=o.pop())-(e=o.pop())<=n)continue;const s=e+Math.ceil((i-e)/n/2)*n;eo(t,s,e,i,r),o.push(e,s,s,i)}}function mo(t,e,i,n,r,o,s,a,h,l,u,c){var p,f=[];if(c){var d=Si(t,e,i,n,c,[t[e],t[e+1]]);p=d[0]>d[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],E=t[e+1],C=0,S=Math.sqrt(Math.pow(x-v,2)+Math.pow(E-m,2)),T=!1,O=0;O0?-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;r0;)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