@chrtco/sdk 0.10.15 → 0.10.17
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 +74 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +74 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7700,6 +7700,16 @@ var S52_DRAW_ORDER = [
|
|
|
7700
7700
|
// the visual-coherence fix for hard charcoal-vs-vector-blue seams at
|
|
7701
7701
|
// scale-band boundaries — see `s52-lookup.ts`'s SEAARE entry for the
|
|
7702
7702
|
// paired paint-spec change (fill-opacity 0 → 1, color → DEPDW).
|
|
7703
|
+
//
|
|
7704
|
+
// ⚠ 2026-08-23: within-band ordering alone was NOT enough. Under the
|
|
7705
|
+
// band-major interleave, band-N's SEAARE painted ABOVE band-(N-1)'s
|
|
7706
|
+
// DEPARE, and NOAA's named-bay SEAARE polygons outrun (and out-survive,
|
|
7707
|
+
// through tile simplification) their own band's DEPARE — the live
|
|
7708
|
+
// "white blobs" over Narragansett/Quincy/Hingham Bays. The style
|
|
7709
|
+
// generator now hoists every band's SEAARE fill below the whole
|
|
7710
|
+
// cascade (BOTTOM_STACK_WATER_BASE_CLASSES in style-generator.ts);
|
|
7711
|
+
// this within-band slot remains for the label layer and as the record
|
|
7712
|
+
// of the original intent.
|
|
7703
7713
|
"SEAARE",
|
|
7704
7714
|
"DEPARE",
|
|
7705
7715
|
// 2a. Unsurveyed area — opaque grey wash painted ON TOP of any DEPARE
|
|
@@ -27229,11 +27239,13 @@ function buildLayersForClass(objectClass, ct, sourceId = DEFAULT_REGION, opts =
|
|
|
27229
27239
|
["linear"],
|
|
27230
27240
|
["zoom"],
|
|
27231
27241
|
10,
|
|
27232
|
-
0.
|
|
27242
|
+
0.16,
|
|
27243
|
+
11,
|
|
27244
|
+
0.22,
|
|
27233
27245
|
12,
|
|
27234
|
-
0.
|
|
27246
|
+
0.3,
|
|
27235
27247
|
13,
|
|
27236
|
-
0.
|
|
27248
|
+
0.5,
|
|
27237
27249
|
14,
|
|
27238
27250
|
0.9,
|
|
27239
27251
|
16,
|
|
@@ -27244,12 +27256,45 @@ function buildLayersForClass(objectClass, ct, sourceId = DEFAULT_REGION, opts =
|
|
|
27244
27256
|
layer.layout = {
|
|
27245
27257
|
...layer.layout,
|
|
27246
27258
|
"icon-size": hazardIconSize,
|
|
27247
|
-
|
|
27248
|
-
|
|
27249
|
-
//
|
|
27250
|
-
//
|
|
27251
|
-
//
|
|
27252
|
-
//
|
|
27259
|
+
// ── A HAZARD IS NEVER SUPPRESSED BY COLLISION ────────────────────
|
|
27260
|
+
//
|
|
27261
|
+
// This was `allow-overlap: false, icon-optional: true`, chosen to stop
|
|
27262
|
+
// adjacent rocks stacking into a black mass — a real problem, and the
|
|
27263
|
+
// reasoning above it only ever considered rock-against-rock.
|
|
27264
|
+
//
|
|
27265
|
+
// The same two flags also made hazards lose against EVERY other
|
|
27266
|
+
// class, and the nav aids they lose to are `allow-overlap: true` and
|
|
27267
|
+
// so can never lose in return. A rock beside a buoy was dropped;
|
|
27268
|
+
// `icon-optional: true` means an icon that collides is simply not
|
|
27269
|
+
// drawn, and a hazard symbol carries no label to fall back to, so it
|
|
27270
|
+
// vanished with nothing left behind to notice. Observed at Sculpin
|
|
27271
|
+
// Ledge (42°39.6'N 070°36.9'W) at Harbor scale.
|
|
27272
|
+
//
|
|
27273
|
+
// Which hazard wins was also decided by an accident of stack
|
|
27274
|
+
// position: UWTROC sits at draw index 802, below the nav aids at
|
|
27275
|
+
// ~947, while WRECKS sits at 950 above them — so rocks beat buoys and
|
|
27276
|
+
// wrecks lost to them, for no reason anyone chose.
|
|
27277
|
+
//
|
|
27278
|
+
// Deconflicting hazards against each other stays; it just no longer
|
|
27279
|
+
// runs through suppression:
|
|
27280
|
+
// - `symbol-sort-key` (below) still ranks by danger, and with
|
|
27281
|
+
// overlap allowed it now sets DRAW ORDER, so the worst hazard is
|
|
27282
|
+
// the one painted on top rather than the one that survives.
|
|
27283
|
+
// - the icon-size curve above is what keeps a dense ledge legible
|
|
27284
|
+
// at the zoomed-out end of Harbor. That is now the only thing
|
|
27285
|
+
// doing it, which is why its low end was lowered in the same
|
|
27286
|
+
// change.
|
|
27287
|
+
//
|
|
27288
|
+
// ⚠ `icon-ignore-placement` is deliberately LEFT AT ITS DEFAULT
|
|
27289
|
+
// (false). Hazards no longer yield to anything, but they still
|
|
27290
|
+
// occupy the collision index, so a label that would sit on top of a
|
|
27291
|
+
// rock moves instead of covering it.
|
|
27292
|
+
"icon-allow-overlap": true,
|
|
27293
|
+
"icon-optional": false,
|
|
27294
|
+
// Retained, with a narrower job than it had. With overlap allowed
|
|
27295
|
+
// this no longer suppresses a neighbouring hazard; it pads the box
|
|
27296
|
+
// hazards present to OTHER classes' placement, keeping labels off
|
|
27297
|
+
// them.
|
|
27253
27298
|
"icon-padding": 2,
|
|
27254
27299
|
"symbol-sort-key": [
|
|
27255
27300
|
"case",
|
|
@@ -28761,6 +28806,7 @@ function isDominanceExempt(layer) {
|
|
|
28761
28806
|
return false;
|
|
28762
28807
|
}
|
|
28763
28808
|
var TOP_STACK_LIGHT_CLASSES = /* @__PURE__ */ new Set(["LIGHTS"]);
|
|
28809
|
+
var BOTTOM_STACK_WATER_BASE_CLASSES = /* @__PURE__ */ new Set(["SEAARE"]);
|
|
28764
28810
|
function makeBandVariants(layer, B) {
|
|
28765
28811
|
const range = BAND_PRIORITY_RANGES[B];
|
|
28766
28812
|
const minzoom = bandVariantMinzoom(layer, B);
|
|
@@ -28960,8 +29006,13 @@ function generateStyle(palette = "DAY", opts = {}) {
|
|
|
28960
29006
|
})
|
|
28961
29007
|
});
|
|
28962
29008
|
}
|
|
28963
|
-
const regularBundles = bundles.filter(
|
|
29009
|
+
const regularBundles = bundles.filter(
|
|
29010
|
+
(b) => !TOP_STACK_LIGHT_CLASSES.has(b.objectClass) && !BOTTOM_STACK_WATER_BASE_CLASSES.has(b.objectClass)
|
|
29011
|
+
);
|
|
28964
29012
|
const topLightBundles = bundles.filter((b) => TOP_STACK_LIGHT_CLASSES.has(b.objectClass));
|
|
29013
|
+
const waterBaseBundles = bundles.filter(
|
|
29014
|
+
(b) => BOTTOM_STACK_WATER_BASE_CLASSES.has(b.objectClass)
|
|
29015
|
+
);
|
|
28965
29016
|
if (chartCascade && chartRequestedCodes) {
|
|
28966
29017
|
const requestedSet = new Set(chartRequestedCodes);
|
|
28967
29018
|
const emitChartFeatureVariants = (bundleSet) => {
|
|
@@ -28989,6 +29040,7 @@ function generateStyle(palette = "DAY", opts = {}) {
|
|
|
28989
29040
|
}
|
|
28990
29041
|
}
|
|
28991
29042
|
};
|
|
29043
|
+
emitChartFeatureVariants(waterBaseBundles);
|
|
28992
29044
|
emitChartFeatureVariants(regularBundles);
|
|
28993
29045
|
emitChartFeatureVariants(topLightBundles);
|
|
28994
29046
|
const chartLabelBundles = byLabelPriorityBottomUp(
|
|
@@ -29029,6 +29081,13 @@ function generateStyle(palette = "DAY", opts = {}) {
|
|
|
29029
29081
|
layers.push(...labelLayers);
|
|
29030
29082
|
} else {
|
|
29031
29083
|
const emitBand = (base, code) => bandFan === "legacy" ? makeBandVariants(base, code) : makeCollapsedBandVariant(base, code, isDominanceExempt(base));
|
|
29084
|
+
for (const code of BAND_DRAW_ORDER) {
|
|
29085
|
+
for (const { featureLayers } of waterBaseBundles) {
|
|
29086
|
+
for (const base of featureLayers) {
|
|
29087
|
+
layers.push(...emitBand(base, code));
|
|
29088
|
+
}
|
|
29089
|
+
}
|
|
29090
|
+
}
|
|
29032
29091
|
for (const code of BAND_DRAW_ORDER) {
|
|
29033
29092
|
for (const { featureLayers } of regularBundles) {
|
|
29034
29093
|
for (const base of featureLayers) {
|
|
@@ -29072,10 +29131,12 @@ function generateStyle(palette = "DAY", opts = {}) {
|
|
|
29072
29131
|
const symbolSet = opts.symbolSet ?? "s52";
|
|
29073
29132
|
const spriteBase = `${opts.tileBaseUrl ?? "https://tiles.chrt.co"}/v1/sprites`;
|
|
29074
29133
|
const isLndareFill = (l) => /^s52-LNDARE-fill-band\d+$/.test(l.id);
|
|
29134
|
+
const isSeaareFill = (l) => /^s52-SEAARE-fill-band\d+$/.test(l.id);
|
|
29075
29135
|
const emitted = opts.land ? (() => {
|
|
29076
|
-
const
|
|
29077
|
-
const
|
|
29078
|
-
|
|
29136
|
+
const lndareFills = layers.filter(isLndareFill);
|
|
29137
|
+
const seaareFills = layers.filter(isSeaareFill);
|
|
29138
|
+
const rest = layers.filter((l) => !isLndareFill(l) && !isSeaareFill(l));
|
|
29139
|
+
return [rest[0], ...seaareFills, ...lndareFills, ...rest.slice(1)];
|
|
29079
29140
|
})() : layers;
|
|
29080
29141
|
const style = {
|
|
29081
29142
|
version: 8,
|