@chrtco/sdk 0.7.1 → 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
@@ -1120,10 +1120,10 @@ var S52_DAY = {
1120
1120
  // Depth
1121
1121
  NODTA: "#a4a4a4",
1122
1122
  DEPIT: "#009678",
1123
- DEPVS: "#99d6ea",
1124
- DEPMS: "#b8e2f1",
1125
- DEPMD: "#c4eaf8",
1126
- DEPDW: "#dbf3fc",
1123
+ DEPVS: "#7fbfdf",
1124
+ DEPMS: "#a7d4e8",
1125
+ DEPMD: "#cae7f3",
1126
+ DEPDW: "#ecf7fc",
1127
1127
  // Land / topography
1128
1128
  LANDA: "#e6d1a1",
1129
1129
  LANDF: "#c8b078",
@@ -1202,10 +1202,10 @@ var S52_DAY = {
1202
1202
  var S52_DUSK = {
1203
1203
  NODTA: "#6b6b6b",
1204
1204
  DEPIT: "#006650",
1205
- DEPVS: "#5a8fa0",
1206
- DEPMS: "#6a9aad",
1207
- DEPMD: "#7ab0c0",
1208
- DEPDW: "#7fb5cc",
1205
+ DEPVS: "#487085",
1206
+ DEPMS: "#608a9d",
1207
+ DEPMD: "#7ba6b8",
1208
+ DEPDW: "#95bfd0",
1209
1209
  LANDA: "#8a7d5e",
1210
1210
  LANDF: "#7a6a48",
1211
1211
  CHBRN: "#6e4e30",
@@ -1273,10 +1273,10 @@ var S52_DUSK = {
1273
1273
  var S52_NIGHT = {
1274
1274
  NODTA: "#3a3a32",
1275
1275
  DEPIT: "#003828",
1276
- DEPVS: "#1a3a45",
1277
- DEPMS: "#1e4050",
1278
- DEPMD: "#1a3848",
1279
- DEPDW: "#1a3545",
1276
+ DEPVS: "#356577",
1277
+ DEPMS: "#265066",
1278
+ DEPMD: "#102e44",
1279
+ DEPDW: "#051a28",
1280
1280
  LANDA: "#3a3020",
1281
1281
  LANDF: "#302818",
1282
1282
  CHBRN: "#382410",
@@ -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";
@@ -6165,8 +6174,8 @@ function getLabelConfig(layerName, opts = {}) {
6165
6174
  15,
6166
6175
  14
6167
6176
  ],
6168
- textColor: COLOR.LAND_REGION,
6169
- textHaloColor: DARK_BG,
6177
+ textColor: DARK_BG,
6178
+ textHaloColor: COLOR.LAND_REGION,
6170
6179
  textHaloWidth: 1.4,
6171
6180
  textOffset: [0, 0],
6172
6181
  textFont: ["Open Sans Regular"],
@@ -6184,8 +6193,8 @@ function getLabelConfig(layerName, opts = {}) {
6184
6193
  type: "symbol",
6185
6194
  textField: ["get", "OBJNAM"],
6186
6195
  textSize: 9,
6187
- textColor: "#d4c9b0",
6188
- textHaloColor: DARK_BG,
6196
+ textColor: DARK_BG,
6197
+ textHaloColor: "#d4c9b0",
6189
6198
  textHaloWidth: 1.5,
6190
6199
  textOffset: [0, 1.2],
6191
6200
  minzoom: 9
@@ -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,
@@ -6324,8 +6333,8 @@ function getLabelConfig(layerName, opts = {}) {
6324
6333
  14,
6325
6334
  17
6326
6335
  ],
6327
- textColor: COLOR.WATER_DEEP,
6328
- textHaloColor: DARK_BG,
6336
+ textColor: DARK_BG,
6337
+ textHaloColor: COLOR.WATER_DEEP,
6329
6338
  textHaloWidth: 1.8,
6330
6339
  textOffset: [0, 0],
6331
6340
  textFont: ["Open Sans Italic"],
@@ -6355,8 +6364,8 @@ function getLabelConfig(layerName, opts = {}) {
6355
6364
  15,
6356
6365
  14
6357
6366
  ],
6358
- textColor: COLOR.WATER,
6359
- textHaloColor: DARK_BG,
6367
+ textColor: DARK_BG,
6368
+ textHaloColor: COLOR.WATER,
6360
6369
  textHaloWidth: 1.5,
6361
6370
  textOffset: [0, 0],
6362
6371
  textFont: ["Open Sans Italic"],
@@ -6384,8 +6393,8 @@ function getLabelConfig(layerName, opts = {}) {
6384
6393
  15,
6385
6394
  13
6386
6395
  ],
6387
- textColor: COLOR.WATER,
6388
- textHaloColor: DARK_BG,
6396
+ textColor: DARK_BG,
6397
+ textHaloColor: COLOR.WATER,
6389
6398
  textHaloWidth: 1.4,
6390
6399
  textOffset: [0, 0],
6391
6400
  textFont: ["Open Sans Italic"],
@@ -6411,8 +6420,8 @@ function getLabelConfig(layerName, opts = {}) {
6411
6420
  14,
6412
6421
  11
6413
6422
  ],
6414
- textColor: COLOR.WATER,
6415
- textHaloColor: DARK_BG,
6423
+ textColor: DARK_BG,
6424
+ textHaloColor: COLOR.WATER,
6416
6425
  textHaloWidth: 1.3,
6417
6426
  textOffset: [0, 0],
6418
6427
  textFont: ["Open Sans Italic"],
@@ -6440,8 +6449,8 @@ function getLabelConfig(layerName, opts = {}) {
6440
6449
  15,
6441
6450
  13
6442
6451
  ],
6443
- textColor: COLOR.LAND_NATURAL,
6444
- textHaloColor: DARK_BG,
6452
+ textColor: DARK_BG,
6453
+ textHaloColor: COLOR.LAND_NATURAL,
6445
6454
  textHaloWidth: 1.4,
6446
6455
  textOffset: [0, 0],
6447
6456
  textFont: ["Open Sans Regular"],
@@ -6469,8 +6478,8 @@ function getLabelConfig(layerName, opts = {}) {
6469
6478
  13,
6470
6479
  15
6471
6480
  ],
6472
- textColor: COLOR.CITY,
6473
- textHaloColor: DARK_BG,
6481
+ textColor: DARK_BG,
6482
+ textHaloColor: COLOR.CITY,
6474
6483
  textHaloWidth: 1.6,
6475
6484
  textOffset: [0, 0],
6476
6485
  textFont: ["Open Sans Regular"],
@@ -6541,8 +6550,8 @@ function getLabelConfig(layerName, opts = {}) {
6541
6550
  type: "symbol",
6542
6551
  textField: ["get", "OBJNAM"],
6543
6552
  textSize: 8,
6544
- textColor: "#c8c0b0",
6545
- textHaloColor: DARK_BG,
6553
+ textColor: DARK_BG,
6554
+ textHaloColor: "#c8c0b0",
6546
6555
  textHaloWidth: 1.2,
6547
6556
  textOffset: [0, 1.2],
6548
6557
  minzoom: 14,
@@ -6564,8 +6573,8 @@ function getLabelConfig(layerName, opts = {}) {
6564
6573
  13,
6565
6574
  11
6566
6575
  ],
6567
- textColor: COLOR.AIRPORT,
6568
- textHaloColor: DARK_BG,
6576
+ textColor: DARK_BG,
6577
+ textHaloColor: COLOR.AIRPORT,
6569
6578
  textHaloWidth: 1.4,
6570
6579
  textOffset: [0, 0],
6571
6580
  textFont: ["Open Sans Regular"],
@@ -6591,8 +6600,8 @@ function getLabelConfig(layerName, opts = {}) {
6591
6600
  16,
6592
6601
  11
6593
6602
  ],
6594
- textColor: COLOR.SOUNDING,
6595
- textHaloColor: DARK_BG,
6603
+ textColor: DARK_BG,
6604
+ textHaloColor: COLOR.SOUNDING,
6596
6605
  textHaloWidth: 1,
6597
6606
  textOffset: [0, 0],
6598
6607
  textFont: ["Open Sans Italic"],
@@ -6684,8 +6693,8 @@ function getLabelConfig(layerName, opts = {}) {
6684
6693
  16,
6685
6694
  11
6686
6695
  ],
6687
- textColor: "#3f8a34",
6688
- textHaloColor: DARK_BG,
6696
+ textColor: DARK_BG,
6697
+ textHaloColor: "#3f8a34",
6689
6698
  textHaloWidth: 1,
6690
6699
  textOffset: [0, 0],
6691
6700
  textFont: ["Open Sans Italic"],
@@ -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
@@ -8948,13 +8957,13 @@ function buildLayersForClass(objectClass, ct, sourceId = DEFAULT_REGION) {
8948
8957
  ["linear"],
8949
8958
  ["zoom"],
8950
8959
  6,
8951
- 0.4,
8960
+ 0.56,
8952
8961
  12,
8953
- 0.45,
8962
+ 0.63,
8954
8963
  14,
8955
- 0.6,
8964
+ 0.85,
8956
8965
  18,
8957
- 1.1
8966
+ 1.4
8958
8967
  ];
8959
8968
  const defaultIconSize = [
8960
8969
  "interpolate",
@@ -9173,7 +9182,7 @@ function buildLayersForClass(objectClass, ct, sourceId = DEFAULT_REGION) {
9173
9182
  filter: GEOM_FILTERS.fill,
9174
9183
  layout: {
9175
9184
  "icon-image": "ACHARE02",
9176
- "icon-size": ["interpolate", ["linear"], ["zoom"], 10, 0.5, 14, 0.8, 17, 1.1],
9185
+ "icon-size": ["interpolate", ["linear"], ["zoom"], 10, 0.7, 14, 1.15, 17, 1.5],
9177
9186
  "icon-allow-overlap": true,
9178
9187
  "icon-ignore-placement": false,
9179
9188
  "symbol-placement": "point",