aviation-chart 2.0.10 → 2.0.11

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.
Files changed (2) hide show
  1. package/dist/nav-sdk.esm.js +35 -14
  2. package/package.json +1 -1
@@ -1606,7 +1606,7 @@ function buildAMMLayersLight(sourceId = 'amm') {
1606
1606
  layout: {
1607
1607
  'text-field': ['get', 'idlin'],
1608
1608
  'text-size': 10,
1609
- "icon-image": "text_bg",
1609
+ "icon-image": "stretch:text_bg",
1610
1610
  "icon-text-fit": "both",
1611
1611
  "icon-text-fit-padding": [
1612
1612
  1,
@@ -1632,7 +1632,7 @@ function buildAMMLayersLight(sourceId = 'amm') {
1632
1632
  'source-layer': 'amm-runway-threshold',
1633
1633
  minzoom: 12,
1634
1634
  layout: {
1635
- "icon-image": "text_bg",
1635
+ "icon-image": "stretch:text_bg",
1636
1636
  "icon-text-fit": "both",
1637
1637
  "icon-text-fit-padding": [
1638
1638
  1,
@@ -1834,12 +1834,12 @@ function buildAMMLayersDark(sourceId = 'amm') {
1834
1834
  { id: 'amm-stand-line', type: 'line', source: sourceId, 'source-layer': 'amm-stand-line', minzoom: 13, paint: { 'line-color': C.standLine, 'line-width': 1 } },
1835
1835
  {
1836
1836
  id: 'amm-taxiway-label', type: 'symbol', source: sourceId, 'source-layer': 'amm-taxiway-line', minzoom: 14,
1837
- 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': true, 'text-allow-overlap': false },
1837
+ layout: { 'text-field': ['get', 'idlin'], 'text-size': 10, "icon-image": "stretch:text_bg", "icon-text-fit": "both", "icon-text-fit-padding": [1, 2, 1, 2], 'symbol-placement': 'line', 'text-keep-upright': true, 'text-allow-overlap': false },
1838
1838
  paint: { 'text-color': "#0f172a", "icon-color": C.taxiwayLine },
1839
1839
  },
1840
1840
  {
1841
1841
  id: 'amm-runway-threshold-label', type: 'symbol', source: sourceId, 'source-layer': 'amm-runway-threshold', minzoom: 12,
1842
- 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': true, 'text-rotation-alignment': 'map', 'icon-rotation-alignment': 'map' },
1842
+ layout: { "icon-image": "stretch:text_bg", "icon-text-fit": "both", "icon-text-fit-padding": [1, 2, 1, 2], 'text-field': ['get', 'idthr'], 'text-size': 14, 'text-allow-overlap': true, 'text-rotation-alignment': 'map', 'icon-rotation-alignment': 'map' },
1843
1843
  paint: { 'text-color': '#ffffff', "icon-color": "#ef4444" },
1844
1844
  },
1845
1845
  { id: 'amm-stand', type: 'circle', source: sourceId, 'source-layer': 'amm-stand', minzoom: 12, paint: { 'circle-color': C.stand, 'circle-radius': 1.5 } },
@@ -1897,7 +1897,7 @@ function buildAMMLayersNeutral(sourceId = 'amm') {
1897
1897
  { id: 'amm-taxiway-line', type: 'line', source: sourceId, 'source-layer': 'amm-taxiway-line', minzoom: 11, paint: { 'line-color': C.taxiwayLine, 'line-width': ['interpolate', ['linear'], ['zoom'], 15, 0.8, 18, 2] } },
1898
1898
  {
1899
1899
  id: 'amm-taxiway-label', type: 'symbol', source: sourceId, 'source-layer': 'amm-taxiway-line', minzoom: 14,
1900
- 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': true, 'text-allow-overlap': false },
1900
+ layout: { 'text-field': ['get', 'idlin'], 'text-size': 10, "icon-image": "stretch:text_bg", "icon-text-fit": "both", "icon-text-fit-padding": [1, 2, 1, 2], 'symbol-placement': 'line', 'text-keep-upright': true, 'text-allow-overlap': false },
1901
1901
  paint: { 'text-color': H, "icon-color": C.taxiwayLine },
1902
1902
  },
1903
1903
  { id: 'amm-holding', type: 'line', source: sourceId, 'source-layer': 'amm-holding', minzoom: 11, paint: { 'line-color': C.holding, 'line-width': 1.5 } },
@@ -1915,7 +1915,7 @@ function buildAMMLayersNeutral(sourceId = 'amm') {
1915
1915
  { id: 'amm-stand-line', type: 'line', source: sourceId, 'source-layer': 'amm-stand-line', minzoom: 13, paint: { 'line-color': C.standLine, 'line-width': 1 } },
1916
1916
  {
1917
1917
  id: 'amm-runway-threshold-label', type: 'symbol', source: sourceId, 'source-layer': 'amm-runway-threshold', minzoom: 12,
1918
- 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': true, 'text-rotation-alignment': 'map', 'icon-rotation-alignment': 'map' },
1918
+ layout: { "icon-image": "stretch:text_bg", "icon-text-fit": "both", "icon-text-fit-padding": [1, 2, 1, 2], 'text-field': ['get', 'idthr'], 'text-size': 14, 'text-allow-overlap': true, 'text-rotation-alignment': 'map', 'icon-rotation-alignment': 'map' },
1919
1919
  paint: { 'text-color': '#ffffff', "icon-color": C.threshold },
1920
1920
  },
1921
1921
  { id: 'amm-stand', type: 'circle', source: sourceId, 'source-layer': 'amm-stand', minzoom: 12, paint: { 'circle-color': C.stand, 'circle-radius': 1.5 } },
@@ -7430,6 +7430,7 @@ function getAviationBaseStyle(opts) {
7430
7430
  { id: "v2", url: `${spriteBase}/sprites/sprite-v2` },
7431
7431
  { id: "vor", url: `${spriteBase}/sprites/sprite-vor` },
7432
7432
  { id: "runway", url: `${spriteBase}/sprites/sprite-runway` },
7433
+ { id: "stretch", url: `${spriteBase}/sprites/sprite-stretch` },
7433
7434
  ],
7434
7435
  sources: {
7435
7436
  land: { type: "geojson", data: { type: "FeatureCollection", features: [] } },
@@ -7960,7 +7961,7 @@ function buildLayers(themeId = 'light') {
7960
7961
  {
7961
7962
  id: 'airline_label', type: 'symbol', source: sourceId, 'source-layer': 'segment', minzoom: 6,
7962
7963
  layout: {
7963
- "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"],
7964
+ "icon-image": ["case", ["all", ["has", "TXT_DESIG"], ["!=", ["get", "TXT_DESIG"], ""], ["!=", ["get", "TXT_DESIG"], " "], ["!=", ["get", "TXT_DESIG"], null]], "stretch:segment-both", ["all", ["has", "TXT_DESIG_FORWARD"]], "stretch:segment-right", ["all", ["has", "TXT_DESIG_BACKWARD"]], "stretch:segment-left", "stretch:segment-both"],
7964
7965
  "icon-anchor": "center", "symbol-placement": "line", "icon-text-fit": "width", "icon-size": 1,
7965
7966
  "text-allow-overlap": false, "icon-allow-overlap": false, "text-optional": false,
7966
7967
  "text-anchor": "center", "text-justify": "center", "text-line-height": 1.3, "text-letter-spacing": 0.1,
@@ -8007,12 +8008,14 @@ function buildLayers(themeId = 'light') {
8007
8008
  // 4级前就显示大型机场+中型,5级后全部显示
8008
8009
  filter:
8009
8010
  ['case',
8010
- ['<=', ['zoom'], 3], ['<=', ['get', 'level'], 2], // ≤4 只显 大型+中型
8011
- true // >4 全部
8011
+ ['<=', ['zoom'], 3], ['<=', ['get', 'level'], 1], // zoom ≤3,只显示 level=1(大型)
8012
+ ['<=', ['zoom'], 4], ['<=', ['get', 'level'], 2], // zoom ≤4,显示 level≤2(大型+中型)
8013
+ ['<=', ['zoom'], 5], ['<=', ['get', 'level'], 3], // zoom ≤5,显示 level≤3(大型+中型+小型)
8014
+ true // zoom >5,全部显示
8012
8015
  ],
8013
8016
  layout: {
8014
8017
  "icon-image": ["case", ["==", ["get", "CODE_TYPE_MIL_OPS"], "MIL"], "airport-mil", ["==", ["get", "CODE_TYPE_MIL_OPS"], "MILEXT"], "airport-milext", "airport-civ"],
8015
- "icon-size": ["interpolate", ["linear"], ["zoom"], 4, 0.5, 10, 0.7],
8018
+ "icon-size": ["interpolate", ["linear"], ["zoom"], 3, 0.4, 4, 0.5, 10, 0.7],
8016
8019
  "symbol-z-order": "viewport-y",
8017
8020
  "text-field": ["get", "codeId"],
8018
8021
  "text-letter-spacing": 0.05,
@@ -8048,12 +8051,21 @@ function buildLayers(themeId = 'light') {
8048
8051
  // sprite is supplied by the host sprite sheet.
8049
8052
  {
8050
8053
  id: 'airport-runway', type: 'symbol', source: sourceId, minzoom: 2, 'source-layer': 'airport',
8051
- filter: ['all', ['has', 'RWY_BRG1'], ['case', ['<=', ['zoom'], 3], ['<=', ['get', 'level'], 2], true]],
8054
+ filter: [
8055
+ 'all',
8056
+ ['has', 'RWY_BRG1'],
8057
+ ['case',
8058
+ ['<=', ['zoom'], 3], ['<=', ['get', 'level'], 1],
8059
+ ['<=', ['zoom'], 4], ['<=', ['get', 'level'], 2],
8060
+ ['<=', ['zoom'], 5], ['<=', ['get', 'level'], 3],
8061
+ true
8062
+ ]
8063
+ ],
8052
8064
  layout: {
8053
8065
  'icon-image': 'runway:runway-strip',
8054
8066
  'icon-rotate': ['get', 'RWY_BRG1'],
8055
8067
  'icon-rotation-alignment': 'map',
8056
- 'icon-size': ['interpolate', ['linear'], ['zoom'], 5, 0.5, 9, 0.7, 12, 0.75],
8068
+ 'icon-size': ['interpolate', ['linear'], ['zoom'], 5, 0.4, 9, 0.7, 12, 0.75],
8057
8069
  'icon-allow-overlap': true,
8058
8070
  'icon-ignore-placement': true,
8059
8071
  'visibility': 'none',
@@ -8065,12 +8077,21 @@ function buildLayers(themeId = 'light') {
8065
8077
  },
8066
8078
  {
8067
8079
  id: 'airport-runway-cross', type: 'symbol', source: sourceId, minzoom: 2, 'source-layer': 'airport',
8068
- filter: ['all', ['has', 'RWY_BRG2'], ['case', ['<=', ['zoom'], 3], ['<=', ['get', 'level'], 2], true]],
8080
+ filter: [
8081
+ 'all',
8082
+ ['has', 'RWY_BRG2'],
8083
+ ['case',
8084
+ ['<=', ['zoom'], 3], ['<=', ['get', 'level'], 1],
8085
+ ['<=', ['zoom'], 4], ['<=', ['get', 'level'], 2],
8086
+ ['<=', ['zoom'], 5], ['<=', ['get', 'level'], 3],
8087
+ true
8088
+ ]
8089
+ ],
8069
8090
  layout: {
8070
8091
  'icon-image': 'runway:runway-strip',
8071
8092
  'icon-rotate': ['get', 'RWY_BRG2'],
8072
8093
  'icon-rotation-alignment': 'map',
8073
- 'icon-size': ['interpolate', ['linear'], ['zoom'], 5, 0.5, 9, 0.7, 12, 0.75],
8094
+ 'icon-size': ['interpolate', ['linear'], ['zoom'], 5, 0.4, 9, 0.7, 12, 0.75],
8074
8095
  'icon-allow-overlap': true,
8075
8096
  'icon-ignore-placement': true,
8076
8097
  'visibility': 'none',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aviation-chart",
3
- "version": "2.0.10",
3
+ "version": "2.0.11",
4
4
  "description": "KunYu aviation map SDK",
5
5
  "main": "dist/nav-sdk.esm.js",
6
6
  "module": "dist/nav-sdk.esm.js",