@chrtco/sdk 0.7.2 → 0.7.3
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/index.cjs +20 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5862,6 +5862,15 @@ var NATQUA_ABBR = [
|
|
|
5862
5862
|
// hard
|
|
5863
5863
|
];
|
|
5864
5864
|
var DARK_BG = "#1a1d23";
|
|
5865
|
+
var NAV_HALO = {
|
|
5866
|
+
WHITE: { bright: "#ffffff", night: "#b8b0a0" },
|
|
5867
|
+
CREAM: { bright: "#fdf0b0", night: "#a89868" },
|
|
5868
|
+
YELLOW: { bright: "#eab308", night: "#806020" },
|
|
5869
|
+
BLUE: { bright: "#b0c8e8", night: "#7088a0" }
|
|
5870
|
+
};
|
|
5871
|
+
function navHalo(palette, ct) {
|
|
5872
|
+
return ct === "NIGHT" ? NAV_HALO[palette].night : NAV_HALO[palette].bright;
|
|
5873
|
+
}
|
|
5865
5874
|
var NAV_AID_LABEL_TEXT_SIZE = [
|
|
5866
5875
|
"interpolate",
|
|
5867
5876
|
["linear"],
|
|
@@ -5968,9 +5977,9 @@ function getLabelBehavior(layerName) {
|
|
|
5968
5977
|
return LABEL_BEHAVIOR[layerName] ?? "feature-band-gated";
|
|
5969
5978
|
}
|
|
5970
5979
|
function getLabelConfig(layerName, opts = {}) {
|
|
5980
|
+
const ct = opts.colorTable ?? "DAY";
|
|
5971
5981
|
switch (layerName) {
|
|
5972
5982
|
case "SOUNDG": {
|
|
5973
|
-
const ct = opts.colorTable ?? "DAY";
|
|
5974
5983
|
const safetyContour = opts.safetyContour ?? 10;
|
|
5975
5984
|
const twoShade = opts.twoShadeSoundings ?? true;
|
|
5976
5985
|
const weight = opts.soundingFontWeight ?? "semibold";
|
|
@@ -6092,7 +6101,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
6092
6101
|
textSize: NAV_AID_LABEL_TEXT_SIZE,
|
|
6093
6102
|
textFont: NAV_AID_LABEL_FONT,
|
|
6094
6103
|
textColor: DARK_BG,
|
|
6095
|
-
textHaloColor: "
|
|
6104
|
+
textHaloColor: navHalo("WHITE", ct),
|
|
6096
6105
|
textHaloWidth: 1.5,
|
|
6097
6106
|
textOffset: [0, 1.5],
|
|
6098
6107
|
minzoom: 10
|
|
@@ -6104,7 +6113,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
6104
6113
|
textSize: NAV_AID_LABEL_TEXT_SIZE,
|
|
6105
6114
|
textFont: NAV_AID_LABEL_FONT,
|
|
6106
6115
|
textColor: DARK_BG,
|
|
6107
|
-
textHaloColor: "
|
|
6116
|
+
textHaloColor: navHalo("WHITE", ct),
|
|
6108
6117
|
textHaloWidth: 1.5,
|
|
6109
6118
|
textOffset: [0, 1.5],
|
|
6110
6119
|
minzoom: 10
|
|
@@ -6117,7 +6126,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
6117
6126
|
textSize: NAV_AID_LABEL_TEXT_SIZE,
|
|
6118
6127
|
textFont: NAV_AID_LABEL_FONT,
|
|
6119
6128
|
textColor: DARK_BG,
|
|
6120
|
-
textHaloColor: "
|
|
6129
|
+
textHaloColor: navHalo("CREAM", ct),
|
|
6121
6130
|
textHaloWidth: 1.5,
|
|
6122
6131
|
textOffset: [0, 1.5],
|
|
6123
6132
|
minzoom: 10
|
|
@@ -6130,7 +6139,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
6130
6139
|
textSize: NAV_AID_LABEL_TEXT_SIZE,
|
|
6131
6140
|
textFont: NAV_AID_LABEL_FONT,
|
|
6132
6141
|
textColor: DARK_BG,
|
|
6133
|
-
textHaloColor: "
|
|
6142
|
+
textHaloColor: navHalo("YELLOW", ct),
|
|
6134
6143
|
textHaloWidth: 1.5,
|
|
6135
6144
|
textOffset: [0, 1.5],
|
|
6136
6145
|
minzoom: 10
|
|
@@ -6143,7 +6152,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
6143
6152
|
textSize: NAV_AID_LABEL_TEXT_SIZE,
|
|
6144
6153
|
textFont: NAV_AID_LABEL_FONT,
|
|
6145
6154
|
textColor: DARK_BG,
|
|
6146
|
-
textHaloColor: "
|
|
6155
|
+
textHaloColor: navHalo("WHITE", ct),
|
|
6147
6156
|
textHaloWidth: 1.5,
|
|
6148
6157
|
textOffset: [0, 1.5],
|
|
6149
6158
|
minzoom: 10
|
|
@@ -6155,7 +6164,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
6155
6164
|
textSize: NAV_AID_LABEL_TEXT_SIZE,
|
|
6156
6165
|
textFont: NAV_AID_LABEL_FONT,
|
|
6157
6166
|
textColor: DARK_BG,
|
|
6158
|
-
textHaloColor: "
|
|
6167
|
+
textHaloColor: navHalo("CREAM", ct),
|
|
6159
6168
|
textHaloWidth: 1.5,
|
|
6160
6169
|
textOffset: [2, 0],
|
|
6161
6170
|
minzoom: 9,
|
|
@@ -6191,7 +6200,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
6191
6200
|
textSize: NAV_AID_LABEL_TEXT_SIZE,
|
|
6192
6201
|
textFont: NAV_AID_LABEL_FONT,
|
|
6193
6202
|
textColor: DARK_BG,
|
|
6194
|
-
textHaloColor: "
|
|
6203
|
+
textHaloColor: navHalo("BLUE", ct),
|
|
6195
6204
|
textHaloWidth: 1.5,
|
|
6196
6205
|
textOffset: [2, 1.2],
|
|
6197
6206
|
minzoom: 11,
|
|
@@ -6597,7 +6606,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
6597
6606
|
case "UWTROC":
|
|
6598
6607
|
case "OBSTRN":
|
|
6599
6608
|
case "WRECKS": {
|
|
6600
|
-
const
|
|
6609
|
+
const ct2 = opts.colorTable ?? "DAY";
|
|
6601
6610
|
const valsou = [
|
|
6602
6611
|
"to-number",
|
|
6603
6612
|
["coalesce", ["get", "VALSOU"], ["get", "valsou"], 0],
|
|
@@ -6624,8 +6633,8 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
6624
6633
|
16,
|
|
6625
6634
|
11
|
|
6626
6635
|
],
|
|
6627
|
-
textColor: resolveColor("CHBLK",
|
|
6628
|
-
textHaloColor: resolveColor("CHWHT",
|
|
6636
|
+
textColor: resolveColor("CHBLK", ct2),
|
|
6637
|
+
textHaloColor: resolveColor("CHWHT", ct2),
|
|
6629
6638
|
textHaloWidth: 1.2,
|
|
6630
6639
|
// Place to the upper-right of the symbol so it doesn't sit on top
|
|
6631
6640
|
// of the asterisk / cross. Anchor top-left so the offset grows
|