@chrtco/sdk 0.10.42 → 0.10.44
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 +12 -0
- package/dist/atlas/browser.cjs +802 -566
- package/dist/atlas/browser.cjs.map +1 -1
- package/dist/atlas/browser.d.cts +229 -9
- package/dist/atlas/browser.d.ts +229 -9
- package/dist/atlas/browser.js +791 -565
- package/dist/atlas/browser.js.map +1 -1
- package/dist/index.cjs +294 -117
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +108 -37
- package/dist/index.d.ts +108 -37
- package/dist/index.js +278 -117
- package/dist/index.js.map +1 -1
- package/dist/symbol-families-D2Kx20HJ.d.cts +47 -0
- package/dist/symbol-families-D2Kx20HJ.d.ts +47 -0
- package/package.json +1 -1
- package/dist/s52-colors-CdVzqt2K.d.cts +0 -17
- package/dist/s52-colors-CdVzqt2K.d.ts +0 -17
package/dist/index.cjs
CHANGED
|
@@ -66,6 +66,8 @@ __export(index_exports, {
|
|
|
66
66
|
DEFAULT_TILE_BASE_URL: () => DEFAULT_TILE_BASE_URL,
|
|
67
67
|
DEFAULT_TILE_REGION: () => DEFAULT_TILE_REGION,
|
|
68
68
|
DEFAULT_WATER_BODY_SETTINGS: () => DEFAULT_WATER_BODY_SETTINGS,
|
|
69
|
+
DEPARE_FILL_BRANCH_TOKENS: () => DEPARE_FILL_BRANCH_TOKENS,
|
|
70
|
+
DEPARE_FILL_FALLBACK_TOKEN: () => DEPARE_FILL_FALLBACK_TOKEN,
|
|
69
71
|
DRAPEABLE_LAYER_TYPES: () => DRAPEABLE_LAYER_TYPES,
|
|
70
72
|
INSPECT_CLASS_RANK: () => INSPECT_CLASS_RANK,
|
|
71
73
|
INSPECT_RANK_DEVIATIONS: () => INSPECT_RANK_DEVIATIONS,
|
|
@@ -85,8 +87,11 @@ __export(index_exports, {
|
|
|
85
87
|
NAUTICAL_SYMBOLS: () => NAUTICAL_SYMBOLS,
|
|
86
88
|
NAV_AID_LAYER_GROUPS: () => NAV_AID_LAYER_GROUPS,
|
|
87
89
|
NAV_AID_QUERY_LAYERS: () => NAV_AID_QUERY_LAYERS,
|
|
90
|
+
NIGHT_INK: () => NIGHT_INK,
|
|
91
|
+
NIGHT_MUTED_INK: () => NIGHT_MUTED_INK,
|
|
88
92
|
NON_SOLAS_DISCLAIMER: () => NON_SOLAS_DISCLAIMER,
|
|
89
93
|
NON_SOLAS_DISCLAIMER_SHORT: () => NON_SOLAS_DISCLAIMER_SHORT,
|
|
94
|
+
OPAQUE_SPLIT_OF: () => OPAQUE_SPLIT_OF,
|
|
90
95
|
OfflineError: () => OfflineError,
|
|
91
96
|
OfflineStyleError: () => OfflineStyleError,
|
|
92
97
|
PLACENAME_LAND_CLASSES: () => PLACENAME_LAND_CLASSES,
|
|
@@ -155,13 +160,16 @@ __export(index_exports, {
|
|
|
155
160
|
buildSectorsFromFeatures: () => buildSectorsFromFeatures,
|
|
156
161
|
buildSources: () => buildSources,
|
|
157
162
|
candidateRank: () => candidateRank,
|
|
163
|
+
capLuminance: () => capLuminance,
|
|
158
164
|
cellBandCharacters: () => cellBandCharacters,
|
|
159
165
|
cellBandMatch: () => cellBandMatch,
|
|
160
166
|
chrtAtonTintExpression: () => chrtAtonTintExpression,
|
|
167
|
+
chrtHouseColor: () => chrtHouseColor,
|
|
161
168
|
chrtLightTintExpression: () => chrtLightTintExpression,
|
|
162
169
|
collectCandidates: () => collectCandidates,
|
|
163
170
|
collectClickCandidates: () => collectClickCandidates,
|
|
164
171
|
combineWithBandFilter: () => combineWithBandFilter,
|
|
172
|
+
contrastRatio: () => contrastRatio,
|
|
165
173
|
daymarkColor: () => daymarkColor,
|
|
166
174
|
decimateFeatures: () => decimateFeatures,
|
|
167
175
|
decodeAreaFeatureProps: () => decodeAreaFeatureProps,
|
|
@@ -170,6 +178,8 @@ __export(index_exports, {
|
|
|
170
178
|
decodeNavAidProps: () => decodeNavAidProps,
|
|
171
179
|
depareColor: () => depareColor,
|
|
172
180
|
depareFillExpression: () => depareFillExpression,
|
|
181
|
+
depthAreaClassLayerId: () => depthAreaClassLayerId,
|
|
182
|
+
depthAreaSplitIds: () => depthAreaSplitIds,
|
|
173
183
|
deriveMarinerName: () => deriveMarinerName,
|
|
174
184
|
drapeHalves: () => drapeHalves,
|
|
175
185
|
drapedFirst: () => drapedFirst,
|
|
@@ -205,6 +215,7 @@ __export(index_exports, {
|
|
|
205
215
|
hazardColor: () => hazardColor,
|
|
206
216
|
hazardFillExpression: () => hazardFillExpression,
|
|
207
217
|
iconExpressionForFamily: () => iconExpressionForFamily,
|
|
218
|
+
isDepthAreaClassLayerId: () => isDepthAreaClassLayerId,
|
|
208
219
|
isDrapeable: () => isDrapeable,
|
|
209
220
|
isLabelLayerVisible: () => isLabelLayerVisible,
|
|
210
221
|
isNavAidLayer: () => isNavAidLayer,
|
|
@@ -222,6 +233,7 @@ __export(index_exports, {
|
|
|
222
233
|
lightsIconExpression: () => lightsIconExpression,
|
|
223
234
|
normalizeStyleMode: () => normalizeStyleMode,
|
|
224
235
|
normalizeTheme: () => normalizeTheme,
|
|
236
|
+
opaqueSplitBaseOf: () => opaqueSplitBaseOf,
|
|
225
237
|
paginate: () => paginate,
|
|
226
238
|
parseListCodes: () => parseListCodes,
|
|
227
239
|
parseSigseqTerms: () => parseSigseqTerms,
|
|
@@ -233,6 +245,7 @@ __export(index_exports, {
|
|
|
233
245
|
preprocessSoundings: () => preprocessSoundings,
|
|
234
246
|
preprocessWaterBodies: () => preprocessWaterBodies,
|
|
235
247
|
rasterAtonIconExpression: () => rasterAtonIconExpression,
|
|
248
|
+
relativeLuminance: () => relativeLuminance,
|
|
236
249
|
resolveColor: () => resolveColor,
|
|
237
250
|
resolveCustomTheme: () => resolveCustomTheme,
|
|
238
251
|
resolveRasterImage: () => resolveRasterImage,
|
|
@@ -242,11 +255,14 @@ __export(index_exports, {
|
|
|
242
255
|
rhythmProperties: () => rhythmProperties,
|
|
243
256
|
s101ArtworkProvenance: () => s101ArtworkProvenance,
|
|
244
257
|
sanitizeCustomStyleConfig: () => sanitizeCustomStyleConfig,
|
|
258
|
+
scaleLinearLight: () => scaleLinearLight,
|
|
245
259
|
scaleSizeValue: () => scaleSizeValue,
|
|
246
260
|
scaminToMinZoom: () => scaminToMinZoom,
|
|
247
261
|
sectorLimitToArcBearing: () => sectorLimitToArcBearing,
|
|
262
|
+
splitOpaqueDepthAreas: () => splitOpaqueDepthAreas,
|
|
248
263
|
styleModeBand: () => styleModeBand,
|
|
249
264
|
terrainStackCount: () => terrainStackCount,
|
|
265
|
+
themeChrtGlyph: () => themeChrtGlyph,
|
|
250
266
|
tileTemplate: () => tileTemplate,
|
|
251
267
|
uncoveredSectorArcs: () => uncoveredSectorArcs,
|
|
252
268
|
withinBboxFilter: () => withinBboxFilter,
|
|
@@ -2484,6 +2500,22 @@ var S52_NIGHT = {
|
|
|
2484
2500
|
CHBRN: "#382410",
|
|
2485
2501
|
CHGRF: "#2a2a22",
|
|
2486
2502
|
CHGRD: "#1e1e18",
|
|
2503
|
+
// The NIGHT ink — linework, symbol outlines, navigation text, the shoal
|
|
2504
|
+
// soundings (SNDG2 below). Light warm on dark water: a deliberate deviation
|
|
2505
|
+
// from the spec's near-black (#1f2223), so a NIGHT chart is legible on a
|
|
2506
|
+
// screen nobody has dimmed. It is the brightest thing NIGHT draws on purpose,
|
|
2507
|
+
// and `night-luminance.test.ts` holds everything else under its muted level.
|
|
2508
|
+
//
|
|
2509
|
+
// ⚠ RED NIGHT DOES NOT DIM IT, AND THAT WAS DECIDED, NOT MISSED (2026-10-01).
|
|
2510
|
+
// Red night composes this same NIGHT chart with red chrome, as iOS does
|
|
2511
|
+
// (ContentView `effectiveChartTheme`). Dimming the ink for red night alone
|
|
2512
|
+
// would (1) drop SNDG2 out of the deeper soundings' legibility window — SNDG1
|
|
2513
|
+
// is pinned to 43% of this light by `sounding-legibility.test.ts` — and the
|
|
2514
|
+
// owner's red-night report of 2026-09-30 asked for MORE sounding legibility,
|
|
2515
|
+
// not less; and (2) dim the hazard outlines (OBSTRN, WRECKS) and coastline
|
|
2516
|
+
// that a night chart must keep. What red night was missing was everything
|
|
2517
|
+
// that did NOT follow this palette: labels, house marks, hatches, sector
|
|
2518
|
+
// bearings. Those follow it now.
|
|
2487
2519
|
CHBLK: "#c8aa78",
|
|
2488
2520
|
CSTLN: "#c8aa78",
|
|
2489
2521
|
OUTLW: "#c8aa78",
|
|
@@ -5228,6 +5260,45 @@ var InteractClient = class {
|
|
|
5228
5260
|
}
|
|
5229
5261
|
};
|
|
5230
5262
|
|
|
5263
|
+
// src/atlas/palette-light.ts
|
|
5264
|
+
var HEX6 = /^#?([0-9a-f]{6})$/i;
|
|
5265
|
+
function channels(hex) {
|
|
5266
|
+
const m = HEX6.exec(hex);
|
|
5267
|
+
if (!m) throw new Error(`palette-light: "${hex}" is not a #rrggbb colour`);
|
|
5268
|
+
const h = m[1];
|
|
5269
|
+
return [0, 2, 4].map((i) => parseInt(h.slice(i, i + 2), 16));
|
|
5270
|
+
}
|
|
5271
|
+
function toLinear(c) {
|
|
5272
|
+
const v = c / 255;
|
|
5273
|
+
return v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4;
|
|
5274
|
+
}
|
|
5275
|
+
function toEncoded(v) {
|
|
5276
|
+
const c = v <= 31308e-7 ? v * 12.92 : 1.055 * v ** (1 / 2.4) - 0.055;
|
|
5277
|
+
return Math.round(Math.min(1, Math.max(0, c)) * 255);
|
|
5278
|
+
}
|
|
5279
|
+
function hex2(n) {
|
|
5280
|
+
return n.toString(16).padStart(2, "0");
|
|
5281
|
+
}
|
|
5282
|
+
function relativeLuminance(hex) {
|
|
5283
|
+
const [r, g2, b] = channels(hex).map(toLinear);
|
|
5284
|
+
return 0.2126 * r + 0.7152 * g2 + 0.0722 * b;
|
|
5285
|
+
}
|
|
5286
|
+
function contrastRatio(a, b) {
|
|
5287
|
+
const [hi, lo] = [relativeLuminance(a), relativeLuminance(b)].sort((x, y) => y - x);
|
|
5288
|
+
return (hi + 0.05) / (lo + 0.05);
|
|
5289
|
+
}
|
|
5290
|
+
function scaleLinearLight(hex, factor) {
|
|
5291
|
+
const [r, g2, b] = channels(hex).map((c) => toEncoded(toLinear(c) * factor));
|
|
5292
|
+
return `#${hex2(r)}${hex2(g2)}${hex2(b)}`;
|
|
5293
|
+
}
|
|
5294
|
+
function capLuminance(hex, ceiling) {
|
|
5295
|
+
const l = relativeLuminance(hex);
|
|
5296
|
+
if (l <= ceiling) return scaleLinearLight(hex, 1);
|
|
5297
|
+
return scaleLinearLight(hex, ceiling / l);
|
|
5298
|
+
}
|
|
5299
|
+
var NIGHT_INK = S52_NIGHT.CHBLK;
|
|
5300
|
+
var NIGHT_MUTED_INK = scaleLinearLight(S52_NIGHT.CHBLK, 0.43);
|
|
5301
|
+
|
|
5231
5302
|
// src/atlas/s52-linestyles-generated.ts
|
|
5232
5303
|
var S52_LINESTYLES = {
|
|
5233
5304
|
ACHARE51: {
|
|
@@ -5911,8 +5982,11 @@ function depareColor(props, ct = "DAY", safetyContourM = DEFAULT_SAFETY_CONTOUR_
|
|
|
5911
5982
|
if (drval1 < DEPARE_DEEP_CUT_M) return resolveColor("DEPMD", ct);
|
|
5912
5983
|
return resolveColor("DEPDW", ct);
|
|
5913
5984
|
}
|
|
5985
|
+
var DEPARE_FILL_BRANCH_TOKENS = ["DEPIT", "DEPVS", "DEPMS", "DEPMD"];
|
|
5986
|
+
var DEPARE_FILL_FALLBACK_TOKEN = "DEPDW";
|
|
5914
5987
|
function depareFillExpression(ct = "DAY", safetyContourM = DEFAULT_SAFETY_CONTOUR_M) {
|
|
5915
5988
|
const safety = effectiveSafetyContour(safetyContourM);
|
|
5989
|
+
const [it, vs, ms, md] = DEPARE_FILL_BRANCH_TOKENS;
|
|
5916
5990
|
return [
|
|
5917
5991
|
"case",
|
|
5918
5992
|
[
|
|
@@ -5920,14 +5994,14 @@ function depareFillExpression(ct = "DAY", safetyContourM = DEFAULT_SAFETY_CONTOU
|
|
|
5920
5994
|
["<", ["coalesce", ["get", "DRVAL1"], ["get", "drval1"], -1], 0],
|
|
5921
5995
|
["<=", ["coalesce", ["get", "DRVAL2"], ["get", "drval2"], 0], 0]
|
|
5922
5996
|
],
|
|
5923
|
-
resolveColor(
|
|
5997
|
+
resolveColor(it, ct),
|
|
5924
5998
|
["<", ["coalesce", ["get", "DRVAL1"], ["get", "drval1"], -1], DEPARE_SHALLOW_CUT_M],
|
|
5925
|
-
resolveColor(
|
|
5999
|
+
resolveColor(vs, ct),
|
|
5926
6000
|
["<", ["coalesce", ["get", "DRVAL1"], ["get", "drval1"], -1], safety],
|
|
5927
|
-
resolveColor(
|
|
6001
|
+
resolveColor(ms, ct),
|
|
5928
6002
|
["<", ["coalesce", ["get", "DRVAL1"], ["get", "drval1"], -1], DEPARE_DEEP_CUT_M],
|
|
5929
|
-
resolveColor(
|
|
5930
|
-
resolveColor(
|
|
6003
|
+
resolveColor(md, ct),
|
|
6004
|
+
resolveColor(DEPARE_FILL_FALLBACK_TOKEN, ct)
|
|
5931
6005
|
];
|
|
5932
6006
|
}
|
|
5933
6007
|
function listAttrString(attr) {
|
|
@@ -23038,14 +23112,60 @@ var NATQUA_ABBR = [
|
|
|
23038
23112
|
// hard
|
|
23039
23113
|
];
|
|
23040
23114
|
var DARK_BG = "#1a1d23";
|
|
23041
|
-
var
|
|
23042
|
-
|
|
23043
|
-
|
|
23044
|
-
|
|
23045
|
-
|
|
23115
|
+
var NIGHT_MUTED = NIGHT_MUTED_INK;
|
|
23116
|
+
var NIGHT_KNOCKOUT = resolveColor("UIBCK", "NIGHT");
|
|
23117
|
+
var LABEL_TINT = {
|
|
23118
|
+
WATER: { day: "#9ec1d8", night: "muted" },
|
|
23119
|
+
// halo — lakes, rivers, canals
|
|
23120
|
+
WATER_DEEP: { day: "#8fb8d0", night: "muted" },
|
|
23121
|
+
// halo — sea areas, water place names
|
|
23122
|
+
LAND_REGION: { day: "#e8d8b8", night: "muted" },
|
|
23123
|
+
// halo — land regions, land place names
|
|
23124
|
+
LAND_NATURAL: { day: "#e0d8c8", night: "muted" },
|
|
23125
|
+
// halo — islands
|
|
23126
|
+
CITY: { day: "#f1e7d2", night: "muted" },
|
|
23127
|
+
// halo — built-up areas
|
|
23128
|
+
AIRPORT: { day: "#d4c9b0", night: "muted" },
|
|
23129
|
+
// halo — airports, landmarks, harbour facilities
|
|
23130
|
+
STRUCTURE: { day: "#bfa88a", night: "muted" },
|
|
23131
|
+
// glyph — bridges, shoreline constructions
|
|
23132
|
+
STRUCTURE_LIGHT: { day: "#c8c0b0", night: "muted" },
|
|
23133
|
+
// glyph — piles, moorings; halo — single buildings
|
|
23134
|
+
SOUNDING: { day: "#c8c8c8", night: "muted" },
|
|
23135
|
+
// halo — seabed, contour values; glyph — variation
|
|
23136
|
+
MAGENTA: { day: "#c545c3", night: "hue" },
|
|
23137
|
+
// glyph — production areas, overhead cables
|
|
23138
|
+
PIPELINE: { day: "#7fbf3f", night: "hue" },
|
|
23139
|
+
// glyph — overhead pipelines
|
|
23140
|
+
KELP: { day: "#3f8a34", night: "hue" },
|
|
23141
|
+
// halo — weed / kelp
|
|
23142
|
+
NAV_WHITE: { day: "#ffffff", night: "ink" },
|
|
23143
|
+
// halo — lateral, isolated danger, safe water
|
|
23144
|
+
NAV_CREAM: { day: "#fdf0b0", night: "ink" },
|
|
23145
|
+
// halo — cardinals, light characteristics
|
|
23146
|
+
NAV_YELLOW: { day: "#eab308", night: "hue" },
|
|
23147
|
+
// halo — special-purpose marks
|
|
23148
|
+
NAV_BLUE: { day: "#b0c8e8", night: "muted" }
|
|
23149
|
+
// halo — fog signals
|
|
23046
23150
|
};
|
|
23047
|
-
function
|
|
23048
|
-
|
|
23151
|
+
function tintFor(tint, ct) {
|
|
23152
|
+
const day = LABEL_TINT[tint].day;
|
|
23153
|
+
if (ct === "DAY") return day;
|
|
23154
|
+
return capLuminance(day, relativeLuminance(resolveColor("CHBLK", ct)));
|
|
23155
|
+
}
|
|
23156
|
+
function nightText(tint) {
|
|
23157
|
+
const role = LABEL_TINT[tint].night;
|
|
23158
|
+
if (role === "ink") return NIGHT_INK;
|
|
23159
|
+
if (role === "muted") return NIGHT_MUTED;
|
|
23160
|
+
return capLuminance(LABEL_TINT[tint].day, relativeLuminance(NIGHT_MUTED));
|
|
23161
|
+
}
|
|
23162
|
+
function onHalo(tint, ct) {
|
|
23163
|
+
if (ct === "NIGHT") return { textColor: nightText(tint), textHaloColor: NIGHT_KNOCKOUT };
|
|
23164
|
+
return { textColor: DARK_BG, textHaloColor: tintFor(tint, ct) };
|
|
23165
|
+
}
|
|
23166
|
+
function onKnockout(tint, ct) {
|
|
23167
|
+
if (ct === "NIGHT") return { textColor: nightText(tint), textHaloColor: NIGHT_KNOCKOUT };
|
|
23168
|
+
return { textColor: tintFor(tint, ct), textHaloColor: DARK_BG };
|
|
23049
23169
|
}
|
|
23050
23170
|
var NAV_AID_LABEL_TEXT_SIZE = [
|
|
23051
23171
|
"interpolate",
|
|
@@ -23327,21 +23447,6 @@ function buildAirportTierExpression() {
|
|
|
23327
23447
|
2
|
|
23328
23448
|
];
|
|
23329
23449
|
}
|
|
23330
|
-
var COLOR = {
|
|
23331
|
-
WATER: "#9ec1d8",
|
|
23332
|
-
WATER_DEEP: "#8fb8d0",
|
|
23333
|
-
LAND_REGION: "#e8d8b8",
|
|
23334
|
-
LAND_NATURAL: "#e0d8c8",
|
|
23335
|
-
CITY: "#f1e7d2",
|
|
23336
|
-
AIRPORT: "#d4c9b0",
|
|
23337
|
-
STRUCTURE: "#bfa88a",
|
|
23338
|
-
STRUCTURE_LIGHT: "#c8c0b0",
|
|
23339
|
-
SOUNDING: "#c8c8c8",
|
|
23340
|
-
NAV_NUMBER: "#ffffff",
|
|
23341
|
-
NAV_CARDINAL: "#fdf0b0",
|
|
23342
|
-
NAV_SPECIAL: "#eab308",
|
|
23343
|
-
LIGHT: "#fdf0b0"
|
|
23344
|
-
};
|
|
23345
23450
|
var ORIENTATION_BAND_SORT_KEY = [
|
|
23346
23451
|
"to-number",
|
|
23347
23452
|
["slice", ["coalesce", ["get", "_cell_id"], "??9???"], 2, 3],
|
|
@@ -23686,8 +23791,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
23686
23791
|
[13, [11.5, 11.5]],
|
|
23687
23792
|
[16, [10.5, 11.5]]
|
|
23688
23793
|
]),
|
|
23689
|
-
|
|
23690
|
-
textHaloColor: COLOR.LAND_REGION,
|
|
23794
|
+
...onHalo("LAND_REGION", ct),
|
|
23691
23795
|
// Land halo, not the shared taper — see LAND_HALO_WIDTH.
|
|
23692
23796
|
textHaloWidth: LAND_HALO_WIDTH,
|
|
23693
23797
|
textOffset: [0, 0],
|
|
@@ -23701,8 +23805,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
23701
23805
|
type: "symbol",
|
|
23702
23806
|
textField: buildLandmarkLabelExpression(),
|
|
23703
23807
|
textSize: 9,
|
|
23704
|
-
|
|
23705
|
-
textHaloColor: "#d4c9b0",
|
|
23808
|
+
...onHalo("AIRPORT", ct),
|
|
23706
23809
|
textHaloWidth: 1.5,
|
|
23707
23810
|
textOffset: [0, 0],
|
|
23708
23811
|
minzoom: 9,
|
|
@@ -23722,8 +23825,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
23722
23825
|
type: "symbol",
|
|
23723
23826
|
textField: buildHarbourFacilityLabelExpression(),
|
|
23724
23827
|
textSize: 9,
|
|
23725
|
-
|
|
23726
|
-
textHaloColor: "#d4c9b0",
|
|
23828
|
+
...onHalo("AIRPORT", ct),
|
|
23727
23829
|
textHaloWidth: 1.5,
|
|
23728
23830
|
textOffset: [0, 0],
|
|
23729
23831
|
minzoom: 12,
|
|
@@ -23740,8 +23842,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
23740
23842
|
textField: ["coalesce", ["get", "_navAidLabel"], OBJNAM_TEXT],
|
|
23741
23843
|
textSize: NAV_AID_LABEL_TEXT_SIZE,
|
|
23742
23844
|
textFont: NAV_AID_LABEL_FONT,
|
|
23743
|
-
|
|
23744
|
-
textHaloColor: navHalo("WHITE", ct),
|
|
23845
|
+
...onHalo("NAV_WHITE", ct),
|
|
23745
23846
|
textHaloWidth: 1.5,
|
|
23746
23847
|
textOffset: [0, 1.5],
|
|
23747
23848
|
minzoom: 10,
|
|
@@ -23753,8 +23854,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
23753
23854
|
textField: ["coalesce", ["get", "_navAidLabel"], OBJNAM_TEXT],
|
|
23754
23855
|
textSize: NAV_AID_LABEL_TEXT_SIZE,
|
|
23755
23856
|
textFont: NAV_AID_LABEL_FONT,
|
|
23756
|
-
|
|
23757
|
-
textHaloColor: navHalo("WHITE", ct),
|
|
23857
|
+
...onHalo("NAV_WHITE", ct),
|
|
23758
23858
|
textHaloWidth: 1.5,
|
|
23759
23859
|
textOffset: [0, 1.5],
|
|
23760
23860
|
minzoom: 10,
|
|
@@ -23767,8 +23867,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
23767
23867
|
textField: ["coalesce", ["get", "_navAidLabel"], OBJNAM_TEXT],
|
|
23768
23868
|
textSize: NAV_AID_LABEL_TEXT_SIZE,
|
|
23769
23869
|
textFont: NAV_AID_LABEL_FONT,
|
|
23770
|
-
|
|
23771
|
-
textHaloColor: navHalo("CREAM", ct),
|
|
23870
|
+
...onHalo("NAV_CREAM", ct),
|
|
23772
23871
|
textHaloWidth: 1.5,
|
|
23773
23872
|
textOffset: [0, 1.5],
|
|
23774
23873
|
minzoom: 10,
|
|
@@ -23781,8 +23880,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
23781
23880
|
textField: ["coalesce", ["get", "_navAidLabel"], OBJNAM_TEXT],
|
|
23782
23881
|
textSize: NAV_AID_LABEL_TEXT_SIZE,
|
|
23783
23882
|
textFont: NAV_AID_LABEL_FONT,
|
|
23784
|
-
|
|
23785
|
-
textHaloColor: navHalo("YELLOW", ct),
|
|
23883
|
+
...onHalo("NAV_YELLOW", ct),
|
|
23786
23884
|
textHaloWidth: 1.5,
|
|
23787
23885
|
textOffset: [0, 1.5],
|
|
23788
23886
|
minzoom: 10,
|
|
@@ -23795,8 +23893,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
23795
23893
|
textField: ["coalesce", ["get", "_navAidLabel"], OBJNAM_TEXT],
|
|
23796
23894
|
textSize: NAV_AID_LABEL_TEXT_SIZE,
|
|
23797
23895
|
textFont: NAV_AID_LABEL_FONT,
|
|
23798
|
-
|
|
23799
|
-
textHaloColor: navHalo("WHITE", ct),
|
|
23896
|
+
...onHalo("NAV_WHITE", ct),
|
|
23800
23897
|
textHaloWidth: 1.5,
|
|
23801
23898
|
textOffset: [0, 1.5],
|
|
23802
23899
|
minzoom: 10,
|
|
@@ -23808,8 +23905,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
23808
23905
|
textField: ["get", "_lightLabel"],
|
|
23809
23906
|
textSize: NAV_AID_LABEL_TEXT_SIZE,
|
|
23810
23907
|
textFont: NAV_AID_LABEL_FONT,
|
|
23811
|
-
|
|
23812
|
-
textHaloColor: navHalo("CREAM", ct),
|
|
23908
|
+
...onHalo("NAV_CREAM", ct),
|
|
23813
23909
|
textHaloWidth: 1.5,
|
|
23814
23910
|
textOffset: [2, 0],
|
|
23815
23911
|
minzoom: 9,
|
|
@@ -23833,8 +23929,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
23833
23929
|
textField: catfogExpr,
|
|
23834
23930
|
textSize: NAV_AID_LABEL_TEXT_SIZE,
|
|
23835
23931
|
textFont: NAV_AID_LABEL_FONT,
|
|
23836
|
-
|
|
23837
|
-
textHaloColor: navHalo("BLUE", ct),
|
|
23932
|
+
...onHalo("NAV_BLUE", ct),
|
|
23838
23933
|
textHaloWidth: 1.5,
|
|
23839
23934
|
textOffset: [2, 1.2],
|
|
23840
23935
|
minzoom: 11,
|
|
@@ -23909,8 +24004,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
23909
24004
|
[13, [0, 0, 13, 10, 11]],
|
|
23910
24005
|
[16, [0, 0, 12, 11, 10]]
|
|
23911
24006
|
]),
|
|
23912
|
-
|
|
23913
|
-
textHaloColor: COLOR.WATER_DEEP,
|
|
24007
|
+
...onHalo("WATER_DEEP", ct),
|
|
23914
24008
|
textHaloWidth: ORIENTATION_HALO_WIDTH,
|
|
23915
24009
|
textOffset: [0, 0],
|
|
23916
24010
|
textFont: ["Open Sans Italic"],
|
|
@@ -23980,8 +24074,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
23980
24074
|
[13, [10, 11]],
|
|
23981
24075
|
[16, [9, 10]]
|
|
23982
24076
|
]),
|
|
23983
|
-
|
|
23984
|
-
textHaloColor: COLOR.WATER,
|
|
24077
|
+
...onHalo("WATER", ct),
|
|
23985
24078
|
textHaloWidth: ORIENTATION_HALO_WIDTH,
|
|
23986
24079
|
textOffset: [0, 0],
|
|
23987
24080
|
textFont: ["Open Sans Italic"],
|
|
@@ -24001,8 +24094,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
24001
24094
|
[13, [10, 10]],
|
|
24002
24095
|
[16, [9, 10]]
|
|
24003
24096
|
]),
|
|
24004
|
-
|
|
24005
|
-
textHaloColor: COLOR.WATER,
|
|
24097
|
+
...onHalo("WATER", ct),
|
|
24006
24098
|
textHaloWidth: ORIENTATION_HALO_WIDTH,
|
|
24007
24099
|
textOffset: [0, 0],
|
|
24008
24100
|
textFont: ["Open Sans Italic"],
|
|
@@ -24025,8 +24117,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
24025
24117
|
16,
|
|
24026
24118
|
9
|
|
24027
24119
|
],
|
|
24028
|
-
|
|
24029
|
-
textHaloColor: COLOR.WATER,
|
|
24120
|
+
...onHalo("WATER", ct),
|
|
24030
24121
|
textHaloWidth: ORIENTATION_HALO_WIDTH,
|
|
24031
24122
|
textOffset: [0, 0],
|
|
24032
24123
|
textFont: ["Open Sans Italic"],
|
|
@@ -24055,8 +24146,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
24055
24146
|
[13, [11.5, 11.5]],
|
|
24056
24147
|
[16, [10.5, 11.5]]
|
|
24057
24148
|
]),
|
|
24058
|
-
|
|
24059
|
-
textHaloColor: COLOR.LAND_NATURAL,
|
|
24149
|
+
...onHalo("LAND_NATURAL", ct),
|
|
24060
24150
|
// Land halo, not the shared taper — see LAND_HALO_WIDTH.
|
|
24061
24151
|
textHaloWidth: LAND_HALO_WIDTH,
|
|
24062
24152
|
textOffset: [0, 0],
|
|
@@ -24079,8 +24169,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
24079
24169
|
[13, [10, 11, 12]],
|
|
24080
24170
|
[16, [10, 10, 11]]
|
|
24081
24171
|
]),
|
|
24082
|
-
|
|
24083
|
-
textHaloColor: COLOR.CITY,
|
|
24172
|
+
...onHalo("CITY", ct),
|
|
24084
24173
|
textHaloWidth: ORIENTATION_HALO_WIDTH,
|
|
24085
24174
|
textOffset: [0, 0],
|
|
24086
24175
|
textFont: ["Open Sans Regular"],
|
|
@@ -24095,8 +24184,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
24095
24184
|
type: "symbol",
|
|
24096
24185
|
textField: OBJNAM_TEXT,
|
|
24097
24186
|
textSize: 9,
|
|
24098
|
-
|
|
24099
|
-
textHaloColor: DARK_BG,
|
|
24187
|
+
...onKnockout("STRUCTURE", ct),
|
|
24100
24188
|
textHaloWidth: 1.5,
|
|
24101
24189
|
textOffset: [0, 0],
|
|
24102
24190
|
minzoom: 12,
|
|
@@ -24114,8 +24202,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
24114
24202
|
type: "symbol",
|
|
24115
24203
|
textField: OBJNAM_TEXT,
|
|
24116
24204
|
textSize: 8,
|
|
24117
|
-
|
|
24118
|
-
textHaloColor: DARK_BG,
|
|
24205
|
+
...onKnockout("STRUCTURE_LIGHT", ct),
|
|
24119
24206
|
textHaloWidth: 1.2,
|
|
24120
24207
|
textOffset: [0, 1.2],
|
|
24121
24208
|
minzoom: 13
|
|
@@ -24125,8 +24212,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
24125
24212
|
type: "symbol",
|
|
24126
24213
|
textField: OBJNAM_TEXT,
|
|
24127
24214
|
textSize: 8,
|
|
24128
|
-
|
|
24129
|
-
textHaloColor: DARK_BG,
|
|
24215
|
+
...onKnockout("STRUCTURE_LIGHT", ct),
|
|
24130
24216
|
textHaloWidth: 1.2,
|
|
24131
24217
|
textOffset: [0, 1.2],
|
|
24132
24218
|
minzoom: 13
|
|
@@ -24136,8 +24222,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
24136
24222
|
type: "symbol",
|
|
24137
24223
|
textField: OBJNAM_TEXT,
|
|
24138
24224
|
textSize: 8,
|
|
24139
|
-
|
|
24140
|
-
textHaloColor: DARK_BG,
|
|
24225
|
+
...onKnockout("STRUCTURE", ct),
|
|
24141
24226
|
textHaloWidth: 1.2,
|
|
24142
24227
|
textOffset: [0, 1],
|
|
24143
24228
|
minzoom: 13,
|
|
@@ -24151,8 +24236,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
24151
24236
|
type: "symbol",
|
|
24152
24237
|
textField: OBJNAM_TEXT,
|
|
24153
24238
|
textSize: 8,
|
|
24154
|
-
|
|
24155
|
-
textHaloColor: "#c8c0b0",
|
|
24239
|
+
...onHalo("STRUCTURE_LIGHT", ct),
|
|
24156
24240
|
textHaloWidth: 1.2,
|
|
24157
24241
|
textOffset: [0, 1.2],
|
|
24158
24242
|
minzoom: 14,
|
|
@@ -24173,8 +24257,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
24173
24257
|
[13, [10, 10]],
|
|
24174
24258
|
[16, [9, 9]]
|
|
24175
24259
|
]),
|
|
24176
|
-
|
|
24177
|
-
textHaloColor: COLOR.AIRPORT,
|
|
24260
|
+
...onHalo("AIRPORT", ct),
|
|
24178
24261
|
textHaloWidth: ORIENTATION_HALO_WIDTH,
|
|
24179
24262
|
textOffset: [0, 0],
|
|
24180
24263
|
textFont: ["Open Sans Regular"],
|
|
@@ -24195,8 +24278,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
24195
24278
|
16,
|
|
24196
24279
|
11
|
|
24197
24280
|
],
|
|
24198
|
-
|
|
24199
|
-
textHaloColor: COLOR.SOUNDING,
|
|
24281
|
+
...onHalo("SOUNDING", ct),
|
|
24200
24282
|
textHaloWidth: 1,
|
|
24201
24283
|
textOffset: [0, 0],
|
|
24202
24284
|
textFont: ["Open Sans Italic"],
|
|
@@ -24230,8 +24312,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
24230
24312
|
14,
|
|
24231
24313
|
11
|
|
24232
24314
|
],
|
|
24233
|
-
|
|
24234
|
-
textHaloColor: DARK_BG,
|
|
24315
|
+
...onKnockout("SOUNDING", ct),
|
|
24235
24316
|
textHaloWidth: 1,
|
|
24236
24317
|
textOffset: [0, 0],
|
|
24237
24318
|
textFont: ["Open Sans Italic"],
|
|
@@ -24261,8 +24342,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
24261
24342
|
16,
|
|
24262
24343
|
8
|
|
24263
24344
|
],
|
|
24264
|
-
|
|
24265
|
-
textHaloColor: DARK_BG,
|
|
24345
|
+
...onKnockout("MAGENTA", ct),
|
|
24266
24346
|
textHaloWidth: ORIENTATION_HALO_WIDTH,
|
|
24267
24347
|
textOffset: [0, 0],
|
|
24268
24348
|
textFont: ["Open Sans Italic"],
|
|
@@ -24282,8 +24362,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
24282
24362
|
16,
|
|
24283
24363
|
11
|
|
24284
24364
|
],
|
|
24285
|
-
|
|
24286
|
-
textHaloColor: "#3f8a34",
|
|
24365
|
+
...onHalo("KELP", ct),
|
|
24287
24366
|
textHaloWidth: 1,
|
|
24288
24367
|
textOffset: [0, 0],
|
|
24289
24368
|
textFont: ["Open Sans Italic"],
|
|
@@ -24375,8 +24454,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
24375
24454
|
17,
|
|
24376
24455
|
11
|
|
24377
24456
|
],
|
|
24378
|
-
|
|
24379
|
-
textHaloColor: DARK_BG,
|
|
24457
|
+
...onKnockout(isCBL ? "MAGENTA" : "PIPELINE", ct),
|
|
24380
24458
|
textHaloWidth: 1.4,
|
|
24381
24459
|
textOffset: [0, 0],
|
|
24382
24460
|
textFont: ["Open Sans Regular"],
|
|
@@ -24411,8 +24489,7 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
24411
24489
|
14,
|
|
24412
24490
|
10
|
|
24413
24491
|
],
|
|
24414
|
-
|
|
24415
|
-
textHaloColor: "#c8c8c8",
|
|
24492
|
+
...onHalo("SOUNDING", ct),
|
|
24416
24493
|
textHaloWidth: 1.2,
|
|
24417
24494
|
textOffset: [0, 0],
|
|
24418
24495
|
textFont: ["Open Sans Regular"],
|
|
@@ -24717,9 +24794,9 @@ var PLACENAME_LAND_SIZE_STOPS = [
|
|
|
24717
24794
|
[13, [0, 0, 10, 11, 10, 11, 10, 10, 10, 10]],
|
|
24718
24795
|
[16, [0, 0, 10, 10, 9, 10, 9, 9, 9, 9]]
|
|
24719
24796
|
];
|
|
24720
|
-
function buildPlaceNameLayers(sourceId) {
|
|
24797
|
+
function buildPlaceNameLayers(sourceId, ct = "DAY") {
|
|
24721
24798
|
const sortKey = ["to-number", ["coalesce", ["get", "rank"], 9999999]];
|
|
24722
|
-
const make = (idSuffix, classes, font,
|
|
24799
|
+
const make = (idSuffix, classes, font, tint, letterSpacing, stops) => ({
|
|
24723
24800
|
id: `chrt-placename-${idSuffix}`,
|
|
24724
24801
|
type: "symbol",
|
|
24725
24802
|
source: sourceId,
|
|
@@ -24747,8 +24824,8 @@ function buildPlaceNameLayers(sourceId) {
|
|
|
24747
24824
|
"symbol-sort-key": sortKey
|
|
24748
24825
|
},
|
|
24749
24826
|
paint: {
|
|
24750
|
-
"text-color":
|
|
24751
|
-
"text-halo-color":
|
|
24827
|
+
"text-color": onHalo(tint, ct).textColor,
|
|
24828
|
+
"text-halo-color": onHalo(tint, ct).textHaloColor,
|
|
24752
24829
|
"text-halo-width": ORIENTATION_HALO_WIDTH,
|
|
24753
24830
|
"text-opacity": PLACENAME_TEXT_OPACITY
|
|
24754
24831
|
},
|
|
@@ -24758,8 +24835,8 @@ function buildPlaceNameLayers(sourceId) {
|
|
|
24758
24835
|
}
|
|
24759
24836
|
});
|
|
24760
24837
|
return [
|
|
24761
|
-
make("water", PLACENAME_WATER_CLASSES, ["Open Sans Italic"],
|
|
24762
|
-
make("land", PLACENAME_LAND_CLASSES, ["Open Sans Regular"],
|
|
24838
|
+
make("water", PLACENAME_WATER_CLASSES, ["Open Sans Italic"], "WATER_DEEP", 0.05, PLACENAME_WATER_SIZE_STOPS),
|
|
24839
|
+
make("land", PLACENAME_LAND_CLASSES, ["Open Sans Regular"], "LAND_REGION", 0.02, PLACENAME_LAND_SIZE_STOPS)
|
|
24763
24840
|
];
|
|
24764
24841
|
}
|
|
24765
24842
|
var DRGNOTE_SOURCE_LAYER = "DRGNOTE";
|
|
@@ -27483,37 +27560,58 @@ var CHRT_ATON_COLORS = {
|
|
|
27483
27560
|
// pink (magenta-ish)
|
|
27484
27561
|
};
|
|
27485
27562
|
var CHRT_UNKNOWN_TINT = "#8B9298";
|
|
27486
|
-
|
|
27563
|
+
var HOUSE_BLACK = "#101418";
|
|
27564
|
+
function chrtHouseColor(dayHex, palette = "DAY") {
|
|
27565
|
+
if (palette === "DAY") return dayHex;
|
|
27566
|
+
const isBlack = dayHex.toLowerCase() === HOUSE_BLACK.toLowerCase();
|
|
27567
|
+
if (palette === "DUSK") {
|
|
27568
|
+
return isBlack ? dayHex : capLuminance(dayHex, relativeLuminance(resolveColor("CHBLK", "DUSK")));
|
|
27569
|
+
}
|
|
27570
|
+
return isBlack ? NIGHT_INK : capLuminance(dayHex, relativeLuminance(NIGHT_MUTED_INK));
|
|
27571
|
+
}
|
|
27572
|
+
function themeChrtGlyph(svg3, palette = "DAY") {
|
|
27573
|
+
if (palette === "DAY") return svg3;
|
|
27574
|
+
return svg3.replace(
|
|
27575
|
+
/(fill|stroke)="(#[0-9a-fA-F]{3}|#[0-9a-fA-F]{6})"/g,
|
|
27576
|
+
(_m, attr, hex) => {
|
|
27577
|
+
const six = hex.length === 4 ? `#${hex[1]}${hex[1]}${hex[2]}${hex[2]}${hex[3]}${hex[3]}` : hex;
|
|
27578
|
+
return `${attr}="${chrtHouseColor(six, palette)}"`;
|
|
27579
|
+
}
|
|
27580
|
+
);
|
|
27581
|
+
}
|
|
27582
|
+
function chrtAtonTintExpression(palette = "DAY") {
|
|
27583
|
+
const c = (code) => chrtHouseColor(CHRT_ATON_COLORS[code], palette);
|
|
27487
27584
|
return colourCodeCase(
|
|
27488
27585
|
[
|
|
27489
|
-
["3",
|
|
27490
|
-
["4",
|
|
27491
|
-
["6",
|
|
27492
|
-
["11",
|
|
27493
|
-
["9",
|
|
27494
|
-
["5",
|
|
27495
|
-
["1",
|
|
27496
|
-
["2",
|
|
27497
|
-
["8",
|
|
27498
|
-
["10",
|
|
27499
|
-
["12",
|
|
27500
|
-
["7",
|
|
27586
|
+
["3", c("3")],
|
|
27587
|
+
["4", c("4")],
|
|
27588
|
+
["6", c("6")],
|
|
27589
|
+
["11", c("11")],
|
|
27590
|
+
["9", c("9")],
|
|
27591
|
+
["5", c("5")],
|
|
27592
|
+
["1", c("1")],
|
|
27593
|
+
["2", c("2")],
|
|
27594
|
+
["8", c("8")],
|
|
27595
|
+
["10", c("10")],
|
|
27596
|
+
["12", c("12")],
|
|
27597
|
+
["7", c("7")]
|
|
27501
27598
|
],
|
|
27502
|
-
CHRT_UNKNOWN_TINT
|
|
27599
|
+
chrtHouseColor(CHRT_UNKNOWN_TINT, palette)
|
|
27503
27600
|
);
|
|
27504
27601
|
}
|
|
27505
|
-
function chrtLightTintExpression() {
|
|
27602
|
+
function chrtLightTintExpression(palette = "DAY") {
|
|
27603
|
+
const c = (code) => chrtHouseColor(CHRT_ATON_COLORS[code], palette);
|
|
27506
27604
|
return colourCodeCase(
|
|
27507
27605
|
[
|
|
27508
|
-
["3",
|
|
27509
|
-
["4",
|
|
27510
|
-
["6",
|
|
27511
|
-
["11",
|
|
27512
|
-
["9",
|
|
27513
|
-
["5",
|
|
27514
|
-
["1",
|
|
27606
|
+
["3", c("3")],
|
|
27607
|
+
["4", c("4")],
|
|
27608
|
+
["6", c("6")],
|
|
27609
|
+
["11", c("11")],
|
|
27610
|
+
["9", c("9")],
|
|
27611
|
+
["5", c("5")],
|
|
27612
|
+
["1", c("1")]
|
|
27515
27613
|
],
|
|
27516
|
-
|
|
27614
|
+
c("1")
|
|
27517
27615
|
);
|
|
27518
27616
|
}
|
|
27519
27617
|
function scalar(attr) {
|
|
@@ -27615,7 +27713,7 @@ var TINTED_CLASSES = /* @__PURE__ */ new Set([
|
|
|
27615
27713
|
"BCNSPP",
|
|
27616
27714
|
"DAYMAR"
|
|
27617
27715
|
]);
|
|
27618
|
-
var CHRT_HALO = { color:
|
|
27716
|
+
var CHRT_HALO = { color: HOUSE_BLACK, width: 1 };
|
|
27619
27717
|
var CHRT_LINE_DASH = {
|
|
27620
27718
|
CBLSUB: { color: "CHMGD", width: 0.8, dash: [6, 3] },
|
|
27621
27719
|
PIPSOL: { color: "PIPLN", width: 0.8, dash: [6, 3] }
|
|
@@ -27643,11 +27741,11 @@ function applyChrtSymbolSet(style, palette = "DAY") {
|
|
|
27643
27741
|
layout["icon-image"] = CHRT_ICON_EXPRESSIONS[objectClass]();
|
|
27644
27742
|
const paint = layer.paint ?? {};
|
|
27645
27743
|
if (TINTED_CLASSES.has(objectClass)) {
|
|
27646
|
-
paint["icon-color"] = chrtAtonTintExpression();
|
|
27744
|
+
paint["icon-color"] = chrtAtonTintExpression(palette);
|
|
27647
27745
|
paint["icon-halo-color"] = CHRT_HALO.color;
|
|
27648
27746
|
paint["icon-halo-width"] = CHRT_HALO.width;
|
|
27649
27747
|
} else if (objectClass === "LIGHTS") {
|
|
27650
|
-
paint["icon-color"] = chrtLightTintExpression();
|
|
27748
|
+
paint["icon-color"] = chrtLightTintExpression(palette);
|
|
27651
27749
|
paint["icon-halo-color"] = CHRT_HALO.color;
|
|
27652
27750
|
paint["icon-halo-width"] = CHRT_HALO.width;
|
|
27653
27751
|
}
|
|
@@ -30799,7 +30897,7 @@ function generateStyle(palette = "DAY", opts = {}) {
|
|
|
30799
30897
|
)
|
|
30800
30898
|
);
|
|
30801
30899
|
if (opts.labels === "placename") {
|
|
30802
|
-
labelLayers.push(...buildPlaceNameLayers(sourceId));
|
|
30900
|
+
labelLayers.push(...buildPlaceNameLayers(sourceId, palette));
|
|
30803
30901
|
}
|
|
30804
30902
|
for (const { label } of chartLabelBundles) {
|
|
30805
30903
|
if (bandFan === "collapsed") {
|
|
@@ -30889,7 +30987,7 @@ function generateStyle(palette = "DAY", opts = {}) {
|
|
|
30889
30987
|
}
|
|
30890
30988
|
}
|
|
30891
30989
|
if (opts.labels === "placename") {
|
|
30892
|
-
labelLayers.push(...buildPlaceNameLayers(sourceId));
|
|
30990
|
+
labelLayers.push(...buildPlaceNameLayers(sourceId, palette));
|
|
30893
30991
|
} else {
|
|
30894
30992
|
for (const { objectClass, label } of bundles) {
|
|
30895
30993
|
if (!label) continue;
|
|
@@ -31574,6 +31672,69 @@ function generateCustomStyle(config, opts = {}) {
|
|
|
31574
31672
|
return { style, palette, themeFellBack };
|
|
31575
31673
|
}
|
|
31576
31674
|
|
|
31675
|
+
// src/atlas/depth-area-opaque.ts
|
|
31676
|
+
var OPAQUE_SPLIT_OF = "chrt:opaqueSplitOf";
|
|
31677
|
+
function depthAreaClassLayerId(baseId, token) {
|
|
31678
|
+
return `chrt-${token.toLowerCase()}-of-${baseId.replace(/-band(\d)/g, "-b$1")}`;
|
|
31679
|
+
}
|
|
31680
|
+
function depthAreaSplitIds(baseId) {
|
|
31681
|
+
return [...DEPARE_FILL_BRANCH_TOKENS].reverse().map((token) => depthAreaClassLayerId(baseId, token));
|
|
31682
|
+
}
|
|
31683
|
+
var CLASS_LAYER_ID = new RegExp(
|
|
31684
|
+
`^chrt-(?:${DEPARE_FILL_BRANCH_TOKENS.map((t) => t.toLowerCase()).join("|")})-of-`
|
|
31685
|
+
);
|
|
31686
|
+
function isDepthAreaClassLayerId(id) {
|
|
31687
|
+
return CLASS_LAYER_ID.test(id);
|
|
31688
|
+
}
|
|
31689
|
+
function opaqueSplitBaseOf(layer) {
|
|
31690
|
+
const meta = layer.metadata;
|
|
31691
|
+
const base = meta?.[OPAQUE_SPLIT_OF];
|
|
31692
|
+
return typeof base === "string" ? base : null;
|
|
31693
|
+
}
|
|
31694
|
+
function exclusiveBranches(expression) {
|
|
31695
|
+
if (!Array.isArray(expression) || expression[0] !== "case") return null;
|
|
31696
|
+
if ((expression.length - 2) / 2 !== DEPARE_FILL_BRANCH_TOKENS.length) return null;
|
|
31697
|
+
const branches = [];
|
|
31698
|
+
const earlier = [];
|
|
31699
|
+
for (let i = 1; i < expression.length - 1; i += 2) {
|
|
31700
|
+
const colour = expression[i + 1];
|
|
31701
|
+
if (typeof colour !== "string") return null;
|
|
31702
|
+
branches.push({ when: [...earlier.map((c) => ["!", c]), expression[i]], colour });
|
|
31703
|
+
earlier.push(expression[i]);
|
|
31704
|
+
}
|
|
31705
|
+
const fallback = expression[expression.length - 1];
|
|
31706
|
+
if (typeof fallback !== "string") return null;
|
|
31707
|
+
return { branches, fallback };
|
|
31708
|
+
}
|
|
31709
|
+
function andFilter(base, terms) {
|
|
31710
|
+
if (Array.isArray(base) && base[0] === "all") return ["all", ...base.slice(1), ...terms];
|
|
31711
|
+
if (base === void 0) return ["all", ...terms];
|
|
31712
|
+
return ["all", base, ...terms];
|
|
31713
|
+
}
|
|
31714
|
+
function splitOpaqueDepthAreas(layers) {
|
|
31715
|
+
const out = [];
|
|
31716
|
+
for (const raw of layers) {
|
|
31717
|
+
const layer = raw;
|
|
31718
|
+
const paint = layer.paint ?? {};
|
|
31719
|
+
const split = layer.type === "fill" && layer.metadata?.["s52:objectClass"] === "DEPARE" && paint["fill-pattern"] === void 0 && (paint["fill-opacity"] === void 0 || paint["fill-opacity"] === 1) ? exclusiveBranches(paint["fill-color"]) : null;
|
|
31720
|
+
if (split === null) {
|
|
31721
|
+
out.push(raw);
|
|
31722
|
+
continue;
|
|
31723
|
+
}
|
|
31724
|
+
out.push({ ...layer, paint: { ...paint, "fill-color": split.fallback } });
|
|
31725
|
+
for (let k = split.branches.length - 1; k >= 0; k -= 1) {
|
|
31726
|
+
out.push({
|
|
31727
|
+
...layer,
|
|
31728
|
+
id: depthAreaClassLayerId(layer.id, DEPARE_FILL_BRANCH_TOKENS[k]),
|
|
31729
|
+
filter: andFilter(layer.filter, split.branches[k].when),
|
|
31730
|
+
paint: { ...paint, "fill-color": split.branches[k].colour },
|
|
31731
|
+
metadata: { ...layer.metadata ?? {}, [OPAQUE_SPLIT_OF]: layer.id }
|
|
31732
|
+
});
|
|
31733
|
+
}
|
|
31734
|
+
}
|
|
31735
|
+
return out;
|
|
31736
|
+
}
|
|
31737
|
+
|
|
31577
31738
|
// src/pagination.ts
|
|
31578
31739
|
async function* paginate(fetchPage, getItems, getTotalCount, options) {
|
|
31579
31740
|
const pageSize = options?.pageSize ?? 100;
|
|
@@ -32043,6 +32204,8 @@ var Chrt = class {
|
|
|
32043
32204
|
DEFAULT_TILE_BASE_URL,
|
|
32044
32205
|
DEFAULT_TILE_REGION,
|
|
32045
32206
|
DEFAULT_WATER_BODY_SETTINGS,
|
|
32207
|
+
DEPARE_FILL_BRANCH_TOKENS,
|
|
32208
|
+
DEPARE_FILL_FALLBACK_TOKEN,
|
|
32046
32209
|
DRAPEABLE_LAYER_TYPES,
|
|
32047
32210
|
INSPECT_CLASS_RANK,
|
|
32048
32211
|
INSPECT_RANK_DEVIATIONS,
|
|
@@ -32062,8 +32225,11 @@ var Chrt = class {
|
|
|
32062
32225
|
NAUTICAL_SYMBOLS,
|
|
32063
32226
|
NAV_AID_LAYER_GROUPS,
|
|
32064
32227
|
NAV_AID_QUERY_LAYERS,
|
|
32228
|
+
NIGHT_INK,
|
|
32229
|
+
NIGHT_MUTED_INK,
|
|
32065
32230
|
NON_SOLAS_DISCLAIMER,
|
|
32066
32231
|
NON_SOLAS_DISCLAIMER_SHORT,
|
|
32232
|
+
OPAQUE_SPLIT_OF,
|
|
32067
32233
|
OfflineError,
|
|
32068
32234
|
OfflineStyleError,
|
|
32069
32235
|
PLACENAME_LAND_CLASSES,
|
|
@@ -32132,13 +32298,16 @@ var Chrt = class {
|
|
|
32132
32298
|
buildSectorsFromFeatures,
|
|
32133
32299
|
buildSources,
|
|
32134
32300
|
candidateRank,
|
|
32301
|
+
capLuminance,
|
|
32135
32302
|
cellBandCharacters,
|
|
32136
32303
|
cellBandMatch,
|
|
32137
32304
|
chrtAtonTintExpression,
|
|
32305
|
+
chrtHouseColor,
|
|
32138
32306
|
chrtLightTintExpression,
|
|
32139
32307
|
collectCandidates,
|
|
32140
32308
|
collectClickCandidates,
|
|
32141
32309
|
combineWithBandFilter,
|
|
32310
|
+
contrastRatio,
|
|
32142
32311
|
daymarkColor,
|
|
32143
32312
|
decimateFeatures,
|
|
32144
32313
|
decodeAreaFeatureProps,
|
|
@@ -32147,6 +32316,8 @@ var Chrt = class {
|
|
|
32147
32316
|
decodeNavAidProps,
|
|
32148
32317
|
depareColor,
|
|
32149
32318
|
depareFillExpression,
|
|
32319
|
+
depthAreaClassLayerId,
|
|
32320
|
+
depthAreaSplitIds,
|
|
32150
32321
|
deriveMarinerName,
|
|
32151
32322
|
drapeHalves,
|
|
32152
32323
|
drapedFirst,
|
|
@@ -32182,6 +32353,7 @@ var Chrt = class {
|
|
|
32182
32353
|
hazardColor,
|
|
32183
32354
|
hazardFillExpression,
|
|
32184
32355
|
iconExpressionForFamily,
|
|
32356
|
+
isDepthAreaClassLayerId,
|
|
32185
32357
|
isDrapeable,
|
|
32186
32358
|
isLabelLayerVisible,
|
|
32187
32359
|
isNavAidLayer,
|
|
@@ -32199,6 +32371,7 @@ var Chrt = class {
|
|
|
32199
32371
|
lightsIconExpression,
|
|
32200
32372
|
normalizeStyleMode,
|
|
32201
32373
|
normalizeTheme,
|
|
32374
|
+
opaqueSplitBaseOf,
|
|
32202
32375
|
paginate,
|
|
32203
32376
|
parseListCodes,
|
|
32204
32377
|
parseSigseqTerms,
|
|
@@ -32210,6 +32383,7 @@ var Chrt = class {
|
|
|
32210
32383
|
preprocessSoundings,
|
|
32211
32384
|
preprocessWaterBodies,
|
|
32212
32385
|
rasterAtonIconExpression,
|
|
32386
|
+
relativeLuminance,
|
|
32213
32387
|
resolveColor,
|
|
32214
32388
|
resolveCustomTheme,
|
|
32215
32389
|
resolveRasterImage,
|
|
@@ -32219,11 +32393,14 @@ var Chrt = class {
|
|
|
32219
32393
|
rhythmProperties,
|
|
32220
32394
|
s101ArtworkProvenance,
|
|
32221
32395
|
sanitizeCustomStyleConfig,
|
|
32396
|
+
scaleLinearLight,
|
|
32222
32397
|
scaleSizeValue,
|
|
32223
32398
|
scaminToMinZoom,
|
|
32224
32399
|
sectorLimitToArcBearing,
|
|
32400
|
+
splitOpaqueDepthAreas,
|
|
32225
32401
|
styleModeBand,
|
|
32226
32402
|
terrainStackCount,
|
|
32403
|
+
themeChrtGlyph,
|
|
32227
32404
|
tileTemplate,
|
|
32228
32405
|
uncoveredSectorArcs,
|
|
32229
32406
|
withinBboxFilter,
|