aviation-chart 0.1.28 → 0.1.29
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 +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +87 -87
- package/package.json +2 -2
|
@@ -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":r.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":r.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",r.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",r.airport]}},{id:"runway-line",type:"line",source:o,"source-layer":"runway",filter:["!",["has","has_amm"]],minzoom:4,maxzoom:11,paint:{"line-color":r.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":r.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":r.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":r.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":r.ndb,"font-scale":1.1},"",{},["coalesce",["get","VAL_FREQ"],""],{"text-color":r.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":r.ndb,"text-halo-color":"#ffffff","text-halo-width":.5,"text-halo-blur":1,"icon-color":r.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":r.waypoint,"text-color":r.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":r.waypoint,"text-color":r.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:"#CC7722",controlledStroke:"#22C55E",controlledFill:"#22C55E",segment:"#40C4FF",waypoint:"#74cdde",vor:"#72aae5",ndb:"#62d6ef",airport:"#73ccdd",runway:"#64748b"};function se(){const o="navdata",r=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-width":["interpolate",["linear"],["zoom"],0,1,7,4],"line-opacity":1,"line-pattern":"normal:national-border-dark"}},{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":r.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":r.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":r.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":r.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":r.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":r.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":r.controlledFill,"fill-opacity":["interpolate",["linear"],["zoom"],10,.04,11.5,0]}},{id:"controlled-stroke",type:"line",source:o,"source-layer":"controlled",paint:{"line-color":r.controlledStroke,"line-width":1,"line-opacity":["interpolate",["linear"],["zoom"],4,.6,8,1],"line-dasharray":[4,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":r.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",r.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":r.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":r.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",r.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":r.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":r.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":r.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":r.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":r.ndb,"text-halo-color":"#0f172a","text-halo-width":1,"icon-color":r.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":r.waypoint,"text-color":r.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":r.waypoint,"text-color":r.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 r=ce;return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":r.airport,"fill-opacity":.4}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":r.airport,"line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":r.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":r.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":r.taxiway,"fill-opacity":.7}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":r.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":r.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":r.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":r.runwayMarking,"fill-opacity":.9}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":r.restricted,"fill-opacity":.08}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":r.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":r.hotspot,"fill-opacity":.1}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":r.hotspot,"line-width":1.5}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":r.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":r.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":r.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":r.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 he(o="amm"){const r=fe;return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":r.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":r.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":r.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":r.taxiway,"fill-opacity":.8}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":r.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":r.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":r.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":r.runwayMarking,"fill-opacity":.8}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":r.restricted,"fill-opacity":.12}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":r.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":r.hotspot,"fill-opacity":.15}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":r.hotspot,"line-width":1.2}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":r.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":r.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":r.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":r.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 de={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 r=de,d="#1f1f23";return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":r.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":r.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":r.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":r.taxiway,"fill-opacity":.9}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":r.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":d,"icon-color":r.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":r.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":r.runwayMarking,"fill-opacity":.85}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":r.restricted,"fill-opacity":.1}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":r.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":r.hotspot,"fill-opacity":.12}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":r.hotspot,"line-width":1.2}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":r.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":d,"text-halo-width":2}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":r.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":r.threshold}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":r.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":r.stand,"text-halo-color":d,"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":d,"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":d,"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":d,"text-halo-width":1}}]}function Nt(o="amm",r="light"){return r==="dark"?he(o):r==="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 r=await fetch(o);if(!r.ok)throw new Error(`fetch ${o} → ${r.status}`);const d=r.headers.get("Content-Encoding"),y=r.headers.get("Content-Type")||"";if(d==="gzip"||y.includes("json"))return r.json();const g=r.body.pipeThrough(new DecompressionStream("gzip"));return new Response(g).json()}class ge{constructor(r={}){const{container:d,theme:y="light",apiUrl:g=ye,spriteUrl:w,period:b=null,layers:S={},center:O=[104,36],zoom:k=4,terrainUrl:z=null}=r;return this._apiUrl=g.replace(/\/$/,""),this._spriteUrl=(w??g).replace(/\/$/,""),this._terrainUrl=z??`${this._apiUrl}/api/terrain/{z}/{x}/{y}.png`,this._theme=y,this._period=b,this._center=O,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(d),new Proxy(this,{get(p,x){if(typeof x=="symbol"||Reflect.has(p,x)){const A=p[x];return typeof A=="function"?A.bind(p):A}const T=p._map;if(!T)return;const D=T[x];return typeof D=="function"?D.bind(T):D},set(p,x,T){return typeof x=="symbol"||Reflect.has(p,x)||!p._map?p[x]=T:x in p._map?p._map[x]=T:p[x]=T,!0},has(p,x){return Reflect.has(p,x)||(p._map?x in p._map:!1)}})}_initMap(r){const d=nt[this._theme]??nt.light;this._map=new ft.Map({container:r,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":d.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 y=await(await fetch(`${this._apiUrl}/api/periods`)).json();this._period=y[y.length-1]}catch(d){console.warn("[AviationChart] fetchPeriods failed:",d),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 r=new te.DemSource({url:this._terrainUrl,encoding:"mapbox",maxzoom:8,worker:!0});r.setupMaplibre(ft),this._map.addSource("contour",{type:"vector",tiles:[r.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 r,d,y,g;try{const[w,b]=await Promise.all([Wt(`${this._apiUrl}/topjson/land.topojson.gz`),Wt(`${this._apiUrl}/topjson/boundary.topojson.gz`)]);(r=w==null?void 0:w.objects)!=null&&r.land?(d=this._map.getSource("land"))==null||d.setData(It(w,w.objects.land)):console.warn("[AviationChart] land topojson missing objects.land"),(y=b==null?void 0:b.objects)!=null&&y.boundary?(g=this._map.getSource("boundary"))==null||g.setData(It(b,b.objects.boundary)):console.warn("[AviationChart] boundary topojson missing objects.boundary")}catch(w){console.error("[AviationChart] loadBaseData failed:",w)}}_initLayers(){const r=this._layerVisible.terrain?"visible":"none",d=this._layerVisible.contour?"visible":"none";this._map.addLayer({id:"terrain-color",type:"color-relief",source:"terrain",layout:{visibility:r},paint:{"color-relief-color":xe}}),this._map.addLayer({id:"terrain-hillshade",type:"hillshade",source:"terrain",layout:{visibility:r},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:d},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:d,"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 y of Xt(this._theme))this._map.getLayer(y.id)||this._map.addLayer(y);for(const y of["terrain-color","terrain-hillshade","contour-line","contour-label"])this._map.getLayer(y)&&this._map.getLayer("boundary")&&this._map.moveLayer(y,"boundary");for(const y of Nt("amm",this._theme))this._map.getLayer(y.id)||this._map.addLayer(y,"fir-line")}_applyVisibility(){for(const[g,w]of Object.entries(_t)){const b=this._layerVisible[g]!==!1?"visible":"none";for(const S of w)this._map.getLayer(S)&&this._map.setLayoutProperty(S,"visibility",b)}const r=this._layerVisible.amm!==!1?"visible":"none";for(const g of Rt)this._map.getLayer(g)&&this._map.setLayoutProperty(g,"visibility",r);const d=this._layerVisible.terrain?"visible":"none";for(const g of Vt)this._map.getLayer(g)&&this._map.setLayoutProperty(g,"visibility",d);const y=this._layerVisible.contour?"visible":"none";for(const g of Ut)this._map.getLayer(g)&&this._map.setLayoutProperty(g,"visibility",y)}get map(){return this._map}get theme(){return this._theme}get period(){return this._period}setTheme(r){if(r===this._theme)return;this._theme=r;const d=nt[r]??nt.light;this._map.setPaintProperty("background","background-color",d.background);const y=["landLaye","boundary",...Object.values(_t).flat(),...Rt];for(const g of y)this._map.getLayer(g)&&this._map.removeLayer(g);for(const g of Xt(this._theme))this._map.addLayer(g);for(const g of Nt("amm",this._theme))this._map.getLayer(g.id)||this._map.addLayer(g,"fir-line");this._applyVisibility()}setLayerVisible(r,d){if(this._layerVisible[r]=d,r==="terrain"){const w=d?"visible":"none";for(const b of Vt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",w);this._map.setTerrain(d?{source:"terrain",exaggeration:4}:null);return}if(r==="contour"){const w=d?"visible":"none";for(const b of Ut)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",w);return}if(r==="amm"){const w=d?"visible":"none";for(const b of Rt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",w);return}const y=_t[r];if(!y){console.warn(`[AviationChart] Unknown layer key: "${r}"`);return}const g=d?"visible":"none";for(const w of y)this._map.getLayer(w)&&this._map.setLayoutProperty(w,"visibility",g)}setPeriod(r){var y;this._period=r;const d=(y=this._map)==null?void 0:y.getSource("navdata");d&&d.setTiles([`${this._apiUrl}/api/tiles/${r}/{z}/{x}/{y}.pbf`])}on(r,d,y){return typeof d=="string"?this._map.on(r,d,y):this._map.on(r,d??y),this}off(r,d,y){return typeof d=="string"?this._map.off(r,d,y):this._map.off(r,d??y),this}once(r,d,y){return typeof d=="string"?this._map.once(r,d,y):this._map.once(r,d??y),this}destroy(){this._map&&(this._map.remove(),this._map=null)}}K.AMM_LAYER_GROUPS=pe,K.AviationChart=ge,K.CHART_THEMES=nt,K.LAYER_GROUPS=_t,Object.defineProperty(K,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":r.ndb,"text-halo-color":"#0f172a","text-halo-width":1,"icon-color":r.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":r.waypoint,"text-color":r.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":r.waypoint,"text-color":r.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","fir-label-lineside"],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 r=ce;return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":r.airport,"fill-opacity":.4}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":r.airport,"line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":r.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":r.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":r.taxiway,"fill-opacity":.7}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":r.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":r.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":r.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":r.runwayMarking,"fill-opacity":.9}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":r.restricted,"fill-opacity":.08}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":r.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":r.hotspot,"fill-opacity":.1}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":r.hotspot,"line-width":1.5}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":r.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":r.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":r.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":r.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 he(o="amm"){const r=fe;return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":r.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":r.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":r.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":r.taxiway,"fill-opacity":.8}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":r.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":r.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":r.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":r.runwayMarking,"fill-opacity":.8}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":r.restricted,"fill-opacity":.12}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":r.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":r.hotspot,"fill-opacity":.15}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":r.hotspot,"line-width":1.2}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":r.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":r.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":r.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":r.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 de={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 r=de,d="#1f1f23";return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":r.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":r.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":r.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":r.taxiway,"fill-opacity":.9}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":r.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":d,"icon-color":r.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":r.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":r.runwayMarking,"fill-opacity":.85}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":r.restricted,"fill-opacity":.1}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":r.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":r.hotspot,"fill-opacity":.12}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":r.hotspot,"line-width":1.2}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":r.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":d,"text-halo-width":2}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":r.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":r.threshold}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":r.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":r.stand,"text-halo-color":d,"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":d,"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":d,"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":d,"text-halo-width":1}}]}function Nt(o="amm",r="light"){return r==="dark"?he(o):r==="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="https://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 r=await fetch(o);if(!r.ok)throw new Error(`fetch ${o} → ${r.status}`);const d=r.headers.get("Content-Encoding"),y=r.headers.get("Content-Type")||"";if(d==="gzip"||y.includes("json"))return r.json();const g=r.body.pipeThrough(new DecompressionStream("gzip"));return new Response(g).json()}class ge{constructor(r={}){const{container:d,theme:y="light",apiUrl:g=ye,spriteUrl:w,period:b=null,layers:S={},center:O=[104,36],zoom:k=4,terrainUrl:z=null}=r;return this._apiUrl=g.replace(/\/$/,""),this._spriteUrl=(w??g).replace(/\/$/,""),this._terrainUrl=z??`${this._apiUrl}/api/terrain/{z}/{x}/{y}.png`,this._theme=y,this._period=b,this._center=O,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(d),new Proxy(this,{get(p,x){if(typeof x=="symbol"||Reflect.has(p,x)){const A=p[x];return typeof A=="function"?A.bind(p):A}const T=p._map;if(!T)return;const D=T[x];return typeof D=="function"?D.bind(T):D},set(p,x,T){return typeof x=="symbol"||Reflect.has(p,x)||!p._map?p[x]=T:x in p._map?p._map[x]=T:p[x]=T,!0},has(p,x){return Reflect.has(p,x)||(p._map?x in p._map:!1)}})}_initMap(r){const d=nt[this._theme]??nt.light;this._map=new ft.Map({container:r,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":d.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 y=await(await fetch(`${this._apiUrl}/api/periods`)).json();this._period=y[y.length-1]}catch(d){console.warn("[AviationChart] fetchPeriods failed:",d),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 r=new te.DemSource({url:this._terrainUrl,encoding:"mapbox",maxzoom:8,worker:!0});r.setupMaplibre(ft),this._map.addSource("contour",{type:"vector",tiles:[r.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 r,d,y,g;try{const[w,b]=await Promise.all([Wt(`${this._apiUrl}/topjson/land.topojson.gz`),Wt(`${this._apiUrl}/topjson/boundary.topojson.gz`)]);(r=w==null?void 0:w.objects)!=null&&r.land?(d=this._map.getSource("land"))==null||d.setData(It(w,w.objects.land)):console.warn("[AviationChart] land topojson missing objects.land"),(y=b==null?void 0:b.objects)!=null&&y.boundary?(g=this._map.getSource("boundary"))==null||g.setData(It(b,b.objects.boundary)):console.warn("[AviationChart] boundary topojson missing objects.boundary")}catch(w){console.error("[AviationChart] loadBaseData failed:",w)}}_initLayers(){const r=this._layerVisible.terrain?"visible":"none",d=this._layerVisible.contour?"visible":"none";this._map.addLayer({id:"terrain-color",type:"color-relief",source:"terrain",layout:{visibility:r},paint:{"color-relief-color":xe}}),this._map.addLayer({id:"terrain-hillshade",type:"hillshade",source:"terrain",layout:{visibility:r},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:d},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:d,"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 y of Xt(this._theme))this._map.getLayer(y.id)||this._map.addLayer(y);for(const y of["terrain-color","terrain-hillshade","contour-line","contour-label"])this._map.getLayer(y)&&this._map.getLayer("boundary")&&this._map.moveLayer(y,"boundary");for(const y of Nt("amm",this._theme))this._map.getLayer(y.id)||this._map.addLayer(y,"fir-line")}_applyVisibility(){for(const[g,w]of Object.entries(_t)){const b=this._layerVisible[g]!==!1?"visible":"none";for(const S of w)this._map.getLayer(S)&&this._map.setLayoutProperty(S,"visibility",b)}const r=this._layerVisible.amm!==!1?"visible":"none";for(const g of Rt)this._map.getLayer(g)&&this._map.setLayoutProperty(g,"visibility",r);const d=this._layerVisible.terrain?"visible":"none";for(const g of Vt)this._map.getLayer(g)&&this._map.setLayoutProperty(g,"visibility",d);const y=this._layerVisible.contour?"visible":"none";for(const g of Ut)this._map.getLayer(g)&&this._map.setLayoutProperty(g,"visibility",y)}get map(){return this._map}get theme(){return this._theme}get period(){return this._period}setTheme(r){if(r===this._theme)return;this._theme=r;const d=nt[r]??nt.light;this._map.setPaintProperty("background","background-color",d.background);const y=["landLaye","boundary",...Object.values(_t).flat(),...Rt];for(const g of y)this._map.getLayer(g)&&this._map.removeLayer(g);for(const g of Xt(this._theme))this._map.addLayer(g);for(const g of Nt("amm",this._theme))this._map.getLayer(g.id)||this._map.addLayer(g,"fir-line");this._applyVisibility()}setLayerVisible(r,d){if(this._layerVisible[r]=d,r==="terrain"){const w=d?"visible":"none";for(const b of Vt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",w);this._map.setTerrain(d?{source:"terrain",exaggeration:4}:null);return}if(r==="contour"){const w=d?"visible":"none";for(const b of Ut)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",w);return}if(r==="amm"){const w=d?"visible":"none";for(const b of Rt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",w);return}const y=_t[r];if(!y){console.warn(`[AviationChart] Unknown layer key: "${r}"`);return}const g=d?"visible":"none";for(const w of y)this._map.getLayer(w)&&this._map.setLayoutProperty(w,"visibility",g)}setPeriod(r){var y;this._period=r;const d=(y=this._map)==null?void 0:y.getSource("navdata");d&&d.setTiles([`${this._apiUrl}/api/tiles/${r}/{z}/{x}/{y}.pbf`])}on(r,d,y){return typeof d=="string"?this._map.on(r,d,y):this._map.on(r,d??y),this}off(r,d,y){return typeof d=="string"?this._map.off(r,d,y):this._map.off(r,d??y),this}once(r,d,y){return typeof d=="string"?this._map.once(r,d,y):this._map.once(r,d??y),this}destroy(){this._map&&(this._map.remove(),this._map=null)}}K.AMM_LAYER_GROUPS=pe,K.AviationChart=ge,K.CHART_THEMES=nt,K.LAYER_GROUPS=_t,Object.defineProperty(K,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":r.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":r.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",r.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",r.airport]}},{id:"runway-line",type:"line",source:o,"source-layer":"runway",filter:["!",["has","has_amm"]],minzoom:4,maxzoom:11,paint:{"line-color":r.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":r.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":r.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":r.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":r.ndb,"font-scale":1.1},"",{},["coalesce",["get","VAL_FREQ"],""],{"text-color":r.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":r.ndb,"text-halo-color":"#ffffff","text-halo-width":.5,"text-halo-blur":1,"icon-color":r.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":r.waypoint,"text-color":r.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":r.waypoint,"text-color":r.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:"#CC7722",controlledStroke:"#22C55E",controlledFill:"#22C55E",segment:"#40C4FF",waypoint:"#74cdde",vor:"#72aae5",ndb:"#62d6ef",airport:"#73ccdd",runway:"#64748b"};function Ke(){const o="navdata",r=$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-width":["interpolate",["linear"],["zoom"],0,1,7,4],"line-opacity":1,"line-pattern":"normal:national-border-dark"}},{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":r.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":r.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":r.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":r.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":r.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":r.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":r.controlledFill,"fill-opacity":["interpolate",["linear"],["zoom"],10,.04,11.5,0]}},{id:"controlled-stroke",type:"line",source:o,"source-layer":"controlled",paint:{"line-color":r.controlledStroke,"line-width":1,"line-opacity":["interpolate",["linear"],["zoom"],4,.6,8,1],"line-dasharray":[4,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":r.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",r.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":r.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":r.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",r.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":r.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":r.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":r.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":r.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":r.ndb,"text-halo-color":"#0f172a","text-halo-width":1,"icon-color":r.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":r.waypoint,"text-color":r.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":r.waypoint,"text-color":r.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:Ke}};function Ht(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"]},He={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 Ye(o="amm"){const r=He;return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":r.airport,"fill-opacity":.4}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":r.airport,"line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":r.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":r.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":r.taxiway,"fill-opacity":.7}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":r.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":r.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":r.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":r.runwayMarking,"fill-opacity":.9}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":r.restricted,"fill-opacity":.08}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":r.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":r.hotspot,"fill-opacity":.1}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":r.hotspot,"line-width":1.5}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":r.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":r.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":r.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":r.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 r=Ze;return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":r.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":r.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":r.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":r.taxiway,"fill-opacity":.8}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":r.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":r.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":r.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":r.runwayMarking,"fill-opacity":.8}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":r.restricted,"fill-opacity":.12}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":r.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":r.hotspot,"fill-opacity":.15}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":r.hotspot,"line-width":1.2}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":r.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":r.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":r.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":r.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 r=Qe,d="#1f1f23";return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":r.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":r.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":r.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":r.taxiway,"fill-opacity":.9}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":r.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":d,"icon-color":r.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":r.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":r.runwayMarking,"fill-opacity":.85}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":r.restricted,"fill-opacity":.1}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":r.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":r.hotspot,"fill-opacity":.12}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":r.hotspot,"line-width":1.2}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":r.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":d,"text-halo-width":2}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":r.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":r.threshold}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":r.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":r.stand,"text-halo-color":d,"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":d,"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":d,"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":d,"text-halo-width":1}}]}function Yt(o="amm",r="light"){return r==="dark"?Je(o):r==="neutral"?qe(o):Ye(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"],Mt=["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 r=await fetch(o);if(!r.ok)throw new Error(`fetch ${o} → ${r.status}`);const d=r.headers.get("Content-Encoding"),y=r.headers.get("Content-Type")||"";if(d==="gzip"||y.includes("json"))return r.json();const g=r.body.pipeThrough(new DecompressionStream("gzip"));return new Response(g).json()}class oi{constructor(r={}){const{container:d,theme:y="light",apiUrl:g=ei,spriteUrl:w,period:b=null,layers:S={},center:O=[104,36],zoom:A=4,terrainUrl:z=null}=r;return this._apiUrl=g.replace(/\/$/,""),this._spriteUrl=(w??g).replace(/\/$/,""),this._terrainUrl=z??`${this._apiUrl}/api/terrain/{z}/{x}/{y}.png`,this._theme=y,this._period=b,this._center=O,this._zoom=A,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(d),new Proxy(this,{get(p,x){if(typeof x=="symbol"||Reflect.has(p,x)){const k=p[x];return typeof k=="function"?k.bind(p):k}const T=p._map;if(!T)return;const D=T[x];return typeof D=="function"?D.bind(T):D},set(p,x,T){return typeof x=="symbol"||Reflect.has(p,x)||!p._map?p[x]=T:x in p._map?p._map[x]=T:p[x]=T,!0},has(p,x){return Reflect.has(p,x)||(p._map?x in p._map:!1)}})}_initMap(r){const d=ct[this._theme]??ct.light;this._map=new jt.Map({container:r,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":d.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 y=await(await fetch(`${this._apiUrl}/api/periods`)).json();this._period=y[y.length-1]}catch(d){console.warn("[AviationChart] fetchPeriods failed:",d),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 r=new Be.DemSource({url:this._terrainUrl,encoding:"mapbox",maxzoom:8,worker:!0});r.setupMaplibre(jt),this._map.addSource("contour",{type:"vector",tiles:[r.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 r,d,y,g;try{const[w,b]=await Promise.all([Qt(`${this._apiUrl}/topjson/land.topojson.gz`),Qt(`${this._apiUrl}/topjson/boundary.topojson.gz`)]);(r=w==null?void 0:w.objects)!=null&&r.land?(d=this._map.getSource("land"))==null||d.setData($t(w,w.objects.land)):console.warn("[AviationChart] land topojson missing objects.land"),(y=b==null?void 0:b.objects)!=null&&y.boundary?(g=this._map.getSource("boundary"))==null||g.setData($t(b,b.objects.boundary)):console.warn("[AviationChart] boundary topojson missing objects.boundary")}catch(w){console.error("[AviationChart] loadBaseData failed:",w)}}_initLayers(){const r=this._layerVisible.terrain?"visible":"none",d=this._layerVisible.contour?"visible":"none";this._map.addLayer({id:"terrain-color",type:"color-relief",source:"terrain",layout:{visibility:r},paint:{"color-relief-color":ii}}),this._map.addLayer({id:"terrain-hillshade",type:"hillshade",source:"terrain",layout:{visibility:r},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:d},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:d,"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 y of Ht(this._theme))this._map.getLayer(y.id)||this._map.addLayer(y);for(const y of["terrain-color","terrain-hillshade","contour-line","contour-label"])this._map.getLayer(y)&&this._map.getLayer("boundary")&&this._map.moveLayer(y,"boundary");for(const y of Yt("amm",this._theme))this._map.getLayer(y.id)||this._map.addLayer(y,"fir-line")}_applyVisibility(){for(const[g,w]of Object.entries(Dt)){const b=this._layerVisible[g]!==!1?"visible":"none";for(const S of w)this._map.getLayer(S)&&this._map.setLayoutProperty(S,"visibility",b)}const r=this._layerVisible.amm!==!1?"visible":"none";for(const g of Mt)this._map.getLayer(g)&&this._map.setLayoutProperty(g,"visibility",r);const d=this._layerVisible.terrain?"visible":"none";for(const g of Zt)this._map.getLayer(g)&&this._map.setLayoutProperty(g,"visibility",d);const y=this._layerVisible.contour?"visible":"none";for(const g of Jt)this._map.getLayer(g)&&this._map.setLayoutProperty(g,"visibility",y)}get map(){return this._map}get theme(){return this._theme}get period(){return this._period}setTheme(r){if(r===this._theme)return;this._theme=r;const d=ct[r]??ct.light;this._map.setPaintProperty("background","background-color",d.background);const y=["landLaye","boundary",...Object.values(Dt).flat(),...Mt];for(const g of y)this._map.getLayer(g)&&this._map.removeLayer(g);for(const g of Ht(this._theme))this._map.addLayer(g);for(const g of Yt("amm",this._theme))this._map.getLayer(g.id)||this._map.addLayer(g,"fir-line");this._applyVisibility()}setLayerVisible(r,d){if(this._layerVisible[r]=d,r==="terrain"){const w=d?"visible":"none";for(const b of Zt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",w);this._map.setTerrain(d?{source:"terrain",exaggeration:4}:null);return}if(r==="contour"){const w=d?"visible":"none";for(const b of Jt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",w);return}if(r==="amm"){const w=d?"visible":"none";for(const b of Mt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",w);return}const y=Dt[r];if(!y){console.warn(`[AviationChart] Unknown layer key: "${r}"`);return}const g=d?"visible":"none";for(const w of y)this._map.getLayer(w)&&this._map.setLayoutProperty(w,"visibility",g)}setPeriod(r){var y;this._period=r;const d=(y=this._map)==null?void 0:y.getSource("navdata");d&&d.setTiles([`${this._apiUrl}/api/tiles/${r}/{z}/{x}/{y}.pbf`])}on(r,d,y){return typeof d=="string"?this._map.on(r,d,y):this._map.on(r,d??y),this}off(r,d,y){return typeof d=="string"?this._map.off(r,d,y):this._map.off(r,d??y),this}once(r,d,y){return typeof d=="string"?this._map.once(r,d,y):this._map.once(r,d??y),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":r.ndb,"text-halo-color":"#0f172a","text-halo-width":1,"icon-color":r.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":r.waypoint,"text-color":r.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":r.waypoint,"text-color":r.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:Ke}};function Ht(o="light"){return(ct[o]??ct.light).build()}const Dt={adiz:["adiz-line","adiz-label"],fir:["fir-line","fir_line_dash","fir-label","fir-label-lineside"],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"]},He={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 Ye(o="amm"){const r=He;return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":r.airport,"fill-opacity":.4}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":r.airport,"line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":r.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":r.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":r.taxiway,"fill-opacity":.7}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":r.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":r.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":r.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":r.runwayMarking,"fill-opacity":.9}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":r.restricted,"fill-opacity":.08}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":r.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":r.hotspot,"fill-opacity":.1}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":r.hotspot,"line-width":1.5}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":r.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":r.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":r.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":r.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 r=Ze;return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":r.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":r.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":r.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":r.taxiway,"fill-opacity":.8}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":r.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":r.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":r.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":r.runwayMarking,"fill-opacity":.8}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":r.restricted,"fill-opacity":.12}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":r.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":r.hotspot,"fill-opacity":.15}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":r.hotspot,"line-width":1.2}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":r.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":r.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":r.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":r.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 r=Qe,d="#1f1f23";return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":r.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":r.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":r.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":r.taxiway,"fill-opacity":.9}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":r.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":d,"icon-color":r.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":r.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":r.runwayMarking,"fill-opacity":.85}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":r.restricted,"fill-opacity":.1}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":r.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":r.hotspot,"fill-opacity":.12}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":r.hotspot,"line-width":1.2}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":r.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":d,"text-halo-width":2}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":r.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":r.threshold}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":r.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":r.stand,"text-halo-color":d,"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":d,"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":d,"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":d,"text-halo-width":1}}]}function Yt(o="amm",r="light"){return r==="dark"?Je(o):r==="neutral"?qe(o):Ye(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="https://aips.siniswift.com",ii=["interpolate",["linear"],["elevation"],0,"#a8c98a",600,"#cdd98a",1200,"#e8d79a",2400,"#c79a5b",3600,"#9c6b3f",4500,"#f2efe9"],Mt=["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 r=await fetch(o);if(!r.ok)throw new Error(`fetch ${o} → ${r.status}`);const d=r.headers.get("Content-Encoding"),y=r.headers.get("Content-Type")||"";if(d==="gzip"||y.includes("json"))return r.json();const g=r.body.pipeThrough(new DecompressionStream("gzip"));return new Response(g).json()}class oi{constructor(r={}){const{container:d,theme:y="light",apiUrl:g=ei,spriteUrl:w,period:b=null,layers:S={},center:O=[104,36],zoom:A=4,terrainUrl:z=null}=r;return this._apiUrl=g.replace(/\/$/,""),this._spriteUrl=(w??g).replace(/\/$/,""),this._terrainUrl=z??`${this._apiUrl}/api/terrain/{z}/{x}/{y}.png`,this._theme=y,this._period=b,this._center=O,this._zoom=A,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(d),new Proxy(this,{get(p,x){if(typeof x=="symbol"||Reflect.has(p,x)){const k=p[x];return typeof k=="function"?k.bind(p):k}const T=p._map;if(!T)return;const D=T[x];return typeof D=="function"?D.bind(T):D},set(p,x,T){return typeof x=="symbol"||Reflect.has(p,x)||!p._map?p[x]=T:x in p._map?p._map[x]=T:p[x]=T,!0},has(p,x){return Reflect.has(p,x)||(p._map?x in p._map:!1)}})}_initMap(r){const d=ct[this._theme]??ct.light;this._map=new jt.Map({container:r,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":d.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 y=await(await fetch(`${this._apiUrl}/api/periods`)).json();this._period=y[y.length-1]}catch(d){console.warn("[AviationChart] fetchPeriods failed:",d),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 r=new Be.DemSource({url:this._terrainUrl,encoding:"mapbox",maxzoom:8,worker:!0});r.setupMaplibre(jt),this._map.addSource("contour",{type:"vector",tiles:[r.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 r,d,y,g;try{const[w,b]=await Promise.all([Qt(`${this._apiUrl}/topjson/land.topojson.gz`),Qt(`${this._apiUrl}/topjson/boundary.topojson.gz`)]);(r=w==null?void 0:w.objects)!=null&&r.land?(d=this._map.getSource("land"))==null||d.setData($t(w,w.objects.land)):console.warn("[AviationChart] land topojson missing objects.land"),(y=b==null?void 0:b.objects)!=null&&y.boundary?(g=this._map.getSource("boundary"))==null||g.setData($t(b,b.objects.boundary)):console.warn("[AviationChart] boundary topojson missing objects.boundary")}catch(w){console.error("[AviationChart] loadBaseData failed:",w)}}_initLayers(){const r=this._layerVisible.terrain?"visible":"none",d=this._layerVisible.contour?"visible":"none";this._map.addLayer({id:"terrain-color",type:"color-relief",source:"terrain",layout:{visibility:r},paint:{"color-relief-color":ii}}),this._map.addLayer({id:"terrain-hillshade",type:"hillshade",source:"terrain",layout:{visibility:r},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:d},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:d,"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 y of Ht(this._theme))this._map.getLayer(y.id)||this._map.addLayer(y);for(const y of["terrain-color","terrain-hillshade","contour-line","contour-label"])this._map.getLayer(y)&&this._map.getLayer("boundary")&&this._map.moveLayer(y,"boundary");for(const y of Yt("amm",this._theme))this._map.getLayer(y.id)||this._map.addLayer(y,"fir-line")}_applyVisibility(){for(const[g,w]of Object.entries(Dt)){const b=this._layerVisible[g]!==!1?"visible":"none";for(const S of w)this._map.getLayer(S)&&this._map.setLayoutProperty(S,"visibility",b)}const r=this._layerVisible.amm!==!1?"visible":"none";for(const g of Mt)this._map.getLayer(g)&&this._map.setLayoutProperty(g,"visibility",r);const d=this._layerVisible.terrain?"visible":"none";for(const g of Zt)this._map.getLayer(g)&&this._map.setLayoutProperty(g,"visibility",d);const y=this._layerVisible.contour?"visible":"none";for(const g of Jt)this._map.getLayer(g)&&this._map.setLayoutProperty(g,"visibility",y)}get map(){return this._map}get theme(){return this._theme}get period(){return this._period}setTheme(r){if(r===this._theme)return;this._theme=r;const d=ct[r]??ct.light;this._map.setPaintProperty("background","background-color",d.background);const y=["landLaye","boundary",...Object.values(Dt).flat(),...Mt];for(const g of y)this._map.getLayer(g)&&this._map.removeLayer(g);for(const g of Ht(this._theme))this._map.addLayer(g);for(const g of Yt("amm",this._theme))this._map.getLayer(g.id)||this._map.addLayer(g,"fir-line");this._applyVisibility()}setLayerVisible(r,d){if(this._layerVisible[r]=d,r==="terrain"){const w=d?"visible":"none";for(const b of Zt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",w);this._map.setTerrain(d?{source:"terrain",exaggeration:4}:null);return}if(r==="contour"){const w=d?"visible":"none";for(const b of Jt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",w);return}if(r==="amm"){const w=d?"visible":"none";for(const b of Mt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",w);return}const y=Dt[r];if(!y){console.warn(`[AviationChart] Unknown layer key: "${r}"`);return}const g=d?"visible":"none";for(const w of y)this._map.getLayer(w)&&this._map.setLayoutProperty(w,"visibility",g)}setPeriod(r){var y;this._period=r;const d=(y=this._map)==null?void 0:y.getSource("navdata");d&&d.setTiles([`${this._apiUrl}/api/tiles/${r}/{z}/{x}/{y}.pbf`])}on(r,d,y){return typeof d=="string"?this._map.on(r,d,y):this._map.on(r,d??y),this}off(r,d,y){return typeof d=="string"?this._map.off(r,d,y):this._map.off(r,d??y),this}once(r,d,y){return typeof d=="string"?this._map.once(r,d,y):this._map.once(r,d??y),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,16 +142,16 @@ Ot(["exports"], function(o) {
|
|
|
142
142
|
if (!t)
|
|
143
143
|
return {};
|
|
144
144
|
const a = i / (e.width - 1);
|
|
145
|
-
let l, s, c, m,
|
|
145
|
+
let l, s, c, m, f, h;
|
|
146
146
|
const u = {}, _ = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map();
|
|
147
147
|
function M(P, L, R) {
|
|
148
|
-
P[0] === 0 ? R(a * (
|
|
148
|
+
P[0] === 0 ? R(a * (h - 1), a * (f - g(c, L, l))) : P[0] === 2 ? R(a * h, a * (f - g(m, L, s))) : P[1] === 0 ? R(a * (h - g(s, L, l)), a * (f - 1)) : R(a * (h - g(m, L, c)), a * f);
|
|
149
149
|
}
|
|
150
|
-
for (
|
|
151
|
-
s = e.get(0,
|
|
150
|
+
for (f = 1 - n; f < e.height + n; f++) {
|
|
151
|
+
s = e.get(0, f - 1), m = e.get(0, f);
|
|
152
152
|
let P = Math.min(s, m), L = Math.max(s, m);
|
|
153
|
-
for (
|
|
154
|
-
l = s, c = m, s = e.get(
|
|
153
|
+
for (h = 1 - n; h < e.width + n; h++) {
|
|
154
|
+
l = s, c = m, s = e.get(h, f - 1), m = e.get(h, f);
|
|
155
155
|
const R = P, V = L;
|
|
156
156
|
if (P = Math.min(s, m), L = Math.max(s, m), isNaN(l) || isNaN(s) || isNaN(m) || isNaN(c))
|
|
157
157
|
continue;
|
|
@@ -163,7 +163,7 @@ Ot(["exports"], function(o) {
|
|
|
163
163
|
H || _.set(C, H = /* @__PURE__ */ new Map());
|
|
164
164
|
let lt = F.get(C);
|
|
165
165
|
lt || F.set(C, lt = /* @__PURE__ */ new Map());
|
|
166
|
-
const At = bt[0], zt = bt[1], yt = y(e.width,
|
|
166
|
+
const At = bt[0], zt = bt[1], yt = y(e.width, h, f, At), st = y(e.width, h, f, zt);
|
|
167
167
|
let I, Tt;
|
|
168
168
|
if (I = lt.get(yt))
|
|
169
169
|
if (lt.delete(yt), Tt = H.get(st))
|
|
@@ -311,19 +311,19 @@ Ot(["exports"], function(o) {
|
|
|
311
311
|
if (l)
|
|
312
312
|
l.lastUsed = ++E, l.waiting++;
|
|
313
313
|
else {
|
|
314
|
-
const
|
|
314
|
+
const f = new AbortController(), h = n(i, f);
|
|
315
315
|
l = {
|
|
316
|
-
abortController:
|
|
317
|
-
item:
|
|
316
|
+
abortController: f,
|
|
317
|
+
item: h,
|
|
318
318
|
lastUsed: ++E,
|
|
319
319
|
waiting: 1
|
|
320
320
|
}, this.items.set(i, l), this.prune();
|
|
321
321
|
}
|
|
322
|
-
const s = this.items, c = l.item.then((
|
|
322
|
+
const s = this.items, c = l.item.then((f) => f, (f) => (s.delete(i), Promise.reject(f)));
|
|
323
323
|
let m = !1;
|
|
324
324
|
return U(a, () => {
|
|
325
|
-
var
|
|
326
|
-
l && l.abortController && !m && (m = !0, --l.waiting <= 0 && ((
|
|
325
|
+
var f;
|
|
326
|
+
l && l.abortController && !m && (m = !0, --l.waiting <= 0 && ((f = l.abortController) === null || f === void 0 || f.abort(), s.delete(i)));
|
|
327
327
|
}), c;
|
|
328
328
|
}, this.clear = () => this.items.clear(), this.maxSize = e, this.items = /* @__PURE__ */ new Map();
|
|
329
329
|
}
|
|
@@ -355,8 +355,8 @@ Ot(["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")) || ((a = c == null ? void 0 : c.format) === null || a === void 0 ? void 0 : a.startsWith("RGB"))))
|
|
357
357
|
throw new Error(`Unrecognized format: ${c == null ? void 0 : c.format}`);
|
|
358
|
-
const
|
|
359
|
-
if (await c.copyTo(u),
|
|
358
|
+
const f = (l = c == null ? void 0 : c.format) === null || l === void 0 ? void 0 : l.startsWith("BGR"), h = c.allocationSize(), u = new Uint8ClampedArray(h);
|
|
359
|
+
if (await c.copyTo(u), f)
|
|
360
360
|
for (let _ = 0; _ < u.length; _ += 4) {
|
|
361
361
|
const F = u[_];
|
|
362
362
|
u[_] = u[_ + 2], u[_ + 2] = F;
|
|
@@ -414,30 +414,30 @@ Ot(["exports"], function(o) {
|
|
|
414
414
|
this.split = (a, l, s) => {
|
|
415
415
|
if (a === 0)
|
|
416
416
|
return this;
|
|
417
|
-
const c = 1 << a, m = l * this.width / c,
|
|
418
|
-
return new $(this.width / c, this.height / c, (
|
|
417
|
+
const c = 1 << a, m = l * this.width / c, f = s * this.height / c;
|
|
418
|
+
return new $(this.width / c, this.height / c, (h, u) => this.get(h + m, u + f));
|
|
419
419
|
}, this.subsamplePixelCenters = (a) => {
|
|
420
|
-
const l = (m,
|
|
420
|
+
const l = (m, f, h) => isNaN(m) ? f : isNaN(f) ? m : m + (f - m) * h;
|
|
421
421
|
if (a <= 1)
|
|
422
422
|
return this;
|
|
423
|
-
const s = 0.5 - 1 / (2 * a), c = (m,
|
|
424
|
-
const
|
|
423
|
+
const s = 0.5 - 1 / (2 * a), c = (m, f) => {
|
|
424
|
+
const h = m / a - s, u = f / a - s, _ = Math.floor(h), F = Math.floor(u), M = this.get(_, F), P = this.get(_ + 1, F), L = this.get(_, F + 1), R = this.get(_ + 1, F + 1), V = h - _, dt = u - F, pt = l(M, P, V), X = l(L, R, V);
|
|
425
425
|
return l(pt, X, dt);
|
|
426
426
|
};
|
|
427
427
|
return new $(this.width * a, this.height * a, c);
|
|
428
428
|
}, this.averagePixelCentersToGrid = (a = 1) => new $(this.width + 1, this.height + 1, (l, s) => {
|
|
429
|
-
let c = 0, m = 0,
|
|
430
|
-
for (let
|
|
429
|
+
let c = 0, m = 0, f = 0;
|
|
430
|
+
for (let h = l - a; h < l + a; h++)
|
|
431
431
|
for (let u = s - a; u < s + a; u++)
|
|
432
|
-
isNaN(
|
|
432
|
+
isNaN(f = this.get(h, u)) || (m++, c += f);
|
|
433
433
|
return m === 0 ? NaN : c / m;
|
|
434
434
|
}), this.scaleElevation = (a) => a === 1 ? this : new $(this.width, this.height, (l, s) => this.get(l, s) * a), this.materialize = (a = 2) => {
|
|
435
435
|
const l = this.width + 2 * a, s = new Float32Array(l * (this.height + 2 * a));
|
|
436
436
|
let c = 0;
|
|
437
437
|
for (let m = -a; m < this.height + a; m++)
|
|
438
|
-
for (let
|
|
439
|
-
s[c++] = this.get(
|
|
440
|
-
return new $(this.width, this.height, (m,
|
|
438
|
+
for (let f = -a; f < this.width + a; f++)
|
|
439
|
+
s[c++] = this.get(f, m);
|
|
440
|
+
return new $(this.width, this.height, (m, f) => s[(f + a) * l + m + a]);
|
|
441
441
|
}, this.get = n, this.width = e, this.height = i;
|
|
442
442
|
}
|
|
443
443
|
/** Construct a height tile from raw DEM pixel values */
|
|
@@ -474,24 +474,24 @@ Ot(["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, a) {
|
|
477
|
-
var l, s, c = a * 8 - n - 1, m = (1 << c) - 1,
|
|
478
|
-
for (u += _, l = F & (1 << -
|
|
477
|
+
var l, s, c = a * 8 - n - 1, m = (1 << c) - 1, f = m >> 1, h = -7, u = i ? a - 1 : 0, _ = i ? -1 : 1, F = t[e + u];
|
|
478
|
+
for (u += _, l = F & (1 << -h) - 1, F >>= -h, h += c; h > 0; l = l * 256 + t[e + u], u += _, h -= 8)
|
|
479
479
|
;
|
|
480
|
-
for (s = l & (1 << -
|
|
480
|
+
for (s = l & (1 << -h) - 1, l >>= -h, h += n; h > 0; s = s * 256 + t[e + u], u += _, h -= 8)
|
|
481
481
|
;
|
|
482
482
|
if (l === 0)
|
|
483
|
-
l = 1 -
|
|
483
|
+
l = 1 - f;
|
|
484
484
|
else {
|
|
485
485
|
if (l === m)
|
|
486
486
|
return s ? NaN : (F ? -1 : 1) * (1 / 0);
|
|
487
|
-
s = s + Math.pow(2, n), l = l -
|
|
487
|
+
s = s + Math.pow(2, n), l = l - f;
|
|
488
488
|
}
|
|
489
489
|
return (F ? -1 : 1) * s * Math.pow(2, l - n);
|
|
490
490
|
}, Et.write = function(t, e, i, n, a, l) {
|
|
491
|
-
var s, c, m,
|
|
492
|
-
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (c = isNaN(e) ? 1 : 0, s =
|
|
491
|
+
var s, c, m, f = l * 8 - a - 1, h = (1 << f) - 1, u = h >> 1, _ = a === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, F = n ? 0 : l - 1, M = n ? 1 : -1, P = 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 = h) : (s = Math.floor(Math.log(e) / Math.LN2), e * (m = Math.pow(2, -s)) < 1 && (s--, m *= 2), s + u >= 1 ? e += _ / m : e += _ * Math.pow(2, 1 - u), e * m >= 2 && (s++, m /= 2), s + u >= h ? (c = 0, s = h) : s + u >= 1 ? (c = (e * m - 1) * Math.pow(2, a), s = s + u) : (c = e * Math.pow(2, u - 1) * Math.pow(2, a), s = 0)); a >= 8; t[i + F] = c & 255, F += M, c /= 256, a -= 8)
|
|
493
493
|
;
|
|
494
|
-
for (s = s << a | c,
|
|
494
|
+
for (s = s << a | c, f += a; f > 0; t[i + F] = s & 255, F += M, s /= 256, f -= 8)
|
|
495
495
|
;
|
|
496
496
|
t[i + F - M] |= P * 128;
|
|
497
497
|
};
|
|
@@ -642,16 +642,16 @@ Ot(["exports"], function(o) {
|
|
|
642
642
|
return this.length = this.pos, this.pos = 0, this.buf.subarray(0, this.length);
|
|
643
643
|
},
|
|
644
644
|
writeFixed32: function(t) {
|
|
645
|
-
this.realloc(4),
|
|
645
|
+
this.realloc(4), ft(this.buf, t, this.pos), this.pos += 4;
|
|
646
646
|
},
|
|
647
647
|
writeSFixed32: function(t) {
|
|
648
|
-
this.realloc(4),
|
|
648
|
+
this.realloc(4), ft(this.buf, t, this.pos), this.pos += 4;
|
|
649
649
|
},
|
|
650
650
|
writeFixed64: function(t) {
|
|
651
|
-
this.realloc(8),
|
|
651
|
+
this.realloc(8), ft(this.buf, t & -1, this.pos), ft(this.buf, Math.floor(t * Gt), this.pos + 4), this.pos += 8;
|
|
652
652
|
},
|
|
653
653
|
writeSFixed64: function(t) {
|
|
654
|
-
this.realloc(8),
|
|
654
|
+
this.realloc(8), ft(this.buf, t & -1, this.pos), ft(this.buf, Math.floor(t * Gt), this.pos + 4), this.pos += 8;
|
|
655
655
|
},
|
|
656
656
|
writeVarint: function(t) {
|
|
657
657
|
if (t = +t || 0, t > 268435455 || t < 0) {
|
|
@@ -695,7 +695,7 @@ Ot(["exports"], function(o) {
|
|
|
695
695
|
this.writeTag(t, v.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, he, e);
|
|
699
699
|
},
|
|
700
700
|
writePackedSVarint: function(t, e) {
|
|
701
701
|
e.length && this.writeMessage(t, de, e);
|
|
@@ -770,12 +770,12 @@ Ot(["exports"], function(o) {
|
|
|
770
770
|
var i, n;
|
|
771
771
|
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)
|
|
772
772
|
throw new Error("Given varint doesn't fit into 10 bytes");
|
|
773
|
-
e.realloc(10), me(i, n, e),
|
|
773
|
+
e.realloc(10), me(i, n, e), fe(n, e);
|
|
774
774
|
}
|
|
775
775
|
function me(t, e, i) {
|
|
776
776
|
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;
|
|
777
777
|
}
|
|
778
|
-
function
|
|
778
|
+
function fe(t, e) {
|
|
779
779
|
var i = (t & 7) << 4;
|
|
780
780
|
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)))));
|
|
781
781
|
}
|
|
@@ -784,7 +784,7 @@ Ot(["exports"], function(o) {
|
|
|
784
784
|
i.realloc(n);
|
|
785
785
|
for (var a = i.pos - 1; a >= t; a--) i.buf[a + n] = i.buf[a];
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function he(t, e) {
|
|
788
788
|
for (var i = 0; i < t.length; i++) e.writeVarint(t[i]);
|
|
789
789
|
}
|
|
790
790
|
function de(t, e) {
|
|
@@ -814,7 +814,7 @@ Ot(["exports"], function(o) {
|
|
|
814
814
|
function wt(t, e) {
|
|
815
815
|
return (t[e] | t[e + 1] << 8 | t[e + 2] << 16) + t[e + 3] * 16777216;
|
|
816
816
|
}
|
|
817
|
-
function
|
|
817
|
+
function ft(t, e, i) {
|
|
818
818
|
t[i] = e, t[i + 1] = e >>> 8, t[i + 2] = e >>> 16, t[i + 3] = e >>> 24;
|
|
819
819
|
}
|
|
820
820
|
function Nt(t, e) {
|
|
@@ -824,8 +824,8 @@ Ot(["exports"], function(o) {
|
|
|
824
824
|
for (var n = "", a = e; a < i; ) {
|
|
825
825
|
var l = t[a], s = null, c = l > 239 ? 4 : l > 223 ? 3 : l > 191 ? 2 : 1;
|
|
826
826
|
if (a + c > i) break;
|
|
827
|
-
var m,
|
|
828
|
-
c === 1 ? l < 128 && (s = l) : c === 2 ? (m = t[a + 1], (m & 192) === 128 && (s = (l & 31) << 6 | m & 63, s <= 127 && (s = null))) : c === 3 ? (m = t[a + 1],
|
|
827
|
+
var m, f, h;
|
|
828
|
+
c === 1 ? l < 128 && (s = l) : c === 2 ? (m = t[a + 1], (m & 192) === 128 && (s = (l & 31) << 6 | m & 63, s <= 127 && (s = null))) : c === 3 ? (m = t[a + 1], f = t[a + 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[a + 1], f = t[a + 2], h = t[a + 3], (m & 192) === 128 && (f & 192) === 128 && (h & 192) === 128 && (s = (l & 15) << 18 | (m & 63) << 12 | (f & 63) << 6 | h & 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), a += c;
|
|
829
829
|
}
|
|
830
830
|
return n;
|
|
831
831
|
}
|
|
@@ -850,10 +850,10 @@ Ot(["exports"], function(o) {
|
|
|
850
850
|
}
|
|
851
851
|
return i;
|
|
852
852
|
}
|
|
853
|
-
var ve = /* @__PURE__ */ ae(ne),
|
|
853
|
+
var ve = /* @__PURE__ */ ae(ne), ht;
|
|
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
|
+
})(ht || (ht = {}));
|
|
857
857
|
function De(t) {
|
|
858
858
|
const e = new ve();
|
|
859
859
|
for (const i in t.layers) {
|
|
@@ -891,13 +891,13 @@ Ot(["exports"], function(o) {
|
|
|
891
891
|
throw new Error();
|
|
892
892
|
const n = t.keys, a = t.values, l = t.keycache, s = t.valuecache;
|
|
893
893
|
for (const c in i.properties) {
|
|
894
|
-
let m = i.properties[c],
|
|
894
|
+
let m = i.properties[c], f = l[c];
|
|
895
895
|
if (m === null)
|
|
896
896
|
continue;
|
|
897
|
-
typeof
|
|
898
|
-
const
|
|
899
|
-
|
|
900
|
-
const u = `${
|
|
897
|
+
typeof f > "u" && (n.push(c), f = n.length - 1, l[c] = f), e.writeVarint(f);
|
|
898
|
+
const h = typeof m;
|
|
899
|
+
h !== "string" && h !== "boolean" && h !== "number" && (m = JSON.stringify(m));
|
|
900
|
+
const u = `${h}:${m}`;
|
|
901
901
|
let _ = s[u];
|
|
902
902
|
typeof _ > "u" && (a.push(m), _ = a.length - 1, s[u] = _), e.writeVarint(_);
|
|
903
903
|
}
|
|
@@ -915,14 +915,14 @@ Ot(["exports"], function(o) {
|
|
|
915
915
|
let a = 0, l = 0;
|
|
916
916
|
for (const s of i) {
|
|
917
917
|
let c = 1;
|
|
918
|
-
n ===
|
|
919
|
-
const m = s.length / 2,
|
|
920
|
-
for (let
|
|
921
|
-
|
|
922
|
-
const u = s[
|
|
918
|
+
n === ht.POINT && (c = s.length / 2), e.writeVarint(St(1, c));
|
|
919
|
+
const m = s.length / 2, f = n === ht.POLYGON ? m - 1 : m;
|
|
920
|
+
for (let h = 0; h < f; h++) {
|
|
921
|
+
h === 1 && n !== 1 && e.writeVarint(St(2, f - 1));
|
|
922
|
+
const u = s[h * 2] - a, _ = s[h * 2 + 1] - l;
|
|
923
923
|
e.writeVarint(Vt(u)), e.writeVarint(Vt(_)), a += u, l += _;
|
|
924
924
|
}
|
|
925
|
-
n ===
|
|
925
|
+
n === ht.POLYGON && e.writeVarint(St(7, 1));
|
|
926
926
|
}
|
|
927
927
|
}
|
|
928
928
|
function Ae(t, e) {
|
|
@@ -932,27 +932,27 @@ Ot(["exports"], function(o) {
|
|
|
932
932
|
}
|
|
933
933
|
class Re {
|
|
934
934
|
constructor(e, i, n, a, l) {
|
|
935
|
-
this.loaded = Promise.resolve(), this.decodeImage = Lt, this.fetchAndParseTile = (s, c, m,
|
|
935
|
+
this.loaded = Promise.resolve(), this.decodeImage = Lt, this.fetchAndParseTile = (s, c, m, f, h) => {
|
|
936
936
|
const u = this, _ = this.demUrlPattern.replace("{z}", s.toString()).replace("{x}", c.toString()).replace("{y}", m.toString());
|
|
937
|
-
return
|
|
938
|
-
const P = await u.fetchTile(s, c, m, M,
|
|
937
|
+
return h == null || h.useTile(_), this.parsedCache.get(_, async (F, M) => {
|
|
938
|
+
const P = await u.fetchTile(s, c, m, M, h);
|
|
939
939
|
if (B(M))
|
|
940
940
|
throw new Error("canceled");
|
|
941
|
-
const L = u.decodeImage(P.data, u.encoding, M), R =
|
|
941
|
+
const L = u.decodeImage(P.data, u.encoding, M), R = h == null ? void 0 : h.marker("decode"), V = await L;
|
|
942
942
|
return R == null || R(), V;
|
|
943
|
-
},
|
|
943
|
+
}, f);
|
|
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 = a;
|
|
945
945
|
}
|
|
946
946
|
fetchTile(e, i, n, a, l) {
|
|
947
947
|
const s = this.demUrlPattern.replace("{z}", e.toString()).replace("{x}", i.toString()).replace("{y}", n.toString());
|
|
948
948
|
return l == null || l.useTile(s), this.tileCache.get(s, (c, m) => {
|
|
949
|
-
const
|
|
949
|
+
const f = {
|
|
950
950
|
signal: m.signal
|
|
951
951
|
};
|
|
952
952
|
l == null || l.fetchTile(s);
|
|
953
|
-
const
|
|
954
|
-
return G(this.timeoutMs, fetch(s,
|
|
955
|
-
if (
|
|
953
|
+
const h = l == null ? void 0 : l.marker("fetch");
|
|
954
|
+
return G(this.timeoutMs, fetch(s, f).then(async (u) => {
|
|
955
|
+
if (h == null || h(), !u.ok)
|
|
956
956
|
throw new Error(`Bad response: ${u.status} for ${s}`);
|
|
957
957
|
return {
|
|
958
958
|
data: await u.blob(),
|
|
@@ -963,11 +963,11 @@ Ot(["exports"], function(o) {
|
|
|
963
963
|
}, a);
|
|
964
964
|
}
|
|
965
965
|
async fetchDem(e, i, n, a, l, s) {
|
|
966
|
-
const c = Math.min(e - (a.overzoom || 0), this.maxzoom), m = e - c,
|
|
967
|
-
return $.fromRawDem(_).split(m, i %
|
|
966
|
+
const c = Math.min(e - (a.overzoom || 0), this.maxzoom), m = e - c, f = 1 << m, h = Math.floor(i / f), u = Math.floor(n / f), _ = await this.fetchAndParseTile(c, h, u, l, s);
|
|
967
|
+
return $.fromRawDem(_).split(m, i % f, n % f);
|
|
968
968
|
}
|
|
969
969
|
fetchContourTile(e, i, n, a, l, s) {
|
|
970
|
-
const { levels: c, multiplier: m = 1, buffer:
|
|
970
|
+
const { levels: c, multiplier: m = 1, buffer: f = 1, extent: h = 4096, contourLayer: u = "contours", elevationKey: _ = "ele", levelKey: F = "level", subsampleBelow: M = 100 } = a;
|
|
971
971
|
if (!c || c.length === 0)
|
|
972
972
|
return Promise.resolve({ arrayBuffer: new ArrayBuffer(0) });
|
|
973
973
|
const P = [e, i, n, p(a)].join("/");
|
|
@@ -987,16 +987,16 @@ Ot(["exports"], function(o) {
|
|
|
987
987
|
for (; X.width < M; )
|
|
988
988
|
X = X.subsamplePixelCenters(2).materialize(2);
|
|
989
989
|
X = X.averagePixelCentersToGrid().scaleElevation(m).materialize(1);
|
|
990
|
-
const C = w(c[0], X,
|
|
990
|
+
const C = w(c[0], X, h, f);
|
|
991
991
|
ot == null || ot();
|
|
992
992
|
const kt = De({
|
|
993
|
-
extent:
|
|
993
|
+
extent: h,
|
|
994
994
|
layers: {
|
|
995
995
|
[u]: {
|
|
996
996
|
features: Object.entries(C).map(([q, nt]) => {
|
|
997
997
|
const _t = Number(q);
|
|
998
998
|
return {
|
|
999
|
-
type:
|
|
999
|
+
type: ht.LINESTRING,
|
|
1000
1000
|
geometry: nt,
|
|
1001
1001
|
properties: {
|
|
1002
1002
|
[_]: _t,
|
|
@@ -1030,8 +1030,8 @@ Ot(["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
|
|
1034
|
-
return Number.isFinite(
|
|
1033
|
+
const f = this.marks[m] || [], h = Math.max(...f.map((_) => Math.max(..._))), u = Math.min(...f.map((_) => Math.min(..._)));
|
|
1034
|
+
return Number.isFinite(h) ? h - u : void 0;
|
|
1035
1035
|
}, a = n("main") || 0, l = n("fetch"), s = n("decode"), c = n("isoline");
|
|
1036
1036
|
return {
|
|
1037
1037
|
url: i,
|
|
@@ -1063,7 +1063,7 @@ Ot(["exports"], function(o) {
|
|
|
1063
1063
|
const a = i.origin - this.timeOrigin;
|
|
1064
1064
|
for (const l in i.marks) {
|
|
1065
1065
|
const s = l;
|
|
1066
|
-
(this.marks[s] || (this.marks[s] = [])).push(...((n = i.marks[s]) === null || n === void 0 ? void 0 : n.map((m) => m.map((
|
|
1066
|
+
(this.marks[s] || (this.marks[s] = [])).push(...((n = i.marks[s]) === null || n === void 0 ? void 0 : n.map((m) => m.map((f) => f + a))) || []);
|
|
1067
1067
|
}
|
|
1068
1068
|
this.resources.push(...i.resources.map((l) => Le(l, a)));
|
|
1069
1069
|
}, this.markFinish = this.marker(e);
|
|
@@ -1088,27 +1088,27 @@ Ot(["exports"], function(o) {
|
|
|
1088
1088
|
const s = this.callbacks[l.id];
|
|
1089
1089
|
delete this.callbacks[l.id], s && s(l.error ? new Error(l.error) : void 0, l.response, l.timings);
|
|
1090
1090
|
} else if (l.type === "request") {
|
|
1091
|
-
const s = new Wt("worker"), c = i[l.name], m = new AbortController(),
|
|
1091
|
+
const s = new Wt("worker"), c = i[l.name], m = new AbortController(), f = c.apply(c, [
|
|
1092
1092
|
...l.args,
|
|
1093
1093
|
m,
|
|
1094
1094
|
s
|
|
1095
|
-
]),
|
|
1096
|
-
if (l.id &&
|
|
1095
|
+
]), h = `${l.name}_${l.id}`;
|
|
1096
|
+
if (l.id && f) {
|
|
1097
1097
|
this.cancels[l.id] = m;
|
|
1098
1098
|
try {
|
|
1099
|
-
const u = await
|
|
1099
|
+
const u = await f, _ = u == null ? void 0 : u.transferrables;
|
|
1100
1100
|
this.postMessage({
|
|
1101
1101
|
id: l.id,
|
|
1102
1102
|
type: "response",
|
|
1103
1103
|
response: u,
|
|
1104
|
-
timings: s.finish(
|
|
1104
|
+
timings: s.finish(h)
|
|
1105
1105
|
}, _);
|
|
1106
1106
|
} catch (u) {
|
|
1107
1107
|
this.postMessage({
|
|
1108
1108
|
id: l.id,
|
|
1109
1109
|
type: "response",
|
|
1110
1110
|
error: (u == null ? void 0 : u.toString()) || "error",
|
|
1111
|
-
timings: s.finish(
|
|
1111
|
+
timings: s.finish(h)
|
|
1112
1112
|
});
|
|
1113
1113
|
}
|
|
1114
1114
|
delete this.cancels[l.id];
|
|
@@ -1121,9 +1121,9 @@ Ot(["exports"], function(o) {
|
|
|
1121
1121
|
}
|
|
1122
1122
|
/** Invokes a method by name with a set of arguments in the remote context. */
|
|
1123
1123
|
send(e, i, n, a, ...l) {
|
|
1124
|
-
const s = ++Ie, c = new Promise((m,
|
|
1125
|
-
this.postMessage({ id: s, type: "request", name: e, args: l }, i), this.callbacks[s] = (
|
|
1126
|
-
a == null || a.addAll(_),
|
|
1124
|
+
const s = ++Ie, c = new Promise((m, f) => {
|
|
1125
|
+
this.postMessage({ id: s, type: "request", name: e, args: l }, i), this.callbacks[s] = (h, u, _) => {
|
|
1126
|
+
a == null || a.addAll(_), h ? f(h) : m(u);
|
|
1127
1127
|
};
|
|
1128
1128
|
});
|
|
1129
1129
|
return U(n, () => {
|
|
@@ -2507,7 +2507,7 @@ function Ht(o = "light") {
|
|
|
2507
2507
|
}
|
|
2508
2508
|
const Ct = {
|
|
2509
2509
|
adiz: ["adiz-line", "adiz-label"],
|
|
2510
|
-
fir: ["fir-line", "fir_line_dash", "fir-label"],
|
|
2510
|
+
fir: ["fir-line", "fir_line_dash", "fir-label", "fir-label-lineside"],
|
|
2511
2511
|
restricted: ["restricted-fill", "restricted-stroke", "restricted-label"],
|
|
2512
2512
|
controlled: ["controlled-fill", "controlled-stroke", "controlled-label"],
|
|
2513
2513
|
segment: ["segment-radial", "segment-line", "segment-label"],
|
|
@@ -3187,7 +3187,7 @@ const oi = {
|
|
|
3187
3187
|
"amm-obstacle-point-label"
|
|
3188
3188
|
],
|
|
3189
3189
|
ammConstruction: ["amm-construction-fill", "amm-construction-stroke", "amm-construction-label"]
|
|
3190
|
-
}, ti = "
|
|
3190
|
+
}, ti = "https://aips.siniswift.com", ei = [
|
|
3191
3191
|
"interpolate",
|
|
3192
3192
|
["linear"],
|
|
3193
3193
|
["elevation"],
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aviation-chart",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "CASC
|
|
3
|
+
"version": "0.1.29",
|
|
4
|
+
"description": "CASC aviation chart SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|