aviation-chart 2.0.27 → 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.d.ts +1 -1
- package/dist/nav-sdk.esm.js +33 -12
- package/package.json +1 -1
package/dist/nav-sdk.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ declare class GlobalConfigManager {
|
|
|
49
49
|
reset(): void;
|
|
50
50
|
setPeriod(period: string): void;
|
|
51
51
|
getPeriod(): string | undefined;
|
|
52
|
-
generateCurrentPeriod(): Promise<string>;
|
|
52
|
+
generateCurrentPeriod(apiUrl?: string): Promise<string>;
|
|
53
53
|
setMapReinitCallback(callback: (() => void | Promise<void>) | null): void;
|
|
54
54
|
destroy(): void;
|
|
55
55
|
}
|
package/dist/nav-sdk.esm.js
CHANGED
|
@@ -3458,8 +3458,8 @@ class GlobalConfigManager {
|
|
|
3458
3458
|
getPeriod() {
|
|
3459
3459
|
return this.config.period;
|
|
3460
3460
|
}
|
|
3461
|
-
async generateCurrentPeriod() {
|
|
3462
|
-
const base = (this.config.apiUrl || "https://aips.siniswift.com").replace(/\/$/, "");
|
|
3461
|
+
async generateCurrentPeriod(apiUrl) {
|
|
3462
|
+
const base = (apiUrl || this.config.apiUrl || "https://aips.siniswift.com").replace(/\/$/, "");
|
|
3463
3463
|
const headers = this.config.apiKey
|
|
3464
3464
|
? { "X-Api-Key": this.config.apiKey }
|
|
3465
3465
|
: {};
|
|
@@ -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],
|
|
@@ -10524,7 +10545,7 @@ class MapSDK {
|
|
|
10524
10545
|
this.setPeriod(options.period);
|
|
10525
10546
|
}
|
|
10526
10547
|
else {
|
|
10527
|
-
const calculatedPeriod = await this.globalConfig.generateCurrentPeriod();
|
|
10548
|
+
const calculatedPeriod = await this.globalConfig.generateCurrentPeriod(this._chartApiUrl);
|
|
10528
10549
|
this.setPeriod(calculatedPeriod);
|
|
10529
10550
|
}
|
|
10530
10551
|
this.initializeManagers();
|
|
@@ -10963,7 +10984,7 @@ class MapSDK {
|
|
|
10963
10984
|
return this.globalConfig.getPeriod();
|
|
10964
10985
|
}
|
|
10965
10986
|
async generateCurrentPeriod() {
|
|
10966
|
-
return await this.globalConfig.generateCurrentPeriod();
|
|
10987
|
+
return await this.globalConfig.generateCurrentPeriod(this._chartApiUrl);
|
|
10967
10988
|
}
|
|
10968
10989
|
async search(params) {
|
|
10969
10990
|
const auth = await this._apiAuth();
|