@fssg/gis.smol
Version:
FSSG内部前端SuperMap OpenLayer基础库
1 lines • 196 kB
JavaScript
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("@fssg/gis.base"),require("@supermap/iclient-ol"),require("@fssg/core"),require("proj4"));else if("function"==typeof define&&define.amd)define([,,,],e);else{var n="object"==typeof exports?e(require("@fssg/gis.base"),require("@supermap/iclient-ol"),require("@fssg/core"),require("proj4")):e(t.FssgGisBase,t.IclientOl,t.FssgCore,t.proj4);for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,((t,e,n,o)=>(()=>{"use strict";var r={575:t=>{t.exports=n},634:e=>{e.exports=t},639:t=>{t.exports=e},907:t=>{t.exports=o}},i={};function s(t){var e=i[t];if(void 0!==e)return e.exports;var n=i[t]={exports:{}};return r[t](n,n.exports,s),n.exports}s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var a={};return(()=>{s.r(a),s.d(a,{EventManager:()=>Do,FssgGisSmol:()=>Ts,LayerFactory:()=>Mo,Map:()=>Es,SpatialReferenceFactory:()=>Ao,TileInfoFactory:()=>Lo,default:()=>Ps});var t={};s.r(t),s.d(t,{LayerFactory:()=>Mo,SpatialReferenceFactory:()=>Ao,TileInfoFactory:()=>Lo});var e={};s.r(e),s.d(e,{EventManager:()=>Do});var n={};s.r(n),s.d(n,{Map:()=>Es,default:()=>bs});var o=s(634);class r extends o.Layer{addToMap(){let t=this.get("layer");t&&(this.$map.get("map").addLayer(t),this.set("added",!0))}hide(){let t=this.get("layer");t&&t.setVisible(!1),this.set("visible",!1)}show(){this.added||this.addToMap();const t=this.get("layer");t&&t.setVisible(!0),this.set("visible",!0)}moveTo(t){const e=this.$map.get("map");let n=this.get("layer");const o=e.getLayers();o.remove(n),o.insertAt(t,n)}getZIndex(){const t=this.$map.get("map");let e=this.get("layer");return t.getLayers().getArray().indexOf(e)}refresh(){const t=this.get("source");t&&t.changed()}removeFromMap(){let t=this.get("layer");t&&(this.$map.get("map").removeLayer(t),this.set("added",!1))}}const i=r,l="top-left";function u(){return function(){throw new Error("Unimplemented abstract method.")}()}var c=0;function h(t){return t.ol_uid||(t.ol_uid=String(++c))}var p,f=(p=function(t,e){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},p(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const d=function(t){function e(e){var n=this,o="Assertion failed. See https://openlayers.org/en/v"+"6.6.1".split("-")[0]+"/doc/errors/#"+e+" for details.";return(n=t.call(this,o)||this).code=e,n.name="AssertionError",n.message=o,n}return f(e,t),e}(Error);function _(t,e){if(!t)throw new d(e)}function y(t){for(var e=[1/0,1/0,-1/0,-1/0],n=0,o=t.length;n<o;++n)b(e,t[n]);return e}function g(t,e,n){var o,r;return(o=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*o+(r=n<t[1]?t[1]-n:t[3]<n?n-t[3]:0)*r}function v(t,e){return m(t,e[0],e[1])}function m(t,e,n){return t[0]<=e&&e<=t[2]&&t[1]<=n&&n<=t[3]}function w(t,e){var n=t[0],o=t[1],r=t[2],i=t[3],s=e[0],a=e[1],l=0;return s<n?l|=16:s>r&&(l|=4),a<o?l|=8:a>i&&(l|=2),0===l&&(l=1),l}function x(t,e,n,o,r){return r?(r[0]=t,r[1]=e,r[2]=n,r[3]=o,r):[t,e,n,o]}function C(t){return x(1/0,1/0,-1/0,-1/0,t)}function E(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function b(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function T(t,e,n,o,r){for(;n<o;n+=r)P(t,e[n],e[n+1]);return t}function P(t,e,n){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],n),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],n)}function O(t,e){var n;return(n=e(S(t)))||(n=e(M(t)))||(n=e(D(t)))?n:(n=e(z(t)))||!1}function R(t){var e=0;return G(t)||(e=k(t)*A(t)),e}function S(t){return[t[0],t[1]]}function M(t){return[t[2],t[1]]}function I(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function j(t,e){var n;return"bottom-left"===e?n=S(t):"bottom-right"===e?n=M(t):e===l?n=z(t):"top-right"===e?n=D(t):_(!1,13),n}function F(t,e,n,o,r){var i=e*o[0]/2,s=e*o[1]/2,a=Math.cos(n),l=Math.sin(n),u=i*a,c=i*l,h=s*a,p=s*l,f=t[0],d=t[1],_=f-u+p,y=f-u-p,g=f+u-p,v=f+u+p,m=d-c-h,w=d-c+h,C=d+c+h,E=d+c-h;return x(Math.min(_,y,g,v),Math.min(m,w,C,E),Math.max(_,y,g,v),Math.max(m,w,C,E),r)}function A(t){return t[3]-t[1]}function L(t,e,n){var o=n||[1/0,1/0,-1/0,-1/0];return K(t,e)?(t[0]>e[0]?o[0]=t[0]:o[0]=e[0],t[1]>e[1]?o[1]=t[1]:o[1]=e[1],t[2]<e[2]?o[2]=t[2]:o[2]=e[2],t[3]<e[3]?o[3]=t[3]:o[3]=e[3]):C(o),o}function z(t){return[t[0],t[3]]}function D(t){return[t[2],t[3]]}function k(t){return t[2]-t[0]}function K(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function G(t){return t[2]<t[0]||t[3]<t[1]}const Z=function(){function t(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),N="propertychange",X=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function U(t,e){return t>e?1:t<e?-1:0}function V(t,e,n){var o=t.length;if(t[0]<=e)return 0;if(e<=t[o-1])return o-1;var r=void 0;if(n>0){for(r=1;r<o;++r)if(t[r]<e)return r-1}else if(n<0){for(r=1;r<o;++r)if(t[r]<=e)return r}else for(r=1;r<o;++r){if(t[r]==e)return r;if(t[r]<e)return"function"==typeof n?n(e,t[r-1],t[r])>0?r-1:r:t[r-1]-e<e-t[r]?r-1:r}return o-1}function W(t,e){var n=t.length;if(n!==e.length)return!1;for(var o=0;o<n;o++)if(t[o]!==e[o])return!1;return!0}function q(){return!0}function Y(){return!1}function B(){}var H="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),o=1,r=arguments.length;o<r;++o){var i=arguments[o];if(null!=i)for(var s in i)i.hasOwnProperty(s)&&(n[s]=i[s])}return n};function Q(t){for(var e in t)delete t[e]}var $="function"==typeof Object.values?Object.values:function(t){var e=[];for(var n in t)e.push(t[n]);return e},J=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const tt=function(t){function e(e){var n=t.call(this)||this;return n.eventTarget_=e,n.pendingRemovals_=null,n.dispatching_=null,n.listeners_=null,n}return J(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var n=this.listeners_||(this.listeners_={}),o=n[t]||(n[t]=[]);-1===o.indexOf(e)&&o.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new Z(t):t,n=e.type;e.target||(e.target=this.eventTarget_||this);var o,r=this.listeners_&&this.listeners_[n];if(r){var i=this.dispatching_||(this.dispatching_={}),s=this.pendingRemovals_||(this.pendingRemovals_={});n in i||(i[n]=0,s[n]=0),++i[n];for(var a=0,l=r.length;a<l;++a)if(!1===(o="handleEvent"in r[a]?r[a].handleEvent(e):r[a].call(this,e))||e.propagationStopped){o=!1;break}if(--i[n],0===i[n]){var u=s[n];for(delete s[n];u--;)this.removeEventListener(n,B);delete i[n]}return o}},e.prototype.disposeInternal=function(){this.listeners_&&Q(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_&&this.listeners_[t]||void 0},e.prototype.hasListener=function(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)},e.prototype.removeEventListener=function(t,e){var n=this.listeners_&&this.listeners_[t];if(n){var o=n.indexOf(e);-1!==o&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[o]=B,++this.pendingRemovals_[t]):(n.splice(o,1),0===n.length&&delete this.listeners_[t]))}},e}(X),et="change",nt="contextmenu",ot="click",rt="keydown",it="keypress",st="resize",at="touchmove",lt="wheel";function ut(t,e,n,o,r){if(o&&o!==t&&(n=n.bind(o)),r){var i=n;n=function(){t.removeEventListener(e,n),i.apply(this,arguments)}}var s={target:t,type:e,listener:n};return t.addEventListener(e,n),s}function ct(t,e,n,o){return ut(t,e,n,o,!0)}function ht(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),Q(t))}var pt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ft=function(t){function e(){var e=t.call(this)||this;return e.on=e.onInternal,e.once=e.onceInternal,e.un=e.unInternal,e.revision_=0,e}return pt(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(et)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var n=t.length,o=new Array(n),r=0;r<n;++r)o[r]=ut(this,t[r],e);return o}return ut(this,t,e)},e.prototype.onceInternal=function(t,e){var n;if(Array.isArray(t)){var o=t.length;n=new Array(o);for(var r=0;r<o;++r)n[r]=ct(this,t[r],e)}else n=ct(this,t,e);return e.ol_key=n,n},e.prototype.unInternal=function(t,e){var n=e.ol_key;if(n)!function(t){if(Array.isArray(t))for(var e=0,n=t.length;e<n;++e)ht(t[e]);else ht(t)}(n);else if(Array.isArray(t))for(var o=0,r=t.length;o<r;++o)this.removeEventListener(t[o],e);else this.removeEventListener(t,e)},e}(tt);ft.prototype.on,ft.prototype.once,ft.prototype.un;const dt=ft;var _t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),yt=function(t){function e(e,n,o){var r=t.call(this,e)||this;return r.key=n,r.oldValue=o,r}return _t(e,t),e}(Z);const gt=function(t){function e(e){var n=t.call(this)||this;return n.on,n.once,n.un,h(n),n.values_=null,void 0!==e&&n.setProperties(e),n}return _t(e,t),e.prototype.get=function(t){var e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},e.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},e.prototype.getProperties=function(){return this.values_&&H({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var n;n="change:"+t,this.dispatchEvent(new yt(n,t,e)),n=N,this.dispatchEvent(new yt(n,t,e))},e.prototype.addChangeListener=function(t,e){this.addEventListener("change:"+t,e)},e.prototype.removeChangeListener=function(t,e){this.removeEventListener("change:"+t,e)},e.prototype.set=function(t,e,n){var o=this.values_||(this.values_={});if(n)o[t]=e;else{var r=o[t];o[t]=e,r!==e&&this.notify(t,r)}},e.prototype.setProperties=function(t,e){for(var n in t)this.set(n,t[n],e)},e.prototype.applyProperties=function(t){t.values_&&H(this.values_||(this.values_={}),t.values_)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var n=this.values_[t];delete this.values_[t],function(t){var e;for(e in t)return!1;return!e}(this.values_)&&(this.values_=null),e||this.notify(t,n)}},e}(dt),vt="opacity",mt="visible",wt="extent",xt="zIndex",Ct="maxResolution",Et="minResolution",bt="maxZoom",Tt="minZoom",Pt="source";function Ot(t,e,n){return Math.min(Math.max(t,e),n)}var Rt="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},St="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function Mt(t,e,n,o,r,i){var s=r-n,a=i-o;if(0!==s||0!==a){var l=((t-n)*s+(e-o)*a)/(s*s+a*a);l>1?(n=r,o=i):l>0&&(n+=s*l,o+=a*l)}return It(t,e,n,o)}function It(t,e,n,o){var r=n-t,i=o-e;return r*r+i*i}function jt(t){return t*Math.PI/180}function Ft(t,e){var n=t%e;return n*e<0?n+e:n}function At(t,e,n){return t+n*(e-t)}var Lt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const zt=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var o=H({},e);return"object"==typeof e.properties&&(delete o.properties,H(o,e.properties)),o.opacity=void 0!==e.opacity?e.opacity:1,_("number"==typeof o.opacity,64),o.visible=void 0===e.visible||e.visible,o.zIndex=e.zIndex,o.maxResolution=void 0!==e.maxResolution?e.maxResolution:1/0,o.minResolution=void 0!==e.minResolution?e.minResolution:0,o.minZoom=void 0!==e.minZoom?e.minZoom:-1/0,o.maxZoom=void 0!==e.maxZoom?e.maxZoom:1/0,n.className_=void 0!==o.className?e.className:"ol-layer",delete o.className,n.setProperties(o),n.state_=null,n}return Lt(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},n=this.getZIndex();return e.opacity=Ot(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==n||e.managed?n:1/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 u()},e.prototype.getLayerStatesArray=function(t){return u()},e.prototype.getExtent=function(){return this.get(wt)},e.prototype.getMaxResolution=function(){return this.get(Ct)},e.prototype.getMinResolution=function(){return this.get(Et)},e.prototype.getMinZoom=function(){return this.get(Tt)},e.prototype.getMaxZoom=function(){return this.get(bt)},e.prototype.getOpacity=function(){return this.get(vt)},e.prototype.getSourceState=function(){return u()},e.prototype.getVisible=function(){return this.get(mt)},e.prototype.getZIndex=function(){return this.get(xt)},e.prototype.setExtent=function(t){this.set(wt,t)},e.prototype.setMaxResolution=function(t){this.set(Ct,t)},e.prototype.setMinResolution=function(t){this.set(Et,t)},e.prototype.setMaxZoom=function(t){this.set(bt,t)},e.prototype.setMinZoom=function(t){this.set(Tt,t)},e.prototype.setOpacity=function(t){_("number"==typeof t,64),this.set(vt,t)},e.prototype.setVisible=function(t){this.set(mt,t)},e.prototype.setZIndex=function(t){this.set(xt,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(gt),Dt="precompose",kt="rendercomplete",Kt="undefined",Gt="ready";var Zt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Nt=function(t){function e(e){var n=this,o=H({},e);delete o.source,(n=t.call(this,o)||this).on,n.once,n.un,n.mapPrecomposeKey_=null,n.mapRenderKey_=null,n.sourceChangeKey_=null,n.renderer_=null,e.render&&(n.render=e.render),e.map&&n.setMap(e.map),n.addChangeListener(Pt,n.handleSourcePropertyChange_);var r=e.source?e.source:null;return n.setSource(r),n}return Zt(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(Pt)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Kt},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(ht(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=ut(t,et,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_?this.renderer_.getFeatures(t):new Promise((function(t){return t([])}))},e.prototype.render=function(t,e){var n=this.getRenderer();if(n.prepareFrame(t))return n.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(ht(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(ht(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=ut(t,Dt,(function(t){var e=t.frameState.layerStatesArray,n=this.getLayerState(!1);_(!e.some((function(t){return t.layer===n.layer})),67),e.push(n)}),this),this.mapRenderKey_=ut(this,et,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Pt,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}(zt);function Xt(t,e){if(!t.visible)return!1;var n=e.resolution;if(n<t.minResolution||n>=t.maxResolution)return!1;var o=e.zoom;return o>t.minZoom&&o<=t.maxZoom}const Ut=Nt,Vt="preload",Wt="useInterimTilesOnError";var qt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const Yt=function(t){function e(e){var n=this,o=e||{},r=H({},o);return delete r.preload,delete r.useInterimTilesOnError,(n=t.call(this,r)||this).on,n.once,n.un,n.setPreload(void 0!==o.preload?o.preload:0),n.setUseInterimTilesOnError(void 0===o.useInterimTilesOnError||o.useInterimTilesOnError),n}return qt(e,t),e.prototype.getPreload=function(){return this.get(Vt)},e.prototype.setPreload=function(t){this.set(Vt,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Wt)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Wt,t)},e}(Ut);var Bt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const Ht=function(t){function e(e){var n=t.call(this)||this;return n.boundHandleImageChange_=n.handleImageChange_.bind(n),n.layer_=e,n.declutterExecutorGroup=null,n}return Bt(e,t),e.prototype.getFeatures=function(t){return u()},e.prototype.prepareFrame=function(t){return u()},e.prototype.renderFrame=function(t,e){return u()},e.prototype.loadedTileCallback=function(t,e,n){t[e]||(t[e]={}),t[e][n.tileCoord.toString()]=n},e.prototype.createLoadedTileFinder=function(t,e,n){return function(o,r){var i=this.loadedTileCallback.bind(this,n,o);return t.forEachLoadedTile(e,o,r,i)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,o,r){},e.prototype.getDataAtPixel=function(t,e,n){return u()},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){2===t.target.getState()&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return 2!=e&&3!=e&&t.addEventListener(et,this.boundHandleImageChange_),0==e&&(t.load(),e=t.getState()),2==e},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Gt&&t.changed()},e}(dt);var Qt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const $t=function(t){function e(e,n,o,r){var i=t.call(this,e)||this;return i.inversePixelTransform=n,i.frameState=o,i.context=r,i}return Qt(e,t),e}(Z);var Jt,te="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",ee=-1!==te.indexOf("firefox"),ne=(-1!==te.indexOf("safari")&&te.indexOf("chrom"),-1!==te.indexOf("webkit")&&-1==te.indexOf("edge")),oe=-1!==te.indexOf("macintosh"),re="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,ie="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,se="undefined"!=typeof Image&&Image.prototype.decode,ae=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(t){}return t}();function le(t,e){var n=e[0],o=e[1];return e[0]=t[0]*n+t[2]*o+t[4],e[1]=t[1]*n+t[3]*o+t[5],e}function ue(t,e,n,o,r,i,s,a){var l=Math.sin(i),u=Math.cos(i);return t[0]=o*u,t[1]=r*l,t[2]=-o*l,t[3]=r*u,t[4]=s*o*u-a*o*l+e,t[5]=s*r*l+a*r*u+n,t}function ce(t,e){var n,o=(n=e)[0]*n[3]-n[1]*n[2];_(0!==o,32);var r=e[0],i=e[1],s=e[2],a=e[3],l=e[4],u=e[5];return t[0]=a/o,t[1]=-i/o,t[2]=-s/o,t[3]=r/o,t[4]=(s*u-a*l)/o,t[5]=-(r*u-i*l)/o,t}function he(t,e,n,o){var r=n&&n.length?n.shift():ie?new OffscreenCanvas(t||300,e||300):document.createElement("canvas");return t&&(r.width=t),e&&(r.height=e),r.getContext("2d",o)}function pe(t,e){var n=e.parentNode;n&&n.replaceChild(t,e)}function fe(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}new Array(6);var de=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),_e=function(t){function e(e){var n=t.call(this,e)||this;return n.container=null,n.renderedResolution,n.tempTransform=[1,0,0,1,0,0],n.pixelTransform=[1,0,0,1,0,0],n.inversePixelTransform=[1,0,0,1,0,0],n.context=null,n.containerReused=!1,n}return de(e,t),e.prototype.useContainer=function(t,e,n){var o,r,i=this.getLayer().getClassName();if(t&&""===t.style.opacity&&t.className===i&&(a=t.firstElementChild)instanceof HTMLCanvasElement&&(r=a.getContext("2d")),!r||0!==r.canvas.width&&r.canvas.style.transform!==e?this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1):(this.container=t,this.context=r,this.containerReused=!0),!this.container){(o=document.createElement("div")).className=i;var s=o.style;s.position="absolute",s.width="100%",s.height="100%";var a=(r=he()).canvas;o.appendChild(a),(s=a.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=o,this.context=r}},e.prototype.clipUnrotated=function(t,e,n){var o=z(n),r=D(n),i=M(n),s=S(n);le(e.coordinateToPixelTransform,o),le(e.coordinateToPixelTransform,r),le(e.coordinateToPixelTransform,i),le(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;le(a,o),le(a,r),le(a,i),le(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(i[0]),Math.round(i[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,n){var o=this.getLayer();if(o.hasListener(t)){var r=new $t(t,this.inversePixelTransform,n,e);o.dispatchEvent(r)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_("prerender",t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_("postrender",t,e)},e.prototype.getRenderTransform=function(t,e,n,o,r,i,s){var a=r/2,l=i/2,u=o/e,c=-u,h=-t[0]+s,p=-t[1];return ue(this.tempTransform,a,l,u,c,-n,h,p)},e.prototype.getDataAtPixel=function(t,e,n){var o,r=le(this.inversePixelTransform,t.slice()),i=this.context,s=this.getLayer().getExtent();if(s&&!v(s,le(e.pixelToCoordinateTransform,t.slice())))return null;try{var a=Math.round(r[0]),l=Math.round(r[1]),u=document.createElement("canvas"),c=u.getContext("2d");u.width=1,u.height=1,c.clearRect(0,0,1,1),c.drawImage(i.canvas,a,l,1,1,0,0,1,1),o=c.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?new Uint8Array:o}return 0===o[3]?null:o},e}(Ht);const ye=_e;var ge=function(){function t(t,e,n,o){this.minX=t,this.maxX=e,this.minY=n,this.maxY=o}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.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 ve(t,e,n,o,r){return void 0!==r?(r.minX=t,r.maxX=e,r.minY=n,r.maxY=o,r):new ge(t,e,n,o)}const me=ge;var we={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},xe={};xe[we.DEGREES]=2*Math.PI*6370997/360,xe[we.FEET]=.3048,xe[we.METERS]=1,xe[we.USFEET]=1200/3937;const Ce=we,Ee=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||xe[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}();var be=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Te=6378137,Pe=Math.PI*Te,Oe=[-Pe,-Pe,Pe,Pe],Re=[-180,-85,180,85],Se=Te*Math.log(Math.tan(Math.PI/2)),Me=function(t){function e(e){return t.call(this,{code:e,units:Ce.METERS,extent:Oe,global:!0,worldExtent:Re,getPointResolution:function(t,e){return t/Rt(e[1]/Te)}})||this}return be(e,t),e}(Ee),Ie=[new Me("EPSG:3857"),new Me("EPSG:102100"),new Me("EPSG:102113"),new Me("EPSG:900913"),new Me("http://www.opengis.net/gml/srs/epsg.xml#3857")];var je=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Fe=[-180,-90,180,90],Ae=6378137*Math.PI/180,Le=function(t){function e(e,n){return t.call(this,{code:e,units:Ce.DEGREES,extent:Fe,axisOrientation:n,global:!0,metersPerUnit:Ae,worldExtent:Fe})||this}return je(e,t),e}(Ee),ze=[new Le("CRS:84"),new Le("EPSG:4326","neu"),new Le("urn:ogc:def:crs:OGC:1.3:CRS84"),new Le("urn:ogc:def:crs:OGC:2:84"),new Le("http://www.opengis.net/gml/srs/epsg.xml#4326","neu")],De={},ke={};function Ke(t,e,n){var o=t.getCode(),r=e.getCode();o in ke||(ke[o]={}),ke[o][r]=n}function Ge(t,e){var n;return t in ke&&e in ke[t]&&(n=ke[t][e]),n}function Ze(t,e,n){var o=n||6371008.8,r=jt(t[1]),i=jt(e[1]),s=(i-r)/2,a=jt(e[0]-t[0])/2,l=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(r)*Math.cos(i);return 2*o*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function Ne(t,e){for(var n=!0,o=t.length-1;o>=0;--o)if(t[o]!=e[o]){n=!1;break}return n}function Xe(t,e){var n=Math.cos(e),o=Math.sin(e),r=t[0]*n-t[1]*o,i=t[1]*n+t[0]*o;return t[0]=r,t[1]=i,t}function Ue(t,e,n){var o=e.getExtent(),r=0;if(e.canWrapX()&&(t[0]<o[0]||t[0]>o[2])){var i=n||k(o);r=Math.floor((t[0]-o[0])/i)}return r}function Ve(t,e,n){var o;if(void 0!==e){for(var r=0,i=t.length;r<i;++r)e[r]=t[r];o=e}else o=t.slice();return o}function We(t,e,n){if(void 0!==e&&t!==e){for(var o=0,r=t.length;o<r;++o)e[o]=t[o];t=e}return t}function qe(t){!function(t,e){De[t]=e}(t.getCode(),t),Ke(t,t,Ve)}function Ye(t){return"string"==typeof t?De[e=t]||De[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function Be(t,e,n,o){var r,i=(t=Ye(t)).getPointResolutionFunc();if(i)r=i(e,n),o&&o!==t.getUnits()&&(a=t.getMetersPerUnit())&&(r=r*a/xe[o]);else{var s=t.getUnits();if(s==Ce.DEGREES&&!o||o==Ce.DEGREES)r=e;else{var a,l=tn(t,Ye("EPSG:4326"));if(l===We&&s!==Ce.DEGREES)r=e*t.getMetersPerUnit();else{var u=[n[0]-e/2,n[1],n[0]+e/2,n[1],n[0],n[1]-e/2,n[0],n[1]+e/2];r=(Ze((u=l(u,u,2)).slice(0,2),u.slice(2,4))+Ze(u.slice(4,6),u.slice(6,8)))/2}void 0!==(a=o?xe[o]:t.getMetersPerUnit())&&(r/=a)}}return r}function He(t){!function(t){t.forEach(qe)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&Ke(e,t,Ve)}))}))}function Qe(t,e){return t?"string"==typeof t?Ye(t):t:Ye(e)}function $e(t){return function(e,n,o){for(var r=e.length,i=void 0!==o?o:2,s=void 0!==n?n:new Array(r),a=0;a<r;a+=i){var l=t([e[a],e[a+1]]);s[a]=l[0],s[a+1]=l[1];for(var u=i-1;u>=2;--u)s[a+u]=e[a+u]}return s}}function Je(t,e){if(t===e)return!0;var n=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||tn(t,e)===Ve)&&n}function tn(t,e){var n=Ge(t.getCode(),e.getCode());return n||(n=We),n}function en(t,e){return tn(Ye(t),Ye(e))}function nn(t,e,n){return en(e,n)(t,void 0,t.length)}var on,rn,sn,an=null;function ln(){return an}function un(t,e){return t}function cn(t,e){return t}function hn(t,e){return t}function pn(t,e,n){return function(o){var r,i,s=o[0],a=o[1];if(t.canWrapX()){var l=t.getExtent(),u=k(l);(i=Ue(o,t,u))&&(s-=i*u),s=Ot(s,l[0],l[2]),a=Ot(a,l[1],l[3]),r=n([s,a])}else r=n(o);return i&&e.canWrapX()&&(r[0]+=i*k(e.getExtent())),r}}He(Ie),He(ze),on=Ie,rn=function(t,e,n){var o=t.length,r=n>1?n:2,i=e;void 0===i&&(i=r>2?t.slice():new Array(o));for(var s=0;s<o;s+=r){i[s]=Pe*t[s]/180;var a=Te*Math.log(Math.tan(Math.PI*(+t[s+1]+90)/360));a>Se?a=Se:a<-Se&&(a=-Se),i[s+1]=a}return i},sn=function(t,e,n){var o=t.length,r=n>1?n:2,i=e;void 0===i&&(i=r>2?t.slice():new Array(o));for(var s=0;s<o;s+=r)i[s]=180*t[s]/Pe,i[s+1]=360*Math.atan(Math.exp(t[s+1]/Te))/Math.PI-90;return i},ze.forEach((function(t){on.forEach((function(e){Ke(t,e,rn),Ke(e,t,sn)}))}));var fn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),dn=function(t){function e(e){var n=t.call(this,e)||this;return n.extentChanged=!0,n.renderedExtent_=null,n.renderedPixelRatio,n.renderedProjection=null,n.renderedRevision,n.renderedTiles=[],n.newTiles_=!1,n.tmpExtent=[1/0,1/0,-1/0,-1/0],n.tmpTileRange_=new me(0,0,0,0),n}return fn(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),n=t.getState(),o=e.getUseInterimTilesOnError();return 2==n||4==n||3==n&&!o},e.prototype.getTile=function(t,e,n,o){var r=o.pixelRatio,i=o.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,n,r,i);return 3==a.getState()&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(2)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.loadedTileCallback=function(e,n,o){return!!this.isDrawableTile(o)&&t.prototype.loadedTileCallback.call(this,e,n,o)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var n=t.layerStatesArray[t.layerIndex],o=t.viewState,r=o.projection,i=o.resolution,s=o.center,a=o.rotation,l=t.pixelRatio,u=this.getLayer(),c=u.getSource(),p=c.getRevision(),f=c.getTileGridForProjection(r),d=f.getZForResolution(i,c.zDirection),_=f.getResolution(d),y=t.extent,g=n.extent&&hn(n.extent);g&&(y=L(y,hn(n.extent)));var v=c.getTilePixelRatio(l),m=Math.round(t.size[0]*v),w=Math.round(t.size[1]*v);if(a){var x=Math.round(Math.sqrt(m*m+w*w));m=x,w=x}var C=_*m/2/v,b=_*w/2/v,T=[s[0]-C,s[1]-b,s[0]+C,s[1]+b],P=f.getTileRangeForExtentAndZ(y,d),O={};O[d]={};var R=this.createLoadedTileFinder(c,r,O),S=this.tmpExtent,M=this.tmpTileRange_;this.newTiles_=!1;for(var I=P.minX;I<=P.maxX;++I)for(var j=P.minY;j<=P.maxY;++j){var F=this.getTile(d,I,j,t);if(this.isDrawableTile(F)){var A=h(this);if(2==F.getState()){O[d][F.tileCoord.toString()]=F;var D=F.inTransition(A);this.newTiles_||!D&&-1!==this.renderedTiles.indexOf(F)||(this.newTiles_=!0)}if(1===F.getAlpha(A,t.time))continue}var k=f.getTileCoordChildTileRange(F.tileCoord,M,S),K=!1;k&&(K=R(d+1,k)),K||f.forEachTileCoordParentTileRange(F.tileCoord,R,M,S)}var G=_/i;ue(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/v,1/v,a,-m/2,-w/2);var Z=function(t){var e="matrix("+t.join(", ")+")";if(ie)return e;var n=Jt||(Jt=document.createElement("div"));return n.style.transform=e,n.style.transform}(this.pixelTransform);this.useContainer(e,Z,n.opacity);var N=this.context,X=N.canvas;ce(this.inversePixelTransform,this.pixelTransform),ue(this.tempTransform,m/2,w/2,G,G,0,-m/2,-w/2),X.width!=m||X.height!=w?(X.width=m,X.height=w):this.containerReused||N.clearRect(0,0,m,w),g&&this.clipUnrotated(N,t,g),H(N,c.getContextOptions()),this.preRender(N,t),this.renderedTiles.length=0;var V,W,q,Y=Object.keys(O).map(Number);Y.sort(U),1!==n.opacity||this.containerReused&&!c.getOpaque(t.viewState.projection)?(V=[],W=[]):Y=Y.reverse();for(var B=Y.length-1;B>=0;--B){var Q=Y[B],$=c.getTilePixelSize(Q,l,r),J=f.getResolution(Q)/_,tt=$[0]*J*G,et=$[1]*J*G,nt=f.getTileCoordForCoordAndZ(z(T),Q),ot=f.getTileCoordExtent(nt),rt=le(this.tempTransform,[v*(ot[0]-T[0])/_,v*(T[3]-ot[3])/_]),it=v*c.getGutterForProjection(r),st=O[Q];for(var at in st){var lt=(F=st[at]).tileCoord,ut=nt[1]-lt[1],ct=Math.round(rt[0]-(ut-1)*tt),ht=nt[2]-lt[2],pt=Math.round(rt[1]-(ht-1)*et),ft=ct-(I=Math.round(rt[0]-ut*tt)),dt=pt-(j=Math.round(rt[1]-ht*et)),_t=d===Q;if(!(D=_t&&1!==F.getAlpha(h(this),t.time)))if(V){N.save(),q=[I,j,I+ft,j,I+ft,j+dt,I,j+dt];for(var yt=0,gt=V.length;yt<gt;++yt)if(d!==Q&&Q<W[yt]){var vt=V[yt];N.beginPath(),N.moveTo(q[0],q[1]),N.lineTo(q[2],q[3]),N.lineTo(q[4],q[5]),N.lineTo(q[6],q[7]),N.moveTo(vt[6],vt[7]),N.lineTo(vt[4],vt[5]),N.lineTo(vt[2],vt[3]),N.lineTo(vt[0],vt[1]),N.clip()}V.push(q),W.push(Q)}else N.clearRect(I,j,ft,dt);this.drawTileImage(F,t,I,j,ft,dt,it,_t,n.opacity),V&&!D?(N.restore(),this.renderedTiles.unshift(F)):this.renderedTiles.push(F),this.updateUsedTiles(t.usedTiles,c,F)}}return this.renderedRevision=p,this.renderedResolution=_,this.extentChanged=!this.renderedExtent_||!E(this.renderedExtent_,T),this.renderedExtent_=T,this.renderedPixelRatio=l,this.renderedProjection=r,this.manageTilePyramid(t,c,f,l,r,y,d,u.getPreload()),this.scheduleExpireCache(t,c),this.postRender(N,t),n.extent&&N.restore(),Z!==X.style.transform&&(X.style.transform=Z),this.container},e.prototype.drawTileImage=function(t,e,n,o,r,i,s,a,l){var u=this.getTileImage(t);if(u){var c=h(this),p=a?t.getAlpha(c,e.time):1,f=l*p,d=f!==this.context.globalAlpha;d&&(this.context.save(),this.context.globalAlpha=f),this.context.drawImage(u,s,s,u.width-2*s,u.height-2*s,n,o,r,i),d&&this.context.restore(),1!==p?e.animate=!0:a&&t.endTransition(c)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var n=function(t,e,n){var o=h(t);o in n.usedTiles&&t.expireCache(n.viewState.projection,n.usedTiles[o])}.bind(null,e);t.postRenderFunctions.push(n)}},e.prototype.updateUsedTiles=function(t,e,n){var o=h(e);o in t||(t[o]={}),t[o][n.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,n,o,r,i,s,a,l){var u=h(e);u in t.wantedTiles||(t.wantedTiles[u]={});var c,p,f,d,_,y,g=t.wantedTiles[u],v=t.tileQueue,m=0;for(y=n.getMinZoom();y<=s;++y)for(p=n.getTileRangeForExtentAndZ(i,y,p),f=n.getResolution(y),d=p.minX;d<=p.maxX;++d)for(_=p.minY;_<=p.maxY;++_)s-y<=a?(++m,0==(c=e.getTile(y,d,_,o,r)).getState()&&(g[c.getKey()]=!0,v.isKeyQueued(c.getKey())||v.enqueue([c,u,n.getTileCoordCenter(c.tileCoord),f])),void 0!==l&&l(c)):e.useTile(y,d,_,r);e.updateCacheSize(m,r)},e}(ye);dn.prototype.getLayer;const _n=dn;var yn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const gn=function(t){function e(e){return t.call(this,e)||this}return yn(e,t),e.prototype.createRenderer=function(){return new _n(this)},e}(Yt);function vn(t){return Math.pow(t,3)}function mn(t){return 1-vn(1-t)}function wn(t){return 3*t*t-2*t*t*t}function xn(t){return t}var Cn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),En=function(t){function e(e,n,o){var r=t.call(this)||this,i=o||{};return r.tileCoord=e,r.state=n,r.interimTile=null,r.key="",r.transition_=void 0===i.transition?250:i.transition,r.transitionStarts_={},r}return Cn(e,t),e.prototype.changed=function(){this.dispatchEvent(et)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(2==t.getState())return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(2==t.getState()){t.interimTile=null;break}1==t.getState()?e=t:0==t.getState()?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(3!==this.state&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){u()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var n=this.transitionStarts_[t];if(n){if(-1===n)return 1}else n=e,this.transitionStarts_[t]=n;var o=e-n+1e3/60;return o>=this.transition_?1:vn(o/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}(tt);const bn=En;var Tn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const Pn=function(t){function e(e,n,o,r){var i=t.call(this)||this;return i.extent=e,i.pixelRatio_=o,i.resolution=n,i.state=r,i}return Tn(e,t),e.prototype.changed=function(){this.dispatchEvent(et)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return u()},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(){u()},e}(tt);var On=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();function Rn(t,e,n){var o=t;if(o.src&&se){var r=o.decode(),i=!0;return r.then((function(){i&&e()})).catch((function(t){i&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():n())})),function(){i=!1}}var s=[ct(o,"load",e),ct(o,"error",n)];return function(){s.forEach(ht)}}!function(t){function e(e,n,o,r,i,s){var a=t.call(this,e,n,o,0)||this;return a.src_=r,a.image_=new Image,null!==i&&(a.image_.crossOrigin=i),a.unlisten_=null,a.state=0,a.imageLoadFunction_=s,a}On(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=3,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=A(this.extent)/this.image_.height),this.state=2,this.unlistenImage_(),this.changed()},e.prototype.load=function(){0!=this.state&&3!=this.state||(this.state=1,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Rn(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=A(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(Pn);var Sn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Mn=function(t){function e(e,n,o,r,i,s){var a=t.call(this,e,n,s)||this;return a.crossOrigin_=r,a.src_=o,a.key=o,a.image_=new Image,null!==r&&(a.image_.crossOrigin=r),a.unlisten_=null,a.tileLoadFunction_=i,a}return Sn(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=2,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=3,this.unlistenImage_(),this.image_=((t=he(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=2:this.state=4,this.unlistenImage_(),this.changed()},e.prototype.load=function(){3==this.state&&(this.state=0,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),0==this.state&&(this.state=1,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Rn(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(bn);const In=Mn;var jn=function(){function t(t,e,n,o,r,i){this.sourceProj_=t,this.targetProj_=e;var s={},a=en(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_=o,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!o&&!!this.sourceProj_.getExtent()&&k(o)==k(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?k(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?k(this.targetProj_.getExtent()):null;var l=z(n),u=D(n),c=M(n),h=S(n),p=this.transformInv_(l),f=this.transformInv_(u),d=this.transformInv_(c),_=this.transformInv_(h),y=10+(i?Math.max(0,Math.ceil(St(R(n)/(i*i*256*256)))):0);if(this.addQuad_(l,u,c,h,p,f,d,_,y),this.wrapsXInSource_){var g=1/0;this.triangles_.forEach((function(t,e,n){g=Math.min(g,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])-g>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]-g>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-g>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-g>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var n=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-n<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}s={}}return t.prototype.addTriangle_=function(t,e,n,o,r,i){this.triangles_.push({source:[o,r,i],target:[t,e,n]})},t.prototype.addQuad_=function(t,e,n,o,r,i,s,a,l){var u=y([r,i,s,a]),c=this.sourceWorldWidth_?k(u)/this.sourceWorldWidth_:null,h=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&c>.5&&c<1,f=!1;if(l>0&&(this.targetProj_.isGlobal()&&this.targetWorldWidth_&&(f=k(y([t,e,n,o]))/this.targetWorldWidth_>.25||f),!p&&this.sourceProj_.isGlobal()&&c&&(f=c>.25||f)),!(!f&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||K(u,this.maxSourceExtent_)){var d=0;if(!(f||isFinite(r[0])&&isFinite(r[1])&&isFinite(i[0])&&isFinite(i[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)f=!0;else if(1!=(d=(isFinite(r[0])&&isFinite(r[1])?0:8)+(isFinite(i[0])&&isFinite(i[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=d&&4!=d&&8!=d)return;if(l>0){if(!f){var _=[(t[0]+n[0])/2,(t[1]+n[1])/2],g=this.transformInv_(_),v=void 0;v=p?(Ft(r[0],h)+Ft(s[0],h))/2-Ft(g[0],h):(r[0]+s[0])/2-g[0];var m=(r[1]+s[1])/2-g[1];f=v*v+m*m>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){var w=[(e[0]+n[0])/2,(e[1]+n[1])/2],x=this.transformInv_(w),C=[(o[0]+t[0])/2,(o[1]+t[1])/2],E=this.transformInv_(C);this.addQuad_(t,e,w,C,r,i,x,E,l-1),this.addQuad_(C,w,n,o,E,x,s,a,l-1)}else{var b=[(t[0]+e[0])/2,(t[1]+e[1])/2],T=this.transformInv_(b),P=[(n[0]+o[0])/2,(n[1]+o[1])/2],O=this.transformInv_(P);this.addQuad_(t,b,P,o,