@chrtco/sdk 0.10.52 → 0.10.53

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/CHANGELOG.md CHANGED
@@ -54,6 +54,20 @@ All notable changes to `@chrtco/sdk` will be documented in this file.
54
54
  emits for the relief source. Exported for consumers that describe that
55
55
  source themselves, such as the tile-worker's TileJSON.
56
56
 
57
+ ### Changed
58
+ - **Below z7, an overview or general chart draws only its aids to navigation.** In continuous
59
+ mode a band-1 or band-2 point mark (an icon or a circle) that is not an aid to navigation now
60
+ draws from z7, the coastal band's floor, instead of from its band's z0 or z5: platforms,
61
+ dumping grounds, islets drawn as points and the like. Buoys, beacons, lights, light floats and
62
+ vessels, fog signals, radio and radar aids, topmarks and daymarks keep their band floor
63
+ (`AID_TO_NAVIGATION_CLASSES`, `COARSE_MARK_FLOOR`), and so, for now, do wrecks, rocks and
64
+ obstructions (`COARSE_MARK_HELD_HAZARDS`). Soundings, text, fills, lines, bands 3–6 and chart
65
+ mode are unchanged.
66
+ - **Sector-light rings wait for their own band**, as the light's flare does: a coastal light's
67
+ legs and arc from z7, an approach light's from z9, a harbour or berthing light's from z11,
68
+ instead of z6 for every band (`bandFloorGate`). Continuous mode only; the night lamps are
69
+ unchanged.
70
+
57
71
  ### Fixed
58
72
  - **The image loaders threw on a map removed while they waited.**
59
73
  `loadS52SymbolImagesCached`, `loadSymbolImageSpecs`, `rethemeSymbolImages`,
package/dist/index.cjs CHANGED
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ AID_TO_NAVIGATION_CLASSES: () => AID_TO_NAVIGATION_CLASSES,
23
24
  ALL_NAV_AID_LAYERS: () => ALL_NAV_AID_LAYERS,
24
25
  ALL_WATER_BODY_LAYERS: () => ALL_WATER_BODY_LAYERS,
25
26
  AREA_QUERY_LAYERS: () => AREA_QUERY_LAYERS,
