aviation-chart 0.1.15 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aviation-chart.umd.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +85 -85
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(Y,dt){typeof exports=="object"&&typeof module<"u"?dt(exports,require("maplibre-gl")):typeof define=="function"&&define.amd?define(["exports","maplibre-gl"],dt):(Y=typeof globalThis<"u"?globalThis:Y||self,dt(Y.AviationChart={},Y.maplibregl))})(this,function(Y,dt){"use strict";var wt,St,At;function kt(o,a){if(!wt)wt=a;else if(!St)St=a;else{var u="var sharedChunk = {}; ("+wt+")(sharedChunk); ("+St+")(sharedChunk);",g={};wt(g),At=a(g),typeof window<"u"&&(At.workerUrl=window.URL.createObjectURL(new Blob([u],{type:"text/javascript"})))}}kt(["exports"],function(o){class a{constructor(e,i){this.start=e,this.end=i,this.points=[],this.append=this.append.bind(this),this.prepend=this.prepend.bind(this)}append(e,i){this.points.push(Math.round(e),Math.round(i))}prepend(e,i){this.points.splice(0,0,Math.round(e),Math.round(i))}lineString(){return this.toArray()}isEmpty(){return this.points.length<2}appendFragment(e){this.points.push(...e.points),this.end=e.end}toArray(){return this.points}}const u=[[],[[[1,2],[0,1]]],[[[2,1],[1,2]]],[[[2,1],[0,1]]],[[[1,0],[2,1]]],[[[1,2],[0,1]],[[1,0],[2,1]]],[[[1,0],[1,2]]],[[[1,0],[0,1]]],[[[0,1],[1,0]]],[[[1,2],[1,0]]],[[[0,1],[1,0]],[[2,1],[1,2]]],[[[2,1],[1,0]]],[[[0,1],[2,1]]],[[[1,2],[2,1]]],[[[0,1],[1,2]]],[]];function g(t,e,i,n){return e=e*2+n[0],i=i*2+n[1],e+i*(t+1)*2}function y(t,e,i){return(e-t)/(i-t)}function x(t,e,i=4096,n=1){if(!t)return{};const r=i/(e.width-1);let l,s,c,m,d,f;const h={},w=new Map,F=new Map;function P(O,I,R){O[0]===0?R(r*(f-1),r*(d-y(c,I,l))):O[0]===2?R(r*f,r*(d-y(m,I,s))):O[1]===0?R(r*(f-y(s,I,l)),r*(d-1)):R(r*(f-y(m,I,c)),r*d)}for(d=1-n;d<e.height+n;d++){s=e.get(0,d-1),m=e.get(0,d);let O=Math.min(s,m),I=Math.max(s,m);for(f=1-n;f<e.width+n;f++){l=s,c=m,s=e.get(f,d-1),m=e.get(f,d);const R=O,V=I;if(O=Math.min(s,m),I=Math.max(s,m),isNaN(l)||isNaN(s)||isNaN(m)||isNaN(c))continue;const yt=Math.min(R,O),xt=Math.max(V,I),X=Math.ceil(yt/t)*t,rt=Math.floor(xt/t)*t;for(let C=X;C<=rt;C+=t){const It=l>C,tt=s>C,st=c>C,vt=m>C;for(const Dt of u[(It?8:0)|(tt?4:0)|(vt?2:0)|(st?1:0)]){let H=w.get(C);H||w.set(C,H=new Map);let ct=F.get(C);ct||F.set(C,ct=new Map);const Lt=Dt[0],Et=Dt[1],gt=g(e.width,f,d,Lt),mt=g(e.width,f,d,Et);let L,Ft;if(L=ct.get(gt))if(ct.delete(gt),Ft=H.get(mt))if(H.delete(mt),L===Ft){if(P(Et,C,L.append),!L.isEmpty()){let at=h[C];at||(h[C]=at=[]),at.push(L.lineString())}}else L.appendFragment(Ft),ct.set(L.end=Ft.end,L);else P(Et,C,L.append),ct.set(L.end=mt,L);else if(L=H.get(mt))H.delete(mt),P(Lt,C,L.prepend),H.set(L.start=gt,L);else{const at=new a(gt,mt);P(Lt,C,at.append),P(Et,C,at.append),H.set(gt,at),ct.set(mt,at)}}}}}for(const[O,I]of w.entries()){let R=null;for(const V of I.values())V.isEmpty()||(R==null&&(R=h[O]||(h[O]=[])),R.push(V.lineString()))}return h}function b(t){const e=Object.entries(t);return e.sort(([i],[n])=>i<n?-1:i>n?1:0),e}function S(t){return b(t).map(([e,i])=>[e,...typeof i=="number"?[i]:i].join("*")).join("~")}function M(t){return Object.fromEntries(t.split("~").map(e=>e.split("*").map(Number)).map(([e,...i])=>[e,i]))}function k({thresholds:t,...e}){return b({thresholds:S(t),...e}).map(([i,n])=>`${encodeURIComponent(i)}=${encodeURIComponent(n)}`).join("&")}function T(t){return Object.fromEntries(t.replace(/^.*\?/,"").split("&").map(e=>{const i=e.split("=").map(decodeURIComponent),n=i[0];let r=i[1];switch(n){case"thresholds":r=M(r);break;case"extent":case"multiplier":case"overzoom":case"buffer":r=Number(r)}return[n,r]}))}function p(t){return b(t).map(([e,i])=>`${encodeURIComponent(e)}=${encodeURIComponent(i)}`).join(",")}function _(t,e){const{thresholds:i,...n}=t;let r=[],l=-1/0;return Object.entries(i).forEach(([s,c])=>{const m=Number(s);m<=e&&m>l&&(l=m,r=typeof c=="number"?[c]:c)}),{levels:r,...n}}function v(t){const e=new ArrayBuffer(t.byteLength);return new Uint8Array(e).set(new Uint8Array(t)),e}function D(t,e){return t.then(({data:i,...n})=>{let r=i;return e&&(r=new Float32Array(i.length),r.set(i)),{...n,data:r,transferrables:[r.buffer]}})}function A(t){return t.then(({arrayBuffer:e})=>{const i=v(e);return{arrayBuffer:i,transferrables:[i]}})}let j=null;function ft(){return j==null&&(j=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),j||!1}let et=null;function Z(){if(et==null&&(et=!1,ft()&&typeof VideoFrame<"u")){const i=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(i){for(let r=0;r<5*5;r++){const l=r*4;i.fillStyle=`rgb(${l},${l+1},${l+2})`,i.fillRect(r%5,Math.floor(r/5),1,1)}const n=i.getImageData(0,0,5,5).data;for(let r=0;r<5*5*4;r++)if(r%4!==3&&n[r]!==r){et=!0;break}}}return et||!1}function G(t,e,i){let n=()=>{};const r=setTimeout(()=>{n(new Error("timed out")),i==null||i.abort()},t);U(i,()=>{n(new Error("aborted")),clearTimeout(r)});const l=new Promise((s,c)=>{n=c});return Promise.race([l,e.finally(()=>clearTimeout(r))])}function U(t,e){e&&(t==null||t.signal.addEventListener("abort",e))}function B(t){var e;return!!(!((e=t==null?void 0:t.signal)===null||e===void 0)&&e.aborted)}let E=0;class J{constructor(e=100){this.size=()=>this.items.size,this.get=(i,n,r)=>{let l=this.items.get(i);if(l)l.lastUsed=++E,l.waiting++;else{const d=new AbortController,f=n(i,d);l={abortController:d,item:f,lastUsed:++E,waiting:1},this.items.set(i,l),this.prune()}const s=this.items,c=l.item.then(d=>d,d=>(s.delete(i),Promise.reject(d)));let m=!1;return U(r,()=>{var d;l&&l.abortController&&!m&&(m=!0,--l.waiting<=0&&((d=l.abortController)===null||d===void 0||d.abort(),s.delete(i)))}),c},this.clear=()=>this.items.clear(),this.maxSize=e,this.items=new Map}prune(){if(this.items.size>this.maxSize){let e,i=1/0;this.items.forEach((n,r)=>{n.lastUsed<i&&(i=n.lastUsed,e=r)}),typeof e<"u"&&this.items.delete(e)}}}let K,it,N,ot;async function lt(t,e,i){const n=await createImageBitmap(t);return B(i)?null:W(n,e)}function W(t,e){return K||(K=new OffscreenCanvas(t.width,t.height),it=K.getContext("2d",{willReadFrequently:!0})),$t(t,e,K,it)}async function bt(t,e,i){var n,r,l;const s=await createImageBitmap(t);if(B(i))return null;const c=new VideoFrame(s,{timestamp:0});try{if(!(((n=c==null?void 0:c.format)===null||n===void 0?void 0:n.startsWith("BGR"))||((r=c==null?void 0:c.format)===null||r===void 0?void 0:r.startsWith("RGB"))))throw new Error(`Unrecognized format: ${c==null?void 0:c.format}`);const d=(l=c==null?void 0:c.format)===null||l===void 0?void 0:l.startsWith("BGR"),f=c.allocationSize(),h=new Uint8ClampedArray(f);if(await c.copyTo(h),d)for(let w=0;w<h.length;w+=4){const F=h[w];h[w]=h[w+2],h[w+2]=F}return Ct(s.width,s.height,e,h)}catch{return B(i)?null:W(s,e)}finally{c.close()}}async function we(t,e,i){N||(N=document.createElement("canvas"),ot=N.getContext("2d",{willReadFrequently:!0}));const n=new Image;U(i,()=>n.src="");const r=await new Promise((l,s)=>{n.onload=()=>{B(i)||l(n),URL.revokeObjectURL(n.src),n.onload=null},n.onerror=()=>s(new Error("Could not load image.")),n.src=t.size?URL.createObjectURL(t):""});return $t(r,e,N,ot)}function _e(t,e,i){return self.actor.send("decodeImage",[],i,void 0,t,e)}function be(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}const jt=Z()?bt:ft()?lt:be()?_e:we;function $t(t,e,i,n){if(i.width=t.width,i.height=t.height,!n)throw new Error("failed to get context");n.drawImage(t,0,0,t.width,t.height);const r=n.getImageData(0,0,t.width,t.height).data;return Ct(t.width,t.height,e,r)}function Ct(t,e,i,n){const r=i==="mapbox"?(s,c,m)=>-1e4+(s*256*256+c*256+m)*.1:(s,c,m)=>s*256+c+m/256-32768,l=new Float32Array(t*e);for(let s=0;s<n.length;s+=4)l[s/4]=r(n[s],n[s+1],n[s+2]);return{width:t,height:e,data:l}}const Te=-12e3,ze=9e3;function ve(t){return!isNaN(t)&&t>=Te&&t<=ze}class ${constructor(e,i,n){this.split=(r,l,s)=>{if(r===0)return this;const c=1<<r,m=l*this.width/c,d=s*this.height/c;return new $(this.width/c,this.height/c,(f,h)=>this.get(f+m,h+d))},this.subsamplePixelCenters=r=>{const l=(m,d,f)=>isNaN(m)?d:isNaN(d)?m:m+(d-m)*f;if(r<=1)return this;const s=.5-1/(2*r),c=(m,d)=>{const f=m/r-s,h=d/r-s,w=Math.floor(f),F=Math.floor(h),P=this.get(w,F),O=this.get(w+1,F),I=this.get(w,F+1),R=this.get(w+1,F+1),V=f-w,yt=h-F,xt=l(P,O,V),X=l(I,R,V);return l(xt,X,yt)};return new $(this.width*r,this.height*r,c)},this.averagePixelCentersToGrid=(r=1)=>new $(this.width+1,this.height+1,(l,s)=>{let c=0,m=0,d=0;for(let f=l-r;f<l+r;f++)for(let h=s-r;h<s+r;h++)isNaN(d=this.get(f,h))||(m++,c+=d);return m===0?NaN:c/m}),this.scaleElevation=r=>r===1?this:new $(this.width,this.height,(l,s)=>this.get(l,s)*r),this.materialize=(r=2)=>{const l=this.width+2*r,s=new Float32Array(l*(this.height+2*r));let c=0;for(let m=-r;m<this.height+r;m++)for(let d=-r;d<this.width+r;d++)s[c++]=this.get(d,m);return new $(this.width,this.height,(m,d)=>s[(d+r)*l+m+r])},this.get=n,this.width=e,this.height=i}static fromRawDem(e){return new $(e.width,e.height,(i,n)=>{const r=e.data[n*e.width+i];return ve(r)?r:NaN})}static combineNeighbors(e){if(e.length!==9)throw new Error("Must include a tile plus 8 neighbors");const i=e[4];if(!i)return;const n=i.width,r=i.height;return new $(n,r,(l,s)=>{let c=0;s<0?s+=r:s<r?c+=3:(s-=r,c+=6),l<0?l+=n:l<n?c+=1:(l-=n,c+=2);const m=e[c];return m?m.get(l,s):NaN})}}function De(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Pt={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Pt.read=function(t,e,i,n,r){var l,s,c=r*8-n-1,m=(1<<c)-1,d=m>>1,f=-7,h=i?r-1:0,w=i?-1:1,F=t[e+h];for(h+=w,l=F&(1<<-f)-1,F>>=-f,f+=c;f>0;l=l*256+t[e+h],h+=w,f-=8);for(s=l&(1<<-f)-1,l>>=-f,f+=n;f>0;s=s*256+t[e+h],h+=w,f-=8);if(l===0)l=1-d;else{if(l===m)return s?NaN:(F?-1:1)*(1/0);s=s+Math.pow(2,n),l=l-d}return(F?-1:1)*s*Math.pow(2,l-n)},Pt.write=function(t,e,i,n,r,l){var s,c,m,d=l*8-r-1,f=(1<<d)-1,h=f>>1,w=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,F=n?0:l-1,P=n?1:-1,O=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(m=Math.pow(2,-s))<1&&(s--,m*=2),s+h>=1?e+=w/m:e+=w*Math.pow(2,1-h),e*m>=2&&(s++,m/=2),s+h>=f?(c=0,s=f):s+h>=1?(c=(e*m-1)*Math.pow(2,r),s=s+h):(c=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[i+F]=c&255,F+=P,c/=256,r-=8);for(s=s<<r|c,d+=r;d>0;t[i+F]=s&255,F+=P,s/=256,d-=8);t[i+F-P]|=O*128};var Ee=z,Tt=Pt;function z(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}z.Varint=0,z.Fixed64=1,z.Bytes=2,z.Fixed32=5;var Ot=65536*65536,Yt=1/Ot,Fe=12,Kt=typeof TextDecoder>"u"?null:new TextDecoder("utf8");z.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),r=n>>3,l=this.pos;this.type=n&7,t(r,e,this),this.pos===l&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=zt(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Zt(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=zt(this.buf,this.pos)+zt(this.buf,this.pos+4)*Ot;return this.pos+=8,t},readSFixed64:function(){var t=zt(this.buf,this.pos)+Zt(this.buf,this.pos+4)*Ot;return this.pos+=8,t},readFloat:function(){var t=Tt.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Tt.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e=this.buf,i,n;return n=e[this.pos++],i=n&127,n<128||(n=e[this.pos++],i|=(n&127)<<7,n<128)||(n=e[this.pos++],i|=(n&127)<<14,n<128)||(n=e[this.pos++],i|=(n&127)<<21,n<128)?i:(n=e[this.pos],i|=(n&15)<<28,Se(i,t,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=Fe&&Kt?Ve(this.buf,e,t):Ne(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==z.Bytes)return t.push(this.readVarint(e));var i=Q(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==z.Bytes)return t.push(this.readSVarint());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==z.Bytes)return t.push(this.readBoolean());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==z.Bytes)return t.push(this.readFloat());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==z.Bytes)return t.push(this.readDouble());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==z.Bytes)return t.push(this.readFixed32());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==z.Bytes)return t.push(this.readSFixed32());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==z.Bytes)return t.push(this.readFixed64());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==z.Bytes)return t.push(this.readSFixed64());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=t&7;if(e===z.Varint)for(;this.buf[this.pos++]>127;);else if(e===z.Bytes)this.pos=this.readVarint()+this.pos;else if(e===z.Fixed32)this.pos+=4;else if(e===z.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),ut(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),ut(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),ut(this.buf,t&-1,this.pos),ut(this.buf,Math.floor(t*Yt),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),ut(this.buf,t&-1,this.pos),ut(this.buf,Math.floor(t*Yt),this.pos+4),this.pos+=8},writeVarint:function(t){if(t=+t||0,t>268435455||t<0){Ae(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))},writeSVarint:function(t){this.writeVarint(t<0?-t*2-1:t*2)},writeBoolean:function(t){this.writeVarint(!!t)},writeString:function(t){t=String(t),this.realloc(t.length*4),this.pos++;var e=this.pos;this.pos=Ue(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Ht(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),Tt.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Tt.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var n=this.pos-i;n>=128&&Ht(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,z.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Ce,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Pe,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ie,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Oe,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Me,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Le,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Ge,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Be,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Xe,e)},writeBytesField:function(t,e){this.writeTag(t,z.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,z.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,z.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,z.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,z.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,z.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,z.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,z.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,z.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,z.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};function Se(t,e,i){var n=i.buf,r,l;if(l=n[i.pos++],r=(l&112)>>4,l<128||(l=n[i.pos++],r|=(l&127)<<3,l<128)||(l=n[i.pos++],r|=(l&127)<<10,l<128)||(l=n[i.pos++],r|=(l&127)<<17,l<128)||(l=n[i.pos++],r|=(l&127)<<24,l<128)||(l=n[i.pos++],r|=(l&1)<<31,l<128))return ht(t,r,e);throw new Error("Expected varint not more than 10 bytes")}function Q(t){return t.type===z.Bytes?t.readVarint()+t.pos:t.pos+1}function ht(t,e,i){return i?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Ae(t,e){var i,n;if(t>=0?(i=t%4294967296|0,n=t/4294967296|0):(i=~(-t%4294967296),n=~(-t/4294967296),i^4294967295?i=i+1|0:(i=0,n=n+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),ke(i,n,e),Re(n,e)}function ke(t,e,i){i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos]=t&127}function Re(t,e){var i=(t&7)<<4;e.buf[e.pos++]|=i|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function Ht(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));i.realloc(n);for(var r=i.pos-1;r>=t;r--)i.buf[r+n]=i.buf[r]}function Ce(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Pe(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function Oe(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function Me(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function Ie(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function Le(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function Ge(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Be(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function Xe(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function zt(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+t[e+3]*16777216}function ut(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Zt(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Ne(t,e,i){for(var n="",r=e;r<i;){var l=t[r],s=null,c=l>239?4:l>223?3:l>191?2:1;if(r+c>i)break;var m,d,f;c===1?l<128&&(s=l):c===2?(m=t[r+1],(m&192)===128&&(s=(l&31)<<6|m&63,s<=127&&(s=null))):c===3?(m=t[r+1],d=t[r+2],(m&192)===128&&(d&192)===128&&(s=(l&15)<<12|(m&63)<<6|d&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):c===4&&(m=t[r+1],d=t[r+2],f=t[r+3],(m&192)===128&&(d&192)===128&&(f&192)===128&&(s=(l&15)<<18|(m&63)<<12|(d&63)<<6|f&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,c=1):s>65535&&(s-=65536,n+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),n+=String.fromCharCode(s),r+=c}return n}function Ve(t,e,i){return Kt.decode(t.subarray(e,i))}function Ue(t,e,i){for(var n=0,r,l;n<e.length;n++){if(r=e.charCodeAt(n),r>55295&&r<57344)if(l)if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,l=r;continue}else r=l-55296<<10|r-56320|65536,l=null;else{r>56319||n+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):l=r;continue}else l&&(t[i++]=239,t[i++]=191,t[i++]=189,l=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=r&63|128)}return i}var We=De(Ee),pt;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.POINT=1]="POINT",t[t.LINESTRING=2]="LINESTRING",t[t.POLYGON=3]="POLYGON"})(pt||(pt={}));function je(t){const e=new We;for(const i in t.layers){const n=t.layers[i];n.extent||(n.extent=t.extent),e.writeMessage(3,$e,{...n,id:i})}return e.finish()}function $e(t,e){if(!e)throw new Error("pbf undefined");e.writeVarintField(15,2),e.writeStringField(1,t.id||""),e.writeVarintField(5,t.extent||4096);const i={keys:[],values:[],keycache:{},valuecache:{}};for(const n of t.features)i.feature=n,e.writeMessage(2,Ye,i);for(const n of i.keys)e.writeStringField(3,n);for(const n of i.values)e.writeMessage(4,Ze,n)}function Ye(t,e){const i=t.feature;if(!i||!e)throw new Error;e.writeMessage(2,Ke,t),e.writeVarintField(3,i.type),e.writeMessage(4,He,i)}function Ke(t,e){const i=t.feature;if(!i||!e)throw new Error;const n=t.keys,r=t.values,l=t.keycache,s=t.valuecache;for(const c in i.properties){let m=i.properties[c],d=l[c];if(m===null)continue;typeof d>"u"&&(n.push(c),d=n.length-1,l[c]=d),e.writeVarint(d);const f=typeof m;f!=="string"&&f!=="boolean"&&f!=="number"&&(m=JSON.stringify(m));const h=`${f}:${m}`;let w=s[h];typeof w>"u"&&(r.push(m),w=r.length-1,s[h]=w),e.writeVarint(w)}}function Mt(t,e){return(e<<3)+(t&7)}function Jt(t){return t<<1^t>>31}function He(t,e){if(!e)throw new Error;const i=t.geometry,n=t.type;let r=0,l=0;for(const s of i){let c=1;n===pt.POINT&&(c=s.length/2),e.writeVarint(Mt(1,c));const m=s.length/2,d=n===pt.POLYGON?m-1:m;for(let f=0;f<d;f++){f===1&&n!==1&&e.writeVarint(Mt(2,d-1));const h=s[f*2]-r,w=s[f*2+1]-l;e.writeVarint(Jt(h)),e.writeVarint(Jt(w)),r+=h,l+=w}n===pt.POLYGON&&e.writeVarint(Mt(7,1))}}function Ze(t,e){if(!e)throw new Error;typeof t=="string"?e.writeStringField(1,t):typeof t=="boolean"?e.writeBooleanField(7,t):typeof t=="number"&&(t%1!==0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}class Je{constructor(e,i,n,r,l){this.loaded=Promise.resolve(),this.decodeImage=jt,this.fetchAndParseTile=(s,c,m,d,f)=>{const h=this,w=this.demUrlPattern.replace("{z}",s.toString()).replace("{x}",c.toString()).replace("{y}",m.toString());return f==null||f.useTile(w),this.parsedCache.get(w,async(F,P)=>{const O=await h.fetchTile(s,c,m,P,f);if(B(P))throw new Error("canceled");const I=h.decodeImage(O.data,h.encoding,P),R=f==null?void 0:f.marker("decode"),V=await I;return R==null||R(),V},d)},this.tileCache=new J(i),this.parsedCache=new J(i),this.contourCache=new J(i),this.timeoutMs=l,this.demUrlPattern=e,this.encoding=n,this.maxzoom=r}fetchTile(e,i,n,r,l){const s=this.demUrlPattern.replace("{z}",e.toString()).replace("{x}",i.toString()).replace("{y}",n.toString());return l==null||l.useTile(s),this.tileCache.get(s,(c,m)=>{const d={signal:m.signal};l==null||l.fetchTile(s);const f=l==null?void 0:l.marker("fetch");return G(this.timeoutMs,fetch(s,d).then(async h=>{if(f==null||f(),!h.ok)throw new Error(`Bad response: ${h.status} for ${s}`);return{data:await h.blob(),expires:h.headers.get("expires")||void 0,cacheControl:h.headers.get("cache-control")||void 0}}),m)},r)}async fetchDem(e,i,n,r,l,s){const c=Math.min(e-(r.overzoom||0),this.maxzoom),m=e-c,d=1<<m,f=Math.floor(i/d),h=Math.floor(n/d),w=await this.fetchAndParseTile(c,f,h,l,s);return $.fromRawDem(w).split(m,i%d,n%d)}fetchContourTile(e,i,n,r,l,s){const{levels:c,multiplier:m=1,buffer:d=1,extent:f=4096,contourLayer:h="contours",elevationKey:w="ele",levelKey:F="level",subsampleBelow:P=100}=r;if(!c||c.length===0)return Promise.resolve({arrayBuffer:new ArrayBuffer(0)});const O=[e,i,n,p(r)].join("/");return this.contourCache.get(O,async(I,R)=>{const V=1<<e,yt=[];for(let tt=n-1;tt<=n+1;tt++)for(let st=i-1;st<=i+1;st++)yt.push(tt<0||tt>=V?void 0:this.fetchDem(e,(st+V)%V,tt,r,R,s));const xt=await Promise.all(yt);let X=$.combineNeighbors(xt);if(!X||B(R))return{arrayBuffer:new Uint8Array().buffer};const rt=s==null?void 0:s.marker("isoline");if(X.width>=P)X=X.materialize(2);else for(;X.width<P;)X=X.subsamplePixelCenters(2).materialize(2);X=X.averagePixelCentersToGrid().scaleElevation(m).materialize(1);const C=x(c[0],X,f,d);rt==null||rt();const It=je({extent:f,layers:{[h]:{features:Object.entries(C).map(([tt,st])=>{const vt=Number(tt);return{type:pt.LINESTRING,geometry:st,properties:{[w]:vt,[F]:Math.max(...c.map((Dt,H)=>vt%Dt===0?H:0))}}})}}});return rt==null||rt(),{arrayBuffer:It.buffer}},l)}}const q=typeof performance<"u"?performance:void 0,Qe=q?q.timeOrigin||new Date().getTime()-q.now():new Date().getTime();function qe(t){var e;return JSON.parse(JSON.stringify(((e=q==null?void 0:q.getEntriesByName)===null||e===void 0?void 0:e.call(q,t))||[]))}function Qt(){return q?q.now():new Date().getTime()}function ti(t){const e=[];for(const i of t)e.push(...i);return e}class qt{constructor(e){this.marks={},this.urls=[],this.fetched=[],this.resources=[],this.tilesFetched=0,this.timeOrigin=Qe,this.finish=i=>{this.markFinish();const n=m=>{const d=this.marks[m]||[],f=Math.max(...d.map(w=>Math.max(...w))),h=Math.min(...d.map(w=>Math.min(...w)));return Number.isFinite(f)?f-h:void 0},r=n("main")||0,l=n("fetch"),s=n("decode"),c=n("isoline");return{url:i,tilesUsed:this.tilesFetched,origin:this.timeOrigin,marks:this.marks,resources:[...this.resources,...ti(this.fetched.map(qe))],duration:r,fetch:l,decode:s,process:c,wait:r-(l||0)-(s||0)-(c||0)}},this.error=i=>({...this.finish(i),error:!0}),this.marker=i=>{var n;this.marks[i]||(this.marks[i]=[]);const r=[Qt()];return(n=this.marks[i])===null||n===void 0||n.push(r),()=>r.push(Qt())},this.useTile=i=>{this.urls.indexOf(i)<0&&(this.urls.push(i),this.tilesFetched++)},this.fetchTile=i=>{this.fetched.indexOf(i)<0&&this.fetched.push(i)},this.addAll=i=>{var n;this.tilesFetched+=i.tilesUsed;const r=i.origin-this.timeOrigin;for(const l in i.marks){const s=l;(this.marks[s]||(this.marks[s]=[])).push(...((n=i.marks[s])===null||n===void 0?void 0:n.map(m=>m.map(d=>d+r)))||[])}this.resources.push(...i.resources.map(l=>ii(l,r)))},this.markFinish=this.marker(e)}}const ei=/(Start$|End$|^start|^end)/;function ii(t,e){const i={};for(const n in t)t[n]!==0&&ei.test(n)?i[n]=Number(t[n])+e:i[n]=t[n];return i}let oi=0;class ri{constructor(e,i,n=2e4){this.callbacks={},this.cancels={},this.dest=e,this.timeoutMs=n,this.dest.onmessage=async({data:r})=>{const l=r;if(l.type==="cancel"){const s=this.cancels[l.id];delete this.cancels[l.id],s==null||s.abort()}else if(l.type==="response"){const s=this.callbacks[l.id];delete this.callbacks[l.id],s&&s(l.error?new Error(l.error):void 0,l.response,l.timings)}else if(l.type==="request"){const s=new qt("worker"),c=i[l.name],m=new AbortController,d=c.apply(c,[...l.args,m,s]),f=`${l.name}_${l.id}`;if(l.id&&d){this.cancels[l.id]=m;try{const h=await d,w=h==null?void 0:h.transferrables;this.postMessage({id:l.id,type:"response",response:h,timings:s.finish(f)},w)}catch(h){this.postMessage({id:l.id,type:"response",error:(h==null?void 0:h.toString())||"error",timings:s.finish(f)})}delete this.cancels[l.id]}}}}postMessage(e,i){this.dest.postMessage(e,i||[])}send(e,i,n,r,...l){const s=++oi,c=new Promise((m,d)=>{this.postMessage({id:s,type:"request",name:e,args:l},i),this.callbacks[s]=(f,h,w)=>{r==null||r.addAll(w),f?d(f):m(h)}});return U(n,()=>{delete this.callbacks[s],this.postMessage({id:s,type:"cancel"})}),G(this.timeoutMs,c,n)}}o.A=ri,o.H=$,o.L=Je,o.T=qt,o.a=T,o.b=x,o.c=Ct,o.d=jt,o.e=k,o.f=A,o.g=_,o.p=D}),kt(["./shared"],function(o){const a=y=>Promise.reject(new Error(`No manager registered for ${y}`));class u{constructor(){this.managers={},this.init=(x,b)=>(this.managers[x.managerId]=new o.L(x.demUrlPattern,x.cacheSize,x.encoding,x.maxzoom,x.timeoutMs),Promise.resolve()),this.fetchTile=(x,b,S,M,k,T)=>{var p;return((p=this.managers[x])===null||p===void 0?void 0:p.fetchTile(b,S,M,k,T))||a(x)},this.fetchAndParseTile=(x,b,S,M,k,T)=>{var p;return o.p(((p=this.managers[x])===null||p===void 0?void 0:p.fetchAndParseTile(b,S,M,k,T))||a(x),!0)},this.fetchContourTile=(x,b,S,M,k,T,p)=>{var _;return o.f(((_=this.managers[x])===null||_===void 0?void 0:_.fetchContourTile(b,S,M,k,T,p))||a(x))}}}const g=typeof self<"u"?self:typeof window<"u"?window:global;g.actor=new o.A(g,new u)}),kt(["./shared"],function(o){const a={workerUrl:""};let u,g=0;class y{constructor(){this.decodeImage=(_,v,D)=>o.p(o.d(_,v,D),!1)}}function x(){if(!u){const p=new Worker(a.workerUrl),_=new y;u=new o.A(p,_)}return u}class b{constructor(_,v,D,A,j,ft){this.fetchTile=(Z,G,U,B,E)=>this.actor.send("fetchTile",[],B,E,this.managerId,Z,G,U),this.fetchAndParseTile=(Z,G,U,B,E)=>this.actor.send("fetchAndParseTile",[],B,E,this.managerId,Z,G,U),this.fetchContourTile=(Z,G,U,B,E,J)=>this.actor.send("fetchContourTile",[],E,J,this.managerId,Z,G,U,B);const et=this.managerId=++g;this.actor=ft||x(),this.loaded=this.actor.send("init",[],new AbortController,void 0,{cacheSize:v,demUrlPattern:_,encoding:D,maxzoom:A,managerId:et,timeoutMs:j})}}Blob.prototype.arrayBuffer||(Blob.prototype.arrayBuffer=function(){return new Promise((_,v)=>{const D=new FileReader;D.onload=A=>{var j;return _((j=A.target)===null||j===void 0?void 0:j.result)},D.onerror=v,D.readAsArrayBuffer(this)})});const S=p=>(_,v)=>{if(v instanceof AbortController)return p(_,v);{const D=new AbortController;return p(_,D).then(A=>v(void 0,A.data,A.cacheControl,A.expires),A=>v(A)),{cancel:()=>D.abort()}}},M=new Set;class k{constructor({url:_,cacheSize:v=100,id:D="dem",encoding:A="terrarium",maxzoom:j=12,worker:ft=!0,timeoutMs:et=1e4,actor:Z}){this.timingCallbacks=[],this.onTiming=E=>{this.timingCallbacks.push(E)},this.setupMaplibre=E=>{E.addProtocol(this.sharedDemProtocolId,this.sharedDemProtocol),E.addProtocol(this.contourProtocolId,this.contourProtocol)},this.sharedDemProtocolV4=async(E,J)=>{const[K,it,N]=this.parseUrl(E.url),ot=new o.T("main");let lt;try{const W=await this.manager.fetchTile(K,it,N,J,ot);return lt=ot.finish(E.url),{data:await W.data.arrayBuffer(),cacheControl:W.cacheControl,expires:W.expires}}catch(W){throw lt=ot.error(E.url),W}finally{this.timingCallbacks.forEach(W=>W(lt))}},this.contourProtocolV4=async(E,J)=>{const K=new o.T("main");let it;try{const[N,ot,lt]=this.parseUrl(E.url),W=o.a(E.url),bt=await this.manager.fetchContourTile(N,ot,lt,o.g(W,N),J,K);return it=K.finish(E.url),{data:bt.arrayBuffer}}catch(N){throw it=K.error(E.url),N}finally{this.timingCallbacks.forEach(N=>N(it))}},this.contourProtocol=S(this.contourProtocolV4),this.sharedDemProtocol=S(this.sharedDemProtocolV4),this.contourProtocolUrl=E=>`${this.contourProtocolUrlBase}?${o.e(E)}`;let G=D,U=1;for(;M.has(G);)G=D+U++;M.add(G),this.sharedDemProtocolId=`${G}-shared`,this.contourProtocolId=`${G}-contour`,this.sharedDemProtocolUrl=`${this.sharedDemProtocolId}://{z}/{x}/{y}`,this.contourProtocolUrlBase=`${this.contourProtocolId}://{z}/{x}/{y}`;const B=ft?b:o.L;this.manager=new B(_,v,A,j,et,Z)}getDemTile(_,v,D,A){return this.manager.fetchAndParseTile(_,v,D,A||new AbortController)}parseUrl(_){const[,v,D,A]=/\/\/(\d+)\/(\d+)\/(\d+)/.exec(_)||[];return[Number(v),Number(D),Number(A)]}}return{generateIsolines:o.b,DemSource:k,HeightTile:o.H,LocalDemManager:o.L,decodeParsedImage:o.c,set workerUrl(p){a.workerUrl=p},get workerUrl(){return a.workerUrl}}});var te=At;function ee(o){return o}function ie(o){if(o==null)return ee;var a,u,g=o.scale[0],y=o.scale[1],x=o.translate[0],b=o.translate[1];return function(S,M){M||(a=u=0);var k=2,T=S.length,p=new Array(T);for(p[0]=(a+=S[0])*g+x,p[1]=(u+=S[1])*y+b;k<T;)p[k]=S[k],++k;return p}}function oe(o,a){for(var u,g=o.length,y=g-a;y<--g;)u=o[y],o[y++]=o[g],o[g]=u}function Gt(o,a){return typeof a=="string"&&(a=o.objects[a]),a.type==="GeometryCollection"?{type:"FeatureCollection",features:a.geometries.map(function(u){return Bt(o,u)})}:Bt(o,a)}function Bt(o,a){var u=a.id,g=a.bbox,y=a.properties==null?{}:a.properties,x=re(o,a);return u==null&&g==null?{type:"Feature",properties:y,geometry:x}:g==null?{type:"Feature",id:u,properties:y,geometry:x}:{type:"Feature",id:u,bbox:g,properties:y,geometry:x}}function re(o,a){var u=ie(o.transform),g=o.arcs;function y(T,p){p.length&&p.pop();for(var _=g[T<0?~T:T],v=0,D=_.length;v<D;++v)p.push(u(_[v],v));T<0&&oe(p,D)}function x(T){return u(T)}function b(T){for(var p=[],_=0,v=T.length;_<v;++_)y(T[_],p);return p.length<2&&p.push(p[0]),p}function S(T){for(var p=b(T);p.length<4;)p.push(p[0]);return p}function M(T){return T.map(S)}function k(T){var p=T.type,_;switch(p){case"GeometryCollection":return{type:p,geometries:T.geometries.map(k)};case"Point":_=x(T.coordinates);break;case"MultiPoint":_=T.coordinates.map(x);break;case"LineString":_=b(T.arcs);break;case"MultiLineString":_=T.arcs.map(b);break;case"Polygon":_=M(T.arcs);break;case"MultiPolygon":_=T.arcs.map(M);break;default:return null}return{type:p,coordinates:_}}return k(a)}const ae={airspaceStroke:"#AAB7B8",restrictedStroke:"#D35400",controlledStroke:"#10B981",controlledFill:"#10B981",segment:"#2E4053",waypoint:"#1C2526",vor:"#00008B",ndb:"#0066CC",airport:"#006400",runway:"#333333"};function ne(){const o="navdata",a=ae;return[{id:"landLaye",type:"fill",source:"land",layout:{visibility:"visible"},paint:{"fill-color":"#F7F9FB","fill-opacity":1}},{id:"boundary",type:"line",source:"boundary",minzoom:.5,paint:{"line-width":["interpolate",["linear"],["zoom"],0,1,7,4],"line-opacity":1,"line-pattern":"normal:national-border"}},{id:"adiz-line",type:"line",source:o,"source-layer":"adiz",minzoom:3,layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":4,"line-pattern":"normal:adiz","line-opacity":["interpolate",["linear"],["zoom"],3,.6,8,.4]}},{id:"adiz-label",type:"symbol",source:o,"source-layer":"adiz-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"text-max-width":10,"symbol-placement":"point"},paint:{"text-color":"#6600cc","text-halo-color":"#ffffff","text-halo-width":1.5}},{id:"fir-line",type:"line",source:o,"source-layer":"fir",minzoom:2,paint:{"line-color":a.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],2,0,2.7,.8,9,.8,10,.5],"line-width":.5,"line-dasharray":[4.2,4]}},{id:"fir_line_dash",type:"line",source:o,"source-layer":"fir",minzoom:5,layout:{"line-miter-limit":0,"line-cap":"butt","line-join":"miter"},paint:{"line-color":a.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],5,0,5.5,.8,9,.8,10,.5],"line-width":6,"line-dasharray":[.2,5]}},{id:"fir-label-lineside",type:"symbol",source:o,"source-layer":"fir",minzoom:4,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1],"text-letter-spacing":.05,"text-optional":!0},paint:{"text-color":a.airspaceStroke}},{id:"fir-label",type:"symbol",source:o,"source-layer":"fir-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":["interpolate",["linear"],["zoom"],3,12,17,16],"symbol-placement":"point","text-max-width":8},paint:{"text-color":a.airspaceStroke,"text-opacity":["interpolate",["linear"],["zoom"],3,.85,8,.7,12,.5]}},{id:"restricted-fill",type:"fill",source:o,"source-layer":"restricted-fill",minzoom:4,paint:{"fill-color":"#FAD7A0","fill-opacity":["interpolate",["linear"],["zoom"],10,.15,11.5,0]}},{id:"restricted-stroke",type:"line",source:o,"source-layer":"restricted",paint:{"line-color":"#f6bf65","line-width":1,"line-dasharray":[2,2],"line-opacity":["interpolate",["linear"],["zoom"],4,.5,8,1]}},{id:"restricted-label",type:"symbol",source:o,"source-layer":"restricted",minzoom:6,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-letter-spacing":.1,"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1]},paint:{"text-color":a.restrictedStroke}},{id:"controlled-fill",type:"fill",source:o,"source-layer":"controlled-fill",minzoom:4,filter:["all",["!=",["get","CODE_TYPE"],"CTA"],["!=",["get","CODE_TYPE"],"ARSA"],["!=",["get","CODE_TYPE"],"TCA"],["!=",["get","CODE_TYPE"],"TRSA"]],paint:{"fill-color":a.controlledFill,"fill-opacity":["interpolate",["linear"],["zoom"],10,.035,11.5,0]}},{id:"controlled-stroke",type:"line",source:o,"source-layer":"controlled",filter:["all",["!=",["get","CODE_TYPE"],"ARSA"],["!=",["get","CODE_TYPE"],"TCA"],["!=",["get","CODE_TYPE"],"TRSA"]],paint:{"line-color":a.controlledStroke,"line-width":1,"line-opacity":["interpolate",["linear"],["zoom"],4,.5,8,1],"line-dasharray":[1,1.4]}},{id:"controlled-label",filter:["all",["!=",["get","CODE_TYPE"],"ARSA"],["!=",["get","CODE_TYPE"],"TCA"],["!=",["get","CODE_TYPE"],"TRSA"]],type:"symbol",source:o,"source-layer":"controlled",minzoom:6,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-size":10,"symbol-placement":"line","text-letter-spacing":.2,"text-max-width":8,"text-offset":[0,1]},paint:{"text-color":a.controlledStroke}},{id:"segment-line",type:"line",source:o,"source-layer":"segment",minzoom:5,paint:{"line-color":["case",["==",["get","HAS_REMARK"],1],"#E8A020",a.segment],"line-width":["interpolate",["linear"],["zoom"],5,.2,8,.8],"line-blur":0,"line-opacity":["interpolate",["linear"],["zoom"],5,.3,6,1,8,1,12,.8,15,.2]}},{id:"segment-label",type:"symbol",source:o,"source-layer":"segment",minzoom:6,layout:{"icon-image":["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""],["!=",["get","TXT_DESIG"]," "],["!=",["get","TXT_DESIG"],null]],"segment-both",["all",["has","TXT_DESIG_FORWARD"]],"segment-right",["all",["has","TXT_DESIG_BACKWARD"]],"segment-left","segment-both"],"icon-anchor":"center","symbol-placement":"line","icon-text-fit":"width","icon-size":1,"text-allow-overlap":!1,"icon-allow-overlap":!1,"text-optional":!1,"text-anchor":"center","text-justify":"center","text-line-height":1.3,"text-letter-spacing":.1,"text-field":["step",["zoom"],["format",["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""]],["get","TXT_DESIG"],["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":1,"text-color":"#ffffff"}],10,["format",["concat",["get","VAL_LEN"],"",["get","UOM_DIST"]],{"font-scale":.95,"text-color":"#3E4759"},`
|
|
1
|
+
(function(Y,ft){typeof exports=="object"&&typeof module<"u"?ft(exports,require("maplibre-gl")):typeof define=="function"&&define.amd?define(["exports","maplibre-gl"],ft):(Y=typeof globalThis<"u"?globalThis:Y||self,ft(Y.AviationChart={},Y.maplibregl))})(this,function(Y,ft){"use strict";var wt,St,At;function kt(o,a){if(!wt)wt=a;else if(!St)St=a;else{var u="var sharedChunk = {}; ("+wt+")(sharedChunk); ("+St+")(sharedChunk);",g={};wt(g),At=a(g),typeof window<"u"&&(At.workerUrl=window.URL.createObjectURL(new Blob([u],{type:"text/javascript"})))}}kt(["exports"],function(o){class a{constructor(e,i){this.start=e,this.end=i,this.points=[],this.append=this.append.bind(this),this.prepend=this.prepend.bind(this)}append(e,i){this.points.push(Math.round(e),Math.round(i))}prepend(e,i){this.points.splice(0,0,Math.round(e),Math.round(i))}lineString(){return this.toArray()}isEmpty(){return this.points.length<2}appendFragment(e){this.points.push(...e.points),this.end=e.end}toArray(){return this.points}}const u=[[],[[[1,2],[0,1]]],[[[2,1],[1,2]]],[[[2,1],[0,1]]],[[[1,0],[2,1]]],[[[1,2],[0,1]],[[1,0],[2,1]]],[[[1,0],[1,2]]],[[[1,0],[0,1]]],[[[0,1],[1,0]]],[[[1,2],[1,0]]],[[[0,1],[1,0]],[[2,1],[1,2]]],[[[2,1],[1,0]]],[[[0,1],[2,1]]],[[[1,2],[2,1]]],[[[0,1],[1,2]]],[]];function g(t,e,i,n){return e=e*2+n[0],i=i*2+n[1],e+i*(t+1)*2}function y(t,e,i){return(e-t)/(i-t)}function x(t,e,i=4096,n=1){if(!t)return{};const r=i/(e.width-1);let l,s,c,m,f,d;const h={},w=new Map,F=new Map;function P(O,I,R){O[0]===0?R(r*(d-1),r*(f-y(c,I,l))):O[0]===2?R(r*d,r*(f-y(m,I,s))):O[1]===0?R(r*(d-y(s,I,l)),r*(f-1)):R(r*(d-y(m,I,c)),r*f)}for(f=1-n;f<e.height+n;f++){s=e.get(0,f-1),m=e.get(0,f);let O=Math.min(s,m),I=Math.max(s,m);for(d=1-n;d<e.width+n;d++){l=s,c=m,s=e.get(d,f-1),m=e.get(d,f);const R=O,V=I;if(O=Math.min(s,m),I=Math.max(s,m),isNaN(l)||isNaN(s)||isNaN(m)||isNaN(c))continue;const yt=Math.min(R,O),xt=Math.max(V,I),X=Math.ceil(yt/t)*t,rt=Math.floor(xt/t)*t;for(let C=X;C<=rt;C+=t){const It=l>C,tt=s>C,st=c>C,vt=m>C;for(const Dt of u[(It?8:0)|(tt?4:0)|(vt?2:0)|(st?1:0)]){let H=w.get(C);H||w.set(C,H=new Map);let ct=F.get(C);ct||F.set(C,ct=new Map);const Lt=Dt[0],Et=Dt[1],gt=g(e.width,d,f,Lt),mt=g(e.width,d,f,Et);let L,Ft;if(L=ct.get(gt))if(ct.delete(gt),Ft=H.get(mt))if(H.delete(mt),L===Ft){if(P(Et,C,L.append),!L.isEmpty()){let at=h[C];at||(h[C]=at=[]),at.push(L.lineString())}}else L.appendFragment(Ft),ct.set(L.end=Ft.end,L);else P(Et,C,L.append),ct.set(L.end=mt,L);else if(L=H.get(mt))H.delete(mt),P(Lt,C,L.prepend),H.set(L.start=gt,L);else{const at=new a(gt,mt);P(Lt,C,at.append),P(Et,C,at.append),H.set(gt,at),ct.set(mt,at)}}}}}for(const[O,I]of w.entries()){let R=null;for(const V of I.values())V.isEmpty()||(R==null&&(R=h[O]||(h[O]=[])),R.push(V.lineString()))}return h}function b(t){const e=Object.entries(t);return e.sort(([i],[n])=>i<n?-1:i>n?1:0),e}function S(t){return b(t).map(([e,i])=>[e,...typeof i=="number"?[i]:i].join("*")).join("~")}function M(t){return Object.fromEntries(t.split("~").map(e=>e.split("*").map(Number)).map(([e,...i])=>[e,i]))}function k({thresholds:t,...e}){return b({thresholds:S(t),...e}).map(([i,n])=>`${encodeURIComponent(i)}=${encodeURIComponent(n)}`).join("&")}function T(t){return Object.fromEntries(t.replace(/^.*\?/,"").split("&").map(e=>{const i=e.split("=").map(decodeURIComponent),n=i[0];let r=i[1];switch(n){case"thresholds":r=M(r);break;case"extent":case"multiplier":case"overzoom":case"buffer":r=Number(r)}return[n,r]}))}function p(t){return b(t).map(([e,i])=>`${encodeURIComponent(e)}=${encodeURIComponent(i)}`).join(",")}function _(t,e){const{thresholds:i,...n}=t;let r=[],l=-1/0;return Object.entries(i).forEach(([s,c])=>{const m=Number(s);m<=e&&m>l&&(l=m,r=typeof c=="number"?[c]:c)}),{levels:r,...n}}function v(t){const e=new ArrayBuffer(t.byteLength);return new Uint8Array(e).set(new Uint8Array(t)),e}function D(t,e){return t.then(({data:i,...n})=>{let r=i;return e&&(r=new Float32Array(i.length),r.set(i)),{...n,data:r,transferrables:[r.buffer]}})}function A(t){return t.then(({arrayBuffer:e})=>{const i=v(e);return{arrayBuffer:i,transferrables:[i]}})}let j=null;function dt(){return j==null&&(j=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),j||!1}let et=null;function Z(){if(et==null&&(et=!1,dt()&&typeof VideoFrame<"u")){const i=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(i){for(let r=0;r<5*5;r++){const l=r*4;i.fillStyle=`rgb(${l},${l+1},${l+2})`,i.fillRect(r%5,Math.floor(r/5),1,1)}const n=i.getImageData(0,0,5,5).data;for(let r=0;r<5*5*4;r++)if(r%4!==3&&n[r]!==r){et=!0;break}}}return et||!1}function G(t,e,i){let n=()=>{};const r=setTimeout(()=>{n(new Error("timed out")),i==null||i.abort()},t);U(i,()=>{n(new Error("aborted")),clearTimeout(r)});const l=new Promise((s,c)=>{n=c});return Promise.race([l,e.finally(()=>clearTimeout(r))])}function U(t,e){e&&(t==null||t.signal.addEventListener("abort",e))}function B(t){var e;return!!(!((e=t==null?void 0:t.signal)===null||e===void 0)&&e.aborted)}let E=0;class J{constructor(e=100){this.size=()=>this.items.size,this.get=(i,n,r)=>{let l=this.items.get(i);if(l)l.lastUsed=++E,l.waiting++;else{const f=new AbortController,d=n(i,f);l={abortController:f,item:d,lastUsed:++E,waiting:1},this.items.set(i,l),this.prune()}const s=this.items,c=l.item.then(f=>f,f=>(s.delete(i),Promise.reject(f)));let m=!1;return U(r,()=>{var f;l&&l.abortController&&!m&&(m=!0,--l.waiting<=0&&((f=l.abortController)===null||f===void 0||f.abort(),s.delete(i)))}),c},this.clear=()=>this.items.clear(),this.maxSize=e,this.items=new Map}prune(){if(this.items.size>this.maxSize){let e,i=1/0;this.items.forEach((n,r)=>{n.lastUsed<i&&(i=n.lastUsed,e=r)}),typeof e<"u"&&this.items.delete(e)}}}let K,it,N,ot;async function lt(t,e,i){const n=await createImageBitmap(t);return B(i)?null:W(n,e)}function W(t,e){return K||(K=new OffscreenCanvas(t.width,t.height),it=K.getContext("2d",{willReadFrequently:!0})),$t(t,e,K,it)}async function bt(t,e,i){var n,r,l;const s=await createImageBitmap(t);if(B(i))return null;const c=new VideoFrame(s,{timestamp:0});try{if(!(((n=c==null?void 0:c.format)===null||n===void 0?void 0:n.startsWith("BGR"))||((r=c==null?void 0:c.format)===null||r===void 0?void 0:r.startsWith("RGB"))))throw new Error(`Unrecognized format: ${c==null?void 0:c.format}`);const f=(l=c==null?void 0:c.format)===null||l===void 0?void 0:l.startsWith("BGR"),d=c.allocationSize(),h=new Uint8ClampedArray(d);if(await c.copyTo(h),f)for(let w=0;w<h.length;w+=4){const F=h[w];h[w]=h[w+2],h[w+2]=F}return Ct(s.width,s.height,e,h)}catch{return B(i)?null:W(s,e)}finally{c.close()}}async function we(t,e,i){N||(N=document.createElement("canvas"),ot=N.getContext("2d",{willReadFrequently:!0}));const n=new Image;U(i,()=>n.src="");const r=await new Promise((l,s)=>{n.onload=()=>{B(i)||l(n),URL.revokeObjectURL(n.src),n.onload=null},n.onerror=()=>s(new Error("Could not load image.")),n.src=t.size?URL.createObjectURL(t):""});return $t(r,e,N,ot)}function _e(t,e,i){return self.actor.send("decodeImage",[],i,void 0,t,e)}function be(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}const jt=Z()?bt:dt()?lt:be()?_e:we;function $t(t,e,i,n){if(i.width=t.width,i.height=t.height,!n)throw new Error("failed to get context");n.drawImage(t,0,0,t.width,t.height);const r=n.getImageData(0,0,t.width,t.height).data;return Ct(t.width,t.height,e,r)}function Ct(t,e,i,n){const r=i==="mapbox"?(s,c,m)=>-1e4+(s*256*256+c*256+m)*.1:(s,c,m)=>s*256+c+m/256-32768,l=new Float32Array(t*e);for(let s=0;s<n.length;s+=4)l[s/4]=r(n[s],n[s+1],n[s+2]);return{width:t,height:e,data:l}}const Te=-12e3,ze=9e3;function ve(t){return!isNaN(t)&&t>=Te&&t<=ze}class ${constructor(e,i,n){this.split=(r,l,s)=>{if(r===0)return this;const c=1<<r,m=l*this.width/c,f=s*this.height/c;return new $(this.width/c,this.height/c,(d,h)=>this.get(d+m,h+f))},this.subsamplePixelCenters=r=>{const l=(m,f,d)=>isNaN(m)?f:isNaN(f)?m:m+(f-m)*d;if(r<=1)return this;const s=.5-1/(2*r),c=(m,f)=>{const d=m/r-s,h=f/r-s,w=Math.floor(d),F=Math.floor(h),P=this.get(w,F),O=this.get(w+1,F),I=this.get(w,F+1),R=this.get(w+1,F+1),V=d-w,yt=h-F,xt=l(P,O,V),X=l(I,R,V);return l(xt,X,yt)};return new $(this.width*r,this.height*r,c)},this.averagePixelCentersToGrid=(r=1)=>new $(this.width+1,this.height+1,(l,s)=>{let c=0,m=0,f=0;for(let d=l-r;d<l+r;d++)for(let h=s-r;h<s+r;h++)isNaN(f=this.get(d,h))||(m++,c+=f);return m===0?NaN:c/m}),this.scaleElevation=r=>r===1?this:new $(this.width,this.height,(l,s)=>this.get(l,s)*r),this.materialize=(r=2)=>{const l=this.width+2*r,s=new Float32Array(l*(this.height+2*r));let c=0;for(let m=-r;m<this.height+r;m++)for(let f=-r;f<this.width+r;f++)s[c++]=this.get(f,m);return new $(this.width,this.height,(m,f)=>s[(f+r)*l+m+r])},this.get=n,this.width=e,this.height=i}static fromRawDem(e){return new $(e.width,e.height,(i,n)=>{const r=e.data[n*e.width+i];return ve(r)?r:NaN})}static combineNeighbors(e){if(e.length!==9)throw new Error("Must include a tile plus 8 neighbors");const i=e[4];if(!i)return;const n=i.width,r=i.height;return new $(n,r,(l,s)=>{let c=0;s<0?s+=r:s<r?c+=3:(s-=r,c+=6),l<0?l+=n:l<n?c+=1:(l-=n,c+=2);const m=e[c];return m?m.get(l,s):NaN})}}function De(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Pt={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Pt.read=function(t,e,i,n,r){var l,s,c=r*8-n-1,m=(1<<c)-1,f=m>>1,d=-7,h=i?r-1:0,w=i?-1:1,F=t[e+h];for(h+=w,l=F&(1<<-d)-1,F>>=-d,d+=c;d>0;l=l*256+t[e+h],h+=w,d-=8);for(s=l&(1<<-d)-1,l>>=-d,d+=n;d>0;s=s*256+t[e+h],h+=w,d-=8);if(l===0)l=1-f;else{if(l===m)return s?NaN:(F?-1:1)*(1/0);s=s+Math.pow(2,n),l=l-f}return(F?-1:1)*s*Math.pow(2,l-n)},Pt.write=function(t,e,i,n,r,l){var s,c,m,f=l*8-r-1,d=(1<<f)-1,h=d>>1,w=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,F=n?0:l-1,P=n?1:-1,O=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,s=d):(s=Math.floor(Math.log(e)/Math.LN2),e*(m=Math.pow(2,-s))<1&&(s--,m*=2),s+h>=1?e+=w/m:e+=w*Math.pow(2,1-h),e*m>=2&&(s++,m/=2),s+h>=d?(c=0,s=d):s+h>=1?(c=(e*m-1)*Math.pow(2,r),s=s+h):(c=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[i+F]=c&255,F+=P,c/=256,r-=8);for(s=s<<r|c,f+=r;f>0;t[i+F]=s&255,F+=P,s/=256,f-=8);t[i+F-P]|=O*128};var Ee=z,Tt=Pt;function z(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}z.Varint=0,z.Fixed64=1,z.Bytes=2,z.Fixed32=5;var Ot=65536*65536,Yt=1/Ot,Fe=12,Kt=typeof TextDecoder>"u"?null:new TextDecoder("utf8");z.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),r=n>>3,l=this.pos;this.type=n&7,t(r,e,this),this.pos===l&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=zt(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Zt(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=zt(this.buf,this.pos)+zt(this.buf,this.pos+4)*Ot;return this.pos+=8,t},readSFixed64:function(){var t=zt(this.buf,this.pos)+Zt(this.buf,this.pos+4)*Ot;return this.pos+=8,t},readFloat:function(){var t=Tt.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Tt.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e=this.buf,i,n;return n=e[this.pos++],i=n&127,n<128||(n=e[this.pos++],i|=(n&127)<<7,n<128)||(n=e[this.pos++],i|=(n&127)<<14,n<128)||(n=e[this.pos++],i|=(n&127)<<21,n<128)?i:(n=e[this.pos],i|=(n&15)<<28,Se(i,t,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=Fe&&Kt?Ve(this.buf,e,t):Ne(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==z.Bytes)return t.push(this.readVarint(e));var i=Q(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==z.Bytes)return t.push(this.readSVarint());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==z.Bytes)return t.push(this.readBoolean());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==z.Bytes)return t.push(this.readFloat());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==z.Bytes)return t.push(this.readDouble());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==z.Bytes)return t.push(this.readFixed32());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==z.Bytes)return t.push(this.readSFixed32());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==z.Bytes)return t.push(this.readFixed64());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==z.Bytes)return t.push(this.readSFixed64());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=t&7;if(e===z.Varint)for(;this.buf[this.pos++]>127;);else if(e===z.Bytes)this.pos=this.readVarint()+this.pos;else if(e===z.Fixed32)this.pos+=4;else if(e===z.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),ut(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),ut(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),ut(this.buf,t&-1,this.pos),ut(this.buf,Math.floor(t*Yt),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),ut(this.buf,t&-1,this.pos),ut(this.buf,Math.floor(t*Yt),this.pos+4),this.pos+=8},writeVarint:function(t){if(t=+t||0,t>268435455||t<0){Ae(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))},writeSVarint:function(t){this.writeVarint(t<0?-t*2-1:t*2)},writeBoolean:function(t){this.writeVarint(!!t)},writeString:function(t){t=String(t),this.realloc(t.length*4),this.pos++;var e=this.pos;this.pos=Ue(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Ht(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),Tt.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Tt.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var n=this.pos-i;n>=128&&Ht(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,z.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Ce,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Pe,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ie,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Oe,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Me,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Le,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Ge,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Be,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Xe,e)},writeBytesField:function(t,e){this.writeTag(t,z.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,z.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,z.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,z.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,z.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,z.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,z.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,z.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,z.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,z.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};function Se(t,e,i){var n=i.buf,r,l;if(l=n[i.pos++],r=(l&112)>>4,l<128||(l=n[i.pos++],r|=(l&127)<<3,l<128)||(l=n[i.pos++],r|=(l&127)<<10,l<128)||(l=n[i.pos++],r|=(l&127)<<17,l<128)||(l=n[i.pos++],r|=(l&127)<<24,l<128)||(l=n[i.pos++],r|=(l&1)<<31,l<128))return ht(t,r,e);throw new Error("Expected varint not more than 10 bytes")}function Q(t){return t.type===z.Bytes?t.readVarint()+t.pos:t.pos+1}function ht(t,e,i){return i?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Ae(t,e){var i,n;if(t>=0?(i=t%4294967296|0,n=t/4294967296|0):(i=~(-t%4294967296),n=~(-t/4294967296),i^4294967295?i=i+1|0:(i=0,n=n+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),ke(i,n,e),Re(n,e)}function ke(t,e,i){i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos]=t&127}function Re(t,e){var i=(t&7)<<4;e.buf[e.pos++]|=i|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function Ht(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));i.realloc(n);for(var r=i.pos-1;r>=t;r--)i.buf[r+n]=i.buf[r]}function Ce(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Pe(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function Oe(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function Me(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function Ie(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function Le(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function Ge(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Be(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function Xe(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function zt(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+t[e+3]*16777216}function ut(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Zt(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Ne(t,e,i){for(var n="",r=e;r<i;){var l=t[r],s=null,c=l>239?4:l>223?3:l>191?2:1;if(r+c>i)break;var m,f,d;c===1?l<128&&(s=l):c===2?(m=t[r+1],(m&192)===128&&(s=(l&31)<<6|m&63,s<=127&&(s=null))):c===3?(m=t[r+1],f=t[r+2],(m&192)===128&&(f&192)===128&&(s=(l&15)<<12|(m&63)<<6|f&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):c===4&&(m=t[r+1],f=t[r+2],d=t[r+3],(m&192)===128&&(f&192)===128&&(d&192)===128&&(s=(l&15)<<18|(m&63)<<12|(f&63)<<6|d&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,c=1):s>65535&&(s-=65536,n+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),n+=String.fromCharCode(s),r+=c}return n}function Ve(t,e,i){return Kt.decode(t.subarray(e,i))}function Ue(t,e,i){for(var n=0,r,l;n<e.length;n++){if(r=e.charCodeAt(n),r>55295&&r<57344)if(l)if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,l=r;continue}else r=l-55296<<10|r-56320|65536,l=null;else{r>56319||n+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):l=r;continue}else l&&(t[i++]=239,t[i++]=191,t[i++]=189,l=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=r&63|128)}return i}var We=De(Ee),pt;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.POINT=1]="POINT",t[t.LINESTRING=2]="LINESTRING",t[t.POLYGON=3]="POLYGON"})(pt||(pt={}));function je(t){const e=new We;for(const i in t.layers){const n=t.layers[i];n.extent||(n.extent=t.extent),e.writeMessage(3,$e,{...n,id:i})}return e.finish()}function $e(t,e){if(!e)throw new Error("pbf undefined");e.writeVarintField(15,2),e.writeStringField(1,t.id||""),e.writeVarintField(5,t.extent||4096);const i={keys:[],values:[],keycache:{},valuecache:{}};for(const n of t.features)i.feature=n,e.writeMessage(2,Ye,i);for(const n of i.keys)e.writeStringField(3,n);for(const n of i.values)e.writeMessage(4,Ze,n)}function Ye(t,e){const i=t.feature;if(!i||!e)throw new Error;e.writeMessage(2,Ke,t),e.writeVarintField(3,i.type),e.writeMessage(4,He,i)}function Ke(t,e){const i=t.feature;if(!i||!e)throw new Error;const n=t.keys,r=t.values,l=t.keycache,s=t.valuecache;for(const c in i.properties){let m=i.properties[c],f=l[c];if(m===null)continue;typeof f>"u"&&(n.push(c),f=n.length-1,l[c]=f),e.writeVarint(f);const d=typeof m;d!=="string"&&d!=="boolean"&&d!=="number"&&(m=JSON.stringify(m));const h=`${d}:${m}`;let w=s[h];typeof w>"u"&&(r.push(m),w=r.length-1,s[h]=w),e.writeVarint(w)}}function Mt(t,e){return(e<<3)+(t&7)}function Jt(t){return t<<1^t>>31}function He(t,e){if(!e)throw new Error;const i=t.geometry,n=t.type;let r=0,l=0;for(const s of i){let c=1;n===pt.POINT&&(c=s.length/2),e.writeVarint(Mt(1,c));const m=s.length/2,f=n===pt.POLYGON?m-1:m;for(let d=0;d<f;d++){d===1&&n!==1&&e.writeVarint(Mt(2,f-1));const h=s[d*2]-r,w=s[d*2+1]-l;e.writeVarint(Jt(h)),e.writeVarint(Jt(w)),r+=h,l+=w}n===pt.POLYGON&&e.writeVarint(Mt(7,1))}}function Ze(t,e){if(!e)throw new Error;typeof t=="string"?e.writeStringField(1,t):typeof t=="boolean"?e.writeBooleanField(7,t):typeof t=="number"&&(t%1!==0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}class Je{constructor(e,i,n,r,l){this.loaded=Promise.resolve(),this.decodeImage=jt,this.fetchAndParseTile=(s,c,m,f,d)=>{const h=this,w=this.demUrlPattern.replace("{z}",s.toString()).replace("{x}",c.toString()).replace("{y}",m.toString());return d==null||d.useTile(w),this.parsedCache.get(w,async(F,P)=>{const O=await h.fetchTile(s,c,m,P,d);if(B(P))throw new Error("canceled");const I=h.decodeImage(O.data,h.encoding,P),R=d==null?void 0:d.marker("decode"),V=await I;return R==null||R(),V},f)},this.tileCache=new J(i),this.parsedCache=new J(i),this.contourCache=new J(i),this.timeoutMs=l,this.demUrlPattern=e,this.encoding=n,this.maxzoom=r}fetchTile(e,i,n,r,l){const s=this.demUrlPattern.replace("{z}",e.toString()).replace("{x}",i.toString()).replace("{y}",n.toString());return l==null||l.useTile(s),this.tileCache.get(s,(c,m)=>{const f={signal:m.signal};l==null||l.fetchTile(s);const d=l==null?void 0:l.marker("fetch");return G(this.timeoutMs,fetch(s,f).then(async h=>{if(d==null||d(),!h.ok)throw new Error(`Bad response: ${h.status} for ${s}`);return{data:await h.blob(),expires:h.headers.get("expires")||void 0,cacheControl:h.headers.get("cache-control")||void 0}}),m)},r)}async fetchDem(e,i,n,r,l,s){const c=Math.min(e-(r.overzoom||0),this.maxzoom),m=e-c,f=1<<m,d=Math.floor(i/f),h=Math.floor(n/f),w=await this.fetchAndParseTile(c,d,h,l,s);return $.fromRawDem(w).split(m,i%f,n%f)}fetchContourTile(e,i,n,r,l,s){const{levels:c,multiplier:m=1,buffer:f=1,extent:d=4096,contourLayer:h="contours",elevationKey:w="ele",levelKey:F="level",subsampleBelow:P=100}=r;if(!c||c.length===0)return Promise.resolve({arrayBuffer:new ArrayBuffer(0)});const O=[e,i,n,p(r)].join("/");return this.contourCache.get(O,async(I,R)=>{const V=1<<e,yt=[];for(let tt=n-1;tt<=n+1;tt++)for(let st=i-1;st<=i+1;st++)yt.push(tt<0||tt>=V?void 0:this.fetchDem(e,(st+V)%V,tt,r,R,s));const xt=await Promise.all(yt);let X=$.combineNeighbors(xt);if(!X||B(R))return{arrayBuffer:new Uint8Array().buffer};const rt=s==null?void 0:s.marker("isoline");if(X.width>=P)X=X.materialize(2);else for(;X.width<P;)X=X.subsamplePixelCenters(2).materialize(2);X=X.averagePixelCentersToGrid().scaleElevation(m).materialize(1);const C=x(c[0],X,d,f);rt==null||rt();const It=je({extent:d,layers:{[h]:{features:Object.entries(C).map(([tt,st])=>{const vt=Number(tt);return{type:pt.LINESTRING,geometry:st,properties:{[w]:vt,[F]:Math.max(...c.map((Dt,H)=>vt%Dt===0?H:0))}}})}}});return rt==null||rt(),{arrayBuffer:It.buffer}},l)}}const q=typeof performance<"u"?performance:void 0,Qe=q?q.timeOrigin||new Date().getTime()-q.now():new Date().getTime();function qe(t){var e;return JSON.parse(JSON.stringify(((e=q==null?void 0:q.getEntriesByName)===null||e===void 0?void 0:e.call(q,t))||[]))}function Qt(){return q?q.now():new Date().getTime()}function ti(t){const e=[];for(const i of t)e.push(...i);return e}class qt{constructor(e){this.marks={},this.urls=[],this.fetched=[],this.resources=[],this.tilesFetched=0,this.timeOrigin=Qe,this.finish=i=>{this.markFinish();const n=m=>{const f=this.marks[m]||[],d=Math.max(...f.map(w=>Math.max(...w))),h=Math.min(...f.map(w=>Math.min(...w)));return Number.isFinite(d)?d-h:void 0},r=n("main")||0,l=n("fetch"),s=n("decode"),c=n("isoline");return{url:i,tilesUsed:this.tilesFetched,origin:this.timeOrigin,marks:this.marks,resources:[...this.resources,...ti(this.fetched.map(qe))],duration:r,fetch:l,decode:s,process:c,wait:r-(l||0)-(s||0)-(c||0)}},this.error=i=>({...this.finish(i),error:!0}),this.marker=i=>{var n;this.marks[i]||(this.marks[i]=[]);const r=[Qt()];return(n=this.marks[i])===null||n===void 0||n.push(r),()=>r.push(Qt())},this.useTile=i=>{this.urls.indexOf(i)<0&&(this.urls.push(i),this.tilesFetched++)},this.fetchTile=i=>{this.fetched.indexOf(i)<0&&this.fetched.push(i)},this.addAll=i=>{var n;this.tilesFetched+=i.tilesUsed;const r=i.origin-this.timeOrigin;for(const l in i.marks){const s=l;(this.marks[s]||(this.marks[s]=[])).push(...((n=i.marks[s])===null||n===void 0?void 0:n.map(m=>m.map(f=>f+r)))||[])}this.resources.push(...i.resources.map(l=>ii(l,r)))},this.markFinish=this.marker(e)}}const ei=/(Start$|End$|^start|^end)/;function ii(t,e){const i={};for(const n in t)t[n]!==0&&ei.test(n)?i[n]=Number(t[n])+e:i[n]=t[n];return i}let oi=0;class ri{constructor(e,i,n=2e4){this.callbacks={},this.cancels={},this.dest=e,this.timeoutMs=n,this.dest.onmessage=async({data:r})=>{const l=r;if(l.type==="cancel"){const s=this.cancels[l.id];delete this.cancels[l.id],s==null||s.abort()}else if(l.type==="response"){const s=this.callbacks[l.id];delete this.callbacks[l.id],s&&s(l.error?new Error(l.error):void 0,l.response,l.timings)}else if(l.type==="request"){const s=new qt("worker"),c=i[l.name],m=new AbortController,f=c.apply(c,[...l.args,m,s]),d=`${l.name}_${l.id}`;if(l.id&&f){this.cancels[l.id]=m;try{const h=await f,w=h==null?void 0:h.transferrables;this.postMessage({id:l.id,type:"response",response:h,timings:s.finish(d)},w)}catch(h){this.postMessage({id:l.id,type:"response",error:(h==null?void 0:h.toString())||"error",timings:s.finish(d)})}delete this.cancels[l.id]}}}}postMessage(e,i){this.dest.postMessage(e,i||[])}send(e,i,n,r,...l){const s=++oi,c=new Promise((m,f)=>{this.postMessage({id:s,type:"request",name:e,args:l},i),this.callbacks[s]=(d,h,w)=>{r==null||r.addAll(w),d?f(d):m(h)}});return U(n,()=>{delete this.callbacks[s],this.postMessage({id:s,type:"cancel"})}),G(this.timeoutMs,c,n)}}o.A=ri,o.H=$,o.L=Je,o.T=qt,o.a=T,o.b=x,o.c=Ct,o.d=jt,o.e=k,o.f=A,o.g=_,o.p=D}),kt(["./shared"],function(o){const a=y=>Promise.reject(new Error(`No manager registered for ${y}`));class u{constructor(){this.managers={},this.init=(x,b)=>(this.managers[x.managerId]=new o.L(x.demUrlPattern,x.cacheSize,x.encoding,x.maxzoom,x.timeoutMs),Promise.resolve()),this.fetchTile=(x,b,S,M,k,T)=>{var p;return((p=this.managers[x])===null||p===void 0?void 0:p.fetchTile(b,S,M,k,T))||a(x)},this.fetchAndParseTile=(x,b,S,M,k,T)=>{var p;return o.p(((p=this.managers[x])===null||p===void 0?void 0:p.fetchAndParseTile(b,S,M,k,T))||a(x),!0)},this.fetchContourTile=(x,b,S,M,k,T,p)=>{var _;return o.f(((_=this.managers[x])===null||_===void 0?void 0:_.fetchContourTile(b,S,M,k,T,p))||a(x))}}}const g=typeof self<"u"?self:typeof window<"u"?window:global;g.actor=new o.A(g,new u)}),kt(["./shared"],function(o){const a={workerUrl:""};let u,g=0;class y{constructor(){this.decodeImage=(_,v,D)=>o.p(o.d(_,v,D),!1)}}function x(){if(!u){const p=new Worker(a.workerUrl),_=new y;u=new o.A(p,_)}return u}class b{constructor(_,v,D,A,j,dt){this.fetchTile=(Z,G,U,B,E)=>this.actor.send("fetchTile",[],B,E,this.managerId,Z,G,U),this.fetchAndParseTile=(Z,G,U,B,E)=>this.actor.send("fetchAndParseTile",[],B,E,this.managerId,Z,G,U),this.fetchContourTile=(Z,G,U,B,E,J)=>this.actor.send("fetchContourTile",[],E,J,this.managerId,Z,G,U,B);const et=this.managerId=++g;this.actor=dt||x(),this.loaded=this.actor.send("init",[],new AbortController,void 0,{cacheSize:v,demUrlPattern:_,encoding:D,maxzoom:A,managerId:et,timeoutMs:j})}}Blob.prototype.arrayBuffer||(Blob.prototype.arrayBuffer=function(){return new Promise((_,v)=>{const D=new FileReader;D.onload=A=>{var j;return _((j=A.target)===null||j===void 0?void 0:j.result)},D.onerror=v,D.readAsArrayBuffer(this)})});const S=p=>(_,v)=>{if(v instanceof AbortController)return p(_,v);{const D=new AbortController;return p(_,D).then(A=>v(void 0,A.data,A.cacheControl,A.expires),A=>v(A)),{cancel:()=>D.abort()}}},M=new Set;class k{constructor({url:_,cacheSize:v=100,id:D="dem",encoding:A="terrarium",maxzoom:j=12,worker:dt=!0,timeoutMs:et=1e4,actor:Z}){this.timingCallbacks=[],this.onTiming=E=>{this.timingCallbacks.push(E)},this.setupMaplibre=E=>{E.addProtocol(this.sharedDemProtocolId,this.sharedDemProtocol),E.addProtocol(this.contourProtocolId,this.contourProtocol)},this.sharedDemProtocolV4=async(E,J)=>{const[K,it,N]=this.parseUrl(E.url),ot=new o.T("main");let lt;try{const W=await this.manager.fetchTile(K,it,N,J,ot);return lt=ot.finish(E.url),{data:await W.data.arrayBuffer(),cacheControl:W.cacheControl,expires:W.expires}}catch(W){throw lt=ot.error(E.url),W}finally{this.timingCallbacks.forEach(W=>W(lt))}},this.contourProtocolV4=async(E,J)=>{const K=new o.T("main");let it;try{const[N,ot,lt]=this.parseUrl(E.url),W=o.a(E.url),bt=await this.manager.fetchContourTile(N,ot,lt,o.g(W,N),J,K);return it=K.finish(E.url),{data:bt.arrayBuffer}}catch(N){throw it=K.error(E.url),N}finally{this.timingCallbacks.forEach(N=>N(it))}},this.contourProtocol=S(this.contourProtocolV4),this.sharedDemProtocol=S(this.sharedDemProtocolV4),this.contourProtocolUrl=E=>`${this.contourProtocolUrlBase}?${o.e(E)}`;let G=D,U=1;for(;M.has(G);)G=D+U++;M.add(G),this.sharedDemProtocolId=`${G}-shared`,this.contourProtocolId=`${G}-contour`,this.sharedDemProtocolUrl=`${this.sharedDemProtocolId}://{z}/{x}/{y}`,this.contourProtocolUrlBase=`${this.contourProtocolId}://{z}/{x}/{y}`;const B=dt?b:o.L;this.manager=new B(_,v,A,j,et,Z)}getDemTile(_,v,D,A){return this.manager.fetchAndParseTile(_,v,D,A||new AbortController)}parseUrl(_){const[,v,D,A]=/\/\/(\d+)\/(\d+)\/(\d+)/.exec(_)||[];return[Number(v),Number(D),Number(A)]}}return{generateIsolines:o.b,DemSource:k,HeightTile:o.H,LocalDemManager:o.L,decodeParsedImage:o.c,set workerUrl(p){a.workerUrl=p},get workerUrl(){return a.workerUrl}}});var te=At;function ee(o){return o}function ie(o){if(o==null)return ee;var a,u,g=o.scale[0],y=o.scale[1],x=o.translate[0],b=o.translate[1];return function(S,M){M||(a=u=0);var k=2,T=S.length,p=new Array(T);for(p[0]=(a+=S[0])*g+x,p[1]=(u+=S[1])*y+b;k<T;)p[k]=S[k],++k;return p}}function oe(o,a){for(var u,g=o.length,y=g-a;y<--g;)u=o[y],o[y++]=o[g],o[g]=u}function Gt(o,a){return typeof a=="string"&&(a=o.objects[a]),a.type==="GeometryCollection"?{type:"FeatureCollection",features:a.geometries.map(function(u){return Bt(o,u)})}:Bt(o,a)}function Bt(o,a){var u=a.id,g=a.bbox,y=a.properties==null?{}:a.properties,x=re(o,a);return u==null&&g==null?{type:"Feature",properties:y,geometry:x}:g==null?{type:"Feature",id:u,properties:y,geometry:x}:{type:"Feature",id:u,bbox:g,properties:y,geometry:x}}function re(o,a){var u=ie(o.transform),g=o.arcs;function y(T,p){p.length&&p.pop();for(var _=g[T<0?~T:T],v=0,D=_.length;v<D;++v)p.push(u(_[v],v));T<0&&oe(p,D)}function x(T){return u(T)}function b(T){for(var p=[],_=0,v=T.length;_<v;++_)y(T[_],p);return p.length<2&&p.push(p[0]),p}function S(T){for(var p=b(T);p.length<4;)p.push(p[0]);return p}function M(T){return T.map(S)}function k(T){var p=T.type,_;switch(p){case"GeometryCollection":return{type:p,geometries:T.geometries.map(k)};case"Point":_=x(T.coordinates);break;case"MultiPoint":_=T.coordinates.map(x);break;case"LineString":_=b(T.arcs);break;case"MultiLineString":_=T.arcs.map(b);break;case"Polygon":_=M(T.arcs);break;case"MultiPolygon":_=T.arcs.map(M);break;default:return null}return{type:p,coordinates:_}}return k(a)}const ae={airspaceStroke:"#AAB7B8",restrictedStroke:"#D35400",controlledStroke:"#10B981",controlledFill:"#10B981",segment:"#2E4053",waypoint:"#1C2526",vor:"#00008B",ndb:"#0066CC",airport:"#006400",runway:"#333333"};function ne(){const o="navdata",a=ae;return[{id:"landLaye",type:"fill",source:"land",layout:{visibility:"visible"},paint:{"fill-color":"#F7F9FB","fill-opacity":1}},{id:"boundary",type:"line",source:"boundary",minzoom:.5,paint:{"line-width":["interpolate",["linear"],["zoom"],0,1,7,4],"line-opacity":1,"line-pattern":"normal:national-border"}},{id:"adiz-line",type:"line",source:o,"source-layer":"adiz",minzoom:3,layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":4,"line-pattern":"normal:adiz","line-opacity":["interpolate",["linear"],["zoom"],3,.6,8,.4]}},{id:"adiz-label",type:"symbol",source:o,"source-layer":"adiz-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"text-max-width":10,"symbol-placement":"point"},paint:{"text-color":"#6600cc","text-halo-color":"#ffffff","text-halo-width":1.5}},{id:"fir-line",type:"line",source:o,"source-layer":"fir",minzoom:2,paint:{"line-color":a.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],2,0,2.7,.8,9,.8,10,.5],"line-width":.5,"line-dasharray":[4.2,4]}},{id:"fir_line_dash",type:"line",source:o,"source-layer":"fir",minzoom:5,layout:{"line-miter-limit":0,"line-cap":"butt","line-join":"miter"},paint:{"line-color":a.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],5,0,5.5,.8,9,.8,10,.5],"line-width":6,"line-dasharray":[.2,5]}},{id:"fir-label-lineside",type:"symbol",source:o,"source-layer":"fir",minzoom:4,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1],"text-letter-spacing":.05,"text-optional":!0},paint:{"text-color":a.airspaceStroke}},{id:"fir-label",type:"symbol",source:o,"source-layer":"fir-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":["interpolate",["linear"],["zoom"],3,12,17,16],"symbol-placement":"point","text-max-width":8},paint:{"text-color":a.airspaceStroke,"text-opacity":["interpolate",["linear"],["zoom"],3,.85,8,.7,12,.5]}},{id:"restricted-fill",type:"fill",source:o,"source-layer":"restricted-fill",minzoom:4,paint:{"fill-color":"#FAD7A0","fill-opacity":["interpolate",["linear"],["zoom"],10,.15,11.5,0]}},{id:"restricted-stroke",type:"line",source:o,"source-layer":"restricted",paint:{"line-color":"#f6bf65","line-width":1,"line-dasharray":[2,2],"line-opacity":["interpolate",["linear"],["zoom"],4,.5,8,1]}},{id:"restricted-label",type:"symbol",source:o,"source-layer":"restricted",minzoom:6,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-letter-spacing":.1,"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1]},paint:{"text-color":a.restrictedStroke}},{id:"controlled-fill",type:"fill",source:o,"source-layer":"controlled-fill",minzoom:4,filter:["all",["!=",["get","CODE_TYPE"],"CTA"],["!=",["get","CODE_TYPE"],"ARSA"],["!=",["get","CODE_TYPE"],"TCA"],["!=",["get","CODE_TYPE"],"TRSA"]],paint:{"fill-color":a.controlledFill,"fill-opacity":["interpolate",["linear"],["zoom"],10,.035,11.5,0]}},{id:"controlled-stroke",type:"line",source:o,"source-layer":"controlled",filter:["all",["!=",["get","CODE_TYPE"],"ARSA"],["!=",["get","CODE_TYPE"],"TCA"],["!=",["get","CODE_TYPE"],"TRSA"]],paint:{"line-color":a.controlledStroke,"line-width":1,"line-opacity":["interpolate",["linear"],["zoom"],4,.5,8,1],"line-dasharray":[1,1.4]}},{id:"controlled-label",filter:["all",["!=",["get","CODE_TYPE"],"ARSA"],["!=",["get","CODE_TYPE"],"TCA"],["!=",["get","CODE_TYPE"],"TRSA"]],type:"symbol",source:o,"source-layer":"controlled",minzoom:6,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-size":10,"symbol-placement":"line","text-letter-spacing":.2,"text-max-width":8,"text-offset":[0,1]},paint:{"text-color":a.controlledStroke}},{id:"segment-line",type:"line",source:o,"source-layer":"segment",minzoom:5,paint:{"line-color":["case",["==",["get","HAS_REMARK"],1],"#E8A020",a.segment],"line-width":["interpolate",["linear"],["zoom"],5,.2,8,.8],"line-blur":0,"line-opacity":["interpolate",["linear"],["zoom"],5,.3,6,1,8,1,12,.8,15,.2]}},{id:"segment-label",type:"symbol",source:o,"source-layer":"segment",minzoom:6,layout:{"icon-image":["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""],["!=",["get","TXT_DESIG"]," "],["!=",["get","TXT_DESIG"],null]],"segment-both",["all",["has","TXT_DESIG_FORWARD"]],"segment-right",["all",["has","TXT_DESIG_BACKWARD"]],"segment-left","segment-both"],"icon-anchor":"center","symbol-placement":"line","icon-text-fit":"width","icon-size":1,"text-allow-overlap":!1,"icon-allow-overlap":!1,"text-optional":!1,"text-anchor":"center","text-justify":"center","text-line-height":1.3,"text-letter-spacing":.1,"text-field":["step",["zoom"],["format",["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""]],["get","TXT_DESIG"],["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":1,"text-color":"#ffffff"}],10,["format",["concat",["get","VAL_LEN"],"",["get","UOM_DIST"]],{"font-scale":.95,"text-color":"#3E4759"},`
|
|
2
2
|
`,["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]],["get","TXT_DESIG_RNP"],""],""],{"font-scale":1,"text-color":"#E8A020"},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]]," ",""],""],{},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""]],["get","TXT_DESIG"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":1,"text-color":"#ffffff","font-weight":"bold"},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],"",["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]]," ",""]],{},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],"",["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]],["get","TXT_DESIG_RNP"],""]],{"font-scale":.85,"text-color":"#E8A020"},`
|
|
3
3
|
`,["case",["all",["has","TXT_DESIG_HIGH"],["!=",["get","TXT_DESIG_HIGH"],""]],["get","TXT_DESIG_HIGH"],["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":.95,"text-color":"#3E4759"}]],"text-size":["interpolate",["linear"],["zoom"],6,9,10,10],"icon-text-fit-padding":[0,3,0,3]},paint:{"text-halo-color":"#ffffff","text-halo-width":.1,"icon-color":a.segment,"text-opacity":["interpolate",["linear"],["zoom"],6,1,12,1,15,.3],"icon-opacity":["interpolate",["linear"],["zoom"],6,1,12,1,15,.3]}},{id:"segment-radial",type:"symbol",source:o,"source-layer":"segment-radial",minzoom:10,layout:{"text-field":["concat",["get","bearing"],"°"],"text-size":9,"text-rotate":["to-number",["get","line_angle"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0,"text-offset":[0,-.6],"text-justify":"auto"},paint:{"text-color":a.segment}},{id:"airport-circle",type:"symbol",source:o,minzoom:3,"source-layer":"airport",filter:["case",["<",["zoom"],6],["==",["get","level"],1],!0],layout:{"icon-image":["case",["==",["get","CODE_TYPE_MIL_OPS"],"MIL"],"airport-mil",["==",["get","CODE_TYPE_MIL_OPS"],"MILEXT"],"airport-milext","airport-civ"],"icon-size":["interpolate",["linear"],["zoom"],4,.5,10,.9],"symbol-z-order":"viewport-y","text-field":["get","codeId"],"text-letter-spacing":.05,"text-anchor":"bottom","text-justify":"center","text-size":["interpolate",["linear"],["zoom"],4,0,5,12],"text-offset":["interpolate",["linear"],["zoom"],4,["literal",[0,-1.2]],5,["literal",[0,-.6]]],"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-allow-overlap":!0,"text-ignore-placement":!0,visibility:"none","icon-size":["interpolate",["linear"],["zoom"],5,.6,9,1.2,12,1.3]},paint:{"icon-color":["case",["has","has_amm"],"#4B2D6E",a.airport],"icon-opacity":["interpolate",["linear"],["zoom"],2,.75,3,.95,5,1,9,1,11,.2]}},{id:"airport-label",type:"symbol",source:o,"source-layer":"airport",minzoom:4,filter:["case",["<",["zoom"],8],["==",["get","level"],1],!0],layout:{"text-field":["get","CODE_ID"],"text-size":["interpolate",["linear"],["zoom"],4,9,8,11],"text-anchor":"top","text-offset":[0,1],"text-allow-overlap":!1,"text-ignore-placement":!1},paint:{"text-color":["case",["has","has_amm"],"#4B2D6E",a.airport]}},{id:"runway-line",type:"line",source:o,"source-layer":"runway",filter:["!",["has","has_amm"]],minzoom:4,maxzoom:11,paint:{"line-color":a.runway,"line-width":["interpolate",["linear"],["zoom"],4,1,13,10]}},{id:"runway-line-amm",type:"line",source:o,"source-layer":"runway",filter:["has","has_amm"],minzoom:4,maxzoom:11,paint:{"line-color":a.runway,"line-width":["interpolate",["linear"],["zoom"],4,1,10,4],"line-opacity":["interpolate",["linear"],["zoom"],10.5,1,11,0]}},{id:"runway-label",type:"symbol",source:o,"source-layer":"runway",minzoom:10,layout:{"text-field":["concat",["to-string",["get","VAL_LEN"]],"×",["to-string",["get","VAL_WID"]],"m"],"text-size":10,"symbol-placement":"line-center","text-rotation-alignment":"map","text-optional":!0},paint:{"text-color":a.runway,"text-halo-width":1,"text-opacity":["interpolate",["linear"],["zoom"],10.5,1,11,0]}},{id:"vor-symbol",type:"symbol",source:o,"source-layer":"vor",minzoom:8,layout:{"icon-image":"vor_dial","icon-size":["interpolate",["linear"],["zoom"],8,.072,10,.072,11,.126,12,.18,13,.234,14,.288,15,.342,16,.396,17,.45,22,.45],"icon-rotate":["to-number",["get","VAL_MAG_VAR"],0],"icon-rotation-alignment":"map","symbol-z-order":"viewport-y","text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0,visibility:"none"},paint:{"icon-color":"#0b417a"}},{id:"vor-symbol-normal",minzoom:4,maxzoom:9,type:"symbol",source:o,"source-layer":"vor",layout:{"icon-image":"v2:vor-normal","icon-size":["interpolate",["linear"],["zoom"],4,.7,8,1],"icon-rotation-alignment":"map","symbol-z-order":"viewport-y","text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0},paint:{"icon-color":"#3874cb","icon-opacity":["interpolate",["linear"],["zoom"],8,1,9,0]}},{id:"vor-label",type:"symbol",source:o,"source-layer":"vor",minzoom:5,layout:{"text-field":["get","CODE_ID"],"text-size":10,"text-anchor":"bottom","text-offset":[0,-.8]},paint:{"text-color":a.vor,"text-halo-color":"#ffffff","text-halo-width":1}},{id:"ndb-symbol",type:"symbol",source:o,minzoom:4,"source-layer":"ndb",layout:{"icon-image":"v2:ndb-normal","icon-size":["interpolate",["linear"],["zoom"],6,.5,10,1],"symbol-z-order":"viewport-y","text-field":["format",["get","CODE_ID"],{"text-color":a.ndb,"font-scale":1.1},"",{},["coalesce",["get","VAL_FREQ"],""],{"text-color":a.ndb,"font-scale":.95}],"text-size":10,"text-offset":[0,.5],"text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0,"text-anchor":"top"},paint:{"text-color":a.ndb,"text-halo-color":"#ffffff","text-halo-width":.5,"text-halo-blur":1,"icon-color":a.ndb,"text-opacity":["interpolate",["linear"],["zoom"],4,0,5.5,0,6,.6,8,1,10,.3,12,0],"icon-opacity":["interpolate",["linear"],["zoom"],4,0,5,.3,5.5,.8,8,1,12,1,14,.6]}},{id:"waypoint-symbol",type:"symbol",source:o,"source-layer":"waypoint",minzoom:5,layout:{"icon-image":["case",["==",["get","report_type"],"C"],"waypoint-compusory","waypoint"],"icon-size":.6,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-field":["get","CODE_ID"],"text-size":10,"text-letter-spacing":.02,"text-variable-anchor-offset":["bottom",[0,-.6],"top",[0,.6],"right",[-.6,0],"left",[.6,0],"bottom-right",[-.4,-.4],"bottom-left",[.4,-.4],"top-right",[-.4,.4],"top-left",[.4,.4]],"text-justify":"auto"},paint:{"icon-color":a.waypoint,"text-color":a.waypoint,"text-halo-color":"#ffffff","text-halo-width":1,"icon-halo-color":"rgba(0,0,0,0)","icon-halo-width":0,"icon-opacity":["interpolate",["linear"],["zoom"],5,.5,12,1,15,.2],"text-halo-color":"#FFFFFF","text-halo-blur":0,"text-opacity":["interpolate",["linear"],["zoom"],6,1,12,.9,15,.15]}},{id:"waypoint-off-airway-symbol",type:"symbol",source:o,"source-layer":"waypoint-off-airway",minzoom:7,layout:{"icon-image":["case",["==",["get","report_type"],"C"],"designate_point_inway","designate_point_notinway"],"icon-size":.6,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-field":["get","CODE_ID"],"text-size":9,"text-variable-anchor-offset":["bottom",[0,-.6],"top",[0,.6],"right",[-.6,0],"left",[.6,0],"bottom-right",[-.4,-.4],"bottom-left",[.4,-.4],"top-right",[-.4,.4],"top-left",[.4,.4]],"text-justify":"auto","text-optional":!0},paint:{"icon-color":a.waypoint,"text-color":a.waypoint,"text-halo-color":"#ffffff","text-halo-width":1,"icon-opacity":["interpolate",["linear"],["zoom"],7,.5,12,1,15,.2],"text-opacity":["interpolate",["linear"],["zoom"],7,1,12,.9,15,.15]}}]}const le={airspaceStroke:"#18C29C",restrictedStroke:"#f87171",controlledStroke:"#38bdf8",controlledFill:"#38bdf8",segment:"#40C4FF",waypoint:"#74cdde",vor:"#72aae5",ndb:"#62d6ef",airport:"#73ccdd",runway:"#64748b"};function se(){const o="navdata",a=le;return[{id:"landLaye",type:"fill",source:"land",layout:{visibility:"visible"},paint:{"fill-color":"#0A111A","fill-opacity":1}},{id:"boundary",type:"line",source:"boundary",minzoom:.5,paint:{"line-color":"#2A303C","line-width":["interpolate",["linear"],["zoom"],0,1,7,4],"line-opacity":1,"line-pattern":"normal:national-border"}},{id:"adiz-line",type:"line",source:o,"source-layer":"adiz",minzoom:3,layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#a855f7","line-width":["interpolate",["linear"],["zoom"],3,3,7,6],"line-pattern":"normal:adiz","line-opacity":["interpolate",["linear"],["zoom"],3,.7,8,.5]}},{id:"adiz-label",type:"symbol",source:o,"source-layer":"adiz-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"text-max-width":10,"symbol-placement":"point"},paint:{"text-color":"#c084fc","text-halo-color":"#0f172a","text-halo-width":1.5}},{id:"fir-line",type:"line",source:o,"source-layer":"fir",minzoom:2,layout:{"line-cap":"butt","line-join":"miter","line-miter-limit":0},paint:{"line-color":a.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],2,0,2.7,.8,9,.8,10,.5],"line-width":.8,"line-dasharray":[4.2,4]}},{id:"fir_line_dash",type:"line",source:o,"source-layer":"fir",minzoom:5,layout:{"line-miter-limit":0,"line-cap":"butt","line-join":"miter"},paint:{"line-color":a.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],5,0,5.5,.8,9,.8,10,.5],"line-width":5,"line-dasharray":[.2,5]}},{id:"fir-label-lineside",type:"symbol",source:o,"source-layer":"fir",minzoom:4,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1],"text-letter-spacing":.05,"text-optional":!0},paint:{"text-color":a.airspaceStroke,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"fir-label",type:"symbol",source:o,"source-layer":"fir-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":["interpolate",["linear"],["zoom"],3,12,17,16],"symbol-placement":"point","text-max-width":8},paint:{"text-color":a.airspaceStroke,"text-halo-color":"#0f172a","text-halo-width":1.5,"text-opacity":["interpolate",["linear"],["zoom"],3,.85,8,.7,12,.5]}},{id:"restricted-fill",type:"fill",source:o,"source-layer":"restricted-fill",minzoom:4,paint:{"fill-color":["case",["==",["get","CODE_TYPE"],"P"],"#ef4444",["==",["get","CODE_TYPE"],"D"],"#f97316","#ef4444"],"fill-opacity":.04}},{id:"restricted-stroke",type:"line",source:o,"source-layer":"restricted",paint:{"line-color":a.restrictedStroke,"line-width":1,"line-dasharray":[2,2],"line-opacity":["interpolate",["linear"],["zoom"],4,.6,8,1]}},{id:"restricted-label",type:"symbol",source:o,"source-layer":"restricted",minzoom:6,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1]},paint:{"text-color":a.restrictedStroke,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"controlled-fill",type:"fill",source:o,"source-layer":"controlled-fill",minzoom:4,paint:{"fill-color":a.controlledFill,"fill-opacity":.03}},{id:"controlled-stroke",type:"line",source:o,"source-layer":"controlled",paint:{"line-color":a.controlledStroke,"line-width":1,"line-opacity":["interpolate",["linear"],["zoom"],4,.6,8,1],"line-dasharray":[2,2]}},{id:"controlled-label",type:"symbol",source:o,"source-layer":"controlled",minzoom:6,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"symbol-placement":"point","text-max-width":8},paint:{"text-color":a.controlledStroke,"text-halo-color":"#0f172a","text-halo-width":1.5}},{id:"segment-line",type:"line",source:o,"source-layer":"segment",minzoom:5,paint:{"line-color":["case",["==",["get","HAS_REMARK"],1],"#fbbf24",a.segment],"line-width":["interpolate",["linear"],["zoom"],5,.2,8,.8],"line-blur":0,"line-opacity":["interpolate",["linear"],["zoom"],5,.3,6,1,8,1,12,.8,15,.2]}},{id:"segment-label",type:"symbol",source:o,"source-layer":"segment",minzoom:6,layout:{"icon-image":["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""],["!=",["get","TXT_DESIG"]," "],["!=",["get","TXT_DESIG"],null]],"segment-both",["all",["has","TXT_DESIG_FORWARD"]],"segment-right",["all",["has","TXT_DESIG_BACKWARD"]],"segment-left","segment-both"],"icon-anchor":"center","symbol-placement":"line","icon-text-fit":"width","icon-size":1,"text-allow-overlap":!1,"icon-allow-overlap":!1,"text-anchor":"center","text-justify":"center","text-line-height":1.3,"text-letter-spacing":.1,"text-field":["step",["zoom"],["format",["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""]],["get","TXT_DESIG"],["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":1,"text-color":"#0f172a"}],10,["format",["concat",["get","VAL_LEN"],"",["get","UOM_DIST"]],{"font-scale":.95,"text-color":"#cbd5e1"},`
|
|
4
4
|
`,["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]],["get","TXT_DESIG_RNP"],""],""],{"font-scale":1,"text-color":"#FFFFFF"},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]]," ",""],""],{},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""]],["get","TXT_DESIG"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":1,"text-color":"#0f172a","font-weight":"bold"},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],"",["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]]," ",""]],{},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],"",["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]],["get","TXT_DESIG_RNP"],""]],{"font-scale":.85,"text-color":"#FFFFFF"},`
|
|
5
5
|
`,["case",["all",["has","TXT_DESIG_HIGH"],["!=",["get","TXT_DESIG_HIGH"],""]],["get","TXT_DESIG_HIGH"],["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":.95,"text-color":"#cbd5e1"}]],"text-size":["interpolate",["linear"],["zoom"],6,9,10,10],"icon-text-fit-padding":[0,3,0,3]},paint:{"icon-color":a.segment}},{id:"segment-radial",type:"symbol",source:o,"source-layer":"segment-radial",minzoom:10,layout:{"text-field":["concat",["get","bearing"],"°"],"text-size":9,"text-rotate":["to-number",["get","line_angle"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0,"text-offset":[0,-1]},paint:{"text-color":a.segment,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"airport-circle",type:"symbol",source:o,minzoom:3,"source-layer":"airport",filter:["case",["<",["zoom"],6],["==",["get","level"],1],!0],layout:{"icon-image":["case",["==",["get","CODE_TYPE_MIL_OPS"],"MIL"],"airport-mil",["==",["get","CODE_TYPE_MIL_OPS"],"MILEXT"],"airport-milext","airport-civ"],"icon-size":["interpolate",["linear"],["zoom"],4,.5,10,.9],"symbol-z-order":"viewport-y","text-field":["get","codeId"],"text-letter-spacing":.05,"text-anchor":"bottom","text-justify":"center","text-size":["interpolate",["linear"],["zoom"],4,0,5,12],"text-offset":["interpolate",["linear"],["zoom"],4,["literal",[0,-1.2]],5,["literal",[0,-.6]]],"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-allow-overlap":!0,"text-ignore-placement":!0,visibility:"none","icon-size":["interpolate",["linear"],["zoom"],5,.6,9,1.2,12,1.3]},paint:{"icon-color":["case",["has","has_amm"],"#4B2D6E",a.airport],"icon-opacity":["interpolate",["linear"],["zoom"],2,.75,3,.95,5,1,9,1,11,.2]}},{id:"airport-label",type:"symbol",source:o,"source-layer":"airport",minzoom:4,filter:["case",["<",["zoom"],8],["==",["get","level"],1],!0],layout:{"text-field":["get","CODE_ID"],"text-size":["interpolate",["linear"],["zoom"],4,9,8,11],"text-anchor":"top","text-offset":[0,1],"text-allow-overlap":!1,"text-ignore-placement":!1},paint:{"text-color":["case",["has","has_amm"],"#4B2D6E","#E0F7FA"]}},{id:"runway-line",type:"line",source:o,"source-layer":"runway",filter:["!",["has","has_amm"]],minzoom:4,paint:{"line-color":a.runway,"line-width":["interpolate",["linear"],["zoom"],4,1,10,3]}},{id:"runway-line-amm",type:"line",source:o,"source-layer":"runway",filter:["has","has_amm"],minzoom:4,paint:{"line-color":a.runway,"line-width":["interpolate",["linear"],["zoom"],4,1,10,3],"line-opacity":["interpolate",["linear"],["zoom"],10.5,1,11,0]}},{id:"runway-label",type:"symbol",source:o,"source-layer":"runway",minzoom:10,layout:{"text-field":["concat",["to-string",["get","VAL_LEN"]],"×",["to-string",["get","VAL_WID"]],"m"],"text-size":10,"text-font":["Noto Sans Regular"],"symbol-placement":"line-center","text-rotation-alignment":"map","text-optional":!0},paint:{"text-color":a.runway,"text-halo-color":"#0f172a","text-halo-width":1,"text-opacity":["interpolate",["linear"],["zoom"],10.5,1,11,0]}},{id:"vor-symbol",type:"symbol",source:o,"source-layer":"vor",layout:{"icon-image":"vor_dial","icon-size":["interpolate",["linear"],["zoom"],5,.072,10,.072,11,.126,12,.18,13,.234,14,.288,15,.342,16,.396,17,.45,22,.45],"icon-rotate":["to-number",["get","VAL_MAG_VAR"],0],"icon-rotation-alignment":"map","symbol-z-order":"viewport-y","text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0,visibility:"none"},paint:{"icon-color":"#38bdf8"}},{id:"vor-label",type:"symbol",source:o,"source-layer":"vor",minzoom:5,layout:{"text-field":["get","CODE_ID"],"text-size":10,"text-anchor":"bottom","text-offset":[0,-.8]},paint:{"text-color":a.vor,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"ndb-symbol",type:"symbol",source:o,minzoom:4,"source-layer":"ndb",layout:{"icon-image":"ndb-inway","icon-size":["interpolate",["linear"],["zoom"],6,.5,10,1],"symbol-z-order":"viewport-y","text-field":["concat",["get","CODE_ID"],`
|
|
6
|
-
`,["get","VAL_FREQ"],"kHz"],"text-size":10,"text-offset":[0,1.4],"text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0},paint:{"text-color":a.ndb,"text-halo-color":"#0f172a","text-halo-width":1,"icon-color":a.ndb}},{id:"waypoint-symbol",type:"symbol",source:o,"source-layer":"waypoint",minzoom:5,layout:{"icon-image":["case",["==",["get","report_type"],"C"],"waypoint-compusory","waypoint"],"icon-size":.6,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-field":["get","CODE_ID"],"text-size":9,"text-variable-anchor-offset":["bottom",[0,-.6],"top",[0,.6],"right",[-.6,0],"left",[.6,0],"bottom-right",[-.4,-.4],"bottom-left",[.4,-.4],"top-right",[-.4,.4],"top-left",[.4,.4]],"text-justify":"auto","text-optional":!0},paint:{"icon-color":a.waypoint,"text-color":a.waypoint,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"waypoint-off-airway-symbol",type:"symbol",source:o,"source-layer":"waypoint-off-airway",minzoom:7,layout:{"icon-image":["case",["==",["get","report_type"],"C"],"designate_point_inway","designate_point_notinway"],"icon-size":.6,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-field":["get","CODE_ID"],"text-size":9,"text-variable-anchor-offset":["bottom",[0,-.6],"top",[0,.6],"right",[-.6,0],"left",[.6,0],"bottom-right",[-.4,-.4],"bottom-left",[.4,-.4],"top-right",[-.4,.4],"top-left",[.4,.4]],"text-justify":"auto","text-optional":!0},paint:{"icon-color":a.waypoint,"text-color":a.waypoint,"text-halo-color":"#0f172a","text-halo-width":1}}]}const nt={light:{id:"light",label:"日间",background:"#EAF2F8",build:ne},dark:{id:"dark",label:"夜间",background:"#000000",build:se}};function Xt(o="light"){return(nt[o]??nt.light).build()}const _t={adiz:["adiz-line","adiz-label"],fir:["fir-line","fir_line_dash","fir-label"],restricted:["restricted-fill","restricted-stroke","restricted-label"],controlled:["controlled-fill","controlled-stroke","controlled-label"],segment:["segment-radial","segment-line","segment-label"],waypoint:["waypoint-symbol"],waypointOffAirway:["waypoint-off-airway-symbol"],vor:["vor-symbol","vor-label"],ndb:["ndb-symbol"],airport:["airport-circle","airport-label"],runway:["runway-line","runway-line-amm","runway-label"]},ce={airport:"#e2e8f0",runway:"#94a3b8",apron:"#cbd5e1",taxiway:"#e2e8f0",taxiwayLine:"#f59e0b",holding:"#b91c1c",stand:"#1e293b",runwayMarking:"#ffffff",runwayCenterline:"#ffffff",standLine:"#64748b",restricted:"#b91c1c",hotspot:"#ea580c"};function me(o="amm"){const a=ce;return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":a.airport,"fill-opacity":.4}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":a.airport,"line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":a.runway,"fill-opacity":.9}},{id:"amm-runway-stroke",type:"line",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"line-color":"#64748b","line-width":.5}},{id:"amm-apron-fill",type:"fill",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"fill-color":a.apron,"fill-opacity":.6}},{id:"amm-apron-stroke",type:"line",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"line-color":"#94a3b8","line-width":.5}},{id:"amm-taxiway-fill",type:"fill",source:o,"source-layer":"amm-taxiway",minzoom:11,paint:{"fill-color":a.taxiway,"fill-opacity":.7}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":a.taxiwayLine,"line-width":["interpolate",["linear"],["zoom"],15,.8,18,2]}},{id:"amm-taxiway-label",type:"symbol",source:o,"source-layer":"amm-taxiway-line",minzoom:14,layout:{"text-field":["get","idlin"],"text-size":10,"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"symbol-placement":"line","text-keep-upright":!0,"text-allow-overlap":!1},paint:{"text-color":"#FFF","icon-color":a.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":a.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":a.runwayMarking,"fill-opacity":.9}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":a.restricted,"fill-opacity":.08}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":a.restricted,"line-width":1.5,"line-dasharray":[4,2]}},{id:"amm-hotspot-fill",type:"fill",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"fill-color":a.hotspot,"fill-opacity":.1}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":a.hotspot,"line-width":1.5}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":a.runwayCenterline,"line-width":1,"line-dasharray":[6,3]}},{id:"amm-runway-info",type:"symbol",source:o,"source-layer":"amm-runway-label",minzoom:13,layout:{"text-field":["concat",["coalesce",["get","length"],""],"×",["coalesce",["get","width"],""],"m"],"text-size":["interpolate",["exponential",1.5],["zoom"],13,10,16,13],"symbol-placement":"point","text-rotate":["coalesce",["get","bearing"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#f8fafc","text-halo-color":"#334155","text-halo-width":2.5}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":a.standLine,"line-width":1}},{id:"amm-runway-threshold-label",type:"symbol",source:o,"source-layer":"amm-runway-threshold",minzoom:12,layout:{"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"text-field":["get","idthr"],"text-size":14,"text-allow-overlap":!0,"text-rotation-alignment":"map","icon-rotation-alignment":"map"},paint:{"text-color":"#fff","icon-color":"#b91c1c"}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":a.stand,"circle-radius":1.5}},{id:"amm-stand-label",type:"symbol",source:o,"source-layer":"amm-stand",minzoom:14,layout:{"text-field":["get","idstd"],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":a.standLine}},{id:"amm-obstacle-region-fill",type:"fill",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"fill-color":"#fef08a","fill-opacity":.35}},{id:"amm-obstacle-region-stroke",type:"line",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"line-color":"#ca8a04","line-width":1.5,"line-dasharray":[1.5,1]}},{id:"amm-obstacle-point",type:"circle",source:o,"source-layer":"amm-obstacle-point",minzoom:11,paint:{"circle-color":"#b45309","circle-radius":4,"circle-stroke-color":"#ffffff","circle-stroke-width":1}},{id:"amm-obstacle-point-label",type:"symbol",source:o,"source-layer":"amm-obstacle-point",minzoom:14,layout:{"text-field":["coalesce",["get","ident"],["get","LABEL"]],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":"#92400e","text-halo-color":"#ffffff","text-halo-width":1}},{id:"amm-construction-fill",type:"fill",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"fill-pattern":"normal:passline","fill-opacity":.8}},{id:"amm-construction-stroke",type:"line",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"line-color":"#d97706","line-width":1.5,"line-dasharray":[4,2]}},{id:"amm-construction-label",type:"symbol",source:o,"source-layer":"amm-construction",minzoom:13,layout:{"text-field":["get","text"],"text-size":9,"text-anchor":"center","symbol-placement":"point","text-allow-overlap":!1},paint:{"text-color":"#92400e","text-halo-color":"#ffffff","text-halo-width":1}}]}const de={airport:"#334155",runway:"#475569",apron:"#1e293b",taxiway:"#334155",taxiwayLine:"#fbbf24",holding:"#ef4444",stand:"#34d399",runwayMarking:"#cbd5e1",runwayCenterline:"#94a3b8",standLine:"#64748b",restricted:"#f87171",hotspot:"#fb923c"};function fe(o="amm"){const a=de;return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":a.airport,"fill-opacity":.3}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":"#475569","line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":a.runway,"fill-opacity":1}},{id:"amm-runway-stroke",type:"line",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"line-color":"#64748b","line-width":.5}},{id:"amm-apron-fill",type:"fill",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"fill-color":a.apron,"fill-opacity":1}},{id:"amm-apron-stroke",type:"line",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"line-color":"#334155","line-width":.5}},{id:"amm-taxiway-fill",type:"fill",source:o,"source-layer":"amm-taxiway",minzoom:11,paint:{"fill-color":a.taxiway,"fill-opacity":.8}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":a.taxiwayLine,"line-width":["interpolate",["linear"],["zoom"],15,.8,18,2]}},{id:"amm-taxiway-label",type:"symbol",source:o,"source-layer":"amm-taxiway-line",minzoom:14,layout:{"text-field":["get","idlin"],"text-size":10,"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"symbol-placement":"line","text-keep-upright":!0,"text-allow-overlap":!1},paint:{"text-color":"#0f172a","icon-color":a.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":a.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":a.runwayMarking,"fill-opacity":.8}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":a.restricted,"fill-opacity":.12}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":a.restricted,"line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-hotspot-fill",type:"fill",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"fill-color":a.hotspot,"fill-opacity":.15}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":a.hotspot,"line-width":1.2}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":a.runwayCenterline,"line-width":1,"line-dasharray":[6,3]}},{id:"amm-runway-info",type:"symbol",source:o,"source-layer":"amm-runway-label",minzoom:13,layout:{"text-field":["concat",["coalesce",["get","length"],""],"×",["coalesce",["get","width"],""],"m"],"text-size":["interpolate",["exponential",1.5],["zoom"],13,10,16,13],"symbol-placement":"point","text-rotate":["coalesce",["get","bearing"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#e2e8f0","text-halo-color":"#0f172a","text-halo-width":2}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":a.standLine,"line-width":1}},{id:"amm-runway-threshold-label",type:"symbol",source:o,"source-layer":"amm-runway-threshold",minzoom:12,layout:{"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"text-field":["get","idthr"],"text-size":14,"text-allow-overlap":!0,"text-rotation-alignment":"map","icon-rotation-alignment":"map"},paint:{"text-color":"#ffffff","icon-color":"#ef4444"}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":a.stand,"circle-radius":1.5}},{id:"amm-stand-label",type:"symbol",source:o,"source-layer":"amm-stand",minzoom:14,layout:{"text-field":["get","idstd"],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":a.stand,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"amm-obstacle-region-fill",type:"fill",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"fill-color":"#fef08a","fill-opacity":.15}},{id:"amm-obstacle-region-stroke",type:"line",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"line-color":"#eab308","line-width":1.2,"line-dasharray":[1.5,1]}},{id:"amm-obstacle-point",type:"circle",source:o,"source-layer":"amm-obstacle-point",minzoom:11,paint:{"circle-color":"#f97316","circle-radius":4,"circle-stroke-color":"#0f172a","circle-stroke-width":1}},{id:"amm-obstacle-point-label",type:"symbol",source:o,"source-layer":"amm-obstacle-point",minzoom:14,layout:{"text-field":["coalesce",["get","ident"],["get","LABEL"]],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":"#fdba74","text-halo-color":"#0f172a","text-halo-width":1.2}},{id:"amm-construction-fill",type:"fill",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"fill-pattern":"normal:passline","fill-opacity":.6}},{id:"amm-construction-stroke",type:"line",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"line-color":"#ea580c","line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-construction-label",type:"symbol",source:o,"source-layer":"amm-construction",minzoom:13,layout:{"text-field":["get","text"],"text-size":9,"text-anchor":"center","symbol-placement":"point","text-allow-overlap":!1},paint:{"text-color":"#f97316","text-halo-color":"#0f172a","text-halo-width":1}}]}const he={airport:"#4b5563",runway:"#71717a",apron:"#27272a",taxiway:"#3f3f46",taxiwayLine:"#eab308",holding:"#ef4444",stand:"#10b981",runwayMarking:"#e4e4e7",runwayCenterline:"#d4d4d8",standLine:"#6b7280",threshold:"#f97316",restricted:"#f87171",hotspot:"#fb923c"};function ue(o="amm"){const a=he,u="#1f1f23";return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":a.airport,"fill-opacity":.3}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":"#52525b","line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":a.runway,"fill-opacity":1}},{id:"amm-runway-stroke",type:"line",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"line-color":"#52525b","line-width":.5}},{id:"amm-apron-fill",type:"fill",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"fill-color":a.apron,"fill-opacity":1}},{id:"amm-apron-stroke",type:"line",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"line-color":"#3f3f46","line-width":.5}},{id:"amm-taxiway-fill",type:"fill",source:o,"source-layer":"amm-taxiway",minzoom:11,paint:{"fill-color":a.taxiway,"fill-opacity":.9}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":a.taxiwayLine,"line-width":["interpolate",["linear"],["zoom"],15,.8,18,2]}},{id:"amm-taxiway-label",type:"symbol",source:o,"source-layer":"amm-taxiway-line",minzoom:14,layout:{"text-field":["get","idlin"],"text-size":10,"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"symbol-placement":"line","text-keep-upright":!0,"text-allow-overlap":!1},paint:{"text-color":u,"icon-color":a.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":a.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":a.runwayMarking,"fill-opacity":.85}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":a.restricted,"fill-opacity":.1}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":a.restricted,"line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-hotspot-fill",type:"fill",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"fill-color":a.hotspot,"fill-opacity":.12}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":a.hotspot,"line-width":1.2}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":a.runwayCenterline,"line-width":1,"line-dasharray":[6,3]}},{id:"amm-runway-info",type:"symbol",source:o,"source-layer":"amm-runway-label",minzoom:13,layout:{"text-field":["concat",["coalesce",["get","length"],""],"×",["coalesce",["get","width"],""],"m"],"text-size":["interpolate",["exponential",1.5],["zoom"],13,10,16,13],"symbol-placement":"point","text-rotate":["coalesce",["get","bearing"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#e4e4e7","text-halo-color":u,"text-halo-width":2}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":a.standLine,"line-width":1}},{id:"amm-runway-threshold-label",type:"symbol",source:o,"source-layer":"amm-runway-threshold",minzoom:12,layout:{"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"text-field":["get","idthr"],"text-size":14,"text-allow-overlap":!0,"text-rotation-alignment":"map","icon-rotation-alignment":"map"},paint:{"text-color":"#ffffff","icon-color":a.threshold}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":a.stand,"circle-radius":1.5}},{id:"amm-stand-label",type:"symbol",source:o,"source-layer":"amm-stand",minzoom:14,layout:{"text-field":["get","idstd"],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":a.stand,"text-halo-color":u,"text-halo-width":1}},{id:"amm-obstacle-region-fill",type:"fill",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"fill-color":"#fef08a","fill-opacity":.1}},{id:"amm-obstacle-region-stroke",type:"line",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"line-color":"#eab308","line-width":1.2,"line-dasharray":[1.5,1]}},{id:"amm-obstacle-point",type:"circle",source:o,"source-layer":"amm-obstacle-point",minzoom:11,paint:{"circle-color":"#f97316","circle-radius":4,"circle-stroke-color":u,"circle-stroke-width":1}},{id:"amm-obstacle-point-label",type:"symbol",source:o,"source-layer":"amm-obstacle-point",minzoom:14,layout:{"text-field":["coalesce",["get","ident"],["get","LABEL"]],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":"#fdba74","text-halo-color":u,"text-halo-width":1.2}},{id:"amm-construction-fill",type:"fill",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"fill-pattern":"normal:passline","fill-opacity":.6}},{id:"amm-construction-stroke",type:"line",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"line-color":"#ea580c","line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-construction-label",type:"symbol",source:o,"source-layer":"amm-construction",minzoom:13,layout:{"text-field":["get","text"],"text-size":9,"text-anchor":"center","symbol-placement":"point","text-allow-overlap":!1},paint:{"text-color":"#f97316","text-halo-color":u,"text-halo-width":1}}]}function Nt(o="amm",a="light"){return a==="dark"?fe(o):a==="neutral"?ue(o):me(o)}const pe={ammAirport:["amm-airport-fill","amm-airport-stroke"],ammRunway:["amm-runway-fill","amm-runway-stroke","amm-runway-info","amm-runway-marking","amm-runway-centerline","amm-runway-threshold","amm-runway-threshold-label"],ammApron:["amm-apron-fill","amm-apron-stroke"],ammTaxiway:["amm-taxiway-fill","amm-taxiway-line","amm-taxiway-label"],ammHolding:["amm-holding"],ammStand:["amm-stand","amm-stand-label","amm-stand-line"],ammRestricted:["amm-restricted-fill","amm-restricted-stroke"],ammHotspot:["amm-hotspot-fill","amm-hotspot-stroke"],ammObstacle:["amm-obstacle-region-fill","amm-obstacle-region-stroke","amm-obstacle-point","amm-obstacle-point-label"],ammConstruction:["amm-construction-fill","amm-construction-stroke","amm-construction-label"]},ye="http://pre.aips.siniswift.com",xe=["interpolate",["linear"],["elevation"],0,"#a8c98a",600,"#cdd98a",1200,"#e8d79a",2400,"#c79a5b",3600,"#9c6b3f",4500,"#f2efe9"],Rt=["amm-airport-fill","amm-airport-stroke","amm-runway-fill","amm-runway-stroke","amm-runway-info","amm-runway-marking","amm-runway-centerline","amm-runway-threshold-label","amm-apron-fill","amm-apron-stroke","amm-taxiway-fill","amm-taxiway-line","amm-taxiway-label","amm-holding","amm-stand","amm-stand-label","amm-stand-line","amm-restricted-fill","amm-restricted-stroke","amm-hotspot-fill","amm-hotspot-stroke","amm-obstacle-region-fill","amm-obstacle-region-stroke","amm-obstacle-point","amm-obstacle-point-label","amm-construction-fill","amm-construction-stroke","amm-construction-label"],Vt=["terrain-color","terrain-hillshade"],Ut=["contour-line","contour-label"];async function Wt(o){const a=await fetch(o);if(!a.ok)throw new Error(`fetch ${o} → ${a.status}`);const u=a.headers.get("Content-Encoding"),g=a.headers.get("Content-Type")||"";if(u==="gzip"||g.includes("json"))return a.json();const y=a.body.pipeThrough(new DecompressionStream("gzip"));return new Response(y).json()}class ge{constructor(a={}){const{container:u,theme:g="light",apiUrl:y=ye,spriteUrl:x,period:b=null,layers:S={},center:M=[104,36],zoom:k=4,terrainUrl:T="http://192.168.125.168:3456/terrain-dem/{z}/{x}/{y}.png"}=a;return this._apiUrl=y.replace(/\/$/,""),this._spriteUrl=(x??y).replace(/\/$/,""),this._terrainUrl=T,this._theme=g,this._period=b,this._center=M,this._zoom=k,this._ready=!1,this._layerVisible={adiz:!0,fir:!0,restricted:!0,controlled:!0,segment:!0,waypoint:!0,waypointOffAirway:!0,vor:!0,ndb:!0,airport:!0,runway:!0,amm:!0,terrain:!1,contour:!1,...S},this._initMap(u),new Proxy(this,{get(p,_,v){var A;if(_ in p)return Reflect.get(p,_,v);const D=(A=p._map)==null?void 0:A[_];return typeof D=="function"?D.bind(p._map):D}})}_initMap(a){const u=nt[this._theme]??nt.light;this._map=new dt.Map({container:a,style:{version:8,glyphs:"https://aips.siniswift.com/mapsdk/glyphs/{fontstack}/{range}.pbf",sprite:[{id:"normal",url:`${this._spriteUrl}/sprites/sprite-color`},{id:"default",url:`${this._spriteUrl}/sprites/sprite`},{id:"v2",url:`${this._spriteUrl}/sprites/sprite-v2`}],sources:{land:{type:"geojson",data:{type:"FeatureCollection",features:[]}},boundary:{type:"geojson",data:{type:"FeatureCollection",features:[]}}},layers:[{id:"background",type:"background",paint:{"background-color":u.background}}]},center:this._center,zoom:this._zoom,minZoom:0,maxZoom:17.5,crossSourceCollisions:!1,maxTileCacheSize:512,prefetchZoomDelta:1,fadeDuration:0,attributionControl:!1}),this._map.on("load",async()=>{await this._initSources(),this._initLayers(),this._applyVisibility(),this._ready=!0,this._map.fire("aviation:ready")})}async _initSources(){if(!this._period)try{const g=await(await fetch(`${this._apiUrl}/api/periods`)).json();this._period=g[g.length-1]}catch(u){console.warn("[AviationChart] fetchPeriods failed:",u),this._period="latest"}this._map.addSource("navdata",{type:"vector",tiles:[`${this._apiUrl}/api/tiles/${this._period}/{z}/{x}/{y}.pbf`],minzoom:.5,maxzoom:18}),this._map.addSource("amm",{type:"vector",tiles:[`${this._apiUrl}/api/amm/{z}/{x}/{y}.pbf`],minzoom:11,maxzoom:18}),this._map.addSource("terrain",{type:"raster-dem",tiles:[this._terrainUrl],tileSize:256,encoding:"mapbox",maxzoom:8});const a=new te.DemSource({url:this._terrainUrl,encoding:"mapbox",maxzoom:8,worker:!0});a.setupMaplibre(dt),this._map.addSource("contour",{type:"vector",tiles:[a.contourProtocolUrl({thresholds:{5:[250,1e3],7:[125,500],9:[100,500],11:[50,500],13:[25,500]},elevationKey:"ele",levelKey:"level",contourLayer:"contours"})],maxzoom:13}),await this._loadBaseData()}async _loadBaseData(){var a,u,g,y;try{const[x,b]=await Promise.all([Wt(`${this._apiUrl}/topjson/land.topojson.gz`),Wt(`${this._apiUrl}/topjson/boundary.topojson.gz`)]);(a=x==null?void 0:x.objects)!=null&&a.land?(u=this._map.getSource("land"))==null||u.setData(Gt(x,x.objects.land)):console.warn("[AviationChart] land topojson missing objects.land"),(g=b==null?void 0:b.objects)!=null&&g.boundary?(y=this._map.getSource("boundary"))==null||y.setData(Gt(b,b.objects.boundary)):console.warn("[AviationChart] boundary topojson missing objects.boundary")}catch(x){console.error("[AviationChart] loadBaseData failed:",x)}}_initLayers(){const a=this._layerVisible.terrain?"visible":"none",u=this._layerVisible.contour?"visible":"none";this._map.addLayer({id:"terrain-color",type:"color-relief",source:"terrain",layout:{visibility:a},paint:{"color-relief-color":xe}}),this._map.addLayer({id:"terrain-hillshade",type:"hillshade",source:"terrain",layout:{visibility:a},paint:{"hillshade-shadow-color":"rgba(74,59,42,0.35)","hillshade-highlight-color":"rgba(255,246,230,0.25)","hillshade-accent-color":"rgba(74,59,42,0.2)","hillshade-exaggeration":.45,"hillshade-illumination-direction":315,"hillshade-illumination-anchor":"viewport"}}),this._map.addLayer({id:"contour-line",type:"line",source:"contour","source-layer":"contours",layout:{visibility:u},paint:{"line-color":["case",["==",["get","level"],1],"rgba(100,70,40,0.40)","rgba(120,90,60,0.18)"],"line-width":["case",["==",["get","level"],1],1,.5]}}),this._map.addLayer({id:"contour-label",type:"symbol",source:"contour","source-layer":"contours",filter:["==",["get","level"],1],layout:{visibility:u,"symbol-placement":"line","text-field":["concat",["to-string",["get","ele"]],"m"],"text-size":10,"text-font":["Open Sans Regular"],"text-allow-overlap":!0,"text-keep-upright":!0},paint:{"text-color":"rgba(100,70,40,0.55)","text-halo-color":"rgba(255,255,255,0.6)","text-halo-width":1}}),this._layerVisible.terrain&&this._map.setTerrain({source:"terrain",exaggeration:4});for(const g of Xt(this._theme))this._map.getLayer(g.id)||this._map.addLayer(g);for(const g of Nt("amm",this._theme))this._map.getLayer(g.id)||this._map.addLayer(g,"fir-line")}_applyVisibility(){for(const[y,x]of Object.entries(_t)){const b=this._layerVisible[y]!==!1?"visible":"none";for(const S of x)this._map.getLayer(S)&&this._map.setLayoutProperty(S,"visibility",b)}const a=this._layerVisible.amm!==!1?"visible":"none";for(const y of Rt)this._map.getLayer(y)&&this._map.setLayoutProperty(y,"visibility",a);const u=this._layerVisible.terrain?"visible":"none";for(const y of Vt)this._map.getLayer(y)&&this._map.setLayoutProperty(y,"visibility",u);const g=this._layerVisible.contour?"visible":"none";for(const y of Ut)this._map.getLayer(y)&&this._map.setLayoutProperty(y,"visibility",g)}get map(){return this._map}get theme(){return this._theme}get period(){return this._period}setTheme(a){if(a===this._theme)return;this._theme=a;const u=nt[a]??nt.light;this._map.setPaintProperty("background","background-color",u.background);const g=["landLaye","boundary",...Object.values(_t).flat(),...Rt];for(const y of g)this._map.getLayer(y)&&this._map.removeLayer(y);for(const y of Xt(this._theme))this._map.addLayer(y);for(const y of Nt("amm",this._theme))this._map.getLayer(y.id)||this._map.addLayer(y,"fir-line");this._applyVisibility()}setLayerVisible(a,u){if(this._layerVisible[a]=u,a==="terrain"){const x=u?"visible":"none";for(const b of Vt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",x);this._map.setTerrain(u?{source:"terrain",exaggeration:4}:null);return}if(a==="contour"){const x=u?"visible":"none";for(const b of Ut)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",x);return}if(a==="amm"){const x=u?"visible":"none";for(const b of Rt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",x);return}const g=_t[a];if(!g){console.warn(`[AviationChart] Unknown layer key: "${a}"`);return}const y=u?"visible":"none";for(const x of g)this._map.getLayer(x)&&this._map.setLayoutProperty(x,"visibility",y)}setPeriod(a){var g;this._period=a;const u=(g=this._map)==null?void 0:g.getSource("navdata");u&&u.setTiles([`${this._apiUrl}/api/tiles/${a}/{z}/{x}/{y}.pbf`])}on(a,u){return this._map.on(a,u),this}off(a,u){return this._map.off(a,u),this}destroy(){this._map&&(this._map.remove(),this._map=null)}}Y.AMM_LAYER_GROUPS=pe,Y.AviationChart=ge,Y.CHART_THEMES=nt,Y.LAYER_GROUPS=_t,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})});
|
|
6
|
+
`,["get","VAL_FREQ"],"kHz"],"text-size":10,"text-offset":[0,1.4],"text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0},paint:{"text-color":a.ndb,"text-halo-color":"#0f172a","text-halo-width":1,"icon-color":a.ndb}},{id:"waypoint-symbol",type:"symbol",source:o,"source-layer":"waypoint",minzoom:5,layout:{"icon-image":["case",["==",["get","report_type"],"C"],"waypoint-compusory","waypoint"],"icon-size":.6,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-field":["get","CODE_ID"],"text-size":9,"text-variable-anchor-offset":["bottom",[0,-.6],"top",[0,.6],"right",[-.6,0],"left",[.6,0],"bottom-right",[-.4,-.4],"bottom-left",[.4,-.4],"top-right",[-.4,.4],"top-left",[.4,.4]],"text-justify":"auto","text-optional":!0},paint:{"icon-color":a.waypoint,"text-color":a.waypoint,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"waypoint-off-airway-symbol",type:"symbol",source:o,"source-layer":"waypoint-off-airway",minzoom:7,layout:{"icon-image":["case",["==",["get","report_type"],"C"],"designate_point_inway","designate_point_notinway"],"icon-size":.6,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-field":["get","CODE_ID"],"text-size":9,"text-variable-anchor-offset":["bottom",[0,-.6],"top",[0,.6],"right",[-.6,0],"left",[.6,0],"bottom-right",[-.4,-.4],"bottom-left",[.4,-.4],"top-right",[-.4,.4],"top-left",[.4,.4]],"text-justify":"auto","text-optional":!0},paint:{"icon-color":a.waypoint,"text-color":a.waypoint,"text-halo-color":"#0f172a","text-halo-width":1}}]}const nt={light:{id:"light",label:"日间",background:"#EAF2F8",build:ne},dark:{id:"dark",label:"夜间",background:"#000000",build:se}};function Xt(o="light"){return(nt[o]??nt.light).build()}const _t={adiz:["adiz-line","adiz-label"],fir:["fir-line","fir_line_dash","fir-label"],restricted:["restricted-fill","restricted-stroke","restricted-label"],controlled:["controlled-fill","controlled-stroke","controlled-label"],segment:["segment-radial","segment-line","segment-label"],waypoint:["waypoint-symbol"],waypointOffAirway:["waypoint-off-airway-symbol"],vor:["vor-symbol","vor-label"],ndb:["ndb-symbol"],airport:["airport-circle","airport-label"],runway:["runway-line","runway-line-amm","runway-label"]},ce={airport:"#e2e8f0",runway:"#94a3b8",apron:"#cbd5e1",taxiway:"#e2e8f0",taxiwayLine:"#f59e0b",holding:"#b91c1c",stand:"#1e293b",runwayMarking:"#ffffff",runwayCenterline:"#ffffff",standLine:"#64748b",restricted:"#b91c1c",hotspot:"#ea580c"};function me(o="amm"){const a=ce;return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":a.airport,"fill-opacity":.4}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":a.airport,"line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":a.runway,"fill-opacity":.9}},{id:"amm-runway-stroke",type:"line",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"line-color":"#64748b","line-width":.5}},{id:"amm-apron-fill",type:"fill",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"fill-color":a.apron,"fill-opacity":.6}},{id:"amm-apron-stroke",type:"line",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"line-color":"#94a3b8","line-width":.5}},{id:"amm-taxiway-fill",type:"fill",source:o,"source-layer":"amm-taxiway",minzoom:11,paint:{"fill-color":a.taxiway,"fill-opacity":.7}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":a.taxiwayLine,"line-width":["interpolate",["linear"],["zoom"],15,.8,18,2]}},{id:"amm-taxiway-label",type:"symbol",source:o,"source-layer":"amm-taxiway-line",minzoom:14,layout:{"text-field":["get","idlin"],"text-size":10,"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"symbol-placement":"line","text-keep-upright":!0,"text-allow-overlap":!1},paint:{"text-color":"#FFF","icon-color":a.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":a.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":a.runwayMarking,"fill-opacity":.9}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":a.restricted,"fill-opacity":.08}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":a.restricted,"line-width":1.5,"line-dasharray":[4,2]}},{id:"amm-hotspot-fill",type:"fill",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"fill-color":a.hotspot,"fill-opacity":.1}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":a.hotspot,"line-width":1.5}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":a.runwayCenterline,"line-width":1,"line-dasharray":[6,3]}},{id:"amm-runway-info",type:"symbol",source:o,"source-layer":"amm-runway-label",minzoom:13,layout:{"text-field":["concat",["coalesce",["get","length"],""],"×",["coalesce",["get","width"],""],"m"],"text-size":["interpolate",["exponential",1.5],["zoom"],13,10,16,13],"symbol-placement":"point","text-rotate":["coalesce",["get","bearing"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#f8fafc","text-halo-color":"#334155","text-halo-width":2.5}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":a.standLine,"line-width":1}},{id:"amm-runway-threshold-label",type:"symbol",source:o,"source-layer":"amm-runway-threshold",minzoom:12,layout:{"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"text-field":["get","idthr"],"text-size":14,"text-allow-overlap":!0,"text-rotation-alignment":"map","icon-rotation-alignment":"map"},paint:{"text-color":"#fff","icon-color":"#b91c1c"}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":a.stand,"circle-radius":1.5}},{id:"amm-stand-label",type:"symbol",source:o,"source-layer":"amm-stand",minzoom:14,layout:{"text-field":["get","idstd"],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":a.standLine}},{id:"amm-obstacle-region-fill",type:"fill",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"fill-color":"#fef08a","fill-opacity":.35}},{id:"amm-obstacle-region-stroke",type:"line",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"line-color":"#ca8a04","line-width":1.5,"line-dasharray":[1.5,1]}},{id:"amm-obstacle-point",type:"circle",source:o,"source-layer":"amm-obstacle-point",minzoom:11,paint:{"circle-color":"#b45309","circle-radius":4,"circle-stroke-color":"#ffffff","circle-stroke-width":1}},{id:"amm-obstacle-point-label",type:"symbol",source:o,"source-layer":"amm-obstacle-point",minzoom:14,layout:{"text-field":["coalesce",["get","ident"],["get","LABEL"]],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":"#92400e","text-halo-color":"#ffffff","text-halo-width":1}},{id:"amm-construction-fill",type:"fill",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"fill-pattern":"normal:passline","fill-opacity":.8}},{id:"amm-construction-stroke",type:"line",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"line-color":"#d97706","line-width":1.5,"line-dasharray":[4,2]}},{id:"amm-construction-label",type:"symbol",source:o,"source-layer":"amm-construction",minzoom:13,layout:{"text-field":["get","text"],"text-size":9,"text-anchor":"center","symbol-placement":"point","text-allow-overlap":!1},paint:{"text-color":"#92400e","text-halo-color":"#ffffff","text-halo-width":1}}]}const fe={airport:"#334155",runway:"#475569",apron:"#1e293b",taxiway:"#334155",taxiwayLine:"#fbbf24",holding:"#ef4444",stand:"#34d399",runwayMarking:"#cbd5e1",runwayCenterline:"#94a3b8",standLine:"#64748b",restricted:"#f87171",hotspot:"#fb923c"};function de(o="amm"){const a=fe;return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":a.airport,"fill-opacity":.3}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":"#475569","line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":a.runway,"fill-opacity":1}},{id:"amm-runway-stroke",type:"line",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"line-color":"#64748b","line-width":.5}},{id:"amm-apron-fill",type:"fill",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"fill-color":a.apron,"fill-opacity":1}},{id:"amm-apron-stroke",type:"line",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"line-color":"#334155","line-width":.5}},{id:"amm-taxiway-fill",type:"fill",source:o,"source-layer":"amm-taxiway",minzoom:11,paint:{"fill-color":a.taxiway,"fill-opacity":.8}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":a.taxiwayLine,"line-width":["interpolate",["linear"],["zoom"],15,.8,18,2]}},{id:"amm-taxiway-label",type:"symbol",source:o,"source-layer":"amm-taxiway-line",minzoom:14,layout:{"text-field":["get","idlin"],"text-size":10,"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"symbol-placement":"line","text-keep-upright":!0,"text-allow-overlap":!1},paint:{"text-color":"#0f172a","icon-color":a.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":a.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":a.runwayMarking,"fill-opacity":.8}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":a.restricted,"fill-opacity":.12}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":a.restricted,"line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-hotspot-fill",type:"fill",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"fill-color":a.hotspot,"fill-opacity":.15}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":a.hotspot,"line-width":1.2}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":a.runwayCenterline,"line-width":1,"line-dasharray":[6,3]}},{id:"amm-runway-info",type:"symbol",source:o,"source-layer":"amm-runway-label",minzoom:13,layout:{"text-field":["concat",["coalesce",["get","length"],""],"×",["coalesce",["get","width"],""],"m"],"text-size":["interpolate",["exponential",1.5],["zoom"],13,10,16,13],"symbol-placement":"point","text-rotate":["coalesce",["get","bearing"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#e2e8f0","text-halo-color":"#0f172a","text-halo-width":2}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":a.standLine,"line-width":1}},{id:"amm-runway-threshold-label",type:"symbol",source:o,"source-layer":"amm-runway-threshold",minzoom:12,layout:{"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"text-field":["get","idthr"],"text-size":14,"text-allow-overlap":!0,"text-rotation-alignment":"map","icon-rotation-alignment":"map"},paint:{"text-color":"#ffffff","icon-color":"#ef4444"}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":a.stand,"circle-radius":1.5}},{id:"amm-stand-label",type:"symbol",source:o,"source-layer":"amm-stand",minzoom:14,layout:{"text-field":["get","idstd"],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":a.stand,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"amm-obstacle-region-fill",type:"fill",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"fill-color":"#fef08a","fill-opacity":.15}},{id:"amm-obstacle-region-stroke",type:"line",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"line-color":"#eab308","line-width":1.2,"line-dasharray":[1.5,1]}},{id:"amm-obstacle-point",type:"circle",source:o,"source-layer":"amm-obstacle-point",minzoom:11,paint:{"circle-color":"#f97316","circle-radius":4,"circle-stroke-color":"#0f172a","circle-stroke-width":1}},{id:"amm-obstacle-point-label",type:"symbol",source:o,"source-layer":"amm-obstacle-point",minzoom:14,layout:{"text-field":["coalesce",["get","ident"],["get","LABEL"]],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":"#fdba74","text-halo-color":"#0f172a","text-halo-width":1.2}},{id:"amm-construction-fill",type:"fill",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"fill-pattern":"normal:passline","fill-opacity":.6}},{id:"amm-construction-stroke",type:"line",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"line-color":"#ea580c","line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-construction-label",type:"symbol",source:o,"source-layer":"amm-construction",minzoom:13,layout:{"text-field":["get","text"],"text-size":9,"text-anchor":"center","symbol-placement":"point","text-allow-overlap":!1},paint:{"text-color":"#f97316","text-halo-color":"#0f172a","text-halo-width":1}}]}const he={airport:"#4b5563",runway:"#71717a",apron:"#27272a",taxiway:"#3f3f46",taxiwayLine:"#eab308",holding:"#ef4444",stand:"#10b981",runwayMarking:"#e4e4e7",runwayCenterline:"#d4d4d8",standLine:"#6b7280",threshold:"#f97316",restricted:"#f87171",hotspot:"#fb923c"};function ue(o="amm"){const a=he,u="#1f1f23";return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":a.airport,"fill-opacity":.3}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":"#52525b","line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":a.runway,"fill-opacity":1}},{id:"amm-runway-stroke",type:"line",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"line-color":"#52525b","line-width":.5}},{id:"amm-apron-fill",type:"fill",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"fill-color":a.apron,"fill-opacity":1}},{id:"amm-apron-stroke",type:"line",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"line-color":"#3f3f46","line-width":.5}},{id:"amm-taxiway-fill",type:"fill",source:o,"source-layer":"amm-taxiway",minzoom:11,paint:{"fill-color":a.taxiway,"fill-opacity":.9}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":a.taxiwayLine,"line-width":["interpolate",["linear"],["zoom"],15,.8,18,2]}},{id:"amm-taxiway-label",type:"symbol",source:o,"source-layer":"amm-taxiway-line",minzoom:14,layout:{"text-field":["get","idlin"],"text-size":10,"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"symbol-placement":"line","text-keep-upright":!0,"text-allow-overlap":!1},paint:{"text-color":u,"icon-color":a.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":a.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":a.runwayMarking,"fill-opacity":.85}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":a.restricted,"fill-opacity":.1}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":a.restricted,"line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-hotspot-fill",type:"fill",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"fill-color":a.hotspot,"fill-opacity":.12}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":a.hotspot,"line-width":1.2}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":a.runwayCenterline,"line-width":1,"line-dasharray":[6,3]}},{id:"amm-runway-info",type:"symbol",source:o,"source-layer":"amm-runway-label",minzoom:13,layout:{"text-field":["concat",["coalesce",["get","length"],""],"×",["coalesce",["get","width"],""],"m"],"text-size":["interpolate",["exponential",1.5],["zoom"],13,10,16,13],"symbol-placement":"point","text-rotate":["coalesce",["get","bearing"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#e4e4e7","text-halo-color":u,"text-halo-width":2}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":a.standLine,"line-width":1}},{id:"amm-runway-threshold-label",type:"symbol",source:o,"source-layer":"amm-runway-threshold",minzoom:12,layout:{"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"text-field":["get","idthr"],"text-size":14,"text-allow-overlap":!0,"text-rotation-alignment":"map","icon-rotation-alignment":"map"},paint:{"text-color":"#ffffff","icon-color":a.threshold}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":a.stand,"circle-radius":1.5}},{id:"amm-stand-label",type:"symbol",source:o,"source-layer":"amm-stand",minzoom:14,layout:{"text-field":["get","idstd"],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":a.stand,"text-halo-color":u,"text-halo-width":1}},{id:"amm-obstacle-region-fill",type:"fill",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"fill-color":"#fef08a","fill-opacity":.1}},{id:"amm-obstacle-region-stroke",type:"line",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"line-color":"#eab308","line-width":1.2,"line-dasharray":[1.5,1]}},{id:"amm-obstacle-point",type:"circle",source:o,"source-layer":"amm-obstacle-point",minzoom:11,paint:{"circle-color":"#f97316","circle-radius":4,"circle-stroke-color":u,"circle-stroke-width":1}},{id:"amm-obstacle-point-label",type:"symbol",source:o,"source-layer":"amm-obstacle-point",minzoom:14,layout:{"text-field":["coalesce",["get","ident"],["get","LABEL"]],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":"#fdba74","text-halo-color":u,"text-halo-width":1.2}},{id:"amm-construction-fill",type:"fill",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"fill-pattern":"normal:passline","fill-opacity":.6}},{id:"amm-construction-stroke",type:"line",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"line-color":"#ea580c","line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-construction-label",type:"symbol",source:o,"source-layer":"amm-construction",minzoom:13,layout:{"text-field":["get","text"],"text-size":9,"text-anchor":"center","symbol-placement":"point","text-allow-overlap":!1},paint:{"text-color":"#f97316","text-halo-color":u,"text-halo-width":1}}]}function Nt(o="amm",a="light"){return a==="dark"?de(o):a==="neutral"?ue(o):me(o)}const pe={ammAirport:["amm-airport-fill","amm-airport-stroke"],ammRunway:["amm-runway-fill","amm-runway-stroke","amm-runway-info","amm-runway-marking","amm-runway-centerline","amm-runway-threshold","amm-runway-threshold-label"],ammApron:["amm-apron-fill","amm-apron-stroke"],ammTaxiway:["amm-taxiway-fill","amm-taxiway-line","amm-taxiway-label"],ammHolding:["amm-holding"],ammStand:["amm-stand","amm-stand-label","amm-stand-line"],ammRestricted:["amm-restricted-fill","amm-restricted-stroke"],ammHotspot:["amm-hotspot-fill","amm-hotspot-stroke"],ammObstacle:["amm-obstacle-region-fill","amm-obstacle-region-stroke","amm-obstacle-point","amm-obstacle-point-label"],ammConstruction:["amm-construction-fill","amm-construction-stroke","amm-construction-label"]},ye="http://pre.aips.siniswift.com",xe=["interpolate",["linear"],["elevation"],0,"#a8c98a",600,"#cdd98a",1200,"#e8d79a",2400,"#c79a5b",3600,"#9c6b3f",4500,"#f2efe9"],Rt=["amm-airport-fill","amm-airport-stroke","amm-runway-fill","amm-runway-stroke","amm-runway-info","amm-runway-marking","amm-runway-centerline","amm-runway-threshold-label","amm-apron-fill","amm-apron-stroke","amm-taxiway-fill","amm-taxiway-line","amm-taxiway-label","amm-holding","amm-stand","amm-stand-label","amm-stand-line","amm-restricted-fill","amm-restricted-stroke","amm-hotspot-fill","amm-hotspot-stroke","amm-obstacle-region-fill","amm-obstacle-region-stroke","amm-obstacle-point","amm-obstacle-point-label","amm-construction-fill","amm-construction-stroke","amm-construction-label"],Vt=["terrain-color","terrain-hillshade"],Ut=["contour-line","contour-label"];async function Wt(o){const a=await fetch(o);if(!a.ok)throw new Error(`fetch ${o} → ${a.status}`);const u=a.headers.get("Content-Encoding"),g=a.headers.get("Content-Type")||"";if(u==="gzip"||g.includes("json"))return a.json();const y=a.body.pipeThrough(new DecompressionStream("gzip"));return new Response(y).json()}class ge{constructor(a={}){const{container:u,theme:g="light",apiUrl:y=ye,spriteUrl:x,period:b=null,layers:S={},center:M=[104,36],zoom:k=4,terrainUrl:T=null}=a;return this._apiUrl=y.replace(/\/$/,""),this._spriteUrl=(x??y).replace(/\/$/,""),this._terrainUrl=T??`${this._apiUrl}/api/terrain/{z}/{x}/{y}.png`,this._theme=g,this._period=b,this._center=M,this._zoom=k,this._ready=!1,this._layerVisible={adiz:!0,fir:!0,restricted:!0,controlled:!0,segment:!0,waypoint:!0,waypointOffAirway:!0,vor:!0,ndb:!0,airport:!0,runway:!0,amm:!0,terrain:!1,contour:!1,...S},this._initMap(u),new Proxy(this,{get(p,_,v){var A;if(_ in p)return Reflect.get(p,_,v);const D=(A=p._map)==null?void 0:A[_];return typeof D=="function"?D.bind(p._map):D}})}_initMap(a){const u=nt[this._theme]??nt.light;this._map=new ft.Map({container:a,style:{version:8,glyphs:"https://aips.siniswift.com/mapsdk/glyphs/{fontstack}/{range}.pbf",sprite:[{id:"normal",url:`${this._spriteUrl}/sprites/sprite-color`},{id:"default",url:`${this._spriteUrl}/sprites/sprite`},{id:"v2",url:`${this._spriteUrl}/sprites/sprite-v2`}],sources:{land:{type:"geojson",data:{type:"FeatureCollection",features:[]}},boundary:{type:"geojson",data:{type:"FeatureCollection",features:[]}}},layers:[{id:"background",type:"background",paint:{"background-color":u.background}}]},center:this._center,zoom:this._zoom,minZoom:0,maxZoom:17.5,crossSourceCollisions:!1,maxTileCacheSize:512,prefetchZoomDelta:1,fadeDuration:0,attributionControl:!1}),this._map.on("load",async()=>{await this._initSources(),this._initLayers(),this._applyVisibility(),this._ready=!0,this._map.fire("aviation:ready")})}async _initSources(){if(!this._period)try{const g=await(await fetch(`${this._apiUrl}/api/periods`)).json();this._period=g[g.length-1]}catch(u){console.warn("[AviationChart] fetchPeriods failed:",u),this._period="latest"}this._map.addSource("navdata",{type:"vector",tiles:[`${this._apiUrl}/api/tiles/${this._period}/{z}/{x}/{y}.pbf`],minzoom:.5,maxzoom:18}),this._map.addSource("amm",{type:"vector",tiles:[`${this._apiUrl}/api/amm/{z}/{x}/{y}.pbf`],minzoom:11,maxzoom:18}),this._map.addSource("terrain",{type:"raster-dem",tiles:[this._terrainUrl],tileSize:256,encoding:"mapbox",maxzoom:8});const a=new te.DemSource({url:this._terrainUrl,encoding:"mapbox",maxzoom:8,worker:!0});a.setupMaplibre(ft),this._map.addSource("contour",{type:"vector",tiles:[a.contourProtocolUrl({thresholds:{5:[250,1e3],7:[125,500],9:[100,500],11:[50,500],13:[25,500]},elevationKey:"ele",levelKey:"level",contourLayer:"contours"})],maxzoom:13}),await this._loadBaseData()}async _loadBaseData(){var a,u,g,y;try{const[x,b]=await Promise.all([Wt(`${this._apiUrl}/topjson/land.topojson.gz`),Wt(`${this._apiUrl}/topjson/boundary.topojson.gz`)]);(a=x==null?void 0:x.objects)!=null&&a.land?(u=this._map.getSource("land"))==null||u.setData(Gt(x,x.objects.land)):console.warn("[AviationChart] land topojson missing objects.land"),(g=b==null?void 0:b.objects)!=null&&g.boundary?(y=this._map.getSource("boundary"))==null||y.setData(Gt(b,b.objects.boundary)):console.warn("[AviationChart] boundary topojson missing objects.boundary")}catch(x){console.error("[AviationChart] loadBaseData failed:",x)}}_initLayers(){const a=this._layerVisible.terrain?"visible":"none",u=this._layerVisible.contour?"visible":"none";this._map.addLayer({id:"terrain-color",type:"color-relief",source:"terrain",layout:{visibility:a},paint:{"color-relief-color":xe}}),this._map.addLayer({id:"terrain-hillshade",type:"hillshade",source:"terrain",layout:{visibility:a},paint:{"hillshade-shadow-color":"rgba(74,59,42,0.35)","hillshade-highlight-color":"rgba(255,246,230,0.25)","hillshade-accent-color":"rgba(74,59,42,0.2)","hillshade-exaggeration":.45,"hillshade-illumination-direction":315,"hillshade-illumination-anchor":"viewport"}}),this._map.addLayer({id:"contour-line",type:"line",source:"contour","source-layer":"contours",layout:{visibility:u},paint:{"line-color":["case",["==",["get","level"],1],"rgba(100,70,40,0.40)","rgba(120,90,60,0.18)"],"line-width":["case",["==",["get","level"],1],1,.5]}}),this._map.addLayer({id:"contour-label",type:"symbol",source:"contour","source-layer":"contours",filter:["==",["get","level"],1],layout:{visibility:u,"symbol-placement":"line","text-field":["concat",["to-string",["get","ele"]],"m"],"text-size":10,"text-font":["Open Sans Regular"],"text-allow-overlap":!0,"text-keep-upright":!0},paint:{"text-color":"rgba(100,70,40,0.55)","text-halo-color":"rgba(255,255,255,0.6)","text-halo-width":1}}),this._layerVisible.terrain&&this._map.setTerrain({source:"terrain",exaggeration:4});for(const g of Xt(this._theme))this._map.getLayer(g.id)||this._map.addLayer(g);for(const g of Nt("amm",this._theme))this._map.getLayer(g.id)||this._map.addLayer(g,"fir-line")}_applyVisibility(){for(const[y,x]of Object.entries(_t)){const b=this._layerVisible[y]!==!1?"visible":"none";for(const S of x)this._map.getLayer(S)&&this._map.setLayoutProperty(S,"visibility",b)}const a=this._layerVisible.amm!==!1?"visible":"none";for(const y of Rt)this._map.getLayer(y)&&this._map.setLayoutProperty(y,"visibility",a);const u=this._layerVisible.terrain?"visible":"none";for(const y of Vt)this._map.getLayer(y)&&this._map.setLayoutProperty(y,"visibility",u);const g=this._layerVisible.contour?"visible":"none";for(const y of Ut)this._map.getLayer(y)&&this._map.setLayoutProperty(y,"visibility",g)}get map(){return this._map}get theme(){return this._theme}get period(){return this._period}setTheme(a){if(a===this._theme)return;this._theme=a;const u=nt[a]??nt.light;this._map.setPaintProperty("background","background-color",u.background);const g=["landLaye","boundary",...Object.values(_t).flat(),...Rt];for(const y of g)this._map.getLayer(y)&&this._map.removeLayer(y);for(const y of Xt(this._theme))this._map.addLayer(y);for(const y of Nt("amm",this._theme))this._map.getLayer(y.id)||this._map.addLayer(y,"fir-line");this._applyVisibility()}setLayerVisible(a,u){if(this._layerVisible[a]=u,a==="terrain"){const x=u?"visible":"none";for(const b of Vt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",x);this._map.setTerrain(u?{source:"terrain",exaggeration:4}:null);return}if(a==="contour"){const x=u?"visible":"none";for(const b of Ut)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",x);return}if(a==="amm"){const x=u?"visible":"none";for(const b of Rt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",x);return}const g=_t[a];if(!g){console.warn(`[AviationChart] Unknown layer key: "${a}"`);return}const y=u?"visible":"none";for(const x of g)this._map.getLayer(x)&&this._map.setLayoutProperty(x,"visibility",y)}setPeriod(a){var g;this._period=a;const u=(g=this._map)==null?void 0:g.getSource("navdata");u&&u.setTiles([`${this._apiUrl}/api/tiles/${a}/{z}/{x}/{y}.pbf`])}on(a,u){return this._map.on(a,u),this}off(a,u){return this._map.off(a,u),this}destroy(){this._map&&(this._map.remove(),this._map=null)}}Y.AMM_LAYER_GROUPS=pe,Y.AviationChart=ge,Y.CHART_THEMES=nt,Y.LAYER_GROUPS=_t,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})});
|
package/dist/index.cjs
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
`,["case",["all",["has","TXT_DESIG_HIGH"],["!=",["get","TXT_DESIG_HIGH"],""]],["get","TXT_DESIG_HIGH"],["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":.95,"text-color":"#3E4759"}]],"text-size":["interpolate",["linear"],["zoom"],6,9,10,10],"icon-text-fit-padding":[0,3,0,3]},paint:{"text-halo-color":"#ffffff","text-halo-width":.1,"icon-color":a.segment,"text-opacity":["interpolate",["linear"],["zoom"],6,1,12,1,15,.3],"icon-opacity":["interpolate",["linear"],["zoom"],6,1,12,1,15,.3]}},{id:"segment-radial",type:"symbol",source:o,"source-layer":"segment-radial",minzoom:10,layout:{"text-field":["concat",["get","bearing"],"°"],"text-size":9,"text-rotate":["to-number",["get","line_angle"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0,"text-offset":[0,-.6],"text-justify":"auto"},paint:{"text-color":a.segment}},{id:"airport-circle",type:"symbol",source:o,minzoom:3,"source-layer":"airport",filter:["case",["<",["zoom"],6],["==",["get","level"],1],!0],layout:{"icon-image":["case",["==",["get","CODE_TYPE_MIL_OPS"],"MIL"],"airport-mil",["==",["get","CODE_TYPE_MIL_OPS"],"MILEXT"],"airport-milext","airport-civ"],"icon-size":["interpolate",["linear"],["zoom"],4,.5,10,.9],"symbol-z-order":"viewport-y","text-field":["get","codeId"],"text-letter-spacing":.05,"text-anchor":"bottom","text-justify":"center","text-size":["interpolate",["linear"],["zoom"],4,0,5,12],"text-offset":["interpolate",["linear"],["zoom"],4,["literal",[0,-1.2]],5,["literal",[0,-.6]]],"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-allow-overlap":!0,"text-ignore-placement":!0,visibility:"none","icon-size":["interpolate",["linear"],["zoom"],5,.6,9,1.2,12,1.3]},paint:{"icon-color":["case",["has","has_amm"],"#4B2D6E",a.airport],"icon-opacity":["interpolate",["linear"],["zoom"],2,.75,3,.95,5,1,9,1,11,.2]}},{id:"airport-label",type:"symbol",source:o,"source-layer":"airport",minzoom:4,filter:["case",["<",["zoom"],8],["==",["get","level"],1],!0],layout:{"text-field":["get","CODE_ID"],"text-size":["interpolate",["linear"],["zoom"],4,9,8,11],"text-anchor":"top","text-offset":[0,1],"text-allow-overlap":!1,"text-ignore-placement":!1},paint:{"text-color":["case",["has","has_amm"],"#4B2D6E",a.airport]}},{id:"runway-line",type:"line",source:o,"source-layer":"runway",filter:["!",["has","has_amm"]],minzoom:4,maxzoom:11,paint:{"line-color":a.runway,"line-width":["interpolate",["linear"],["zoom"],4,1,13,10]}},{id:"runway-line-amm",type:"line",source:o,"source-layer":"runway",filter:["has","has_amm"],minzoom:4,maxzoom:11,paint:{"line-color":a.runway,"line-width":["interpolate",["linear"],["zoom"],4,1,10,4],"line-opacity":["interpolate",["linear"],["zoom"],10.5,1,11,0]}},{id:"runway-label",type:"symbol",source:o,"source-layer":"runway",minzoom:10,layout:{"text-field":["concat",["to-string",["get","VAL_LEN"]],"×",["to-string",["get","VAL_WID"]],"m"],"text-size":10,"symbol-placement":"line-center","text-rotation-alignment":"map","text-optional":!0},paint:{"text-color":a.runway,"text-halo-width":1,"text-opacity":["interpolate",["linear"],["zoom"],10.5,1,11,0]}},{id:"vor-symbol",type:"symbol",source:o,"source-layer":"vor",minzoom:8,layout:{"icon-image":"vor_dial","icon-size":["interpolate",["linear"],["zoom"],8,.072,10,.072,11,.126,12,.18,13,.234,14,.288,15,.342,16,.396,17,.45,22,.45],"icon-rotate":["to-number",["get","VAL_MAG_VAR"],0],"icon-rotation-alignment":"map","symbol-z-order":"viewport-y","text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0,visibility:"none"},paint:{"icon-color":"#0b417a"}},{id:"vor-symbol-normal",minzoom:4,maxzoom:9,type:"symbol",source:o,"source-layer":"vor",layout:{"icon-image":"v2:vor-normal","icon-size":["interpolate",["linear"],["zoom"],4,.7,8,1],"icon-rotation-alignment":"map","symbol-z-order":"viewport-y","text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0},paint:{"icon-color":"#3874cb","icon-opacity":["interpolate",["linear"],["zoom"],8,1,9,0]}},{id:"vor-label",type:"symbol",source:o,"source-layer":"vor",minzoom:5,layout:{"text-field":["get","CODE_ID"],"text-size":10,"text-anchor":"bottom","text-offset":[0,-.8]},paint:{"text-color":a.vor,"text-halo-color":"#ffffff","text-halo-width":1}},{id:"ndb-symbol",type:"symbol",source:o,minzoom:4,"source-layer":"ndb",layout:{"icon-image":"v2:ndb-normal","icon-size":["interpolate",["linear"],["zoom"],6,.5,10,1],"symbol-z-order":"viewport-y","text-field":["format",["get","CODE_ID"],{"text-color":a.ndb,"font-scale":1.1},"",{},["coalesce",["get","VAL_FREQ"],""],{"text-color":a.ndb,"font-scale":.95}],"text-size":10,"text-offset":[0,.5],"text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0,"text-anchor":"top"},paint:{"text-color":a.ndb,"text-halo-color":"#ffffff","text-halo-width":.5,"text-halo-blur":1,"icon-color":a.ndb,"text-opacity":["interpolate",["linear"],["zoom"],4,0,5.5,0,6,.6,8,1,10,.3,12,0],"icon-opacity":["interpolate",["linear"],["zoom"],4,0,5,.3,5.5,.8,8,1,12,1,14,.6]}},{id:"waypoint-symbol",type:"symbol",source:o,"source-layer":"waypoint",minzoom:5,layout:{"icon-image":["case",["==",["get","report_type"],"C"],"waypoint-compusory","waypoint"],"icon-size":.6,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-field":["get","CODE_ID"],"text-size":10,"text-letter-spacing":.02,"text-variable-anchor-offset":["bottom",[0,-.6],"top",[0,.6],"right",[-.6,0],"left",[.6,0],"bottom-right",[-.4,-.4],"bottom-left",[.4,-.4],"top-right",[-.4,.4],"top-left",[.4,.4]],"text-justify":"auto"},paint:{"icon-color":a.waypoint,"text-color":a.waypoint,"text-halo-color":"#ffffff","text-halo-width":1,"icon-halo-color":"rgba(0,0,0,0)","icon-halo-width":0,"icon-opacity":["interpolate",["linear"],["zoom"],5,.5,12,1,15,.2],"text-halo-color":"#FFFFFF","text-halo-blur":0,"text-opacity":["interpolate",["linear"],["zoom"],6,1,12,.9,15,.15]}},{id:"waypoint-off-airway-symbol",type:"symbol",source:o,"source-layer":"waypoint-off-airway",minzoom:7,layout:{"icon-image":["case",["==",["get","report_type"],"C"],"designate_point_inway","designate_point_notinway"],"icon-size":.6,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-field":["get","CODE_ID"],"text-size":9,"text-variable-anchor-offset":["bottom",[0,-.6],"top",[0,.6],"right",[-.6,0],"left",[.6,0],"bottom-right",[-.4,-.4],"bottom-left",[.4,-.4],"top-right",[-.4,.4],"top-left",[.4,.4]],"text-justify":"auto","text-optional":!0},paint:{"icon-color":a.waypoint,"text-color":a.waypoint,"text-halo-color":"#ffffff","text-halo-width":1,"icon-opacity":["interpolate",["linear"],["zoom"],7,.5,12,1,15,.2],"text-opacity":["interpolate",["linear"],["zoom"],7,1,12,.9,15,.15]}}]}const $e={airspaceStroke:"#18C29C",restrictedStroke:"#f87171",controlledStroke:"#38bdf8",controlledFill:"#38bdf8",segment:"#40C4FF",waypoint:"#74cdde",vor:"#72aae5",ndb:"#62d6ef",airport:"#73ccdd",runway:"#64748b"};function Ye(){const o="navdata",a=$e;return[{id:"landLaye",type:"fill",source:"land",layout:{visibility:"visible"},paint:{"fill-color":"#0A111A","fill-opacity":1}},{id:"boundary",type:"line",source:"boundary",minzoom:.5,paint:{"line-color":"#2A303C","line-width":["interpolate",["linear"],["zoom"],0,1,7,4],"line-opacity":1,"line-pattern":"normal:national-border"}},{id:"adiz-line",type:"line",source:o,"source-layer":"adiz",minzoom:3,layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#a855f7","line-width":["interpolate",["linear"],["zoom"],3,3,7,6],"line-pattern":"normal:adiz","line-opacity":["interpolate",["linear"],["zoom"],3,.7,8,.5]}},{id:"adiz-label",type:"symbol",source:o,"source-layer":"adiz-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"text-max-width":10,"symbol-placement":"point"},paint:{"text-color":"#c084fc","text-halo-color":"#0f172a","text-halo-width":1.5}},{id:"fir-line",type:"line",source:o,"source-layer":"fir",minzoom:2,layout:{"line-cap":"butt","line-join":"miter","line-miter-limit":0},paint:{"line-color":a.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],2,0,2.7,.8,9,.8,10,.5],"line-width":.8,"line-dasharray":[4.2,4]}},{id:"fir_line_dash",type:"line",source:o,"source-layer":"fir",minzoom:5,layout:{"line-miter-limit":0,"line-cap":"butt","line-join":"miter"},paint:{"line-color":a.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],5,0,5.5,.8,9,.8,10,.5],"line-width":5,"line-dasharray":[.2,5]}},{id:"fir-label-lineside",type:"symbol",source:o,"source-layer":"fir",minzoom:4,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1],"text-letter-spacing":.05,"text-optional":!0},paint:{"text-color":a.airspaceStroke,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"fir-label",type:"symbol",source:o,"source-layer":"fir-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":["interpolate",["linear"],["zoom"],3,12,17,16],"symbol-placement":"point","text-max-width":8},paint:{"text-color":a.airspaceStroke,"text-halo-color":"#0f172a","text-halo-width":1.5,"text-opacity":["interpolate",["linear"],["zoom"],3,.85,8,.7,12,.5]}},{id:"restricted-fill",type:"fill",source:o,"source-layer":"restricted-fill",minzoom:4,paint:{"fill-color":["case",["==",["get","CODE_TYPE"],"P"],"#ef4444",["==",["get","CODE_TYPE"],"D"],"#f97316","#ef4444"],"fill-opacity":.04}},{id:"restricted-stroke",type:"line",source:o,"source-layer":"restricted",paint:{"line-color":a.restrictedStroke,"line-width":1,"line-dasharray":[2,2],"line-opacity":["interpolate",["linear"],["zoom"],4,.6,8,1]}},{id:"restricted-label",type:"symbol",source:o,"source-layer":"restricted",minzoom:6,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1]},paint:{"text-color":a.restrictedStroke,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"controlled-fill",type:"fill",source:o,"source-layer":"controlled-fill",minzoom:4,paint:{"fill-color":a.controlledFill,"fill-opacity":.03}},{id:"controlled-stroke",type:"line",source:o,"source-layer":"controlled",paint:{"line-color":a.controlledStroke,"line-width":1,"line-opacity":["interpolate",["linear"],["zoom"],4,.6,8,1],"line-dasharray":[2,2]}},{id:"controlled-label",type:"symbol",source:o,"source-layer":"controlled",minzoom:6,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"symbol-placement":"point","text-max-width":8},paint:{"text-color":a.controlledStroke,"text-halo-color":"#0f172a","text-halo-width":1.5}},{id:"segment-line",type:"line",source:o,"source-layer":"segment",minzoom:5,paint:{"line-color":["case",["==",["get","HAS_REMARK"],1],"#fbbf24",a.segment],"line-width":["interpolate",["linear"],["zoom"],5,.2,8,.8],"line-blur":0,"line-opacity":["interpolate",["linear"],["zoom"],5,.3,6,1,8,1,12,.8,15,.2]}},{id:"segment-label",type:"symbol",source:o,"source-layer":"segment",minzoom:6,layout:{"icon-image":["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""],["!=",["get","TXT_DESIG"]," "],["!=",["get","TXT_DESIG"],null]],"segment-both",["all",["has","TXT_DESIG_FORWARD"]],"segment-right",["all",["has","TXT_DESIG_BACKWARD"]],"segment-left","segment-both"],"icon-anchor":"center","symbol-placement":"line","icon-text-fit":"width","icon-size":1,"text-allow-overlap":!1,"icon-allow-overlap":!1,"text-anchor":"center","text-justify":"center","text-line-height":1.3,"text-letter-spacing":.1,"text-field":["step",["zoom"],["format",["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""]],["get","TXT_DESIG"],["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":1,"text-color":"#0f172a"}],10,["format",["concat",["get","VAL_LEN"],"",["get","UOM_DIST"]],{"font-scale":.95,"text-color":"#cbd5e1"},`
|
|
4
4
|
`,["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]],["get","TXT_DESIG_RNP"],""],""],{"font-scale":1,"text-color":"#FFFFFF"},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]]," ",""],""],{},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""]],["get","TXT_DESIG"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":1,"text-color":"#0f172a","font-weight":"bold"},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],"",["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]]," ",""]],{},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],"",["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]],["get","TXT_DESIG_RNP"],""]],{"font-scale":.85,"text-color":"#FFFFFF"},`
|
|
5
5
|
`,["case",["all",["has","TXT_DESIG_HIGH"],["!=",["get","TXT_DESIG_HIGH"],""]],["get","TXT_DESIG_HIGH"],["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":.95,"text-color":"#cbd5e1"}]],"text-size":["interpolate",["linear"],["zoom"],6,9,10,10],"icon-text-fit-padding":[0,3,0,3]},paint:{"icon-color":a.segment}},{id:"segment-radial",type:"symbol",source:o,"source-layer":"segment-radial",minzoom:10,layout:{"text-field":["concat",["get","bearing"],"°"],"text-size":9,"text-rotate":["to-number",["get","line_angle"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0,"text-offset":[0,-1]},paint:{"text-color":a.segment,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"airport-circle",type:"symbol",source:o,minzoom:3,"source-layer":"airport",filter:["case",["<",["zoom"],6],["==",["get","level"],1],!0],layout:{"icon-image":["case",["==",["get","CODE_TYPE_MIL_OPS"],"MIL"],"airport-mil",["==",["get","CODE_TYPE_MIL_OPS"],"MILEXT"],"airport-milext","airport-civ"],"icon-size":["interpolate",["linear"],["zoom"],4,.5,10,.9],"symbol-z-order":"viewport-y","text-field":["get","codeId"],"text-letter-spacing":.05,"text-anchor":"bottom","text-justify":"center","text-size":["interpolate",["linear"],["zoom"],4,0,5,12],"text-offset":["interpolate",["linear"],["zoom"],4,["literal",[0,-1.2]],5,["literal",[0,-.6]]],"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-allow-overlap":!0,"text-ignore-placement":!0,visibility:"none","icon-size":["interpolate",["linear"],["zoom"],5,.6,9,1.2,12,1.3]},paint:{"icon-color":["case",["has","has_amm"],"#4B2D6E",a.airport],"icon-opacity":["interpolate",["linear"],["zoom"],2,.75,3,.95,5,1,9,1,11,.2]}},{id:"airport-label",type:"symbol",source:o,"source-layer":"airport",minzoom:4,filter:["case",["<",["zoom"],8],["==",["get","level"],1],!0],layout:{"text-field":["get","CODE_ID"],"text-size":["interpolate",["linear"],["zoom"],4,9,8,11],"text-anchor":"top","text-offset":[0,1],"text-allow-overlap":!1,"text-ignore-placement":!1},paint:{"text-color":["case",["has","has_amm"],"#4B2D6E","#E0F7FA"]}},{id:"runway-line",type:"line",source:o,"source-layer":"runway",filter:["!",["has","has_amm"]],minzoom:4,paint:{"line-color":a.runway,"line-width":["interpolate",["linear"],["zoom"],4,1,10,3]}},{id:"runway-line-amm",type:"line",source:o,"source-layer":"runway",filter:["has","has_amm"],minzoom:4,paint:{"line-color":a.runway,"line-width":["interpolate",["linear"],["zoom"],4,1,10,3],"line-opacity":["interpolate",["linear"],["zoom"],10.5,1,11,0]}},{id:"runway-label",type:"symbol",source:o,"source-layer":"runway",minzoom:10,layout:{"text-field":["concat",["to-string",["get","VAL_LEN"]],"×",["to-string",["get","VAL_WID"]],"m"],"text-size":10,"text-font":["Noto Sans Regular"],"symbol-placement":"line-center","text-rotation-alignment":"map","text-optional":!0},paint:{"text-color":a.runway,"text-halo-color":"#0f172a","text-halo-width":1,"text-opacity":["interpolate",["linear"],["zoom"],10.5,1,11,0]}},{id:"vor-symbol",type:"symbol",source:o,"source-layer":"vor",layout:{"icon-image":"vor_dial","icon-size":["interpolate",["linear"],["zoom"],5,.072,10,.072,11,.126,12,.18,13,.234,14,.288,15,.342,16,.396,17,.45,22,.45],"icon-rotate":["to-number",["get","VAL_MAG_VAR"],0],"icon-rotation-alignment":"map","symbol-z-order":"viewport-y","text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0,visibility:"none"},paint:{"icon-color":"#38bdf8"}},{id:"vor-label",type:"symbol",source:o,"source-layer":"vor",minzoom:5,layout:{"text-field":["get","CODE_ID"],"text-size":10,"text-anchor":"bottom","text-offset":[0,-.8]},paint:{"text-color":a.vor,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"ndb-symbol",type:"symbol",source:o,minzoom:4,"source-layer":"ndb",layout:{"icon-image":"ndb-inway","icon-size":["interpolate",["linear"],["zoom"],6,.5,10,1],"symbol-z-order":"viewport-y","text-field":["concat",["get","CODE_ID"],`
|
|
6
|
-
`,["get","VAL_FREQ"],"kHz"],"text-size":10,"text-offset":[0,1.4],"text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0},paint:{"text-color":a.ndb,"text-halo-color":"#0f172a","text-halo-width":1,"icon-color":a.ndb}},{id:"waypoint-symbol",type:"symbol",source:o,"source-layer":"waypoint",minzoom:5,layout:{"icon-image":["case",["==",["get","report_type"],"C"],"waypoint-compusory","waypoint"],"icon-size":.6,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-field":["get","CODE_ID"],"text-size":9,"text-variable-anchor-offset":["bottom",[0,-.6],"top",[0,.6],"right",[-.6,0],"left",[.6,0],"bottom-right",[-.4,-.4],"bottom-left",[.4,-.4],"top-right",[-.4,.4],"top-left",[.4,.4]],"text-justify":"auto","text-optional":!0},paint:{"icon-color":a.waypoint,"text-color":a.waypoint,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"waypoint-off-airway-symbol",type:"symbol",source:o,"source-layer":"waypoint-off-airway",minzoom:7,layout:{"icon-image":["case",["==",["get","report_type"],"C"],"designate_point_inway","designate_point_notinway"],"icon-size":.6,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-field":["get","CODE_ID"],"text-size":9,"text-variable-anchor-offset":["bottom",[0,-.6],"top",[0,.6],"right",[-.6,0],"left",[.6,0],"bottom-right",[-.4,-.4],"bottom-left",[.4,-.4],"top-right",[-.4,.4],"top-left",[.4,.4]],"text-justify":"auto","text-optional":!0},paint:{"icon-color":a.waypoint,"text-color":a.waypoint,"text-halo-color":"#0f172a","text-halo-width":1}}]}const ct={light:{id:"light",label:"日间",background:"#EAF2F8",build:je},dark:{id:"dark",label:"夜间",background:"#000000",build:Ye}};function Kt(o="light"){return(ct[o]??ct.light).build()}const Dt={adiz:["adiz-line","adiz-label"],fir:["fir-line","fir_line_dash","fir-label"],restricted:["restricted-fill","restricted-stroke","restricted-label"],controlled:["controlled-fill","controlled-stroke","controlled-label"],segment:["segment-radial","segment-line","segment-label"],waypoint:["waypoint-symbol"],waypointOffAirway:["waypoint-off-airway-symbol"],vor:["vor-symbol","vor-label"],ndb:["ndb-symbol"],airport:["airport-circle","airport-label"],runway:["runway-line","runway-line-amm","runway-label"]},Ke={airport:"#e2e8f0",runway:"#94a3b8",apron:"#cbd5e1",taxiway:"#e2e8f0",taxiwayLine:"#f59e0b",holding:"#b91c1c",stand:"#1e293b",runwayMarking:"#ffffff",runwayCenterline:"#ffffff",standLine:"#64748b",restricted:"#b91c1c",hotspot:"#ea580c"};function He(o="amm"){const a=Ke;return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":a.airport,"fill-opacity":.4}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":a.airport,"line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":a.runway,"fill-opacity":.9}},{id:"amm-runway-stroke",type:"line",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"line-color":"#64748b","line-width":.5}},{id:"amm-apron-fill",type:"fill",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"fill-color":a.apron,"fill-opacity":.6}},{id:"amm-apron-stroke",type:"line",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"line-color":"#94a3b8","line-width":.5}},{id:"amm-taxiway-fill",type:"fill",source:o,"source-layer":"amm-taxiway",minzoom:11,paint:{"fill-color":a.taxiway,"fill-opacity":.7}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":a.taxiwayLine,"line-width":["interpolate",["linear"],["zoom"],15,.8,18,2]}},{id:"amm-taxiway-label",type:"symbol",source:o,"source-layer":"amm-taxiway-line",minzoom:14,layout:{"text-field":["get","idlin"],"text-size":10,"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"symbol-placement":"line","text-keep-upright":!0,"text-allow-overlap":!1},paint:{"text-color":"#FFF","icon-color":a.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":a.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":a.runwayMarking,"fill-opacity":.9}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":a.restricted,"fill-opacity":.08}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":a.restricted,"line-width":1.5,"line-dasharray":[4,2]}},{id:"amm-hotspot-fill",type:"fill",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"fill-color":a.hotspot,"fill-opacity":.1}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":a.hotspot,"line-width":1.5}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":a.runwayCenterline,"line-width":1,"line-dasharray":[6,3]}},{id:"amm-runway-info",type:"symbol",source:o,"source-layer":"amm-runway-label",minzoom:13,layout:{"text-field":["concat",["coalesce",["get","length"],""],"×",["coalesce",["get","width"],""],"m"],"text-size":["interpolate",["exponential",1.5],["zoom"],13,10,16,13],"symbol-placement":"point","text-rotate":["coalesce",["get","bearing"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#f8fafc","text-halo-color":"#334155","text-halo-width":2.5}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":a.standLine,"line-width":1}},{id:"amm-runway-threshold-label",type:"symbol",source:o,"source-layer":"amm-runway-threshold",minzoom:12,layout:{"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"text-field":["get","idthr"],"text-size":14,"text-allow-overlap":!0,"text-rotation-alignment":"map","icon-rotation-alignment":"map"},paint:{"text-color":"#fff","icon-color":"#b91c1c"}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":a.stand,"circle-radius":1.5}},{id:"amm-stand-label",type:"symbol",source:o,"source-layer":"amm-stand",minzoom:14,layout:{"text-field":["get","idstd"],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":a.standLine}},{id:"amm-obstacle-region-fill",type:"fill",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"fill-color":"#fef08a","fill-opacity":.35}},{id:"amm-obstacle-region-stroke",type:"line",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"line-color":"#ca8a04","line-width":1.5,"line-dasharray":[1.5,1]}},{id:"amm-obstacle-point",type:"circle",source:o,"source-layer":"amm-obstacle-point",minzoom:11,paint:{"circle-color":"#b45309","circle-radius":4,"circle-stroke-color":"#ffffff","circle-stroke-width":1}},{id:"amm-obstacle-point-label",type:"symbol",source:o,"source-layer":"amm-obstacle-point",minzoom:14,layout:{"text-field":["coalesce",["get","ident"],["get","LABEL"]],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":"#92400e","text-halo-color":"#ffffff","text-halo-width":1}},{id:"amm-construction-fill",type:"fill",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"fill-pattern":"normal:passline","fill-opacity":.8}},{id:"amm-construction-stroke",type:"line",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"line-color":"#d97706","line-width":1.5,"line-dasharray":[4,2]}},{id:"amm-construction-label",type:"symbol",source:o,"source-layer":"amm-construction",minzoom:13,layout:{"text-field":["get","text"],"text-size":9,"text-anchor":"center","symbol-placement":"point","text-allow-overlap":!1},paint:{"text-color":"#92400e","text-halo-color":"#ffffff","text-halo-width":1}}]}const Ze={airport:"#334155",runway:"#475569",apron:"#1e293b",taxiway:"#334155",taxiwayLine:"#fbbf24",holding:"#ef4444",stand:"#34d399",runwayMarking:"#cbd5e1",runwayCenterline:"#94a3b8",standLine:"#64748b",restricted:"#f87171",hotspot:"#fb923c"};function Je(o="amm"){const a=Ze;return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":a.airport,"fill-opacity":.3}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":"#475569","line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":a.runway,"fill-opacity":1}},{id:"amm-runway-stroke",type:"line",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"line-color":"#64748b","line-width":.5}},{id:"amm-apron-fill",type:"fill",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"fill-color":a.apron,"fill-opacity":1}},{id:"amm-apron-stroke",type:"line",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"line-color":"#334155","line-width":.5}},{id:"amm-taxiway-fill",type:"fill",source:o,"source-layer":"amm-taxiway",minzoom:11,paint:{"fill-color":a.taxiway,"fill-opacity":.8}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":a.taxiwayLine,"line-width":["interpolate",["linear"],["zoom"],15,.8,18,2]}},{id:"amm-taxiway-label",type:"symbol",source:o,"source-layer":"amm-taxiway-line",minzoom:14,layout:{"text-field":["get","idlin"],"text-size":10,"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"symbol-placement":"line","text-keep-upright":!0,"text-allow-overlap":!1},paint:{"text-color":"#0f172a","icon-color":a.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":a.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":a.runwayMarking,"fill-opacity":.8}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":a.restricted,"fill-opacity":.12}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":a.restricted,"line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-hotspot-fill",type:"fill",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"fill-color":a.hotspot,"fill-opacity":.15}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":a.hotspot,"line-width":1.2}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":a.runwayCenterline,"line-width":1,"line-dasharray":[6,3]}},{id:"amm-runway-info",type:"symbol",source:o,"source-layer":"amm-runway-label",minzoom:13,layout:{"text-field":["concat",["coalesce",["get","length"],""],"×",["coalesce",["get","width"],""],"m"],"text-size":["interpolate",["exponential",1.5],["zoom"],13,10,16,13],"symbol-placement":"point","text-rotate":["coalesce",["get","bearing"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#e2e8f0","text-halo-color":"#0f172a","text-halo-width":2}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":a.standLine,"line-width":1}},{id:"amm-runway-threshold-label",type:"symbol",source:o,"source-layer":"amm-runway-threshold",minzoom:12,layout:{"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"text-field":["get","idthr"],"text-size":14,"text-allow-overlap":!0,"text-rotation-alignment":"map","icon-rotation-alignment":"map"},paint:{"text-color":"#ffffff","icon-color":"#ef4444"}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":a.stand,"circle-radius":1.5}},{id:"amm-stand-label",type:"symbol",source:o,"source-layer":"amm-stand",minzoom:14,layout:{"text-field":["get","idstd"],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":a.stand,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"amm-obstacle-region-fill",type:"fill",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"fill-color":"#fef08a","fill-opacity":.15}},{id:"amm-obstacle-region-stroke",type:"line",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"line-color":"#eab308","line-width":1.2,"line-dasharray":[1.5,1]}},{id:"amm-obstacle-point",type:"circle",source:o,"source-layer":"amm-obstacle-point",minzoom:11,paint:{"circle-color":"#f97316","circle-radius":4,"circle-stroke-color":"#0f172a","circle-stroke-width":1}},{id:"amm-obstacle-point-label",type:"symbol",source:o,"source-layer":"amm-obstacle-point",minzoom:14,layout:{"text-field":["coalesce",["get","ident"],["get","LABEL"]],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":"#fdba74","text-halo-color":"#0f172a","text-halo-width":1.2}},{id:"amm-construction-fill",type:"fill",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"fill-pattern":"normal:passline","fill-opacity":.6}},{id:"amm-construction-stroke",type:"line",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"line-color":"#ea580c","line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-construction-label",type:"symbol",source:o,"source-layer":"amm-construction",minzoom:13,layout:{"text-field":["get","text"],"text-size":9,"text-anchor":"center","symbol-placement":"point","text-allow-overlap":!1},paint:{"text-color":"#f97316","text-halo-color":"#0f172a","text-halo-width":1}}]}const Qe={airport:"#4b5563",runway:"#71717a",apron:"#27272a",taxiway:"#3f3f46",taxiwayLine:"#eab308",holding:"#ef4444",stand:"#10b981",runwayMarking:"#e4e4e7",runwayCenterline:"#d4d4d8",standLine:"#6b7280",threshold:"#f97316",restricted:"#f87171",hotspot:"#fb923c"};function qe(o="amm"){const a=Qe,u="#1f1f23";return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":a.airport,"fill-opacity":.3}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":"#52525b","line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":a.runway,"fill-opacity":1}},{id:"amm-runway-stroke",type:"line",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"line-color":"#52525b","line-width":.5}},{id:"amm-apron-fill",type:"fill",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"fill-color":a.apron,"fill-opacity":1}},{id:"amm-apron-stroke",type:"line",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"line-color":"#3f3f46","line-width":.5}},{id:"amm-taxiway-fill",type:"fill",source:o,"source-layer":"amm-taxiway",minzoom:11,paint:{"fill-color":a.taxiway,"fill-opacity":.9}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":a.taxiwayLine,"line-width":["interpolate",["linear"],["zoom"],15,.8,18,2]}},{id:"amm-taxiway-label",type:"symbol",source:o,"source-layer":"amm-taxiway-line",minzoom:14,layout:{"text-field":["get","idlin"],"text-size":10,"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"symbol-placement":"line","text-keep-upright":!0,"text-allow-overlap":!1},paint:{"text-color":u,"icon-color":a.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":a.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":a.runwayMarking,"fill-opacity":.85}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":a.restricted,"fill-opacity":.1}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":a.restricted,"line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-hotspot-fill",type:"fill",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"fill-color":a.hotspot,"fill-opacity":.12}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":a.hotspot,"line-width":1.2}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":a.runwayCenterline,"line-width":1,"line-dasharray":[6,3]}},{id:"amm-runway-info",type:"symbol",source:o,"source-layer":"amm-runway-label",minzoom:13,layout:{"text-field":["concat",["coalesce",["get","length"],""],"×",["coalesce",["get","width"],""],"m"],"text-size":["interpolate",["exponential",1.5],["zoom"],13,10,16,13],"symbol-placement":"point","text-rotate":["coalesce",["get","bearing"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#e4e4e7","text-halo-color":u,"text-halo-width":2}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":a.standLine,"line-width":1}},{id:"amm-runway-threshold-label",type:"symbol",source:o,"source-layer":"amm-runway-threshold",minzoom:12,layout:{"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"text-field":["get","idthr"],"text-size":14,"text-allow-overlap":!0,"text-rotation-alignment":"map","icon-rotation-alignment":"map"},paint:{"text-color":"#ffffff","icon-color":a.threshold}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":a.stand,"circle-radius":1.5}},{id:"amm-stand-label",type:"symbol",source:o,"source-layer":"amm-stand",minzoom:14,layout:{"text-field":["get","idstd"],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":a.stand,"text-halo-color":u,"text-halo-width":1}},{id:"amm-obstacle-region-fill",type:"fill",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"fill-color":"#fef08a","fill-opacity":.1}},{id:"amm-obstacle-region-stroke",type:"line",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"line-color":"#eab308","line-width":1.2,"line-dasharray":[1.5,1]}},{id:"amm-obstacle-point",type:"circle",source:o,"source-layer":"amm-obstacle-point",minzoom:11,paint:{"circle-color":"#f97316","circle-radius":4,"circle-stroke-color":u,"circle-stroke-width":1}},{id:"amm-obstacle-point-label",type:"symbol",source:o,"source-layer":"amm-obstacle-point",minzoom:14,layout:{"text-field":["coalesce",["get","ident"],["get","LABEL"]],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":"#fdba74","text-halo-color":u,"text-halo-width":1.2}},{id:"amm-construction-fill",type:"fill",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"fill-pattern":"normal:passline","fill-opacity":.6}},{id:"amm-construction-stroke",type:"line",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"line-color":"#ea580c","line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-construction-label",type:"symbol",source:o,"source-layer":"amm-construction",minzoom:13,layout:{"text-field":["get","text"],"text-size":9,"text-anchor":"center","symbol-placement":"point","text-allow-overlap":!1},paint:{"text-color":"#f97316","text-halo-color":u,"text-halo-width":1}}]}function Ht(o="amm",a="light"){return a==="dark"?Je(o):a==="neutral"?qe(o):He(o)}const ti={ammAirport:["amm-airport-fill","amm-airport-stroke"],ammRunway:["amm-runway-fill","amm-runway-stroke","amm-runway-info","amm-runway-marking","amm-runway-centerline","amm-runway-threshold","amm-runway-threshold-label"],ammApron:["amm-apron-fill","amm-apron-stroke"],ammTaxiway:["amm-taxiway-fill","amm-taxiway-line","amm-taxiway-label"],ammHolding:["amm-holding"],ammStand:["amm-stand","amm-stand-label","amm-stand-line"],ammRestricted:["amm-restricted-fill","amm-restricted-stroke"],ammHotspot:["amm-hotspot-fill","amm-hotspot-stroke"],ammObstacle:["amm-obstacle-region-fill","amm-obstacle-region-stroke","amm-obstacle-point","amm-obstacle-point-label"],ammConstruction:["amm-construction-fill","amm-construction-stroke","amm-construction-label"]},ei="http://pre.aips.siniswift.com",ii=["interpolate",["linear"],["elevation"],0,"#a8c98a",600,"#cdd98a",1200,"#e8d79a",2400,"#c79a5b",3600,"#9c6b3f",4500,"#f2efe9"],Pt=["amm-airport-fill","amm-airport-stroke","amm-runway-fill","amm-runway-stroke","amm-runway-info","amm-runway-marking","amm-runway-centerline","amm-runway-threshold-label","amm-apron-fill","amm-apron-stroke","amm-taxiway-fill","amm-taxiway-line","amm-taxiway-label","amm-holding","amm-stand","amm-stand-label","amm-stand-line","amm-restricted-fill","amm-restricted-stroke","amm-hotspot-fill","amm-hotspot-stroke","amm-obstacle-region-fill","amm-obstacle-region-stroke","amm-obstacle-point","amm-obstacle-point-label","amm-construction-fill","amm-construction-stroke","amm-construction-label"],Zt=["terrain-color","terrain-hillshade"],Jt=["contour-line","contour-label"];async function Qt(o){const a=await fetch(o);if(!a.ok)throw new Error(`fetch ${o} → ${a.status}`);const u=a.headers.get("Content-Encoding"),g=a.headers.get("Content-Type")||"";if(u==="gzip"||g.includes("json"))return a.json();const y=a.body.pipeThrough(new DecompressionStream("gzip"));return new Response(y).json()}class oi{constructor(a={}){const{container:u,theme:g="light",apiUrl:y=ei,spriteUrl:x,period:b=null,layers:S={},center:M=[104,36],zoom:k=4,terrainUrl:z="http://192.168.125.168:3456/terrain-dem/{z}/{x}/{y}.png"}=a;return this._apiUrl=y.replace(/\/$/,""),this._spriteUrl=(x??y).replace(/\/$/,""),this._terrainUrl=z,this._theme=g,this._period=b,this._center=M,this._zoom=k,this._ready=!1,this._layerVisible={adiz:!0,fir:!0,restricted:!0,controlled:!0,segment:!0,waypoint:!0,waypointOffAirway:!0,vor:!0,ndb:!0,airport:!0,runway:!0,amm:!0,terrain:!1,contour:!1,...S},this._initMap(u),new Proxy(this,{get(p,_,v){var A;if(_ in p)return Reflect.get(p,_,v);const D=(A=p._map)==null?void 0:A[_];return typeof D=="function"?D.bind(p._map):D}})}_initMap(a){const u=ct[this._theme]??ct.light;this._map=new jt.Map({container:a,style:{version:8,glyphs:"https://aips.siniswift.com/mapsdk/glyphs/{fontstack}/{range}.pbf",sprite:[{id:"normal",url:`${this._spriteUrl}/sprites/sprite-color`},{id:"default",url:`${this._spriteUrl}/sprites/sprite`},{id:"v2",url:`${this._spriteUrl}/sprites/sprite-v2`}],sources:{land:{type:"geojson",data:{type:"FeatureCollection",features:[]}},boundary:{type:"geojson",data:{type:"FeatureCollection",features:[]}}},layers:[{id:"background",type:"background",paint:{"background-color":u.background}}]},center:this._center,zoom:this._zoom,minZoom:0,maxZoom:17.5,crossSourceCollisions:!1,maxTileCacheSize:512,prefetchZoomDelta:1,fadeDuration:0,attributionControl:!1}),this._map.on("load",async()=>{await this._initSources(),this._initLayers(),this._applyVisibility(),this._ready=!0,this._map.fire("aviation:ready")})}async _initSources(){if(!this._period)try{const g=await(await fetch(`${this._apiUrl}/api/periods`)).json();this._period=g[g.length-1]}catch(u){console.warn("[AviationChart] fetchPeriods failed:",u),this._period="latest"}this._map.addSource("navdata",{type:"vector",tiles:[`${this._apiUrl}/api/tiles/${this._period}/{z}/{x}/{y}.pbf`],minzoom:.5,maxzoom:18}),this._map.addSource("amm",{type:"vector",tiles:[`${this._apiUrl}/api/amm/{z}/{x}/{y}.pbf`],minzoom:11,maxzoom:18}),this._map.addSource("terrain",{type:"raster-dem",tiles:[this._terrainUrl],tileSize:256,encoding:"mapbox",maxzoom:8});const a=new Be.DemSource({url:this._terrainUrl,encoding:"mapbox",maxzoom:8,worker:!0});a.setupMaplibre(jt),this._map.addSource("contour",{type:"vector",tiles:[a.contourProtocolUrl({thresholds:{5:[250,1e3],7:[125,500],9:[100,500],11:[50,500],13:[25,500]},elevationKey:"ele",levelKey:"level",contourLayer:"contours"})],maxzoom:13}),await this._loadBaseData()}async _loadBaseData(){var a,u,g,y;try{const[x,b]=await Promise.all([Qt(`${this._apiUrl}/topjson/land.topojson.gz`),Qt(`${this._apiUrl}/topjson/boundary.topojson.gz`)]);(a=x==null?void 0:x.objects)!=null&&a.land?(u=this._map.getSource("land"))==null||u.setData($t(x,x.objects.land)):console.warn("[AviationChart] land topojson missing objects.land"),(g=b==null?void 0:b.objects)!=null&&g.boundary?(y=this._map.getSource("boundary"))==null||y.setData($t(b,b.objects.boundary)):console.warn("[AviationChart] boundary topojson missing objects.boundary")}catch(x){console.error("[AviationChart] loadBaseData failed:",x)}}_initLayers(){const a=this._layerVisible.terrain?"visible":"none",u=this._layerVisible.contour?"visible":"none";this._map.addLayer({id:"terrain-color",type:"color-relief",source:"terrain",layout:{visibility:a},paint:{"color-relief-color":ii}}),this._map.addLayer({id:"terrain-hillshade",type:"hillshade",source:"terrain",layout:{visibility:a},paint:{"hillshade-shadow-color":"rgba(74,59,42,0.35)","hillshade-highlight-color":"rgba(255,246,230,0.25)","hillshade-accent-color":"rgba(74,59,42,0.2)","hillshade-exaggeration":.45,"hillshade-illumination-direction":315,"hillshade-illumination-anchor":"viewport"}}),this._map.addLayer({id:"contour-line",type:"line",source:"contour","source-layer":"contours",layout:{visibility:u},paint:{"line-color":["case",["==",["get","level"],1],"rgba(100,70,40,0.40)","rgba(120,90,60,0.18)"],"line-width":["case",["==",["get","level"],1],1,.5]}}),this._map.addLayer({id:"contour-label",type:"symbol",source:"contour","source-layer":"contours",filter:["==",["get","level"],1],layout:{visibility:u,"symbol-placement":"line","text-field":["concat",["to-string",["get","ele"]],"m"],"text-size":10,"text-font":["Open Sans Regular"],"text-allow-overlap":!0,"text-keep-upright":!0},paint:{"text-color":"rgba(100,70,40,0.55)","text-halo-color":"rgba(255,255,255,0.6)","text-halo-width":1}}),this._layerVisible.terrain&&this._map.setTerrain({source:"terrain",exaggeration:4});for(const g of Kt(this._theme))this._map.getLayer(g.id)||this._map.addLayer(g);for(const g of Ht("amm",this._theme))this._map.getLayer(g.id)||this._map.addLayer(g,"fir-line")}_applyVisibility(){for(const[y,x]of Object.entries(Dt)){const b=this._layerVisible[y]!==!1?"visible":"none";for(const S of x)this._map.getLayer(S)&&this._map.setLayoutProperty(S,"visibility",b)}const a=this._layerVisible.amm!==!1?"visible":"none";for(const y of Pt)this._map.getLayer(y)&&this._map.setLayoutProperty(y,"visibility",a);const u=this._layerVisible.terrain?"visible":"none";for(const y of Zt)this._map.getLayer(y)&&this._map.setLayoutProperty(y,"visibility",u);const g=this._layerVisible.contour?"visible":"none";for(const y of Jt)this._map.getLayer(y)&&this._map.setLayoutProperty(y,"visibility",g)}get map(){return this._map}get theme(){return this._theme}get period(){return this._period}setTheme(a){if(a===this._theme)return;this._theme=a;const u=ct[a]??ct.light;this._map.setPaintProperty("background","background-color",u.background);const g=["landLaye","boundary",...Object.values(Dt).flat(),...Pt];for(const y of g)this._map.getLayer(y)&&this._map.removeLayer(y);for(const y of Kt(this._theme))this._map.addLayer(y);for(const y of Ht("amm",this._theme))this._map.getLayer(y.id)||this._map.addLayer(y,"fir-line");this._applyVisibility()}setLayerVisible(a,u){if(this._layerVisible[a]=u,a==="terrain"){const x=u?"visible":"none";for(const b of Zt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",x);this._map.setTerrain(u?{source:"terrain",exaggeration:4}:null);return}if(a==="contour"){const x=u?"visible":"none";for(const b of Jt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",x);return}if(a==="amm"){const x=u?"visible":"none";for(const b of Pt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",x);return}const g=Dt[a];if(!g){console.warn(`[AviationChart] Unknown layer key: "${a}"`);return}const y=u?"visible":"none";for(const x of g)this._map.getLayer(x)&&this._map.setLayoutProperty(x,"visibility",y)}setPeriod(a){var g;this._period=a;const u=(g=this._map)==null?void 0:g.getSource("navdata");u&&u.setTiles([`${this._apiUrl}/api/tiles/${a}/{z}/{x}/{y}.pbf`])}on(a,u){return this._map.on(a,u),this}off(a,u){return this._map.off(a,u),this}destroy(){this._map&&(this._map.remove(),this._map=null)}}exports.AMM_LAYER_GROUPS=ti;exports.AviationChart=oi;exports.CHART_THEMES=ct;exports.LAYER_GROUPS=Dt;
|
|
6
|
+
`,["get","VAL_FREQ"],"kHz"],"text-size":10,"text-offset":[0,1.4],"text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0},paint:{"text-color":a.ndb,"text-halo-color":"#0f172a","text-halo-width":1,"icon-color":a.ndb}},{id:"waypoint-symbol",type:"symbol",source:o,"source-layer":"waypoint",minzoom:5,layout:{"icon-image":["case",["==",["get","report_type"],"C"],"waypoint-compusory","waypoint"],"icon-size":.6,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-field":["get","CODE_ID"],"text-size":9,"text-variable-anchor-offset":["bottom",[0,-.6],"top",[0,.6],"right",[-.6,0],"left",[.6,0],"bottom-right",[-.4,-.4],"bottom-left",[.4,-.4],"top-right",[-.4,.4],"top-left",[.4,.4]],"text-justify":"auto","text-optional":!0},paint:{"icon-color":a.waypoint,"text-color":a.waypoint,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"waypoint-off-airway-symbol",type:"symbol",source:o,"source-layer":"waypoint-off-airway",minzoom:7,layout:{"icon-image":["case",["==",["get","report_type"],"C"],"designate_point_inway","designate_point_notinway"],"icon-size":.6,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-field":["get","CODE_ID"],"text-size":9,"text-variable-anchor-offset":["bottom",[0,-.6],"top",[0,.6],"right",[-.6,0],"left",[.6,0],"bottom-right",[-.4,-.4],"bottom-left",[.4,-.4],"top-right",[-.4,.4],"top-left",[.4,.4]],"text-justify":"auto","text-optional":!0},paint:{"icon-color":a.waypoint,"text-color":a.waypoint,"text-halo-color":"#0f172a","text-halo-width":1}}]}const ct={light:{id:"light",label:"日间",background:"#EAF2F8",build:je},dark:{id:"dark",label:"夜间",background:"#000000",build:Ye}};function Kt(o="light"){return(ct[o]??ct.light).build()}const Dt={adiz:["adiz-line","adiz-label"],fir:["fir-line","fir_line_dash","fir-label"],restricted:["restricted-fill","restricted-stroke","restricted-label"],controlled:["controlled-fill","controlled-stroke","controlled-label"],segment:["segment-radial","segment-line","segment-label"],waypoint:["waypoint-symbol"],waypointOffAirway:["waypoint-off-airway-symbol"],vor:["vor-symbol","vor-label"],ndb:["ndb-symbol"],airport:["airport-circle","airport-label"],runway:["runway-line","runway-line-amm","runway-label"]},Ke={airport:"#e2e8f0",runway:"#94a3b8",apron:"#cbd5e1",taxiway:"#e2e8f0",taxiwayLine:"#f59e0b",holding:"#b91c1c",stand:"#1e293b",runwayMarking:"#ffffff",runwayCenterline:"#ffffff",standLine:"#64748b",restricted:"#b91c1c",hotspot:"#ea580c"};function He(o="amm"){const a=Ke;return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":a.airport,"fill-opacity":.4}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":a.airport,"line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":a.runway,"fill-opacity":.9}},{id:"amm-runway-stroke",type:"line",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"line-color":"#64748b","line-width":.5}},{id:"amm-apron-fill",type:"fill",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"fill-color":a.apron,"fill-opacity":.6}},{id:"amm-apron-stroke",type:"line",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"line-color":"#94a3b8","line-width":.5}},{id:"amm-taxiway-fill",type:"fill",source:o,"source-layer":"amm-taxiway",minzoom:11,paint:{"fill-color":a.taxiway,"fill-opacity":.7}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":a.taxiwayLine,"line-width":["interpolate",["linear"],["zoom"],15,.8,18,2]}},{id:"amm-taxiway-label",type:"symbol",source:o,"source-layer":"amm-taxiway-line",minzoom:14,layout:{"text-field":["get","idlin"],"text-size":10,"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"symbol-placement":"line","text-keep-upright":!0,"text-allow-overlap":!1},paint:{"text-color":"#FFF","icon-color":a.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":a.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":a.runwayMarking,"fill-opacity":.9}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":a.restricted,"fill-opacity":.08}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":a.restricted,"line-width":1.5,"line-dasharray":[4,2]}},{id:"amm-hotspot-fill",type:"fill",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"fill-color":a.hotspot,"fill-opacity":.1}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":a.hotspot,"line-width":1.5}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":a.runwayCenterline,"line-width":1,"line-dasharray":[6,3]}},{id:"amm-runway-info",type:"symbol",source:o,"source-layer":"amm-runway-label",minzoom:13,layout:{"text-field":["concat",["coalesce",["get","length"],""],"×",["coalesce",["get","width"],""],"m"],"text-size":["interpolate",["exponential",1.5],["zoom"],13,10,16,13],"symbol-placement":"point","text-rotate":["coalesce",["get","bearing"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#f8fafc","text-halo-color":"#334155","text-halo-width":2.5}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":a.standLine,"line-width":1}},{id:"amm-runway-threshold-label",type:"symbol",source:o,"source-layer":"amm-runway-threshold",minzoom:12,layout:{"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"text-field":["get","idthr"],"text-size":14,"text-allow-overlap":!0,"text-rotation-alignment":"map","icon-rotation-alignment":"map"},paint:{"text-color":"#fff","icon-color":"#b91c1c"}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":a.stand,"circle-radius":1.5}},{id:"amm-stand-label",type:"symbol",source:o,"source-layer":"amm-stand",minzoom:14,layout:{"text-field":["get","idstd"],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":a.standLine}},{id:"amm-obstacle-region-fill",type:"fill",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"fill-color":"#fef08a","fill-opacity":.35}},{id:"amm-obstacle-region-stroke",type:"line",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"line-color":"#ca8a04","line-width":1.5,"line-dasharray":[1.5,1]}},{id:"amm-obstacle-point",type:"circle",source:o,"source-layer":"amm-obstacle-point",minzoom:11,paint:{"circle-color":"#b45309","circle-radius":4,"circle-stroke-color":"#ffffff","circle-stroke-width":1}},{id:"amm-obstacle-point-label",type:"symbol",source:o,"source-layer":"amm-obstacle-point",minzoom:14,layout:{"text-field":["coalesce",["get","ident"],["get","LABEL"]],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":"#92400e","text-halo-color":"#ffffff","text-halo-width":1}},{id:"amm-construction-fill",type:"fill",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"fill-pattern":"normal:passline","fill-opacity":.8}},{id:"amm-construction-stroke",type:"line",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"line-color":"#d97706","line-width":1.5,"line-dasharray":[4,2]}},{id:"amm-construction-label",type:"symbol",source:o,"source-layer":"amm-construction",minzoom:13,layout:{"text-field":["get","text"],"text-size":9,"text-anchor":"center","symbol-placement":"point","text-allow-overlap":!1},paint:{"text-color":"#92400e","text-halo-color":"#ffffff","text-halo-width":1}}]}const Ze={airport:"#334155",runway:"#475569",apron:"#1e293b",taxiway:"#334155",taxiwayLine:"#fbbf24",holding:"#ef4444",stand:"#34d399",runwayMarking:"#cbd5e1",runwayCenterline:"#94a3b8",standLine:"#64748b",restricted:"#f87171",hotspot:"#fb923c"};function Je(o="amm"){const a=Ze;return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":a.airport,"fill-opacity":.3}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":"#475569","line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":a.runway,"fill-opacity":1}},{id:"amm-runway-stroke",type:"line",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"line-color":"#64748b","line-width":.5}},{id:"amm-apron-fill",type:"fill",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"fill-color":a.apron,"fill-opacity":1}},{id:"amm-apron-stroke",type:"line",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"line-color":"#334155","line-width":.5}},{id:"amm-taxiway-fill",type:"fill",source:o,"source-layer":"amm-taxiway",minzoom:11,paint:{"fill-color":a.taxiway,"fill-opacity":.8}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":a.taxiwayLine,"line-width":["interpolate",["linear"],["zoom"],15,.8,18,2]}},{id:"amm-taxiway-label",type:"symbol",source:o,"source-layer":"amm-taxiway-line",minzoom:14,layout:{"text-field":["get","idlin"],"text-size":10,"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"symbol-placement":"line","text-keep-upright":!0,"text-allow-overlap":!1},paint:{"text-color":"#0f172a","icon-color":a.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":a.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":a.runwayMarking,"fill-opacity":.8}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":a.restricted,"fill-opacity":.12}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":a.restricted,"line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-hotspot-fill",type:"fill",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"fill-color":a.hotspot,"fill-opacity":.15}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":a.hotspot,"line-width":1.2}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":a.runwayCenterline,"line-width":1,"line-dasharray":[6,3]}},{id:"amm-runway-info",type:"symbol",source:o,"source-layer":"amm-runway-label",minzoom:13,layout:{"text-field":["concat",["coalesce",["get","length"],""],"×",["coalesce",["get","width"],""],"m"],"text-size":["interpolate",["exponential",1.5],["zoom"],13,10,16,13],"symbol-placement":"point","text-rotate":["coalesce",["get","bearing"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#e2e8f0","text-halo-color":"#0f172a","text-halo-width":2}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":a.standLine,"line-width":1}},{id:"amm-runway-threshold-label",type:"symbol",source:o,"source-layer":"amm-runway-threshold",minzoom:12,layout:{"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"text-field":["get","idthr"],"text-size":14,"text-allow-overlap":!0,"text-rotation-alignment":"map","icon-rotation-alignment":"map"},paint:{"text-color":"#ffffff","icon-color":"#ef4444"}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":a.stand,"circle-radius":1.5}},{id:"amm-stand-label",type:"symbol",source:o,"source-layer":"amm-stand",minzoom:14,layout:{"text-field":["get","idstd"],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":a.stand,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"amm-obstacle-region-fill",type:"fill",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"fill-color":"#fef08a","fill-opacity":.15}},{id:"amm-obstacle-region-stroke",type:"line",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"line-color":"#eab308","line-width":1.2,"line-dasharray":[1.5,1]}},{id:"amm-obstacle-point",type:"circle",source:o,"source-layer":"amm-obstacle-point",minzoom:11,paint:{"circle-color":"#f97316","circle-radius":4,"circle-stroke-color":"#0f172a","circle-stroke-width":1}},{id:"amm-obstacle-point-label",type:"symbol",source:o,"source-layer":"amm-obstacle-point",minzoom:14,layout:{"text-field":["coalesce",["get","ident"],["get","LABEL"]],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":"#fdba74","text-halo-color":"#0f172a","text-halo-width":1.2}},{id:"amm-construction-fill",type:"fill",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"fill-pattern":"normal:passline","fill-opacity":.6}},{id:"amm-construction-stroke",type:"line",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"line-color":"#ea580c","line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-construction-label",type:"symbol",source:o,"source-layer":"amm-construction",minzoom:13,layout:{"text-field":["get","text"],"text-size":9,"text-anchor":"center","symbol-placement":"point","text-allow-overlap":!1},paint:{"text-color":"#f97316","text-halo-color":"#0f172a","text-halo-width":1}}]}const Qe={airport:"#4b5563",runway:"#71717a",apron:"#27272a",taxiway:"#3f3f46",taxiwayLine:"#eab308",holding:"#ef4444",stand:"#10b981",runwayMarking:"#e4e4e7",runwayCenterline:"#d4d4d8",standLine:"#6b7280",threshold:"#f97316",restricted:"#f87171",hotspot:"#fb923c"};function qe(o="amm"){const a=Qe,u="#1f1f23";return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":a.airport,"fill-opacity":.3}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":"#52525b","line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":a.runway,"fill-opacity":1}},{id:"amm-runway-stroke",type:"line",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"line-color":"#52525b","line-width":.5}},{id:"amm-apron-fill",type:"fill",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"fill-color":a.apron,"fill-opacity":1}},{id:"amm-apron-stroke",type:"line",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"line-color":"#3f3f46","line-width":.5}},{id:"amm-taxiway-fill",type:"fill",source:o,"source-layer":"amm-taxiway",minzoom:11,paint:{"fill-color":a.taxiway,"fill-opacity":.9}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":a.taxiwayLine,"line-width":["interpolate",["linear"],["zoom"],15,.8,18,2]}},{id:"amm-taxiway-label",type:"symbol",source:o,"source-layer":"amm-taxiway-line",minzoom:14,layout:{"text-field":["get","idlin"],"text-size":10,"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"symbol-placement":"line","text-keep-upright":!0,"text-allow-overlap":!1},paint:{"text-color":u,"icon-color":a.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":a.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":a.runwayMarking,"fill-opacity":.85}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":a.restricted,"fill-opacity":.1}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":a.restricted,"line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-hotspot-fill",type:"fill",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"fill-color":a.hotspot,"fill-opacity":.12}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":a.hotspot,"line-width":1.2}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":a.runwayCenterline,"line-width":1,"line-dasharray":[6,3]}},{id:"amm-runway-info",type:"symbol",source:o,"source-layer":"amm-runway-label",minzoom:13,layout:{"text-field":["concat",["coalesce",["get","length"],""],"×",["coalesce",["get","width"],""],"m"],"text-size":["interpolate",["exponential",1.5],["zoom"],13,10,16,13],"symbol-placement":"point","text-rotate":["coalesce",["get","bearing"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#e4e4e7","text-halo-color":u,"text-halo-width":2}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":a.standLine,"line-width":1}},{id:"amm-runway-threshold-label",type:"symbol",source:o,"source-layer":"amm-runway-threshold",minzoom:12,layout:{"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"text-field":["get","idthr"],"text-size":14,"text-allow-overlap":!0,"text-rotation-alignment":"map","icon-rotation-alignment":"map"},paint:{"text-color":"#ffffff","icon-color":a.threshold}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":a.stand,"circle-radius":1.5}},{id:"amm-stand-label",type:"symbol",source:o,"source-layer":"amm-stand",minzoom:14,layout:{"text-field":["get","idstd"],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":a.stand,"text-halo-color":u,"text-halo-width":1}},{id:"amm-obstacle-region-fill",type:"fill",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"fill-color":"#fef08a","fill-opacity":.1}},{id:"amm-obstacle-region-stroke",type:"line",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"line-color":"#eab308","line-width":1.2,"line-dasharray":[1.5,1]}},{id:"amm-obstacle-point",type:"circle",source:o,"source-layer":"amm-obstacle-point",minzoom:11,paint:{"circle-color":"#f97316","circle-radius":4,"circle-stroke-color":u,"circle-stroke-width":1}},{id:"amm-obstacle-point-label",type:"symbol",source:o,"source-layer":"amm-obstacle-point",minzoom:14,layout:{"text-field":["coalesce",["get","ident"],["get","LABEL"]],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":"#fdba74","text-halo-color":u,"text-halo-width":1.2}},{id:"amm-construction-fill",type:"fill",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"fill-pattern":"normal:passline","fill-opacity":.6}},{id:"amm-construction-stroke",type:"line",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"line-color":"#ea580c","line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-construction-label",type:"symbol",source:o,"source-layer":"amm-construction",minzoom:13,layout:{"text-field":["get","text"],"text-size":9,"text-anchor":"center","symbol-placement":"point","text-allow-overlap":!1},paint:{"text-color":"#f97316","text-halo-color":u,"text-halo-width":1}}]}function Ht(o="amm",a="light"){return a==="dark"?Je(o):a==="neutral"?qe(o):He(o)}const ti={ammAirport:["amm-airport-fill","amm-airport-stroke"],ammRunway:["amm-runway-fill","amm-runway-stroke","amm-runway-info","amm-runway-marking","amm-runway-centerline","amm-runway-threshold","amm-runway-threshold-label"],ammApron:["amm-apron-fill","amm-apron-stroke"],ammTaxiway:["amm-taxiway-fill","amm-taxiway-line","amm-taxiway-label"],ammHolding:["amm-holding"],ammStand:["amm-stand","amm-stand-label","amm-stand-line"],ammRestricted:["amm-restricted-fill","amm-restricted-stroke"],ammHotspot:["amm-hotspot-fill","amm-hotspot-stroke"],ammObstacle:["amm-obstacle-region-fill","amm-obstacle-region-stroke","amm-obstacle-point","amm-obstacle-point-label"],ammConstruction:["amm-construction-fill","amm-construction-stroke","amm-construction-label"]},ei="http://pre.aips.siniswift.com",ii=["interpolate",["linear"],["elevation"],0,"#a8c98a",600,"#cdd98a",1200,"#e8d79a",2400,"#c79a5b",3600,"#9c6b3f",4500,"#f2efe9"],Pt=["amm-airport-fill","amm-airport-stroke","amm-runway-fill","amm-runway-stroke","amm-runway-info","amm-runway-marking","amm-runway-centerline","amm-runway-threshold-label","amm-apron-fill","amm-apron-stroke","amm-taxiway-fill","amm-taxiway-line","amm-taxiway-label","amm-holding","amm-stand","amm-stand-label","amm-stand-line","amm-restricted-fill","amm-restricted-stroke","amm-hotspot-fill","amm-hotspot-stroke","amm-obstacle-region-fill","amm-obstacle-region-stroke","amm-obstacle-point","amm-obstacle-point-label","amm-construction-fill","amm-construction-stroke","amm-construction-label"],Zt=["terrain-color","terrain-hillshade"],Jt=["contour-line","contour-label"];async function Qt(o){const a=await fetch(o);if(!a.ok)throw new Error(`fetch ${o} → ${a.status}`);const u=a.headers.get("Content-Encoding"),g=a.headers.get("Content-Type")||"";if(u==="gzip"||g.includes("json"))return a.json();const y=a.body.pipeThrough(new DecompressionStream("gzip"));return new Response(y).json()}class oi{constructor(a={}){const{container:u,theme:g="light",apiUrl:y=ei,spriteUrl:x,period:b=null,layers:S={},center:M=[104,36],zoom:k=4,terrainUrl:z=null}=a;return this._apiUrl=y.replace(/\/$/,""),this._spriteUrl=(x??y).replace(/\/$/,""),this._terrainUrl=z??`${this._apiUrl}/api/terrain/{z}/{x}/{y}.png`,this._theme=g,this._period=b,this._center=M,this._zoom=k,this._ready=!1,this._layerVisible={adiz:!0,fir:!0,restricted:!0,controlled:!0,segment:!0,waypoint:!0,waypointOffAirway:!0,vor:!0,ndb:!0,airport:!0,runway:!0,amm:!0,terrain:!1,contour:!1,...S},this._initMap(u),new Proxy(this,{get(p,_,v){var A;if(_ in p)return Reflect.get(p,_,v);const D=(A=p._map)==null?void 0:A[_];return typeof D=="function"?D.bind(p._map):D}})}_initMap(a){const u=ct[this._theme]??ct.light;this._map=new jt.Map({container:a,style:{version:8,glyphs:"https://aips.siniswift.com/mapsdk/glyphs/{fontstack}/{range}.pbf",sprite:[{id:"normal",url:`${this._spriteUrl}/sprites/sprite-color`},{id:"default",url:`${this._spriteUrl}/sprites/sprite`},{id:"v2",url:`${this._spriteUrl}/sprites/sprite-v2`}],sources:{land:{type:"geojson",data:{type:"FeatureCollection",features:[]}},boundary:{type:"geojson",data:{type:"FeatureCollection",features:[]}}},layers:[{id:"background",type:"background",paint:{"background-color":u.background}}]},center:this._center,zoom:this._zoom,minZoom:0,maxZoom:17.5,crossSourceCollisions:!1,maxTileCacheSize:512,prefetchZoomDelta:1,fadeDuration:0,attributionControl:!1}),this._map.on("load",async()=>{await this._initSources(),this._initLayers(),this._applyVisibility(),this._ready=!0,this._map.fire("aviation:ready")})}async _initSources(){if(!this._period)try{const g=await(await fetch(`${this._apiUrl}/api/periods`)).json();this._period=g[g.length-1]}catch(u){console.warn("[AviationChart] fetchPeriods failed:",u),this._period="latest"}this._map.addSource("navdata",{type:"vector",tiles:[`${this._apiUrl}/api/tiles/${this._period}/{z}/{x}/{y}.pbf`],minzoom:.5,maxzoom:18}),this._map.addSource("amm",{type:"vector",tiles:[`${this._apiUrl}/api/amm/{z}/{x}/{y}.pbf`],minzoom:11,maxzoom:18}),this._map.addSource("terrain",{type:"raster-dem",tiles:[this._terrainUrl],tileSize:256,encoding:"mapbox",maxzoom:8});const a=new Be.DemSource({url:this._terrainUrl,encoding:"mapbox",maxzoom:8,worker:!0});a.setupMaplibre(jt),this._map.addSource("contour",{type:"vector",tiles:[a.contourProtocolUrl({thresholds:{5:[250,1e3],7:[125,500],9:[100,500],11:[50,500],13:[25,500]},elevationKey:"ele",levelKey:"level",contourLayer:"contours"})],maxzoom:13}),await this._loadBaseData()}async _loadBaseData(){var a,u,g,y;try{const[x,b]=await Promise.all([Qt(`${this._apiUrl}/topjson/land.topojson.gz`),Qt(`${this._apiUrl}/topjson/boundary.topojson.gz`)]);(a=x==null?void 0:x.objects)!=null&&a.land?(u=this._map.getSource("land"))==null||u.setData($t(x,x.objects.land)):console.warn("[AviationChart] land topojson missing objects.land"),(g=b==null?void 0:b.objects)!=null&&g.boundary?(y=this._map.getSource("boundary"))==null||y.setData($t(b,b.objects.boundary)):console.warn("[AviationChart] boundary topojson missing objects.boundary")}catch(x){console.error("[AviationChart] loadBaseData failed:",x)}}_initLayers(){const a=this._layerVisible.terrain?"visible":"none",u=this._layerVisible.contour?"visible":"none";this._map.addLayer({id:"terrain-color",type:"color-relief",source:"terrain",layout:{visibility:a},paint:{"color-relief-color":ii}}),this._map.addLayer({id:"terrain-hillshade",type:"hillshade",source:"terrain",layout:{visibility:a},paint:{"hillshade-shadow-color":"rgba(74,59,42,0.35)","hillshade-highlight-color":"rgba(255,246,230,0.25)","hillshade-accent-color":"rgba(74,59,42,0.2)","hillshade-exaggeration":.45,"hillshade-illumination-direction":315,"hillshade-illumination-anchor":"viewport"}}),this._map.addLayer({id:"contour-line",type:"line",source:"contour","source-layer":"contours",layout:{visibility:u},paint:{"line-color":["case",["==",["get","level"],1],"rgba(100,70,40,0.40)","rgba(120,90,60,0.18)"],"line-width":["case",["==",["get","level"],1],1,.5]}}),this._map.addLayer({id:"contour-label",type:"symbol",source:"contour","source-layer":"contours",filter:["==",["get","level"],1],layout:{visibility:u,"symbol-placement":"line","text-field":["concat",["to-string",["get","ele"]],"m"],"text-size":10,"text-font":["Open Sans Regular"],"text-allow-overlap":!0,"text-keep-upright":!0},paint:{"text-color":"rgba(100,70,40,0.55)","text-halo-color":"rgba(255,255,255,0.6)","text-halo-width":1}}),this._layerVisible.terrain&&this._map.setTerrain({source:"terrain",exaggeration:4});for(const g of Kt(this._theme))this._map.getLayer(g.id)||this._map.addLayer(g);for(const g of Ht("amm",this._theme))this._map.getLayer(g.id)||this._map.addLayer(g,"fir-line")}_applyVisibility(){for(const[y,x]of Object.entries(Dt)){const b=this._layerVisible[y]!==!1?"visible":"none";for(const S of x)this._map.getLayer(S)&&this._map.setLayoutProperty(S,"visibility",b)}const a=this._layerVisible.amm!==!1?"visible":"none";for(const y of Pt)this._map.getLayer(y)&&this._map.setLayoutProperty(y,"visibility",a);const u=this._layerVisible.terrain?"visible":"none";for(const y of Zt)this._map.getLayer(y)&&this._map.setLayoutProperty(y,"visibility",u);const g=this._layerVisible.contour?"visible":"none";for(const y of Jt)this._map.getLayer(y)&&this._map.setLayoutProperty(y,"visibility",g)}get map(){return this._map}get theme(){return this._theme}get period(){return this._period}setTheme(a){if(a===this._theme)return;this._theme=a;const u=ct[a]??ct.light;this._map.setPaintProperty("background","background-color",u.background);const g=["landLaye","boundary",...Object.values(Dt).flat(),...Pt];for(const y of g)this._map.getLayer(y)&&this._map.removeLayer(y);for(const y of Kt(this._theme))this._map.addLayer(y);for(const y of Ht("amm",this._theme))this._map.getLayer(y.id)||this._map.addLayer(y,"fir-line");this._applyVisibility()}setLayerVisible(a,u){if(this._layerVisible[a]=u,a==="terrain"){const x=u?"visible":"none";for(const b of Zt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",x);this._map.setTerrain(u?{source:"terrain",exaggeration:4}:null);return}if(a==="contour"){const x=u?"visible":"none";for(const b of Jt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",x);return}if(a==="amm"){const x=u?"visible":"none";for(const b of Pt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",x);return}const g=Dt[a];if(!g){console.warn(`[AviationChart] Unknown layer key: "${a}"`);return}const y=u?"visible":"none";for(const x of g)this._map.getLayer(x)&&this._map.setLayoutProperty(x,"visibility",y)}setPeriod(a){var g;this._period=a;const u=(g=this._map)==null?void 0:g.getSource("navdata");u&&u.setTiles([`${this._apiUrl}/api/tiles/${a}/{z}/{x}/{y}.pbf`])}on(a,u){return this._map.on(a,u),this}off(a,u){return this._map.off(a,u),this}destroy(){this._map&&(this._map.remove(),this._map=null)}}exports.AMM_LAYER_GROUPS=ti;exports.AviationChart=oi;exports.CHART_THEMES=ct;exports.LAYER_GROUPS=Dt;
|
package/dist/index.js
CHANGED
|
@@ -142,20 +142,20 @@ Mt(["exports"], function(o) {
|
|
|
142
142
|
if (!t)
|
|
143
143
|
return {};
|
|
144
144
|
const r = i / (e.width - 1);
|
|
145
|
-
let l, s, c, m, h,
|
|
146
|
-
const
|
|
145
|
+
let l, s, c, m, h, f;
|
|
146
|
+
const d = {}, w = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map();
|
|
147
147
|
function P(O, I, R) {
|
|
148
|
-
O[0] === 0 ? R(r * (
|
|
148
|
+
O[0] === 0 ? R(r * (f - 1), r * (h - y(c, I, l))) : O[0] === 2 ? R(r * f, r * (h - y(m, I, s))) : O[1] === 0 ? R(r * (f - y(s, I, l)), r * (h - 1)) : R(r * (f - y(m, I, c)), r * h);
|
|
149
149
|
}
|
|
150
150
|
for (h = 1 - n; h < e.height + n; h++) {
|
|
151
151
|
s = e.get(0, h - 1), m = e.get(0, h);
|
|
152
152
|
let O = Math.min(s, m), I = Math.max(s, m);
|
|
153
|
-
for (
|
|
154
|
-
l = s, c = m, s = e.get(
|
|
153
|
+
for (f = 1 - n; f < e.width + n; f++) {
|
|
154
|
+
l = s, c = m, s = e.get(f, h - 1), m = e.get(f, h);
|
|
155
155
|
const R = O, V = I;
|
|
156
156
|
if (O = Math.min(s, m), I = Math.max(s, m), isNaN(l) || isNaN(s) || isNaN(m) || isNaN(c))
|
|
157
157
|
continue;
|
|
158
|
-
const
|
|
158
|
+
const dt = Math.min(R, O), pt = Math.max(V, I), X = Math.ceil(dt / t) * t, ot = Math.floor(pt / t) * t;
|
|
159
159
|
for (let C = X; C <= ot; C += t) {
|
|
160
160
|
const At = l > C, q = s > C, nt = c > C, _t = m > C;
|
|
161
161
|
for (const bt of u[(At ? 8 : 0) | (q ? 4 : 0) | (_t ? 2 : 0) | (nt ? 1 : 0)]) {
|
|
@@ -163,14 +163,14 @@ Mt(["exports"], function(o) {
|
|
|
163
163
|
Y || w.set(C, Y = /* @__PURE__ */ new Map());
|
|
164
164
|
let lt = F.get(C);
|
|
165
165
|
lt || F.set(C, lt = /* @__PURE__ */ new Map());
|
|
166
|
-
const kt = bt[0], zt = bt[1], yt = g(e.width,
|
|
166
|
+
const kt = bt[0], zt = bt[1], yt = g(e.width, f, h, kt), st = g(e.width, f, h, zt);
|
|
167
167
|
let L, Tt;
|
|
168
168
|
if (L = lt.get(yt))
|
|
169
169
|
if (lt.delete(yt), Tt = Y.get(st))
|
|
170
170
|
if (Y.delete(st), L === Tt) {
|
|
171
171
|
if (P(zt, C, L.append), !L.isEmpty()) {
|
|
172
|
-
let rt =
|
|
173
|
-
rt || (
|
|
172
|
+
let rt = d[C];
|
|
173
|
+
rt || (d[C] = rt = []), rt.push(L.lineString());
|
|
174
174
|
}
|
|
175
175
|
} else
|
|
176
176
|
L.appendFragment(Tt), lt.set(L.end = Tt.end, L);
|
|
@@ -189,9 +189,9 @@ Mt(["exports"], function(o) {
|
|
|
189
189
|
for (const [O, I] of w.entries()) {
|
|
190
190
|
let R = null;
|
|
191
191
|
for (const V of I.values())
|
|
192
|
-
V.isEmpty() || (R == null && (R =
|
|
192
|
+
V.isEmpty() || (R == null && (R = d[O] || (d[O] = [])), R.push(V.lineString()));
|
|
193
193
|
}
|
|
194
|
-
return
|
|
194
|
+
return d;
|
|
195
195
|
}
|
|
196
196
|
function b(t) {
|
|
197
197
|
const e = Object.entries(t);
|
|
@@ -311,10 +311,10 @@ Mt(["exports"], function(o) {
|
|
|
311
311
|
if (l)
|
|
312
312
|
l.lastUsed = ++E, l.waiting++;
|
|
313
313
|
else {
|
|
314
|
-
const h = new AbortController(),
|
|
314
|
+
const h = new AbortController(), f = n(i, h);
|
|
315
315
|
l = {
|
|
316
316
|
abortController: h,
|
|
317
|
-
item:
|
|
317
|
+
item: f,
|
|
318
318
|
lastUsed: ++E,
|
|
319
319
|
waiting: 1
|
|
320
320
|
}, this.items.set(i, l), this.prune();
|
|
@@ -355,13 +355,13 @@ Mt(["exports"], function(o) {
|
|
|
355
355
|
try {
|
|
356
356
|
if (!(((n = c == null ? void 0 : c.format) === null || n === void 0 ? void 0 : n.startsWith("BGR")) || ((r = c == null ? void 0 : c.format) === null || r === void 0 ? void 0 : r.startsWith("RGB"))))
|
|
357
357
|
throw new Error(`Unrecognized format: ${c == null ? void 0 : c.format}`);
|
|
358
|
-
const h = (l = c == null ? void 0 : c.format) === null || l === void 0 ? void 0 : l.startsWith("BGR"),
|
|
359
|
-
if (await c.copyTo(
|
|
360
|
-
for (let w = 0; w <
|
|
361
|
-
const F =
|
|
362
|
-
|
|
358
|
+
const h = (l = c == null ? void 0 : c.format) === null || l === void 0 ? void 0 : l.startsWith("BGR"), f = c.allocationSize(), d = new Uint8ClampedArray(f);
|
|
359
|
+
if (await c.copyTo(d), h)
|
|
360
|
+
for (let w = 0; w < d.length; w += 4) {
|
|
361
|
+
const F = d[w];
|
|
362
|
+
d[w] = d[w + 2], d[w + 2] = F;
|
|
363
363
|
}
|
|
364
|
-
return Dt(s.width, s.height, e,
|
|
364
|
+
return Dt(s.width, s.height, e, d);
|
|
365
365
|
} catch {
|
|
366
366
|
return B(i) ? null : W(s, e);
|
|
367
367
|
} finally {
|
|
@@ -415,21 +415,21 @@ Mt(["exports"], function(o) {
|
|
|
415
415
|
if (r === 0)
|
|
416
416
|
return this;
|
|
417
417
|
const c = 1 << r, m = l * this.width / c, h = s * this.height / c;
|
|
418
|
-
return new $(this.width / c, this.height / c, (
|
|
418
|
+
return new $(this.width / c, this.height / c, (f, d) => this.get(f + m, d + h));
|
|
419
419
|
}, this.subsamplePixelCenters = (r) => {
|
|
420
|
-
const l = (m, h,
|
|
420
|
+
const l = (m, h, f) => isNaN(m) ? h : isNaN(h) ? m : m + (h - m) * f;
|
|
421
421
|
if (r <= 1)
|
|
422
422
|
return this;
|
|
423
423
|
const s = 0.5 - 1 / (2 * r), c = (m, h) => {
|
|
424
|
-
const
|
|
425
|
-
return l(pt, X,
|
|
424
|
+
const f = m / r - s, d = h / r - s, w = Math.floor(f), F = Math.floor(d), P = this.get(w, F), O = this.get(w + 1, F), I = this.get(w, F + 1), R = this.get(w + 1, F + 1), V = f - w, dt = d - F, pt = l(P, O, V), X = l(I, R, V);
|
|
425
|
+
return l(pt, X, dt);
|
|
426
426
|
};
|
|
427
427
|
return new $(this.width * r, this.height * r, c);
|
|
428
428
|
}, this.averagePixelCentersToGrid = (r = 1) => new $(this.width + 1, this.height + 1, (l, s) => {
|
|
429
429
|
let c = 0, m = 0, h = 0;
|
|
430
|
-
for (let
|
|
431
|
-
for (let
|
|
432
|
-
isNaN(h = this.get(
|
|
430
|
+
for (let f = l - r; f < l + r; f++)
|
|
431
|
+
for (let d = s - r; d < s + r; d++)
|
|
432
|
+
isNaN(h = this.get(f, d)) || (m++, c += h);
|
|
433
433
|
return m === 0 ? NaN : c / m;
|
|
434
434
|
}), this.scaleElevation = (r) => r === 1 ? this : new $(this.width, this.height, (l, s) => this.get(l, s) * r), this.materialize = (r = 2) => {
|
|
435
435
|
const l = this.width + 2 * r, s = new Float32Array(l * (this.height + 2 * r));
|
|
@@ -474,10 +474,10 @@ Mt(["exports"], function(o) {
|
|
|
474
474
|
var Et = {};
|
|
475
475
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
476
476
|
Et.read = function(t, e, i, n, r) {
|
|
477
|
-
var l, s, c = r * 8 - n - 1, m = (1 << c) - 1, h = m >> 1,
|
|
478
|
-
for (
|
|
477
|
+
var l, s, c = r * 8 - n - 1, m = (1 << c) - 1, h = m >> 1, f = -7, d = i ? r - 1 : 0, w = i ? -1 : 1, F = t[e + d];
|
|
478
|
+
for (d += w, l = F & (1 << -f) - 1, F >>= -f, f += c; f > 0; l = l * 256 + t[e + d], d += w, f -= 8)
|
|
479
479
|
;
|
|
480
|
-
for (s = l & (1 << -
|
|
480
|
+
for (s = l & (1 << -f) - 1, l >>= -f, f += n; f > 0; s = s * 256 + t[e + d], d += w, f -= 8)
|
|
481
481
|
;
|
|
482
482
|
if (l === 0)
|
|
483
483
|
l = 1 - h;
|
|
@@ -488,8 +488,8 @@ Mt(["exports"], function(o) {
|
|
|
488
488
|
}
|
|
489
489
|
return (F ? -1 : 1) * s * Math.pow(2, l - n);
|
|
490
490
|
}, Et.write = function(t, e, i, n, r, l) {
|
|
491
|
-
var s, c, m, h = l * 8 - r - 1,
|
|
492
|
-
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (c = isNaN(e) ? 1 : 0, s =
|
|
491
|
+
var s, c, m, h = l * 8 - r - 1, f = (1 << h) - 1, d = f >> 1, w = r === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, F = n ? 0 : l - 1, P = n ? 1 : -1, O = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
|
|
492
|
+
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (c = isNaN(e) ? 1 : 0, s = f) : (s = Math.floor(Math.log(e) / Math.LN2), e * (m = Math.pow(2, -s)) < 1 && (s--, m *= 2), s + d >= 1 ? e += w / m : e += w * Math.pow(2, 1 - d), e * m >= 2 && (s++, m /= 2), s + d >= f ? (c = 0, s = f) : s + d >= 1 ? (c = (e * m - 1) * Math.pow(2, r), s = s + d) : (c = e * Math.pow(2, d - 1) * Math.pow(2, r), s = 0)); r >= 8; t[i + F] = c & 255, F += P, c /= 256, r -= 8)
|
|
493
493
|
;
|
|
494
494
|
for (s = s << r | c, h += r; h > 0; t[i + F] = s & 255, F += P, s /= 256, h -= 8)
|
|
495
495
|
;
|
|
@@ -695,10 +695,10 @@ Mt(["exports"], function(o) {
|
|
|
695
695
|
this.writeTag(t, T.Bytes), this.writeRawMessage(e, i);
|
|
696
696
|
},
|
|
697
697
|
writePackedVarint: function(t, e) {
|
|
698
|
-
e.length && this.writeMessage(t,
|
|
698
|
+
e.length && this.writeMessage(t, fe, e);
|
|
699
699
|
},
|
|
700
700
|
writePackedSVarint: function(t, e) {
|
|
701
|
-
e.length && this.writeMessage(t,
|
|
701
|
+
e.length && this.writeMessage(t, de, e);
|
|
702
702
|
},
|
|
703
703
|
writePackedBoolean: function(t, e) {
|
|
704
704
|
e.length && this.writeMessage(t, ye, e);
|
|
@@ -784,10 +784,10 @@ Mt(["exports"], function(o) {
|
|
|
784
784
|
i.realloc(n);
|
|
785
785
|
for (var r = i.pos - 1; r >= t; r--) i.buf[r + n] = i.buf[r];
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function fe(t, e) {
|
|
788
788
|
for (var i = 0; i < t.length; i++) e.writeVarint(t[i]);
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function de(t, e) {
|
|
791
791
|
for (var i = 0; i < t.length; i++) e.writeSVarint(t[i]);
|
|
792
792
|
}
|
|
793
793
|
function ue(t, e) {
|
|
@@ -824,8 +824,8 @@ Mt(["exports"], function(o) {
|
|
|
824
824
|
for (var n = "", r = e; r < i; ) {
|
|
825
825
|
var l = t[r], s = null, c = l > 239 ? 4 : l > 223 ? 3 : l > 191 ? 2 : 1;
|
|
826
826
|
if (r + c > i) break;
|
|
827
|
-
var m, h,
|
|
828
|
-
c === 1 ? l < 128 && (s = l) : c === 2 ? (m = t[r + 1], (m & 192) === 128 && (s = (l & 31) << 6 | m & 63, s <= 127 && (s = null))) : c === 3 ? (m = t[r + 1], h = t[r + 2], (m & 192) === 128 && (h & 192) === 128 && (s = (l & 15) << 12 | (m & 63) << 6 | h & 63, (s <= 2047 || s >= 55296 && s <= 57343) && (s = null))) : c === 4 && (m = t[r + 1], h = t[r + 2],
|
|
827
|
+
var m, h, f;
|
|
828
|
+
c === 1 ? l < 128 && (s = l) : c === 2 ? (m = t[r + 1], (m & 192) === 128 && (s = (l & 31) << 6 | m & 63, s <= 127 && (s = null))) : c === 3 ? (m = t[r + 1], h = t[r + 2], (m & 192) === 128 && (h & 192) === 128 && (s = (l & 15) << 12 | (m & 63) << 6 | h & 63, (s <= 2047 || s >= 55296 && s <= 57343) && (s = null))) : c === 4 && (m = t[r + 1], h = t[r + 2], f = t[r + 3], (m & 192) === 128 && (h & 192) === 128 && (f & 192) === 128 && (s = (l & 15) << 18 | (m & 63) << 12 | (h & 63) << 6 | f & 63, (s <= 65535 || s >= 1114112) && (s = null))), s === null ? (s = 65533, c = 1) : s > 65535 && (s -= 65536, n += String.fromCharCode(s >>> 10 & 1023 | 55296), s = 56320 | s & 1023), n += String.fromCharCode(s), r += c;
|
|
829
829
|
}
|
|
830
830
|
return n;
|
|
831
831
|
}
|
|
@@ -850,10 +850,10 @@ Mt(["exports"], function(o) {
|
|
|
850
850
|
}
|
|
851
851
|
return i;
|
|
852
852
|
}
|
|
853
|
-
var ve = /* @__PURE__ */ ae(ne),
|
|
853
|
+
var ve = /* @__PURE__ */ ae(ne), ft;
|
|
854
854
|
(function(t) {
|
|
855
855
|
t[t.UNKNOWN = 0] = "UNKNOWN", t[t.POINT = 1] = "POINT", t[t.LINESTRING = 2] = "LINESTRING", t[t.POLYGON = 3] = "POLYGON";
|
|
856
|
-
})(
|
|
856
|
+
})(ft || (ft = {}));
|
|
857
857
|
function De(t) {
|
|
858
858
|
const e = new ve();
|
|
859
859
|
for (const i in t.layers) {
|
|
@@ -895,11 +895,11 @@ Mt(["exports"], function(o) {
|
|
|
895
895
|
if (m === null)
|
|
896
896
|
continue;
|
|
897
897
|
typeof h > "u" && (n.push(c), h = n.length - 1, l[c] = h), e.writeVarint(h);
|
|
898
|
-
const
|
|
899
|
-
|
|
900
|
-
const
|
|
901
|
-
let w = s[
|
|
902
|
-
typeof w > "u" && (r.push(m), w = r.length - 1, s[
|
|
898
|
+
const f = typeof m;
|
|
899
|
+
f !== "string" && f !== "boolean" && f !== "number" && (m = JSON.stringify(m));
|
|
900
|
+
const d = `${f}:${m}`;
|
|
901
|
+
let w = s[d];
|
|
902
|
+
typeof w > "u" && (r.push(m), w = r.length - 1, s[d] = w), e.writeVarint(w);
|
|
903
903
|
}
|
|
904
904
|
}
|
|
905
905
|
function St(t, e) {
|
|
@@ -915,14 +915,14 @@ Mt(["exports"], function(o) {
|
|
|
915
915
|
let r = 0, l = 0;
|
|
916
916
|
for (const s of i) {
|
|
917
917
|
let c = 1;
|
|
918
|
-
n ===
|
|
919
|
-
const m = s.length / 2, h = n ===
|
|
920
|
-
for (let
|
|
921
|
-
|
|
922
|
-
const
|
|
923
|
-
e.writeVarint(Vt(
|
|
918
|
+
n === ft.POINT && (c = s.length / 2), e.writeVarint(St(1, c));
|
|
919
|
+
const m = s.length / 2, h = n === ft.POLYGON ? m - 1 : m;
|
|
920
|
+
for (let f = 0; f < h; f++) {
|
|
921
|
+
f === 1 && n !== 1 && e.writeVarint(St(2, h - 1));
|
|
922
|
+
const d = s[f * 2] - r, w = s[f * 2 + 1] - l;
|
|
923
|
+
e.writeVarint(Vt(d)), e.writeVarint(Vt(w)), r += d, l += w;
|
|
924
924
|
}
|
|
925
|
-
n ===
|
|
925
|
+
n === ft.POLYGON && e.writeVarint(St(7, 1));
|
|
926
926
|
}
|
|
927
927
|
}
|
|
928
928
|
function ke(t, e) {
|
|
@@ -932,13 +932,13 @@ Mt(["exports"], function(o) {
|
|
|
932
932
|
}
|
|
933
933
|
class Re {
|
|
934
934
|
constructor(e, i, n, r, l) {
|
|
935
|
-
this.loaded = Promise.resolve(), this.decodeImage = It, this.fetchAndParseTile = (s, c, m, h,
|
|
936
|
-
const
|
|
937
|
-
return
|
|
938
|
-
const O = await
|
|
935
|
+
this.loaded = Promise.resolve(), this.decodeImage = It, this.fetchAndParseTile = (s, c, m, h, f) => {
|
|
936
|
+
const d = this, w = this.demUrlPattern.replace("{z}", s.toString()).replace("{x}", c.toString()).replace("{y}", m.toString());
|
|
937
|
+
return f == null || f.useTile(w), this.parsedCache.get(w, async (F, P) => {
|
|
938
|
+
const O = await d.fetchTile(s, c, m, P, f);
|
|
939
939
|
if (B(P))
|
|
940
940
|
throw new Error("canceled");
|
|
941
|
-
const I =
|
|
941
|
+
const I = d.decodeImage(O.data, d.encoding, P), R = f == null ? void 0 : f.marker("decode"), V = await I;
|
|
942
942
|
return R == null || R(), V;
|
|
943
943
|
}, h);
|
|
944
944
|
}, this.tileCache = new Z(i), this.parsedCache = new Z(i), this.contourCache = new Z(i), this.timeoutMs = l, this.demUrlPattern = e, this.encoding = n, this.maxzoom = r;
|
|
@@ -950,33 +950,33 @@ Mt(["exports"], function(o) {
|
|
|
950
950
|
signal: m.signal
|
|
951
951
|
};
|
|
952
952
|
l == null || l.fetchTile(s);
|
|
953
|
-
const
|
|
954
|
-
return G(this.timeoutMs, fetch(s, h).then(async (
|
|
955
|
-
if (
|
|
956
|
-
throw new Error(`Bad response: ${
|
|
953
|
+
const f = l == null ? void 0 : l.marker("fetch");
|
|
954
|
+
return G(this.timeoutMs, fetch(s, h).then(async (d) => {
|
|
955
|
+
if (f == null || f(), !d.ok)
|
|
956
|
+
throw new Error(`Bad response: ${d.status} for ${s}`);
|
|
957
957
|
return {
|
|
958
|
-
data: await
|
|
959
|
-
expires:
|
|
960
|
-
cacheControl:
|
|
958
|
+
data: await d.blob(),
|
|
959
|
+
expires: d.headers.get("expires") || void 0,
|
|
960
|
+
cacheControl: d.headers.get("cache-control") || void 0
|
|
961
961
|
};
|
|
962
962
|
}), m);
|
|
963
963
|
}, r);
|
|
964
964
|
}
|
|
965
965
|
async fetchDem(e, i, n, r, l, s) {
|
|
966
|
-
const c = Math.min(e - (r.overzoom || 0), this.maxzoom), m = e - c, h = 1 << m,
|
|
966
|
+
const c = Math.min(e - (r.overzoom || 0), this.maxzoom), m = e - c, h = 1 << m, f = Math.floor(i / h), d = Math.floor(n / h), w = await this.fetchAndParseTile(c, f, d, l, s);
|
|
967
967
|
return $.fromRawDem(w).split(m, i % h, n % h);
|
|
968
968
|
}
|
|
969
969
|
fetchContourTile(e, i, n, r, l, s) {
|
|
970
|
-
const { levels: c, multiplier: m = 1, buffer: h = 1, extent:
|
|
970
|
+
const { levels: c, multiplier: m = 1, buffer: h = 1, extent: f = 4096, contourLayer: d = "contours", elevationKey: w = "ele", levelKey: F = "level", subsampleBelow: P = 100 } = r;
|
|
971
971
|
if (!c || c.length === 0)
|
|
972
972
|
return Promise.resolve({ arrayBuffer: new ArrayBuffer(0) });
|
|
973
973
|
const O = [e, i, n, p(r)].join("/");
|
|
974
974
|
return this.contourCache.get(O, async (I, R) => {
|
|
975
|
-
const V = 1 << e,
|
|
975
|
+
const V = 1 << e, dt = [];
|
|
976
976
|
for (let q = n - 1; q <= n + 1; q++)
|
|
977
977
|
for (let nt = i - 1; nt <= i + 1; nt++)
|
|
978
|
-
|
|
979
|
-
const pt = await Promise.all(
|
|
978
|
+
dt.push(q < 0 || q >= V ? void 0 : this.fetchDem(e, (nt + V) % V, q, r, R, s));
|
|
979
|
+
const pt = await Promise.all(dt);
|
|
980
980
|
let X = $.combineNeighbors(pt);
|
|
981
981
|
if (!X || B(R))
|
|
982
982
|
return { arrayBuffer: new Uint8Array().buffer };
|
|
@@ -987,16 +987,16 @@ Mt(["exports"], function(o) {
|
|
|
987
987
|
for (; X.width < P; )
|
|
988
988
|
X = X.subsamplePixelCenters(2).materialize(2);
|
|
989
989
|
X = X.averagePixelCentersToGrid().scaleElevation(m).materialize(1);
|
|
990
|
-
const C = x(c[0], X,
|
|
990
|
+
const C = x(c[0], X, f, h);
|
|
991
991
|
ot == null || ot();
|
|
992
992
|
const At = De({
|
|
993
|
-
extent:
|
|
993
|
+
extent: f,
|
|
994
994
|
layers: {
|
|
995
|
-
[
|
|
995
|
+
[d]: {
|
|
996
996
|
features: Object.entries(C).map(([q, nt]) => {
|
|
997
997
|
const _t = Number(q);
|
|
998
998
|
return {
|
|
999
|
-
type:
|
|
999
|
+
type: ft.LINESTRING,
|
|
1000
1000
|
geometry: nt,
|
|
1001
1001
|
properties: {
|
|
1002
1002
|
[w]: _t,
|
|
@@ -1030,8 +1030,8 @@ Mt(["exports"], function(o) {
|
|
|
1030
1030
|
this.marks = {}, this.urls = [], this.fetched = [], this.resources = [], this.tilesFetched = 0, this.timeOrigin = Ce, this.finish = (i) => {
|
|
1031
1031
|
this.markFinish();
|
|
1032
1032
|
const n = (m) => {
|
|
1033
|
-
const h = this.marks[m] || [],
|
|
1034
|
-
return Number.isFinite(
|
|
1033
|
+
const h = this.marks[m] || [], f = Math.max(...h.map((w) => Math.max(...w))), d = Math.min(...h.map((w) => Math.min(...w)));
|
|
1034
|
+
return Number.isFinite(f) ? f - d : void 0;
|
|
1035
1035
|
}, r = n("main") || 0, l = n("fetch"), s = n("decode"), c = n("isoline");
|
|
1036
1036
|
return {
|
|
1037
1037
|
url: i,
|
|
@@ -1092,23 +1092,23 @@ Mt(["exports"], function(o) {
|
|
|
1092
1092
|
...l.args,
|
|
1093
1093
|
m,
|
|
1094
1094
|
s
|
|
1095
|
-
]),
|
|
1095
|
+
]), f = `${l.name}_${l.id}`;
|
|
1096
1096
|
if (l.id && h) {
|
|
1097
1097
|
this.cancels[l.id] = m;
|
|
1098
1098
|
try {
|
|
1099
|
-
const
|
|
1099
|
+
const d = await h, w = d == null ? void 0 : d.transferrables;
|
|
1100
1100
|
this.postMessage({
|
|
1101
1101
|
id: l.id,
|
|
1102
1102
|
type: "response",
|
|
1103
|
-
response:
|
|
1104
|
-
timings: s.finish(
|
|
1103
|
+
response: d,
|
|
1104
|
+
timings: s.finish(f)
|
|
1105
1105
|
}, w);
|
|
1106
|
-
} catch (
|
|
1106
|
+
} catch (d) {
|
|
1107
1107
|
this.postMessage({
|
|
1108
1108
|
id: l.id,
|
|
1109
1109
|
type: "response",
|
|
1110
|
-
error: (
|
|
1111
|
-
timings: s.finish(
|
|
1110
|
+
error: (d == null ? void 0 : d.toString()) || "error",
|
|
1111
|
+
timings: s.finish(f)
|
|
1112
1112
|
});
|
|
1113
1113
|
}
|
|
1114
1114
|
delete this.cancels[l.id];
|
|
@@ -1122,8 +1122,8 @@ Mt(["exports"], function(o) {
|
|
|
1122
1122
|
/** Invokes a method by name with a set of arguments in the remote context. */
|
|
1123
1123
|
send(e, i, n, r, ...l) {
|
|
1124
1124
|
const s = ++Le, c = new Promise((m, h) => {
|
|
1125
|
-
this.postMessage({ id: s, type: "request", name: e, args: l }, i), this.callbacks[s] = (
|
|
1126
|
-
r == null || r.addAll(w),
|
|
1125
|
+
this.postMessage({ id: s, type: "request", name: e, args: l }, i), this.callbacks[s] = (f, d, w) => {
|
|
1126
|
+
r == null || r.addAll(w), f ? h(f) : m(d);
|
|
1127
1127
|
};
|
|
1128
1128
|
});
|
|
1129
1129
|
return U(n, () => {
|
|
@@ -3270,9 +3270,9 @@ class ri {
|
|
|
3270
3270
|
layers: S = {},
|
|
3271
3271
|
center: M = [104, 36],
|
|
3272
3272
|
zoom: k = 4,
|
|
3273
|
-
terrainUrl: z =
|
|
3273
|
+
terrainUrl: z = null
|
|
3274
3274
|
} = a;
|
|
3275
|
-
return this._apiUrl = y.replace(/\/$/, ""), this._spriteUrl = (x ?? y).replace(/\/$/, ""), this._terrainUrl = z
|
|
3275
|
+
return this._apiUrl = y.replace(/\/$/, ""), this._spriteUrl = (x ?? y).replace(/\/$/, ""), this._terrainUrl = z ?? `${this._apiUrl}/api/terrain/{z}/{x}/{y}.png`, this._theme = g, this._period = b, this._center = M, this._zoom = k, this._ready = !1, this._layerVisible = {
|
|
3276
3276
|
// aviation groups — all visible by default
|
|
3277
3277
|
adiz: !0,
|
|
3278
3278
|
fir: !0,
|