aviation-chart 2.0.28 → 2.0.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/nav-sdk.esm.js +29 -8
- package/package.json +1 -1
package/dist/nav-sdk.esm.js
CHANGED
|
@@ -9980,6 +9980,27 @@ const THEME_TOKENS = {
|
|
|
9980
9980
|
function buildLayers(themeId = 'light') {
|
|
9981
9981
|
const T = THEME_TOKENS[themeId] ?? THEME_TOKENS.light;
|
|
9982
9982
|
const sourceId = 'navdata';
|
|
9983
|
+
// `has` alone is insufficient for segment labels: the data can carry an
|
|
9984
|
+
// empty direction field. Keep all direction decisions on non-empty values.
|
|
9985
|
+
const hasText = (field) => [
|
|
9986
|
+
'all',
|
|
9987
|
+
['has', field],
|
|
9988
|
+
['!=', ['get', field], ''],
|
|
9989
|
+
['!=', ['get', field], ' '],
|
|
9990
|
+
['!=', ['get', field], null],
|
|
9991
|
+
];
|
|
9992
|
+
const hasBothDesignation = hasText('TXT_DESIG');
|
|
9993
|
+
const hasForwardDesignation = [
|
|
9994
|
+
'all',
|
|
9995
|
+
['!', hasBothDesignation],
|
|
9996
|
+
hasText('TXT_DESIG_FORWARD'),
|
|
9997
|
+
];
|
|
9998
|
+
const hasBackwardDesignation = [
|
|
9999
|
+
'all',
|
|
10000
|
+
['!', hasBothDesignation],
|
|
10001
|
+
['!', hasText('TXT_DESIG_FORWARD')],
|
|
10002
|
+
hasText('TXT_DESIG_BACKWARD'),
|
|
10003
|
+
];
|
|
9983
10004
|
return [
|
|
9984
10005
|
{
|
|
9985
10006
|
"id": "landLayer", "type": "fill", "source": "land",
|
|
@@ -10093,22 +10114,22 @@ function buildLayers(themeId = 'light') {
|
|
|
10093
10114
|
{
|
|
10094
10115
|
id: 'airline_label', type: 'symbol', source: sourceId, 'source-layer': 'segment', minzoom: 6,
|
|
10095
10116
|
layout: {
|
|
10096
|
-
"icon-image": ["case",
|
|
10117
|
+
"icon-image": ["case", hasBothDesignation, "stretch:segment-both", hasForwardDesignation, "stretch:segment-right", hasBackwardDesignation, "stretch:segment-left", "stretch:segment-both"],
|
|
10097
10118
|
"icon-anchor": "center", "symbol-placement": "line", "icon-text-fit": "width", "icon-size": 1,
|
|
10098
10119
|
"text-allow-overlap": false, "icon-allow-overlap": false, "text-optional": false,
|
|
10099
10120
|
"text-anchor": "center", "text-justify": "center", "text-line-height": 1.3, "text-letter-spacing": 0.1,
|
|
10100
10121
|
"text-field": ["step", ["zoom"],
|
|
10101
|
-
["format", ["case",
|
|
10122
|
+
["format", ["case", hasBothDesignation, ["get", "TXT_DESIG"], hasForwardDesignation, ["get", "TXT_DESIG_FORWARD"], hasBackwardDesignation, ["get", "TXT_DESIG_BACKWARD"], "-"], { "font-scale": 1, "text-color": T.alBase }],
|
|
10102
10123
|
10,
|
|
10103
10124
|
["format",
|
|
10104
10125
|
["concat", ["get", "VAL_LEN"], "", ["get", "UOM_DIST"]], { "font-scale": 0.95, "text-color": T.alDist }, "\n",
|
|
10105
|
-
["case",
|
|
10106
|
-
["case",
|
|
10107
|
-
["case",
|
|
10108
|
-
["case",
|
|
10109
|
-
["case",
|
|
10126
|
+
["case", hasForwardDesignation, ["case", hasText("TXT_DESIG_RNP"), ["get", "TXT_DESIG_RNP"], ""], ""], { "font-scale": 1, "text-color": T.alRnp },
|
|
10127
|
+
["case", hasForwardDesignation, ["case", hasText("TXT_DESIG_RNP"), " ", ""], ""], {},
|
|
10128
|
+
["case", hasBothDesignation, ["get", "TXT_DESIG"], hasForwardDesignation, ["get", "TXT_DESIG_FORWARD"], hasBackwardDesignation, ["get", "TXT_DESIG_BACKWARD"], "-"], { "font-scale": 1, "text-color": T.alBase, "font-weight": "bold" },
|
|
10129
|
+
["case", hasForwardDesignation, "", ["case", hasText("TXT_DESIG_RNP"), " ", ""]], {},
|
|
10130
|
+
["case", hasForwardDesignation, "", ["case", hasText("TXT_DESIG_RNP"), ["get", "TXT_DESIG_RNP"], ""]], { "font-scale": 0.85, "text-color": T.alRnp },
|
|
10110
10131
|
"\n",
|
|
10111
|
-
["case",
|
|
10132
|
+
["case", hasBothDesignation, ["case", hasText("TXT_DESIG_HIGH"), ["get", "TXT_DESIG_HIGH"], "-"], hasForwardDesignation, ["case", hasText("TXT_DESIG_HIGH_FORWARD"), ["get", "TXT_DESIG_HIGH_FORWARD"], "-"], hasBackwardDesignation, ["case", hasText("TXT_DESIG_HIGH_BACKWARD"), ["get", "TXT_DESIG_HIGH_BACKWARD"], "-"], "-"], { "font-scale": 0.95, "text-color": T.alDist }
|
|
10112
10133
|
]
|
|
10113
10134
|
],
|
|
10114
10135
|
"text-size": ["interpolate", ["linear"], ["zoom"], 6.5, 9, 10, 10],
|