@@ -59,6 +60,8 @@ __export(index_exports, {
59
60
  CHRT_ICON_PREFIX: () => CHRT_ICON_PREFIX,
60
61
  CHRT_SDF_GLYPHS: () => CHRT_SDF_GLYPHS,
61
62
  CHRT_STYLE_MODES: () => CHRT_STYLE_MODES,
63
+ COARSE_MARK_FLOOR: () => COARSE_MARK_FLOOR,
64
+ COARSE_MARK_HELD_HAZARDS: () => COARSE_MARK_HELD_HAZARDS,
62
65
  Chrt: () => Chrt,
63
66
  ChrtError: () => ChrtError,
64
67
  DANGER_DEPTH_LABEL_ID: () => DANGER_DEPTH_LABEL_ID,
@@ -191,6 +194,7 @@ __export(index_exports, {
191
194
  applyS101SymbolSet: () => applyS101SymbolSet,
192
195
  atonIconExpression: () => atonIconExpression,
193
196
  bandFilterExpression: () => bandFilterExpression,
197
+ bandFloorGate: () => bandFloorGate,
194
198
  buildAirportTierExpression: () => buildAirportTierExpression,
195
199
  buildBuiltUpAreaTierExpression: () => buildBuiltUpAreaTierExpression,
196
200
  buildFlashPattern: () => buildFlashPattern,
@@ -31977,8 +31981,54 @@ function bandVariantMinzoom(layer, B) {
31977
31981
  if (isGroundFill(layer)) {
31978
31982
  return BAND_PRIORITY_RANGES[B].minzoom;
31979
31983
  }
31984
+ if (COARSE_MARK_BANDS.has(B) && isCoarseNonAidMark(layer)) {
31985
+ return Math.max(classMinzoom, BAND_PRIORITY_RANGES[B].minzoom, COARSE_MARK_FLOOR);
31986
+ }
31980
31987
  return Math.max(classMinzoom, BAND_PRIORITY_RANGES[B].minzoom);
31981
31988
  }
31989
+ var AID_TO_NAVIGATION_CLASSES = /* @__PURE__ */ new Set([
31990
+ "BOYLAT",
31991
+ "BOYCAR",
31992
+ "BOYSPP",
31993
+ "BOYISD",
31994
+ "BOYSAW",
31995
+ "BOYINB",
31996
+ "BCNLAT",
31997
+ "BCNCAR",
31998
+ "BCNSPP",
31999
+ "BCNISD",
32000
+ "BCNSAW",
32001
+ "LIGHTS",
32002
+ "LITFLT",
32003
+ "LITVES",
32004
+ "FOGSIG",
32005
+ "TOPMAR",
32006
+ "DAYMAR",
32007
+ "RTPBCN",
32008
+ "RDOSTA",
32009
+ "RADRFL",
32010
+ "RETRFL"
32011
+ ]);
32012
+ var COARSE_MARK_BANDS = /* @__PURE__ */ new Set(["1", "2"]);
32013
+ var COARSE_MARK_HELD_HAZARDS = /* @__PURE__ */ new Set(["WRECKS", "OBSTRN", "UWTROC"]);
32014
+ var COARSE_MARK_FLOOR = BAND_PRIORITY_RANGES["3"].minzoom;
32015
+ function bandFloorGate() {
32016
+ return [
32017
+ "any",
32018
+ ...BAND_DRAW_ORDER.map((B) => {
32019
+ const floor = BAND_PRIORITY_RANGES[B].minzoom;
32020
+ return floor > 0 ? ["all", bandFilterExpression(B), [">=", ["zoom"], floor]] : bandFilterExpression(B);
32021
+ })
32022
+ ];
32023
+ }
32024
+ function isCoarseNonAidMark(layer) {
32025
+ if (layer.type !== "symbol" && layer.type !== "circle") return false;
32026
+ const cls = /^s52-([A-Za-z]{6})(?:-|$)/.exec(layer.id)?.[1]?.toUpperCase();
32027
+ if (!cls || cls === "SOUNDG" || AID_TO_NAVIGATION_CLASSES.has(cls) || COARSE_MARK_HELD_HAZARDS.has(cls)) return false;
32028
+ if (layer.type === "circle") return true;
32029
+ const layout = layer.layout;
32030
+ return typeof layout === "object" && layout !== null && "icon-image" in layout;
32031
+ }
31982
32032
  var GENERALISED_AREA_FILL_CLASSES = /* @__PURE__ */ new Set([
31983
32033
  "BUAARE",
31984
32034
  // 2026-08-28, New York Harbor: the "New York Marine Inspection Zone and
@@ -33102,7 +33152,11 @@ function generateStyle(palette = "DAY", opts = {}) {
33102
33152
  }
33103
33153
  }
33104
33154
  }
33105
- layers.push(...sectorLightLayers, ...lampLayers);
33155
+ const sectorGate = bandFloorGate();
33156
+ layers.push(
33157
+ ...sectorLightLayers.map((l) => ({ ...l, filter: combineWithBandFilter(l.filter, sectorGate) })),
33158
+ ...lampLayers
33159
+ );
33106
33160
  {
33107
33161
  const TERMINAL_FILL_RE = new RegExp(
33108
33162
  `^s52-(?:${[...DOMINANCE_EXEMPT_FILL_CLASSES].join("|")})-fill-band[456]$`
@@ -34309,6 +34363,7 @@ var Chrt = class {
34309
34363
  };
34310
34364
  // Annotate the CommonJS export names for ESM import in node:
34311
34365
  0 && (module.exports = {
34366
+ AID_TO_NAVIGATION_CLASSES,
34312
34367
  ALL_NAV_AID_LAYERS,
34313
34368
  ALL_WATER_BODY_LAYERS,
34314
34369
  AREA_QUERY_LAYERS,
@@ -34348,6 +34403,8 @@ var Chrt = class {
34348
34403
  CHRT_ICON_PREFIX,
34349
34404
  CHRT_SDF_GLYPHS,
34350
34405
  CHRT_STYLE_MODES,
34406
+ COARSE_MARK_FLOOR,
34407
+ COARSE_MARK_HELD_HAZARDS,
34351
34408
  Chrt,
34352
34409
  ChrtError,
34353
34410
  DANGER_DEPTH_LABEL_ID,
@@ -34480,6 +34537,7 @@ var Chrt = class {
34480
34537
  applyS101SymbolSet,
34481
34538
  atonIconExpression,
34482
34539
  bandFilterExpression,
34540
+ bandFloorGate,
34483
34541
  buildAirportTierExpression,
34484
34542
  buildBuiltUpAreaTierExpression,
34485
34543
  buildFlashPattern,