ol
Version:
OpenLayers mapping library
1 lines • 885 kB
JavaScript
var ol=function(){"use strict";var t="add",e="remove",i="propertychange",n="change",r="error",s="contextmenu",o="click",a="dblclick",l="dragenter",h="dragover",c="drop",u="keydown",d="keypress",g="load",f="touchmove",p="wheel";class _{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function m(t,e,i){let n,r;i=i||y;let s=0,o=t.length,a=!1;for(;s<o;)n=s+(o-s>>1),r=+i(t[n],e),r<0?s=n+1:(o=n,a=!r);return a?s:~s}function y(t,e){return t>e?1:t<e?-1:0}function x(t,e){return t<e?1:t>e?-1:0}function v(t,e,i){if(t[0]<=e)return 0;const n=t.length;if(e<=t[n-1])return n-1;if("function"==typeof i){for(let r=1;r<n;++r){const n=t[r];if(n===e)return r;if(n<e)return i(e,t[r-1],n)>0?r-1:r}return n-1}if(i>0){for(let i=1;i<n;++i)if(t[i]<e)return i-1;return n-1}if(i<0){for(let i=1;i<n;++i)if(t[i]<=e)return i;return n-1}for(let i=1;i<n;++i){if(t[i]==e)return i;if(t[i]<e)return t[i-1]-e<e-t[i]?i-1:i}return n-1}function S(t,e,i){for(;e<i;){const n=t[e];t[e]=t[i],t[i]=n,++e,--i}}function E(t,e){const i=Array.isArray(e)?e:[e],n=i.length;for(let e=0;e<n;e++)t[t.length]=i[e]}function w(t,e){const i=t.length;if(i!==e.length)return!1;for(let n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}function T(t,e,i){const n=e||y;return t.every((function(e,r){if(0===r)return!0;const s=n(t[r-1],e);return!(s>0||i&&0===s)}))}function C(){return!0}function b(){return!1}function R(){}function P(t){let e,i,n;return function(){const r=Array.prototype.slice.call(arguments);return i&&this===n&&w(r,i)||(n=this,i=r,e=t.apply(this,arguments)),e}}function I(t){return function(){let e;try{e=t()}catch(t){return Promise.reject(t)}return e instanceof Promise?e:Promise.resolve(e)}()}function F(t){for(const e in t)delete t[e]}function L(t){let e;for(e in t)return!1;return!e}class M{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}function A(t){t.stopPropagation()}class O extends _{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const i=this.listeners_||(this.listeners_={}),n=i[t]||(i[t]=[]);n.includes(e)||n.push(e)}dispatchEvent(t){const e="string"==typeof t,i=e?t:t.type,n=this.listeners_&&this.listeners_[i];if(!n)return;const r=e?new M(t):t;r.target||(r.target=this.eventTarget_||this);const s=this.dispatching_||(this.dispatching_={}),o=this.pendingRemovals_||(this.pendingRemovals_={});let a;i in s||(s[i]=0,o[i]=0),++s[i];for(let t=0,e=n.length;t<e;++t)if(a="handleEvent"in n[t]?n[t].handleEvent(r):n[t].call(this,r),!1===a||r.propagationStopped){a=!1;break}if(0==--s[i]){let t=o[i];for(delete o[i];t--;)this.removeEventListener(i,R);delete s[i]}return a}disposeInternal(){this.listeners_&&F(this.listeners_)}getListeners(t){return this.listeners_&&this.listeners_[t]||void 0}hasListener(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)}removeEventListener(t,e){if(!this.listeners_)return;const i=this.listeners_[t];if(!i)return;const n=i.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=R,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t]))}}function D(t,e,i,n,r){if(r){const r=i;i=function(s){return t.removeEventListener(e,i),r.call(n??this,s)}}else n&&n!==t&&(i=i.bind(n));const s={target:t,type:e,listener:i};return t.addEventListener(e,i),s}function N(t,e,i,n){return D(t,e,i,n,!0)}function k(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),F(t))}class G extends O{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(n)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const i=t.length,n=new Array(i);for(let r=0;r<i;++r)n[r]=D(this,t[r],e);return n}return D(this,t,e)}onceInternal(t,e){let i;if(Array.isArray(t)){const n=t.length;i=new Array(n);for(let r=0;r<n;++r)i[r]=N(this,t[r],e)}else i=N(this,t,e);return e.ol_key=i,i}unInternal(t,e){const i=e.ol_key;if(i)j(i);else if(Array.isArray(t))for(let i=0,n=t.length;i<n;++i)this.removeEventListener(t[i],e);else this.removeEventListener(t,e)}}function j(t){if(Array.isArray(t))for(let e=0,i=t.length;e<i;++e)k(t[e]);else k(t)}function U(){throw new Error("Unimplemented abstract method.")}G.prototype.on,G.prototype.once,G.prototype.un;let B=0;function z(t){return t.ol_uid||(t.ol_uid=String(++B))}class X extends M{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}}class V extends G{constructor(t){super(),this.on,this.once,this.un,z(this),this.values_=null,void 0!==t&&this.setProperties(t)}get(t){let e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(t,e){let n;n=`change:${t}`,this.hasListener(n)&&this.dispatchEvent(new X(n,t,e)),n=i,this.hasListener(n)&&this.dispatchEvent(new X(n,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,i){const n=this.values_||(this.values_={});if(i)n[t]=e;else{const i=n[t];n[t]=e,i!==e&&this.notify(t,i)}}setProperties(t,e){for(const i in t)this.set(i,t[i],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const i=this.values_[t];delete this.values_[t],L(this.values_)&&(this.values_=null),e||this.notify(t,i)}}}const $="length";class W extends M{constructor(t,e,i){super(t),this.element=e,this.index=i}}class Z extends V{constructor(t,e){if(super(),this.on,this.once,this.un,e=e||{},this.unique_=!!e.unique,this.array_=t??[],this.unique_)for(let t=1,e=this.array_.length;t<e;++t)this.assertUnique_(this.array_[t],t);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(t){for(let e=0,i=t.length;e<i;++e)this.push(t[e]);return this}forEach(t){const e=this.array_;for(let i=0,n=e.length;i<n;++i)t(e[i],i,e)}getArray(){return this.array_}item(t){return this.array_[t]}getLength(){return this.get($)}insertAt(e,i){if(e<0||e>this.getLength())throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(i),this.array_.splice(e,0,i),this.updateLength_(),this.dispatchEvent(new W(t,i,e))}pop(){return this.removeAt(this.getLength()-1)}push(t){const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let i=0,n=e.length;i<n;++i)if(e[i]===t)return this.removeAt(i)}removeAt(t){if(t<0||t>=this.getLength())return;const i=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new W(e,i,t)),i}setAt(i,n){if(i>=this.getLength())return void this.insertAt(i,n);if(i<0)throw new Error("Index out of bounds: "+i);this.unique_&&this.assertUnique_(n,i);const r=this.array_[i];this.array_[i]=n,this.dispatchEvent(new W(e,r,i)),this.dispatchEvent(new W(t,n,i))}updateLength_(){this.set($,this.array_.length)}assertUnique_(t,e){const i=this.array_;for(let n=0,r=i.length;n<r;++n)if(i[n]===t&&n!==e)throw new Error("Duplicate item added to a unique collection")}}var Y=0,H=1,K=2,q=3,J=4;function Q(t){return Math.pow(t,3)}function tt(t){return 1-Q(1-t)}function et(t){return 3*t*t-2*t*t*t}function it(t){return t}class nt extends O{constructor(t,e,i){super(),i=i||{},this.tileCoord=t,this.state=e,this.key="",this.transition_=void 0===i.transition?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(n)}release(){this.setState(J)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==J){if(this.state!==q&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}}load(){U()}getAlpha(t,e){if(!this.transition_)return 1;let i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;const n=e-i+1e3/60;return n>=this.transition_?1:Q(n/this.transition_)}inTransition(t){return!!this.transition_&&-1!==this.transitionStarts_[t]}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}disposeInternal(){this.release(),super.disposeInternal()}}const rt="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",st=rt.includes("safari")&&!rt.includes("chrom"),ot=st&&(rt.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(rt)),at=rt.includes("webkit")&&!rt.includes("edge"),lt=rt.includes("macintosh"),ht="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,ct="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,ut="undefined"!=typeof Image&&Image.prototype.decode,dt="function"==typeof createImageBitmap,gt=function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return t}();function ft(t,e,i,n){let r;return r=i&&i.length?i.shift():ct?new class extends OffscreenCanvas{style={}}(t??300,e??150):document.createElement("canvas"),t&&(r.width=t),e&&(r.height=e),r.getContext("2d",n)}let pt;function _t(){return pt||(pt=ft(1,1)),pt}function mt(t){const e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function yt(t){let e=t.offsetWidth;const i=getComputedStyle(t);return e+=parseInt(i.marginLeft,10)+parseInt(i.marginRight,10),e}function xt(t){let e=t.offsetHeight;const i=getComputedStyle(t);return e+=parseInt(i.marginTop,10)+parseInt(i.marginBottom,10),e}function vt(t,e){const i=e.parentNode;i&&i.replaceChild(t,e)}function St(t){for(;t.lastChild;)t.lastChild.remove()}function Et(t,e){const i=t.childNodes;for(let n=0;;++n){const r=i[n],s=e[n];if(!r&&!s)break;r!==s&&(r?s?t.insertBefore(s,r):(t.removeChild(r),--n):t.appendChild(s))}}function wt(){return new Proxy({childNodes:[],appendChild:function(t){return this.childNodes.push(t),t},remove:function(){},removeChild:function(t){const e=this.childNodes.indexOf(t);if(-1===e)throw new Error("Node to remove was not found");return this.childNodes.splice(e,1),t},insertBefore:function(t,e){const i=this.childNodes.indexOf(e);if(-1===i)throw new Error("Reference node not found");return this.childNodes.splice(i,0,t),t},style:{}},{get:(t,e,i)=>"firstElementChild"===e?t.childNodes.length>0?t.childNodes[0]:null:Reflect.get(t,e,i)})}function Tt(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas}function Ct(t){return t instanceof Image||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageBitmap?t:null}function bt(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t instanceof DataView?t:null}const Rt=new Error("disposed");let Pt=null;function It(t){Pt||(Pt=ft(t.width,t.height,void 0,{willReadFrequently:!0}));const e=Pt.canvas,i=t.width;e.width!==i&&(e.width=i);const n=t.height;return e.height!==n&&(e.height=n),Pt.clearRect(0,0,i,n),Pt.drawImage(t,0,0),Pt.getImageData(0,0,i,n).data}const Ft=[256,256];class Lt extends nt{constructor(t){const e=Y;super(t.tileCoord,e,{transition:t.transition,interpolate:t.interpolate}),this.loader_=t.loader,this.data_=null,this.error_=null,this.size_=t.size||null,this.controller_=t.controller||null}getSize(){if(this.size_)return this.size_;const t=Ct(this.data_);return t?[t.width,t.height]:Ft}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==Y&&this.state!==q)return;this.state=H,this.changed();const t=this;this.loader_().then((function(e){t.data_=e,t.state=K,t.changed()})).catch((function(e){t.error_=e,t.state=q,t.changed()}))}disposeInternal(){this.controller_&&(this.controller_.abort(Rt),this.controller_=null),super.disposeInternal()}}function Mt(t,e){if(!t)throw new Error(e)}class At extends V{constructor(t){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),t)if("function"==typeof t.getSimplifiedGeometry){const e=t;this.setGeometry(e)}else{const e=t;this.setProperties(e)}}clone(){const t=new At(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const i=this.getStyle();return i&&t.setStyle(i),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(k(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=D(t,n,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?Ot(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function Ot(t){if("function"==typeof t)return t;let e;if(Array.isArray(t))e=t;else{Mt("function"==typeof t.getZIndex,"Expected an `ol/style/Style` or an array of `ol/style/Style.js`");e=[t]}return function(){return e}}var Dt=0,Nt=1,kt=2,Gt=4,jt=8,Ut=16;function Bt(t){const e=Ht();for(let i=0,n=t.length;i<n;++i)ne(e,t[i]);return e}function zt(t,e,i){return i?(i[0]=t[0]-e,i[1]=t[1]-e,i[2]=t[2]+e,i[3]=t[3]+e,i):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function Xt(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function Vt(t,e,i){let n,r;return n=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0,r=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0,n*n+r*r}function $t(t,e){return Zt(t,e[0],e[1])}function Wt(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function Zt(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function Yt(t,e){const i=t[0],n=t[1],r=t[2],s=t[3],o=e[0],a=e[1];let l=Dt;return o<i?l|=Ut:o>r&&(l|=Gt),a<n?l|=jt:a>s&&(l|=kt),l===Dt&&(l=Nt),l}function Ht(){return[1/0,1/0,-1/0,-1/0]}function Kt(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 qt(t){return Kt(1/0,1/0,-1/0,-1/0,t)}function Jt(t,e){const i=t[0],n=t[1];return Kt(i,n,i,n,e)}function Qt(t,e,i,n,r){return se(qt(r),t,e,i,n)}function te(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function ee(t,e,i){return Math.abs(t[0]-e[0])<i&&Math.abs(t[2]-e[2])<i&&Math.abs(t[1]-e[1])<i&&Math.abs(t[3]-e[3])<i}function ie(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function ne(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 re(t,e){for(let i=0,n=e.length;i<n;++i)ne(t,e[i]);return t}function se(t,e,i,n,r){for(;i<n;i+=r)ae(t,e[i],e[i+1]);return t}function oe(t,e){for(let i=0,n=e.length;i<n;++i)re(t,e[i]);return t}function ae(t,e,i){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],i)}function le(t,e){let i;return i=e(ce(t)),i||(i=e(ue(t)),i||(i=e(xe(t)),i||(i=e(ye(t)),i||!1)))}function he(t){let e=0;return Ee(t)||(e=ve(t)*_e(t)),e}function ce(t){return[t[0],t[1]]}function ue(t){return[t[2],t[1]]}function de(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function ge(t,e){let i;if("bottom-left"===e)i=ce(t);else if("bottom-right"===e)i=ue(t);else if("top-left"===e)i=ye(t);else{if("top-right"!==e)throw new Error("Invalid corner");i=xe(t)}return i}function fe(t,e,i,n,r){const[s,o,a,l,h,c,u,d]=pe(t,e,i,n);return Kt(Math.min(s,a,h,u),Math.min(o,l,c,d),Math.max(s,a,h,u),Math.max(o,l,c,d),r)}function pe(t,e,i,n){const r=e*n[0]/2,s=e*n[1]/2,o=Math.cos(i),a=Math.sin(i),l=r*o,h=r*a,c=s*o,u=s*a,d=t[0],g=t[1];return[d-l+u,g-h-c,d-l-u,g-h+c,d+l-u,g+h+c,d+l+u,g+h-c,d-l+u,g-h-c]}function _e(t){return t[3]-t[1]}function me(t,e,i){const n=i||[1/0,1/0,-1/0,-1/0];return Se(t,e)?(t[0]>e[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]<e[2]?n[2]=t[2]:n[2]=e[2],t[3]<e[3]?n[3]=t[3]:n[3]=e[3]):qt(n),n}function ye(t){return[t[0],t[3]]}function xe(t){return[t[2],t[3]]}function ve(t){return t[2]-t[0]}function Se(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Ee(t){return t[2]<t[0]||t[3]<t[1]}function we(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}function Te(t,e){const 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}function Ce(t,e,i){let n=!1;const r=Yt(t,e),s=Yt(t,i);if(r===Nt||s===Nt)n=!0;else{const o=t[0],a=t[1],l=t[2],h=t[3],c=e[0],u=e[1],d=i[0],g=i[1],f=(g-u)/(d-c);let p,_;s&kt&&!(r&kt)&&(p=d-(g-h)/f,n=p>=o&&p<=l),n||!(s&Gt)||r&Gt||(_=g-(d-l)*f,n=_>=a&&_<=h),n||!(s&jt)||r&jt||(p=d-(g-a)/f,n=p>=o&&p<=l),n||!(s&Ut)||r&Ut||(_=g-(d-o)*f,n=_>=a&&_<=h)}return n}function be(t,e,i,n){if(Ee(t))return qt(i);let r=[];if(n>1){const e=t[2]-t[0],i=t[3]-t[1];for(let s=0;s<n;++s)r.push(t[0]+e*s/n,t[1],t[2],t[1]+i*s/n,t[2]-e*s/n,t[3],t[0],t[3]-i*s/n)}else r=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(r,r,2);const s=[],o=[];for(let t=0,e=r.length;t<e;t+=2)s.push(r[t]),o.push(r[t+1]);return function(t,e,i){return Kt(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),i)}(s,o,i)}function Re(t,e){const i=e.getExtent(),n=de(t);if(e.canWrapX()&&(n[0]<i[0]||n[0]>=i[2])){const e=ve(i),r=Math.floor((n[0]-i[0])/e)*e;t[0]-=r,t[2]-=r}return t}function Pe(t,e,i){if(e.canWrapX()){const n=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[n[0],t[1],n[2],t[3]]];Re(t,e);const r=ve(n);if(ve(t)>r&&!i)return[[n[0],t[1],n[2],t[3]]];if(t[0]<n[0])return[[t[0]+r,t[1],n[2],t[3]],[n[0],t[1],t[2],t[3]]];if(t[2]>n[2])return[[t[0],t[1],n[2],t[3]],[n[0],t[1],t[2]-r,t[3]]]}return[t]}function Ie(t,e,i){return Math.min(Math.max(t,e),i)}function Fe(t,e,i,n,r,s){const o=r-i,a=s-n;if(0!==o||0!==a){const l=((t-i)*o+(e-n)*a)/(o*o+a*a);l>1?(i=r,n=s):l>0&&(i+=o*l,n+=a*l)}return Le(t,e,i,n)}function Le(t,e,i,n){const r=i-t,s=n-e;return r*r+s*s}function Me(t){const e=t.length;for(let i=0;i<e;i++){let n=i,r=Math.abs(t[i][i]);for(let s=i+1;s<e;s++){const e=Math.abs(t[s][i]);e>r&&(r=e,n=s)}if(0===r)return null;const s=t[n];t[n]=t[i],t[i]=s;for(let n=i+1;n<e;n++){const r=-t[n][i]/t[i][i];for(let s=i;s<e+1;s++)i==s?t[n][s]=0:t[n][s]+=r*t[i][s]}}const i=new Array(e);for(let n=e-1;n>=0;n--){i[n]=t[n][e]/t[n][n];for(let r=n-1;r>=0;r--)t[r][e]-=t[r][n]*i[n]}return i}function Ae(t){return 180*t/Math.PI}function Oe(t){return t*Math.PI/180}function De(t,e){const i=t%e;return i*e<0?i+e:i}function Ne(t,e,i){return t+i*(e-t)}function ke(t,e){const i=Math.pow(10,e);return Math.round(t*i)/i}function Ge(t,e){return Math.round(ke(t,e))}function je(t,e){return Math.floor(ke(t,e))}function Ue(t,e){return Math.ceil(ke(t,e))}function Be(t,e,i){if(t>=e&&t<i)return t;const n=i-e;return((t-e)%n+n)%n+e}const ze=6371008.8;function Xe(t,e,i){i=i||ze;const n=Oe(t[1]),r=Oe(e[1]),s=(r-n)/2,o=Oe(e[0]-t[0])/2,a=Math.sin(s)*Math.sin(s)+Math.sin(o)*Math.sin(o)*Math.cos(n)*Math.cos(r);return 2*i*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function Ve(t,e){let i=0;for(let n=0,r=t.length;n<r-1;++n)i+=Xe(t[n],t[n+1],e);return i}function $e(t,e){let i=0;const n=t.length;let r=t[n-1][0],s=t[n-1][1];for(let e=0;e<n;e++){const n=t[e][0],o=t[e][1];i+=Oe(n-r)*(2+Math.sin(Oe(s))+Math.sin(Oe(o))),r=n,s=o}return i*e*e/2}function We(t,e,i,n){n=n||ze;const r=Oe(t[1]),s=Oe(t[0]),o=e/n,a=Math.asin(Math.sin(r)*Math.cos(o)+Math.cos(r)*Math.sin(o)*Math.cos(i));return[Ae(s+Math.atan2(Math.sin(i)*Math.sin(o)*Math.cos(r),Math.cos(o)-Math.sin(r)*Math.sin(a))),Ae(a)]}const Ze={info:1,warn:2,error:3,none:4};let Ye=Ze.info;function He(...t){Ye>Ze.warn||console.warn(...t)}function Ke(...t){Ye>Ze.error||console.error(...t)}function qe(t,e,i){const n=void 0!==i?t.toFixed(i):""+t;let r=n.indexOf(".");return r=-1===r?n.length:r,r>e?n:new Array(1+e-r).join("0")+n}function Je(t,e){const i=(""+t).split("."),n=(""+e).split(".");for(let t=0;t<Math.max(i.length,n.length);t++){const e=parseInt(i[t]||"0",10),r=parseInt(n[t]||"0",10);if(e>r)return 1;if(r>e)return-1}return 0}function Qe(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function ti(t,e){const i=e.getRadius(),n=e.getCenter(),r=n[0],s=n[1];let o=t[0]-r;const a=t[1]-s;0===o&&0===a&&(o=1);const l=Math.sqrt(o*o+a*a);return[r+i*o/l,s+i*a/l]}function ei(t,e){const i=t[0],n=t[1],r=e[0],s=e[1],o=r[0],a=r[1],l=s[0],h=s[1],c=l-o,u=h-a,d=0===c&&0===u?0:(c*(i-o)+u*(n-a))/(c*c+u*u||0);let g,f;return d<=0?(g=o,f=a):d>=1?(g=l,f=h):(g=o+d*c,f=a+d*u),[g,f]}function ii(t,e,i){const n=De(e+180,360)-180,r=Math.abs(3600*n),s=i||0;let o=Math.floor(r/3600),a=Math.floor((r-3600*o)/60),l=ke(r-3600*o-60*a,s);l>=60&&(l=0,a+=1),a>=60&&(a=0,o+=1);let h=o+"°";return 0===a&&0===l||(h+=" "+qe(a,2)+"′"),0!==l&&(h+=" "+qe(l,2,s)+"″"),0!==n&&(h+=" "+t.charAt(n<0?1:0)),h}function ni(t,e,i){return t?e.replace("{x}",t[0].toFixed(i)).replace("{y}",t[1].toFixed(i)):""}function ri(t,e){let i=!0;for(let n=t.length-1;n>=0;--n)if(t[n]!=e[n]){i=!1;break}return i}function si(t,e){const i=Math.cos(e),n=Math.sin(e),r=t[0]*i-t[1]*n,s=t[1]*i+t[0]*n;return t[0]=r,t[1]=s,t}function oi(t,e){return t[0]*=e,t[1]*=e,t}function ai(t,e){const i=t[0]-e[0],n=t[1]-e[1];return i*i+n*n}function li(t,e){return Math.sqrt(ai(t,e))}function hi(t,e){return ai(t,ei(t,e))}function ci(t,e){return ni(t,"{x}, {y}",e)}function ui(t,e){if(e.canWrapX()){const i=ve(e.getExtent()),n=di(t,e,i);n&&(t[0]-=n*i)}return t}function di(t,e,i){const n=e.getExtent();let r=0;return e.canWrapX()&&(t[0]<n[0]||t[0]>n[2])&&(i=i||ve(n),r=Math.floor((t[0]-n[0])/i)),r}function gi(t,e,i){const n=Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])),r=[(e[0]-t[0])/n,(e[1]-t[1])/n],s=[-r[1],r[0]],o=Math.sqrt((i[0]-t[0])*(i[0]-t[0])+(i[1]-t[1])*(i[1]-t[1])),a=[(i[0]-t[0])/o,(i[1]-t[1])/o];let l=0===n||0===o?0:Math.acos(Ie(a[0]*r[0]+a[1]*r[1],-1,1));l=Math.max(l,1e-5);return a[0]*s[0]+a[1]*s[1]>0?l:2*Math.PI-l}const fi={9001:"m",9002:"ft",9003:"us-ft",9101:"radians",9102:"degrees"};function pi(t){return fi[t]}const _i={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class mi{constructor(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}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||_i[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const yi=6378137,xi=Math.PI*yi,vi=[-xi,-xi,xi,xi],Si=[-180,-85,180,85],Ei=yi*Math.log(Math.tan(Math.PI/2));class wi extends mi{constructor(t){super({code:t,units:"m",extent:vi,global:!0,worldExtent:Si,getPointResolution:function(t,e){return t/Math.cosh(e[1]/yi)}})}}const Ti=[new wi("EPSG:3857"),new wi("EPSG:102100"),new wi("EPSG:102113"),new wi("EPSG:900913"),new wi("http://www.opengis.net/def/crs/EPSG/0/3857"),new wi("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Ci(t,e,i,n){const r=t.length;i=i>1?i:2,n=n??i,void 0===e&&(e=i>2?t.slice():new Array(r));for(let i=0;i<r;i+=n){e[i]=xi*t[i]/180;let n=yi*Math.log(Math.tan(Math.PI*(+t[i+1]+90)/360));n>Ei?n=Ei:n<-Ei&&(n=-Ei),e[i+1]=n}return e}function bi(t,e,i,n){const r=t.length;i=i>1?i:2,n=n??i,void 0===e&&(e=i>2?t.slice():new Array(r));for(let i=0;i<r;i+=n)e[i]=180*t[i]/xi,e[i+1]=360*Math.atan(Math.exp(t[i+1]/yi))/Math.PI-90;return e}const Ri=6378137,Pi=[-180,-90,180,90],Ii=Math.PI*Ri/180;class Fi extends mi{constructor(t,e){super({code:t,units:"degrees",extent:Pi,axisOrientation:e,global:!0,metersPerUnit:Ii,worldExtent:Pi})}}const Li=[new Fi("CRS:84"),new Fi("EPSG:4326","neu"),new Fi("urn:ogc:def:crs:OGC:1.3:CRS84"),new Fi("urn:ogc:def:crs:OGC:2:84"),new Fi("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Fi("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Fi("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let Mi={};function Ai(){Mi={}}function Oi(t){return Mi[t]||Mi[t.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Di(t,e){Mi[t]=e}let Ni={};function ki(){Ni={}}function Gi(t,e,i){const n=t.getCode(),r=e.getCode();n in Ni||(Ni[n]={}),Ni[n][r]=i}function ji(t,e){return t in Ni&&e in Ni[t]?Ni[t][e]:null}const Ui=.9996,Bi=.00669438,zi=Bi*Bi,Xi=zi*Bi,Vi=Bi/(1-Bi),$i=Math.sqrt(1-Bi),Wi=(1-$i)/(1+$i),Zi=Wi*Wi,Yi=Zi*Wi,Hi=Yi*Wi,Ki=Hi*Wi,qi=.9983242984503243,Ji=15*zi/256+45*Xi/1024,Qi=35*Xi/3072,tn=1.5*Wi-27/32*Yi+269/512*Ki,en=21/16*Zi-55/32*Hi,nn=151/96*Yi-417/128*Ki,rn=1097/512*Hi,sn=6378137;function on(t,e,i){const n=t-5e5,r=(i.north?e:e-1e7)/Ui/(sn*qi),s=r+tn*Math.sin(2*r)+en*Math.sin(4*r)+nn*Math.sin(6*r)+rn*Math.sin(8*r),o=Math.sin(s),a=o*o,l=Math.cos(s),h=o/l,c=h*h,u=c*c,d=1-Bi*a,g=Math.sqrt(1-Bi*a),f=Vi*l**2,p=f*f,_=n/(sn/g*Ui),m=_*_,y=m*_,x=y*_,v=x*_,S=s-h/((1-Bi)/d)*(m/2-x/24*(5+3*c+10*f-4*p-9*Vi))+v*_/720*(61+90*c+298*f+45*u-252*Vi-3*p);let E=(_-y/6*(1+2*c+f)+v/120*(5-2*f+28*c-3*p+8*Vi+24*u))/l;return E=Be(E+Oe(ln(i.number)),-Math.PI,Math.PI),[Ae(E),Ae(S)]}function an(t,e,i){t=Be(t,-180,180),e<-80?e=-80:e>84&&(e=84);const n=Oe(e),r=Math.sin(n),s=Math.cos(n),o=r/s,a=o*o,l=a*a,h=Oe(t),c=Oe(ln(i.number)),u=sn/Math.sqrt(1-Bi*r**2),d=Vi*s**2,g=s*Be(h-c,-Math.PI,Math.PI),f=g*g,p=f*g,_=p*g,m=_*g,y=m*g,x=sn*(qi*n-.002514607064228144*Math.sin(2*n)+Ji*Math.sin(4*n)-Qi*Math.sin(6*n)),v=Ui*u*(g+p/6*(1-a+d)+m/120*(5-18*a+l+72*d-58*Vi))+5e5;let S=Ui*(x+u*o*(f/2+_/24*(5-a+9*d+4*d**2)+y/720*(61-58*a+l+600*d-330*Vi)));return i.north||(S+=1e7),[v,S]}function ln(t){return 6*(t-1)-180+3}const hn=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function cn(t){let e=0;for(const i of hn){const n=t.match(i);if(n){e=parseInt(n[1]);break}}if(!e)return null;let i=0,n=!1;return e>32700&&e<32761?i=e-32700:e>32600&&e<32661&&(n=!0,i=e-32600),i?{number:i,north:n}:null}function un(t,e){return function(i,n,r,s){const o=i.length;r=r>1?r:2,s=s??r,n||(n=r>2?i.slice():new Array(o));for(let r=0;r<o;r+=s){const s=i[r],o=i[r+1],a=t(s,o,e);n[r]=a[0],n[r+1]=a[1]}return n}}function dn(t){return cn(t)?new mi({code:t,units:"m"}):null}function gn(t){const e=cn(t.getCode());return e?{forward:un(an,e),inverse:un(on,e)}:null}const fn=[gn],pn=[dn];let _n=!0;function mn(t){_n=!(void 0===t||t)}function yn(t,e){if(void 0!==e)for(let i=0,n=t.length;i<n;++i)e[i]=t[i];else e=t.slice();return e}function xn(t,e){if(void 0!==e&&t!==e){for(let i=0,n=t.length;i<n;++i)e[i]=t[i];t=e}return t}function vn(t){Di(t.getCode(),t),Gi(t,t,yn)}function Sn(t){t.forEach(vn)}function En(t){if("string"!=typeof t)return t;const e=Oi(t);if(e)return e;for(const e of pn){const i=e(t);if(i)return i}return null}function wn(t,e,i,n){let r;const s=(t=En(t)).getPointResolutionFunc();if(s){if(r=s(e,i),n&&n!==t.getUnits()){const e=t.getMetersPerUnit();e&&(r=r*e/_i[n])}}else{const s=t.getUnits();if("degrees"==s&&!n||"degrees"==n)r=e;else{const o=Ln(t,En("EPSG:4326"));if(o||"degrees"===s){let t=[i[0]-e/2,i[1],i[0]+e/2,i[1],i[0],i[1]-e/2,i[0],i[1]+e/2];t=o(t,t,2);r=(Xe(t.slice(0,2),t.slice(2,4))+Xe(t.slice(4,6),t.slice(6,8)))/2}else r=e*t.getMetersPerUnit();const a=n?_i[n]:t.getMetersPerUnit();void 0!==a&&(r/=a)}}return r}function Tn(t){Sn(t),t.forEach((function(e){t.forEach((function(t){e!==t&&Gi(e,t,yn)}))}))}function Cn(t,e,i,n){t.forEach((function(t){e.forEach((function(e){Gi(t,e,i),Gi(e,t,n)}))}))}function bn(t,e){return t?"string"==typeof t?En(t):t:En(e)}function Rn(t){return function(e,i,n,r){const s=e.length;n=void 0!==n?n:2,r=r??n,i=void 0!==i?i:new Array(s);for(let o=0;o<s;o+=r){const s=t(e.slice(o,o+n)),a=s.length;for(let t=0,n=r;t<n;++t)i[o+t]=t>=a?e[o+t]:s[t]}return i}}function Pn(t,e,i,n){const r=En(t),s=En(e);Gi(r,s,Rn(i)),Gi(s,r,Rn(n))}function In(t,e){const i=On(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),n=i[0];return(n<-180||n>180)&&(i[0]=De(n+180,360)-180),i}function Fn(t,e){if(t===e)return!0;const i=t.getUnits()===e.getUnits();if(t.getCode()===e.getCode())return i;return Ln(t,e)===yn&&i}function Ln(t,e){const i=t.getCode(),n=e.getCode();let r=ji(i,n);if(r)return r;let s=null,o=null;for(const i of fn)s||(s=i(t)),o||(o=i(e));if(!s&&!o)return null;const a="EPSG:4326";if(o)if(s)r=Mn(s.inverse,o.forward);else{const t=ji(i,a);t&&(r=Mn(t,o.forward))}else{const t=ji(a,n);t&&(r=Mn(s.inverse,t))}return r&&(vn(t),vn(e),Gi(t,e,r)),r}function Mn(t,e){return function(i,n,r,s){return n=t(i,n,r,s),e(n,n,r,s)}}function An(t,e){return Ln(En(t),En(e))}function On(t,e,i){const n=An(e,i);if(!n){const t=En(e).getCode(),n=En(i).getCode();throw new Error(`No transform available between ${t} and ${n}`)}return n(t,void 0,t.length)}function Dn(t,e,i,n){return be(t,An(e,i),void 0,n)}let Nn=null;function kn(t){Nn=En(t)}function Gn(){return Nn}function jn(t,e){return Nn?On(t,e,Nn):t}function Un(t,e){return Nn?On(t,Nn,e):(_n&&!ri(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(_n=!1,He("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t)}function Bn(t,e){return Nn?Dn(t,e,Nn):t}function zn(t,e){return Nn?Dn(t,Nn,e):t}function Xn(t,e){if(!Nn)return t;const i=En(e).getMetersPerUnit(),n=Nn.getMetersPerUnit();return i&&n?t*i/n:t}function Vn(t,e){if(!Nn)return t;const i=En(e).getMetersPerUnit(),n=Nn.getMetersPerUnit();return i&&n?t*n/i:t}function $n(t,e,i){return function(n){let r,s;if(t.canWrapX()){const e=t.getExtent(),o=ve(e);s=di(n=n.slice(0),t,o),s&&(n[0]=n[0]-s*o),n[0]=Ie(n[0],e[0],e[2]),n[1]=Ie(n[1],e[1],e[3]),r=i(n)}else r=i(n);return s&&e.canWrapX()&&(r[0]+=s*ve(e.getExtent())),r}}function Wn(){Tn(Ti),Tn(Li),Cn(Li,Ti,Ci,bi)}Wn();const Zn=new Array(6);function Yn(){return[1,0,0,1,0,0]}function Hn(t){return qn(t,1,0,0,1,0,0)}function Kn(t,e){const i=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=e[0],h=e[1],c=e[2],u=e[3],d=e[4],g=e[5];return t[0]=i*l+r*h,t[1]=n*l+s*h,t[2]=i*c+r*u,t[3]=n*c+s*u,t[4]=i*d+r*g+o,t[5]=n*d+s*g+a,t}function qn(t,e,i,n,r,s,o){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t[4]=s,t[5]=o,t}function Jn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Qn(t,e){const 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 tr(t,e){const i=Math.cos(e),n=Math.sin(e);return Kn(t,qn(Zn,i,n,-n,i,0,0))}function er(t,e,i){return Kn(t,qn(Zn,e,0,0,i,0,0))}function ir(t,e,i){return Kn(t,qn(Zn,1,0,0,1,e,i))}function nr(t,e,i,n,r,s,o,a){const l=Math.sin(s),h=Math.cos(s);return t[0]=n*h,t[1]=r*l,t[2]=-n*l,t[3]=r*h,t[4]=o*n*h-a*n*l+e,t[5]=o*r*l+a*r*h+i,t}function rr(t,e){const i=sr(e);Mt(0!==i,"Transformation matrix cannot be inverted");const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5];return t[0]=o/i,t[1]=-r/i,t[2]=-s/i,t[3]=n/i,t[4]=(s*l-o*a)/i,t[5]=-(n*l-r*a)/i,t}function sr(t){return t[0]*t[3]-t[1]*t[2]}const or=[1e5,1e5,1e5,1e5,2,2];function ar(t){return"matrix("+t.join(", ")+")"}function lr(t){return t.substring(7,t.length-1).split(",").map(parseFloat)}function hr(t,e){const i=lr(t),n=lr(e);for(let t=0;t<6;++t)if(0!==Math.round((i[t]-n[t])*or[t]))return!1;return!0}function cr(t,e,i,n,r,s,o){s=s||[],o=o||2;let a=0;for(let l=e;l<i;l+=n){const e=t[l],i=t[l+1];s[a++]=r[0]*e+r[2]*i+r[4],s[a++]=r[1]*e+r[3]*i+r[5];for(let e=2;e<o;e++)s[a++]=t[l+e]}return s&&s.length!=a&&(s.length=a),s}function ur(t,e,i,n,r,s,o){o=o||[];const a=Math.cos(r),l=Math.sin(r),h=s[0],c=s[1];let u=0;for(let r=e;r<i;r+=n){const e=t[r]-h,i=t[r+1]-c;o[u++]=h+e*a-i*l,o[u++]=c+e*l+i*a;for(let e=r+2;e<r+n;++e)o[u++]=t[e]}return o&&o.length!=u&&(o.length=u),o}function dr(t,e,i,n,r,s,o,a){a=a||[];const l=o[0],h=o[1];let c=0;for(let o=e;o<i;o+=n){const e=t[o]-l,i=t[o+1]-h;a[c++]=l+r*e,a[c++]=h+s*i;for(let e=o+2;e<o+n;++e)a[c++]=t[e]}return a&&a.length!=c&&(a.length=c),a}function gr(t,e,i,n,r,s,o){o=o||[];let a=0;for(let l=e;l<i;l+=n){o[a++]=t[l]+r,o[a++]=t[l+1]+s;for(let e=l+2;e<l+n;++e)o[a++]=t[e]}return o&&o.length!=a&&(o.length=a),o}const fr=[1,0,0,1,0,0],pr=[NaN,NaN];class _r extends V{constructor(){super(),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=P(((t,e,i)=>{if(!i)return this.getSimplifiedGeometry(e);const n=this.clone();return n.applyTransform(i),n.getSimplifiedGeometry(e)}))}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return U()}closestPointXY(t,e,i,n){return U()}containsXY(t,e){return 0===this.closestPointXY(t,e,pr,Number.MIN_VALUE)}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return U()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&qt(t),this.extentRevision_=this.getRevision()}return we(this.extent_,t)}rotate(t,e){U()}scale(t,e,i){U()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return U()}getType(){return U()}applyTransform(t){U()}intersectsExtent(t){return U()}translate(t,e){U()}transform(t,e){const i=En(t),n="tile-pixels"==i.getUnits()?function(t,n,r){const s=i.getExtent(),o=i.getWorldExtent(),a=_e(o)/_e(s);nr(fr,o[0],o[3],a,-a,0,0,0);const l=cr(t,0,t.length,r,fr,n),h=An(i,e);return h?h(l,l,r):l}:An(i,e);return this.applyTransform(n),this}}class mr extends _r{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return Qt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return U()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getSimplifiedGeometryInternal(t){return this}getStride(){return this.stride}setFlatCoordinates(t,e){this.stride=xr(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){U()}setLayout(t,e,i){let n;if(t)n=xr(t);else{for(let t=0;t<i;++t){if(0===e.length)return this.layout="XY",void(this.stride=2);e=e[0]}n=e.length,t=yr(n)}this.layout=t,this.stride=n}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(t,e){const i=this.getFlatCoordinates();if(i){const n=this.getStride();ur(i,0,i.length,n,t,e,i),this.changed()}}scale(t,e,i){void 0===e&&(e=t),i||(i=de(this.getExtent()));const n=this.getFlatCoordinates();if(n){const r=this.getStride();dr(n,0,n.length,r,t,e,i,n),this.changed()}}translate(t,e){const i=this.getFlatCoordinates();if(i){const n=this.getStride();gr(i,0,i.length,n,t,e,i),this.changed()}}}function yr(t){let e;return 2==t?e="XY":3==t?e="XYZ":4==t&&(e="XYZM"),e}function xr(t){let e;return"XY"==t?e=2:"XYZ"==t||"XYM"==t?e=3:"XYZM"==t&&(e=4),e}function vr(t,e,i){const n=t.getFlatCoordinates();if(!n)return null;const r=t.getStride();return cr(n,0,n.length,r,e,i)}function Sr(t,e,i,n){let r=0;const s=t[i-n],o=t[i-n+1];let a=0,l=0;for(;e<i;e+=n){const i=t[e]-s,n=t[e+1]-o;r+=l*i-a*n,a=i,l=n}return r/2}function Er(t,e,i,n){let r=0;for(let s=0,o=i.length;s<o;++s){const o=i[s];r+=Sr(t,e,o,n),e=o}return r}function wr(t,e,i,n){let r=0;for(let s=0,o=i.length;s<o;++s){const o=i[s];r+=Er(t,e,o,n),e=o[o.length-1]}return r}function Tr(t,e,i,n,r,s,o){const a=t[e],l=t[e+1],h=t[i]-a,c=t[i+1]-l;let u;if(0===h&&0===c)u=e;else{const d=((r-a)*h+(s-l)*c)/(h*h+c*c);if(d>1)u=i;else{if(d>0){for(let r=0;r<n;++r)o[r]=Ne(t[e+r],t[i+r],d);return void(o.length=n)}u=e}}for(let e=0;e<n;++e)o[e]=t[u+e];o.length=n}function Cr(t,e,i,n,r){let s=t[e],o=t[e+1];for(e+=n;e<i;e+=n){const i=t[e],n=t[e+1],a=Le(s,o,i,n);a>r&&(r=a),s=i,o=n}return r}function br(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){const o=i[s];r=Cr(t,e,o,n,r),e=o}return r}function Rr(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){const o=i[s];r=br(t,e,o,n,r),e=o[o.length-1]}return r}function Pr(t,e,i,n,r,s,o,a,l,h,c){if(e==i)return h;let u,d;if(0===r){if(d=Le(o,a,t[e],t[e+1]),d<h){for(u=0;u<n;++u)l[u]=t[e+u];return l.length=n,d}return h}c=c||[NaN,NaN];let g=e+n;for(;g<i;)if(Tr(t,g-n,g,n,o,a,c),d=Le(o,a,c[0],c[1]),d<h){for(h=d,u=0;u<n;++u)l[u]=c[u];l.length=n,g+=n}else g+=n*Math.max((Math.sqrt(d)-Math.sqrt(h))/r|0,1);if(s&&(Tr(t,i-n,e,n,o,a,c),d=Le(o,a,c[0],c[1]),d<h)){for(h=d,u=0;u<n;++u)l[u]=c[u];l.length=n}return h}function Ir(t,e,i,n,r,s,o,a,l,h,c){c=c||[NaN,NaN];for(let u=0,d=i.length;u<d;++u){const d=i[u];h=Pr(t,e,d,n,r,s,o,a,l,h,c),e=d}return h}function Fr(t,e,i,n,r,s,o,a,l,h,c){c=c||[NaN,NaN];for(let u=0,d=i.length;u<d;++u){const d=i[u];h=Ir(t,e,d,n,r,s,o,a,l,h,c),e=d[d.length-1]}return h}function Lr(t,e,i,n){for(let n=0,r=i.length;n<r;++n)t[e++]=i[n];return e}function Mr(t,e,i,n){for(let r=0,s=i.length;r<s;++r){const s=i[r];for(let i=0;i<n;++i)t[e++]=s[i]}return e}function Ar(t,e,i,n,r){r=r||[];let s=0;for(let o=0,a=i.length;o<a;++o){const a=Mr(t,e,i[o],n);r[s++]=a,e=a}return r.length=s,r}function Or(t,e,i,n,r){r=r||[];let s=0;for(let o=0,a=i.length;o<a;++o){const a=Ar(t,e,i[o],n,r[s]);0===a.length&&(a[0]=e),r[s++]=a,e=a[a.length-1]}return r.length=s,r}function Dr(t,e,i,n,r){r=void 0!==r?r:[];let s=0;for(let o=e;o<i;o+=n)r[s++]=t.slice(o,o+n);return r.length=s,r}function Nr(t,e,i,n,r){r=void 0!==r?r:[];let s=0;for(let o=0,a=i.length;o<a;++o){const a=i[o];r[s++]=Dr(t,e,a,n,r[s]),e=a}return r.length=s,r}function kr(t,e,i,n,r){r=void 0!==r?r:[];let s=0;for(let o=0,a=i.length;o<a;++o){const a=i[o];r[s++]=1===a.length&&a[0]===e?[]:Nr(t,e,a,n,r[s]),e=a[a.length-1]}return r.length=s,r}function Gr(t,e,i,n,r,s,o){const a=(i-e)/n;if(a<3){for(;e<i;e+=n)s[o++]=t[e],s[o++]=t[e+1];return o}const l=new Array(a);l[0]=1,l[a-1]=1;const h=[e,i-n];let c=0;for(;h.length>0;){const i=h.pop(),s=h.pop();let o=0;const a=t[s],u=t[s+1],d=t[i],g=t[i+1];for(let e=s+n;e<i;e+=n){const i=Fe(t[e],t[e+1],a,u,d,g);i>o&&(c=e,o=i)}o>r&&(l[(c-e)/n]=1,s+n<c&&h.push(s,c),c+n<i&&h.push(c,i))}for(let i=0;i<a;++i)l[i]&&(s[o++]=t[e+i*n],s[o++]=t[e+i*n+1]);return o}function jr(t,e,i,n,r,s,o,a){for(let l=0,h=i.length;l<h;++l){const h=i[l];o=Gr(t,e,h,n,r,s,o),a.push(o),e=h}return o}function Ur(t,e,i,n,r,s,o){if(i<=e+n){for(;e<i;e+=n)s[o++]=t[e],s[o++]=t[e+1];return o}let a=t[e],l=t[e+1];s[o++]=a,s[o++]=l;let h=a,c=l;for(e+=n;e<i;e+=n)h=t[e],c=t[e+1],Le(a,l,h,c)>r&&(s[o++]=h,s[o++]=c,a=h,l=c);return h==a&&c==l||(s[o++]=h,s[o++]=c),o}function Br(t,e){return e*Math.round(t/e)}function zr(t,e,i,n,r,s,o){if(e==i)return o;let a,l,h=Br(t[e],r),c=Br(t[e+1],r);e+=n,s[o++]=h,s[o++]=c;do{if(a=Br(t[e],r),l=Br(t[e+1],r),(e+=n)==i)return s[o++]=a,s[o++]=l,o}while(a==h&&l==c);for(;e<i;){const i=Br(t[e],r),u=Br(t[e+1],r);if(e+=n,i==a&&u==l)continue;const d=a-h,g=l-c,f=i-h,p=u-c;d*p==g*f&&(d<0&&f<d||d==f||d>0&&f>d)&&(g<0&&p<g||g==p||g>0&&p>g)?(a=i,l=u):(s[o++]=a,s[o++]=l,h=a,c=l,a=i,l=u)}return s[o++]=a,s[o++]=l,o}function Xr(t,e,i,n,r,s,o,a){for(let l=0,h=i.length;l<h;++l){const h=i[l];o=zr(t,e,h,n,r,s,o),a.push(o),e=h}return o}function Vr(t,e,i,n,r,s,o,a){for(let l=0,h=i.length;l<h;++l){const h=i[l],c=[];o=Xr(t,e,h,n,r,s,o,c),a.push(c),e=h[h.length-1]}return o}class $r extends mr{constructor(t,e){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===e||Array.isArray(t[0])?this.setCoordinates(t,e):this.setFlatCoordinates(e,t)}clone(){return new $r(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,i,n){return n<Vt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Cr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Pr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,n))}getArea(){return Sr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Dr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=Gr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new $r(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Mr(this.flatCoordinates,0,t,this.stride),this.changed()}}class Wr extends mr{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new Wr(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){const r=this.flatCoordinates,s=Le(t,e,r[0],r[1]);if(s<n){const t=this.stride;for(let e=0;e<t;++e)i[e]=r[e];return i.length=t,s}return n}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(t){return Jt(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return Zt(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Lr(this.flatCoordinates,0,t,this.stride),this.changed()}}function Zr(t,e,i,n,r){return!le(r,(function(r){return!Yr(t,e,i,n,r[0],r[1])}))}function Yr(t,e,i,n,r,s){let o=0,a=t[i-n],l=t[i-n+1];for(;e<i;e+=n){const i=t[e],n=t[e+1];l<=s?n>s&&(i-a)*(s-l)-(r-a)*(n-l)>0&&o++:n<=s&&(i-a)*(s-l)-(r-a)*(n-l)<0&&o--,a=i,l=n}return 0!==o}function Hr(t,e,i,n,r,s){if(0===i.length)return!1;if(!Yr(t,e,i[0],n,r,s))return!1;for(let e=1,o=i.length;e<o;++e)if(Yr(t,i[e-1],i[e],n,r,s))return!1;return!0}function Kr(t,e,i,n,r,s){if(0===i.length)return!1;for(let o=0,a=i.length;o<a;++o){const a=i[o];if(Hr(t,e,a,n,r,s))return!0;e=a[a.length-1]}return!1}function qr(t,e,i,n,r,s,o){let a,l,h,c,u,d,g;const f=r[s+1],p=[];for(let r=0,s=i.length;r<s;++r){const s=i[r];for(c=t[s-n],d=t[s-n+1],a=e;a<s;a+=n)u=t[a],g=t[a+1],(f<=d&&g<=f||d<=f&&f<=g)&&(h=(f-d)/(g-d)*(u-c)+c,p.push(h)),c=u,d=g}let _=NaN,m=-1/0;for(p.sort(y),c=p[0],a=1,l=p.length;a<l;++a){u=p[a];const r=Math.abs(u-c);r>m&&(h=(c+u)/2,Hr(t,e,i,n,h,f)&&(_=h,m=r)),c=u}return isNaN(_)&&(_=r[s]),o?(o.push(_,f,m),o):[_,f,m]}function Jr(t,e,i,n,r){let s=[];for(let o=0,a=i.length;o<a;++o){const a=i[o];s=qr(t,e,a,n,r,2*o,s),e=a[a.length-1]}return s}function Qr(t,e,i,n,r){let s;for(e+=n;e<i;e+=n)if(s=r(t.slice(e-n,e),t.slice(e,e+n)),s)return s;return!1}function ts(t,e){const[i,n]=t,[r,s]=e,o=((i[0]-r[0])*(r[1]-s[1])-(i[1]-r[1])*(r[0]-s[0]))/((i[0]-n[0])*(r[1]-s[1])-(i[1]-n[1])*(r[0]-s[0])),a=((i[0]-r[0])*(i[1]-n[1])-(i[1]-r[1])*(i[0]-n[0]))/((i[0]-n[0])*(r[1]-s[1])-(i[1]-n[1])*(r[0]-s[0]));if(0<=o&&o<=1&&0<=a&&a<=1)return[i[0]+o*(n[0]-i[0]),i[1]+o*(n[1]-i[1])]}function es(t,e,i,n,r,s){return s=s??se([1/0,1/0,-1/0,-1/0],t,e,i,n),!!Se(r,s)&&(s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3]||Qr(t,e,i,n,(function(t,e){return Ce(r,t,e)})))}function is(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){if(es(t,e,i[s],n,r))return!0;e=i[s]}return!1}function ns(t,e,i,n,r){return!!es(t,e,i,n,r)||(!!Yr(t,e,i,n,r[0],r[1])||(!!Yr(t,e,i,n,r[0],r[3])||(!!Yr(t,e,i,n,r[2],r[1])||!!Yr(t,e,i,n,r[2],r[3]))))}function rs(t,e,i,n,r){if(!ns(t,e,i[0],n,r))return!1;if(1===i.length)return!0;for(let e=1,s=i.length;e<s;++e)if(Zr(t,i[e-1],i[e],n,r)&&!es(t,i[e-1],i[e],n,r))return!1;return!0}function ss(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){const o=i[s];if(rs(t,e,o,n,r))return!0;e=o[o.length-1]}return!1}function os(t,e,i,n){for(;e<i-n;){for(let r=0;r<n;++r){const s=t[e+r];t[e+r]=t[i-n+r],t[i-n+r]=s}e+=n,i-=n}}function as(t,e,i,n){let r=0,s=t[i-n],o=t[i-n+1];for(;e<i;e+=n){const i=t[e],n=t[e+1];r+=(i-s)*(n+o),s=i,o=n}return 0===r?void 0:r>0}function ls(t,e,i,n,r){r=void 0!==r&&r;for(let s=0,o=i.length;s<o;++s){const o=i[s],a=as(t,e,o,n);if(0===s){if(r&&a||!r&&!a)return!1}else if(r&&!a||!r&&a)return!1;e=o}return!0}function hs(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){const o=i[s];if(!ls(t,e,o,n,r))return!1;o.length&&(e=o[o.length-1])}return!0}function cs(t,e,i,n,r){r=void 0!==r&&r;for(let s=0,o=i.length;s<o;++s){const o=i[s],a=as(t,e,o,n);(0===s?r&&a||!r&&!a:r&&!a||!r&&a)&&os(t,e,o,n),e=o}return e}function us(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s)e=cs(t,e,i[s],n,r);return e}function ds(t,e){const i=[];let n,r=0,s=0;for(let o=0,a=e.length;o<a;++o){const a=e[o],l=as(t,r,a,2);if(void 0===n&&(n=l),l===n)i.push(e.slice(s,o+1));else{if(0===i.length)continue;i[i.length-1].push(e[s])}s=o+1,r=a}return i}class gs extends mr{constructor(t,e,i){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,void 0!==e&&i?(this.setFlatCoordinates(e,t),this.ends_=i):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?E(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new gs(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<Vt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(br(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ir(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,n))}containsXY(t,e){return Hr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return Er(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),cs(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,Nr(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=de(this.getExtent());this.flatInteriorPoint_=qr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Wr(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new $r(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,e=this.flatCoordinates,i=this.ends_,n=[];let r=0;for(let s=0,o=i.length;s<o;++s){const o=i[s],a=new $r(e.slice(r,o),t);n.push(a),r=o}return n}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;ls(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=cs(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=Xr(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,i),new gs(e,"XY",i)}getType(){return"Polygon"}intersectsExtent(t){return rs(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Ar(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()}}function fs(t,e,i,n){i=i||32;const r=[];for(let s=0;s<i;++s)E(r,We(t,e,2*Math.PI*s/i,n));return r.push(r[0],r[1]),new gs(r,"XY",[r.length])}function ps(t){if(Ee(t))throw new Error("Cannot create polygon from empty extent");const e=t[0],i=t[1],n=t[2],r=t[3],s=[e,i,e,r,n,r,n,i,e,i];return new gs(s,"XY",[s.length])}function _s(t,e,i){e=e||32;const n=t.getStride(),r=t.getLayout(),s=t.getCenter(),o=n*(e+1),a=new Array(o);for(let t=0;t<o;t+=n){a[t]=0,a[t+1]=0;for(let e=2;e<n;e++)a[t+e]=s[e]}const l=[a.length],h=new gs(a,r,l);return ms(h,s,t.getRadius(),i),h}function ms(t,e,i,n){const r=t.getFlatCoordinates(),s=t.getStride(),o=r.length/s-1,a=n||0;for(let t=0;t<=o;++t){const n=t*s,l=a+2*De(t,o)*Math.PI/o;r[n]=e[0]+i*Math.cos(l),r[n+1]=e[1]+i*Math.sin(l)}t.changed()}const ys="accuracy",xs="accuracyGeometry",vs="altitude",Ss="altitudeAccuracy",Es="heading",ws="position",Ts="projection",Cs="speed",bs="tracking",Rs="trackingOptions",Ps="error";class Is extends M{constructor(t){super(Ps),this.code=t.code,this.message=t.message}}var Fs=0,Ls=1,Ms=2,As=3,Os=4;class Ds extends O{constructor(t,e,i,n){super(),this.extent=t,this.pixelRatio_=i,this.resolution=e,this.state="function"==typeof n?Fs:n,this.image_=null,th