@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 CHANGED
@@ -5967,6 +5967,15 @@ var NATQUA_ABBR = [
5967
5967
  // hard
5968
5968
  ];
5969
5969
  var DARK_BG = "#1a1d23";
5970
+ var NAV_HALO = {
5971
+ WHITE: { bright: "#ffffff", night: "#b8b0a0" },
5972
+ CREAM: { bright: "#fdf0b0", night: "#a89868" },
5973
+ YELLOW: { bright: "#eab308", night: "#806020" },
5974
+ BLUE: { bright: "#b0c8e8", night: "#7088a0" }
5975
+ };
5976
+ function navHalo(palette, ct) {
5977
+ return ct === "NIGHT" ? NAV_HALO[palette].night : NAV_HALO[palette].bright;
5978
+ }
5970
5979
  var NAV_AID_LABEL_TEXT_SIZE = [
5971
5980
  "interpolate",
5972
5981
  ["linear"],
@@ -6073,9 +6082,9 @@ function getLabelBehavior(layerName) {
6073
6082
  return LABEL_BEHAVIOR[layerName] ?? "feature-band-gated";
6074
6083
  }
6075
6084
  function getLabelConfig(layerName, opts = {}) {
6085
+ const ct = opts.colorTable ?? "DAY";
6076
6086
  switch (layerName) {
6077
6087
  case "SOUNDG": {
6078
- const ct = opts.colorTable ?? "DAY";
6079
6088
  const safetyContour = opts.safetyContour ?? 10;
6080
6089
  const twoShade = opts.twoShadeSoundings ?? true;
6081
6090
  const weight = opts.soundingFontWeight ?? "semibold";
@@ -6197,7 +6206,7 @@ function getLabelConfig(layerName, opts = {}) {
6197
6206
  textSize: NAV_AID_LABEL_TEXT_SIZE,
6198
6207
  textFont: NAV_AID_LABEL_FONT,
6199
6208
  textColor: DARK_BG,
6200
- textHaloColor: "#ffffff",
6209
+ textHaloColor: navHalo("WHITE", ct),
6201
6210
  textHaloWidth: 1.5,
6202
6211
  textOffset: [0, 1.5],
6203
6212
  minzoom: 10
@@ -6209,7 +6218,7 @@ function getLabelConfig(layerName, opts = {}) {
6209
6218
  textSize: NAV_AID_LABEL_TEXT_SIZE,
6210
6219
  textFont: NAV_AID_LABEL_FONT,
6211
6220
  textColor: DARK_BG,
6212
- textHaloColor: "#ffffff",
6221
+ textHaloColor: navHalo("WHITE", ct),
6213
6222
  textHaloWidth: 1.5,
6214
6223
  textOffset: [0, 1.5],
6215
6224
  minzoom: 10
@@ -6222,7 +6231,7 @@ function getLabelConfig(layerName, opts = {}) {
6222
6231
  textSize: NAV_AID_LABEL_TEXT_SIZE,
6223
6232
  textFont: NAV_AID_LABEL_FONT,
6224
6233
  textColor: DARK_BG,
6225
- textHaloColor: "#fdf0b0",
6234
+ textHaloColor: navHalo("CREAM", ct),
6226
6235
  textHaloWidth: 1.5,
6227
6236
  textOffset: [0, 1.5],
6228
6237
  minzoom: 10
@@ -6235,7 +6244,7 @@ function getLabelConfig(layerName, opts = {}) {
6235
6244
  textSize: NAV_AID_LABEL_TEXT_SIZE,
6236
6245
  textFont: NAV_AID_LABEL_FONT,
6237
6246
  textColor: DARK_BG,
6238
- textHaloColor: "#eab308",
6247
+ textHaloColor: navHalo("YELLOW", ct),
6239
6248
  textHaloWidth: 1.5,
6240
6249
  textOffset: [0, 1.5],
6241
6250
  minzoom: 10
@@ -6248,7 +6257,7 @@ function getLabelConfig(layerName, opts = {}) {
6248
6257
  textSize: NAV_AID_LABEL_TEXT_SIZE,
6249
6258
  textFont: NAV_AID_LABEL_FONT,
6250
6259
  textColor: DARK_BG,
6251
- textHaloColor: "#ffffff",
6260
+ textHaloColor: navHalo("WHITE", ct),
6252
6261
  textHaloWidth: 1.5,
6253
6262
  textOffset: [0, 1.5],
6254
6263
  minzoom: 10
@@ -6260,7 +6269,7 @@ function getLabelConfig(layerName, opts = {}) {
6260
6269
  textSize: NAV_AID_LABEL_TEXT_SIZE,
6261
6270
  textFont: NAV_AID_LABEL_FONT,
6262
6271
  textColor: DARK_BG,
6263
- textHaloColor: "#fdf0b0",
6272
+ textHaloColor: navHalo("CREAM", ct),
6264
6273
  textHaloWidth: 1.5,
6265
6274
  textOffset: [2, 0],
6266
6275
  minzoom: 9,
@@ -6296,7 +6305,7 @@ function getLabelConfig(layerName, opts = {}) {
6296
6305
  textSize: NAV_AID_LABEL_TEXT_SIZE,
6297
6306
  textFont: NAV_AID_LABEL_FONT,
6298
6307
  textColor: DARK_BG,
6299
- textHaloColor: "#b0c8e8",
6308
+ textHaloColor: navHalo("BLUE", ct),
6300
6309
  textHaloWidth: 1.5,
6301
6310
  textOffset: [2, 1.2],
6302
6311
  minzoom: 11,
@@ -6702,7 +6711,7 @@ function getLabelConfig(layerName, opts = {}) {
6702
6711
  case "UWTROC":
6703
6712
  case "OBSTRN":
6704
6713
  case "WRECKS": {
6705
- const ct = opts.colorTable ?? "DAY";
6714
+ const ct2 = opts.colorTable ?? "DAY";
6706
6715
  const valsou = [
6707
6716
  "to-number",
6708
6717
  ["coalesce", ["get", "VALSOU"], ["get", "valsou"], 0],
@@ -6729,8 +6738,8 @@ function getLabelConfig(layerName, opts = {}) {
6729
6738
  16,
6730
6739
  11
6731
6740
  ],
6732
- textColor: resolveColor("CHBLK", ct),
6733
- textHaloColor: resolveColor("CHWHT", ct),
6741
+ textColor: resolveColor("CHBLK", ct2),
6742
+ textHaloColor: resolveColor("CHWHT", ct2),
6734
6743
  textHaloWidth: 1.2,
6735
6744
  // Place to the upper-right of the symbol so it doesn't sit on top
6736
6745
  // of the asterisk / cross. Anchor top-left so the offset grows