@chrtco/sdk 0.10.16 → 0.10.18
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 +61 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +61 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -27239,11 +27239,13 @@ function buildLayersForClass(objectClass, ct, sourceId = DEFAULT_REGION, opts =
|
|
|
27239
27239
|
["linear"],
|
|
27240
27240
|
["zoom"],
|
|
27241
27241
|
10,
|
|
27242
|
-
0.
|
|
27242
|
+
0.16,
|
|
27243
|
+
11,
|
|
27244
|
+
0.22,
|
|
27243
27245
|
12,
|
|
27244
|
-
0.
|
|
27246
|
+
0.3,
|
|
27245
27247
|
13,
|
|
27246
|
-
0.
|
|
27248
|
+
0.5,
|
|
27247
27249
|
14,
|
|
27248
27250
|
0.9,
|
|
27249
27251
|
16,
|
|
@@ -27254,12 +27256,45 @@ function buildLayersForClass(objectClass, ct, sourceId = DEFAULT_REGION, opts =
|
|
|
27254
27256
|
layer.layout = {
|
|
27255
27257
|
...layer.layout,
|
|
27256
27258
|
"icon-size": hazardIconSize,
|
|
27257
|
-
|
|
27258
|
-
|
|
27259
|
-
//
|
|
27260
|
-
//
|
|
27261
|
-
//
|
|
27262
|
-
//
|
|
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.
|
|
27263
27298
|
"icon-padding": 2,
|
|
27264
27299
|
"symbol-sort-key": [
|
|
27265
27300
|
"case",
|
|
@@ -27282,6 +27317,18 @@ function buildLayersForClass(objectClass, ct, sourceId = DEFAULT_REGION, opts =
|
|
|
27282
27317
|
"icon-allow-overlap": true,
|
|
27283
27318
|
"icon-ignore-placement": true
|
|
27284
27319
|
};
|
|
27320
|
+
const valnmrNum = ["to-number", ["coalesce", ["get", "VALNMR"], ["get", "valnmr"], 0], 0];
|
|
27321
|
+
const isMajor = [">=", valnmrNum, 10];
|
|
27322
|
+
const majorLayer = {
|
|
27323
|
+
...layer,
|
|
27324
|
+
id: `${layer.id}-major`,
|
|
27325
|
+
filter: layer.filter ? ["all", layer.filter, isMajor] : isMajor,
|
|
27326
|
+
layout: { ...layer.layout },
|
|
27327
|
+
minzoom: 6
|
|
27328
|
+
};
|
|
27329
|
+
layer.filter = layer.filter ? ["all", layer.filter, ["!", isMajor]] : ["!", isMajor];
|
|
27330
|
+
layer.minzoom = scaminToMinZoom(entry?.scamin) ?? layer.minzoom;
|
|
27331
|
+
layers.push(majorLayer);
|
|
27285
27332
|
}
|
|
27286
27333
|
} else if (resolved.layout) {
|
|
27287
27334
|
layer.layout = resolved.layout;
|
|
@@ -29096,10 +29143,12 @@ function generateStyle(palette = "DAY", opts = {}) {
|
|
|
29096
29143
|
const symbolSet = opts.symbolSet ?? "s52";
|
|
29097
29144
|
const spriteBase = `${opts.tileBaseUrl ?? "https://tiles.chrt.co"}/v1/sprites`;
|
|
29098
29145
|
const isLndareFill = (l) => /^s52-LNDARE-fill-band\d+$/.test(l.id);
|
|
29146
|
+
const isSeaareFill = (l) => /^s52-SEAARE-fill-band\d+$/.test(l.id);
|
|
29099
29147
|
const emitted = opts.land ? (() => {
|
|
29100
|
-
const
|
|
29101
|
-
const
|
|
29102
|
-
|
|
29148
|
+
const lndareFills = layers.filter(isLndareFill);
|
|
29149
|
+
const seaareFills = layers.filter(isSeaareFill);
|
|
29150
|
+
const rest = layers.filter((l) => !isLndareFill(l) && !isSeaareFill(l));
|
|
29151
|
+
return [rest[0], ...seaareFills, ...lndareFills, ...rest.slice(1)];
|
|
29103
29152
|
})() : layers;
|
|
29104
29153
|
const style = {
|
|
29105
29154
|
version: 8,
|