@chrtco/sdk 0.10.52 → 0.10.54
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 +14 -0
- package/dist/index.cjs +63 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +82 -3
- package/dist/index.d.ts +82 -3
- package/dist/index.js +59 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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,
|
|
@@ -31546,7 +31550,10 @@ var SERVED_FONT_STACKS = [
|
|
|
31546
31550
|
"Open Sans Semibold",
|
|
31547
31551
|
"Old Standard TT Regular",
|
|
31548
31552
|
"Old Standard TT Italic",
|
|
31549
|
-
"Old Standard TT Bold"
|
|
31553
|
+
"Old Standard TT Bold",
|
|
31554
|
+
"Liberation Sans Regular",
|
|
31555
|
+
"Liberation Sans Italic",
|
|
31556
|
+
"Liberation Sans Bold"
|
|
31550
31557
|
];
|
|
31551
31558
|
function semiboldFontStack(font) {
|
|
31552
31559
|
if (!Array.isArray(font) || !font.every((face) => typeof face === "string")) return font;
|
|
@@ -31977,8 +31984,54 @@ function bandVariantMinzoom(layer, B) {
|
|
|
31977
31984
|
if (isGroundFill(layer)) {
|
|
31978
31985
|
return BAND_PRIORITY_RANGES[B].minzoom;
|
|
31979
31986
|
}
|
|
31987
|
+
if (COARSE_MARK_BANDS.has(B) && isCoarseNonAidMark(layer)) {
|
|
31988
|
+
return Math.max(classMinzoom, BAND_PRIORITY_RANGES[B].minzoom, COARSE_MARK_FLOOR);
|
|
31989
|
+
}
|
|
31980
31990
|
return Math.max(classMinzoom, BAND_PRIORITY_RANGES[B].minzoom);
|
|
31981
31991
|
}
|
|
31992
|
+
var AID_TO_NAVIGATION_CLASSES = /* @__PURE__ */ new Set([
|
|
31993
|
+
"BOYLAT",
|
|
31994
|
+
"BOYCAR",
|
|
31995
|
+
"BOYSPP",
|
|
31996
|
+
"BOYISD",
|
|
31997
|
+
"BOYSAW",
|
|
31998
|
+
"BOYINB",
|
|
31999
|
+
"BCNLAT",
|
|
32000
|
+
"BCNCAR",
|
|
32001
|
+
"BCNSPP",
|
|
32002
|
+
"BCNISD",
|
|
32003
|
+
"BCNSAW",
|
|
32004
|
+
"LIGHTS",
|
|
32005
|
+
"LITFLT",
|
|
32006
|
+
"LITVES",
|
|
32007
|
+
"FOGSIG",
|
|
32008
|
+
"TOPMAR",
|
|
32009
|
+
"DAYMAR",
|
|
32010
|
+
"RTPBCN",
|
|
32011
|
+
"RDOSTA",
|
|
32012
|
+
"RADRFL",
|
|
32013
|
+
"RETRFL"
|
|
32014
|
+
]);
|
|
32015
|
+
var COARSE_MARK_BANDS = /* @__PURE__ */ new Set(["1", "2"]);
|
|
32016
|
+
var COARSE_MARK_HELD_HAZARDS = /* @__PURE__ */ new Set(["WRECKS", "OBSTRN", "UWTROC"]);
|
|
32017
|
+
var COARSE_MARK_FLOOR = BAND_PRIORITY_RANGES["3"].minzoom;
|
|
32018
|
+
function bandFloorGate() {
|
|
32019
|
+
return [
|
|
32020
|
+
"any",
|
|
32021
|
+
...BAND_DRAW_ORDER.map((B) => {
|
|
32022
|
+
const floor = BAND_PRIORITY_RANGES[B].minzoom;
|
|
32023
|
+
return floor > 0 ? ["all", bandFilterExpression(B), [">=", ["zoom"], floor]] : bandFilterExpression(B);
|
|
32024
|
+
})
|
|
32025
|
+
];
|
|
32026
|
+
}
|
|
32027
|
+
function isCoarseNonAidMark(layer) {
|
|
32028
|
+
if (layer.type !== "symbol" && layer.type !== "circle") return false;
|
|
32029
|
+
const cls = /^s52-([A-Za-z]{6})(?:-|$)/.exec(layer.id)?.[1]?.toUpperCase();
|
|
32030
|
+
if (!cls || cls === "SOUNDG" || AID_TO_NAVIGATION_CLASSES.has(cls) || COARSE_MARK_HELD_HAZARDS.has(cls)) return false;
|
|
32031
|
+
if (layer.type === "circle") return true;
|
|
32032
|
+
const layout = layer.layout;
|
|
32033
|
+
return typeof layout === "object" && layout !== null && "icon-image" in layout;
|
|
32034
|
+
}
|
|
31982
32035
|
var GENERALISED_AREA_FILL_CLASSES = /* @__PURE__ */ new Set([
|
|
31983
32036
|
"BUAARE",
|
|
31984
32037
|
// 2026-08-28, New York Harbor: the "New York Marine Inspection Zone and
|
|
@@ -33102,7 +33155,11 @@ function generateStyle(palette = "DAY", opts = {}) {
|
|
|
33102
33155
|
}
|
|
33103
33156
|
}
|
|
33104
33157
|
}
|
|
33105
|
-
|
|
33158
|
+
const sectorGate = bandFloorGate();
|
|
33159
|
+
layers.push(
|
|
33160
|
+
...sectorLightLayers.map((l) => ({ ...l, filter: combineWithBandFilter(l.filter, sectorGate) })),
|
|
33161
|
+
...lampLayers
|
|
33162
|
+
);
|
|
33106
33163
|
{
|
|
33107
33164
|
const TERMINAL_FILL_RE = new RegExp(
|
|
33108
33165
|
`^s52-(?:${[...DOMINANCE_EXEMPT_FILL_CLASSES].join("|")})-fill-band[456]$`
|
|
@@ -34309,6 +34366,7 @@ var Chrt = class {
|
|
|
34309
34366
|
};
|
|
34310
34367
|
// Annotate the CommonJS export names for ESM import in node:
|
|
34311
34368
|
0 && (module.exports = {
|
|
34369
|
+
AID_TO_NAVIGATION_CLASSES,
|
|
34312
34370
|
ALL_NAV_AID_LAYERS,
|
|
34313
34371
|
ALL_WATER_BODY_LAYERS,
|
|
34314
34372
|
AREA_QUERY_LAYERS,
|
|
@@ -34348,6 +34406,8 @@ var Chrt = class {
|
|
|
34348
34406
|
CHRT_ICON_PREFIX,
|
|
34349
34407
|
CHRT_SDF_GLYPHS,
|
|
34350
34408
|
CHRT_STYLE_MODES,
|
|
34409
|
+
COARSE_MARK_FLOOR,
|
|
34410
|
+
COARSE_MARK_HELD_HAZARDS,
|
|
34351
34411
|
Chrt,
|
|
34352
34412
|
ChrtError,
|
|
34353
34413
|
DANGER_DEPTH_LABEL_ID,
|
|
@@ -34480,6 +34540,7 @@ var Chrt = class {
|
|
|
34480
34540
|
applyS101SymbolSet,
|
|
34481
34541
|
atonIconExpression,
|
|
34482
34542
|
bandFilterExpression,
|
|
34543
|
+
bandFloorGate,
|
|
34483
34544
|
buildAirportTierExpression,
|
|
34484
34545
|
buildBuiltUpAreaTierExpression,
|
|
34485
34546
|
buildFlashPattern,
|