@chrtco/sdk 0.10.11 → 0.10.13
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/index.cjs +217 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +120 -11
- package/dist/index.d.ts +120 -11
- package/dist/index.js +206 -45
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5271,16 +5271,23 @@ function patternSpriteId(patternName) {
|
|
|
5271
5271
|
// src/atlas/s52-conditional.ts
|
|
5272
5272
|
var DEFAULT_SAFETY_CONTOUR_M = 10;
|
|
5273
5273
|
var DEPARE_DEEP_CUT_M = 18.2;
|
|
5274
|
-
|
|
5274
|
+
var DEPARE_SHALLOW_CUT_M = 2;
|
|
5275
|
+
function effectiveSafetyContour(safetyContourM) {
|
|
5276
|
+
if (!Number.isFinite(safetyContourM)) return DEFAULT_SAFETY_CONTOUR_M;
|
|
5277
|
+
return Math.min(Math.max(safetyContourM, DEPARE_SHALLOW_CUT_M), DEPARE_DEEP_CUT_M);
|
|
5278
|
+
}
|
|
5279
|
+
function depareColor(props, ct = "DAY", safetyContourM = DEFAULT_SAFETY_CONTOUR_M) {
|
|
5275
5280
|
const drval1 = Number(props.DRVAL1 ?? props.drval1 ?? -1);
|
|
5276
5281
|
const drval2 = Number(props.DRVAL2 ?? props.drval2 ?? drval1);
|
|
5282
|
+
const safety = effectiveSafetyContour(safetyContourM);
|
|
5277
5283
|
if (drval1 < 0 && drval2 <= 0) return resolveColor("DEPIT", ct);
|
|
5278
|
-
if (drval1 <
|
|
5279
|
-
if (drval1 <
|
|
5284
|
+
if (drval1 < DEPARE_SHALLOW_CUT_M) return resolveColor("DEPVS", ct);
|
|
5285
|
+
if (drval1 < safety) return resolveColor("DEPMS", ct);
|
|
5280
5286
|
if (drval1 < DEPARE_DEEP_CUT_M) return resolveColor("DEPMD", ct);
|
|
5281
5287
|
return resolveColor("DEPDW", ct);
|
|
5282
5288
|
}
|
|
5283
|
-
function depareFillExpression(ct = "DAY") {
|
|
5289
|
+
function depareFillExpression(ct = "DAY", safetyContourM = DEFAULT_SAFETY_CONTOUR_M) {
|
|
5290
|
+
const safety = effectiveSafetyContour(safetyContourM);
|
|
5284
5291
|
return [
|
|
5285
5292
|
"case",
|
|
5286
5293
|
[
|
|
@@ -5289,9 +5296,9 @@ function depareFillExpression(ct = "DAY") {
|
|
|
5289
5296
|
["<=", ["coalesce", ["get", "DRVAL2"], ["get", "drval2"], 0], 0]
|
|
5290
5297
|
],
|
|
5291
5298
|
resolveColor("DEPIT", ct),
|
|
5292
|
-
["<", ["coalesce", ["get", "DRVAL1"], ["get", "drval1"], -1],
|
|
5299
|
+
["<", ["coalesce", ["get", "DRVAL1"], ["get", "drval1"], -1], DEPARE_SHALLOW_CUT_M],
|
|
5293
5300
|
resolveColor("DEPVS", ct),
|
|
5294
|
-
["<", ["coalesce", ["get", "DRVAL1"], ["get", "drval1"], -1],
|
|
5301
|
+
["<", ["coalesce", ["get", "DRVAL1"], ["get", "drval1"], -1], safety],
|
|
5295
5302
|
resolveColor("DEPMS", ct),
|
|
5296
5303
|
["<", ["coalesce", ["get", "DRVAL1"], ["get", "drval1"], -1], DEPARE_DEEP_CUT_M],
|
|
5297
5304
|
resolveColor("DEPMD", ct),
|
|
@@ -22070,15 +22077,32 @@ function isVisibleInMode(displayCategory, mode) {
|
|
|
22070
22077
|
if (mode === "STANDARD") return displayCategory === "BASE" || displayCategory === "STANDARD";
|
|
22071
22078
|
return displayCategory === "BASE";
|
|
22072
22079
|
}
|
|
22080
|
+
var SCAMIN_ZOOM_BUCKETS = [
|
|
22081
|
+
[12e3, 14],
|
|
22082
|
+
[22e3, 12],
|
|
22083
|
+
[45e3, 11],
|
|
22084
|
+
[9e4, 10],
|
|
22085
|
+
[35e4, 8],
|
|
22086
|
+
[15e5, 6]
|
|
22087
|
+
];
|
|
22073
22088
|
function scaminToMinZoom(scamin) {
|
|
22074
22089
|
if (scamin === void 0 || scamin === null || scamin === 0) return void 0;
|
|
22075
|
-
|
|
22076
|
-
|
|
22077
|
-
|
|
22078
|
-
|
|
22079
|
-
|
|
22080
|
-
|
|
22081
|
-
|
|
22090
|
+
let zoom;
|
|
22091
|
+
for (const [denom, z] of SCAMIN_ZOOM_BUCKETS) {
|
|
22092
|
+
if (scamin >= denom) zoom = z;
|
|
22093
|
+
}
|
|
22094
|
+
return zoom;
|
|
22095
|
+
}
|
|
22096
|
+
function scaminZoomGateFilter() {
|
|
22097
|
+
const step = [
|
|
22098
|
+
"step",
|
|
22099
|
+
["to-number", ["coalesce", ["get", "SCAMIN"], ["get", "scamin"], 0]],
|
|
22100
|
+
0
|
|
22101
|
+
];
|
|
22102
|
+
for (const [denom, z] of SCAMIN_ZOOM_BUCKETS) {
|
|
22103
|
+
step.push(denom, z);
|
|
22104
|
+
}
|
|
22105
|
+
return [">=", ["zoom"], step];
|
|
22082
22106
|
}
|
|
22083
22107
|
var SAFETY_CRITICAL_GROUPS = /* @__PURE__ */ new Set([24020, 27010, 27070, 27080]);
|
|
22084
22108
|
var OPAQUE_FILL_LAYERS = /* @__PURE__ */ new Set(["DEPARE", "LNDARE", "UNSARE", "LAKARE", "DRGARE", "SEAARE"]);
|
|
@@ -22112,7 +22136,7 @@ var ZOOM_SCALED_LINES = {
|
|
|
22112
22136
|
BRIDGE: [8, 1, 14, 2],
|
|
22113
22137
|
DAMCON: [8, 1, 14, 2]
|
|
22114
22138
|
};
|
|
22115
|
-
function resolvePaint(layerName, paint, geomType, ct = "DAY") {
|
|
22139
|
+
function resolvePaint(layerName, paint, geomType, ct = "DAY", opts = {}) {
|
|
22116
22140
|
const resolved = {};
|
|
22117
22141
|
for (const [key, value] of Object.entries(paint)) {
|
|
22118
22142
|
if (typeof value === "string" && /^[A-Z]{4,5}[0-9]?$/.test(value)) {
|
|
@@ -22122,7 +22146,7 @@ function resolvePaint(layerName, paint, geomType, ct = "DAY") {
|
|
|
22122
22146
|
}
|
|
22123
22147
|
}
|
|
22124
22148
|
if (layerName === "DEPARE" && geomType === "fill") {
|
|
22125
|
-
resolved["fill-color"] = depareFillExpression(ct);
|
|
22149
|
+
resolved["fill-color"] = depareFillExpression(ct, opts.safetyContour);
|
|
22126
22150
|
} else if (layerName === "LIGHTS" && geomType === "circle") {
|
|
22127
22151
|
resolved["circle-color"] = lightFillExpression(ct);
|
|
22128
22152
|
} else if ((layerName === "BOYLAT" || layerName === "BCNLAT") && geomType === "circle") {
|
|
@@ -22134,7 +22158,7 @@ function resolvePaint(layerName, paint, geomType, ct = "DAY") {
|
|
|
22134
22158
|
}
|
|
22135
22159
|
return resolved;
|
|
22136
22160
|
}
|
|
22137
|
-
function resolveStyle(layerName, geomKind, ct = "DAY") {
|
|
22161
|
+
function resolveStyle(layerName, geomKind, ct = "DAY", opts = {}) {
|
|
22138
22162
|
const entry = S52_LOOKUP[layerName];
|
|
22139
22163
|
if (!entry) {
|
|
22140
22164
|
const type = geomKind ?? "circle";
|
|
@@ -22170,7 +22194,7 @@ function resolveStyle(layerName, geomKind, ct = "DAY") {
|
|
|
22170
22194
|
const paint2 = effectiveType === "fill" ? { "fill-color": hexColor, "fill-opacity": 0.3 } : effectiveType === "line" ? { "line-color": hexColor, "line-width": 1 } : { "circle-color": hexColor, "circle-radius": 3, "circle-stroke-width": 0 };
|
|
22171
22195
|
return { type: effectiveType, paint: paint2 };
|
|
22172
22196
|
}
|
|
22173
|
-
const paint = resolvePaint(layerName, { ...entry.style.paint }, effectiveType, ct);
|
|
22197
|
+
const paint = resolvePaint(layerName, { ...entry.style.paint }, effectiveType, ct, opts);
|
|
22174
22198
|
if (effectiveType === "fill" && OPAQUE_FILL_LAYERS.has(layerName)) {
|
|
22175
22199
|
paint["fill-opacity"] = 1;
|
|
22176
22200
|
}
|
|
@@ -23119,21 +23143,19 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
23119
23143
|
layout: orientationLabelLayout({
|
|
23120
23144
|
"text-letter-spacing": 0.15,
|
|
23121
23145
|
"text-max-width": 9,
|
|
23122
|
-
// SEAARE
|
|
23123
|
-
//
|
|
23124
|
-
//
|
|
23125
|
-
//
|
|
23126
|
-
//
|
|
23127
|
-
//
|
|
23128
|
-
//
|
|
23129
|
-
//
|
|
23130
|
-
//
|
|
23131
|
-
//
|
|
23132
|
-
//
|
|
23133
|
-
//
|
|
23134
|
-
|
|
23135
|
-
"text-ignore-placement": true,
|
|
23136
|
-
"text-optional": false,
|
|
23146
|
+
// SEAARE was always-paint (allow-overlap + ignore-placement)
|
|
23147
|
+
// because collision starved big-water names at z8. That trade
|
|
23148
|
+
// inverted in the field on 2026-08-21: the always-paint copies —
|
|
23149
|
+
// per band, per adjacent cell, and one per TILE-CLIPPED piece of
|
|
23150
|
+
// a big polygon — stack into unreadable black smears (dozens of
|
|
23151
|
+
// "Chesapeake Bay" at z9, owner screenshot). With collision ON
|
|
23152
|
+
// the duplicates collide with EACH OTHER, so MapLibre keeps one
|
|
23153
|
+
// and drops the rest: a possibly-starved name beats an illegible
|
|
23154
|
+
// smear categorically. This is the interim state until the
|
|
23155
|
+
// PLACENAME layer (one anchor per named place, PR #1308) reaches
|
|
23156
|
+
// the tiles and replaces this fan outright — do not restore
|
|
23157
|
+
// always-paint on a starvation report; flip `labels: "placename"`
|
|
23158
|
+
// instead once the build carries the layer.
|
|
23137
23159
|
"text-padding": 2
|
|
23138
23160
|
})
|
|
23139
23161
|
};
|
|
@@ -23826,6 +23848,102 @@ function computePolygonCentroid(geom) {
|
|
|
23826
23848
|
}
|
|
23827
23849
|
return [sumX / coords.length, sumY / coords.length];
|
|
23828
23850
|
}
|
|
23851
|
+
var PLACENAME_SOURCE_LAYER = "PLACENAME";
|
|
23852
|
+
var PLACENAME_WATER_CLASSES = [
|
|
23853
|
+
"SEAARE",
|
|
23854
|
+
"LAKARE",
|
|
23855
|
+
"RIVERS",
|
|
23856
|
+
"CANALS",
|
|
23857
|
+
"PRDARE"
|
|
23858
|
+
];
|
|
23859
|
+
var PLACENAME_LAND_CLASSES = [
|
|
23860
|
+
"LNDRGN",
|
|
23861
|
+
"LNDARE",
|
|
23862
|
+
"BUAARE",
|
|
23863
|
+
"AIRARE"
|
|
23864
|
+
];
|
|
23865
|
+
var PLACENAME_FITS = ["<=", ["coalesce", ["get", "min_z"], 0], ["zoom"]];
|
|
23866
|
+
var PLACENAME_RETIRES = [">=", ["coalesce", ["get", "max_z"], 14], ["zoom"]];
|
|
23867
|
+
var PLACENAME_TIER = [
|
|
23868
|
+
"to-number",
|
|
23869
|
+
["coalesce", ["get", "tier"], 9]
|
|
23870
|
+
];
|
|
23871
|
+
var PLACENAME_TEXT_OPACITY = [
|
|
23872
|
+
"interpolate",
|
|
23873
|
+
["linear"],
|
|
23874
|
+
["zoom"],
|
|
23875
|
+
3,
|
|
23876
|
+
0.55,
|
|
23877
|
+
9,
|
|
23878
|
+
0.5,
|
|
23879
|
+
12,
|
|
23880
|
+
0.4,
|
|
23881
|
+
16,
|
|
23882
|
+
0.3
|
|
23883
|
+
];
|
|
23884
|
+
var PLACENAME_WATER_SIZE_STOPS = [
|
|
23885
|
+
[3, [14, 9, 0, 0, 0, 0, 0, 0, 0, 0]],
|
|
23886
|
+
[5, [16, 13, 9, 0, 0, 0, 0, 0, 0, 0]],
|
|
23887
|
+
[7, [14, 14, 12, 9, 0, 0, 0, 0, 0, 0]],
|
|
23888
|
+
[9, [12, 13, 14, 11, 10, 9, 0, 9, 9, 9]],
|
|
23889
|
+
[11, [10, 12, 13, 12, 10, 9, 9, 11, 11, 9]],
|
|
23890
|
+
[13, [9, 11, 12, 11, 10, 10, 10, 11, 11, 10]],
|
|
23891
|
+
[16, [9, 10, 11, 10, 9, 9, 9, 10, 10, 9]]
|
|
23892
|
+
];
|
|
23893
|
+
var PLACENAME_LAND_SIZE_STOPS = [
|
|
23894
|
+
[3, [0, 0, 11, 0, 0, 0, 0, 0, 0, 0]],
|
|
23895
|
+
[5, [0, 0, 13, 0, 0, 0, 0, 0, 0, 0]],
|
|
23896
|
+
[7, [0, 0, 13, 9, 9, 0, 0, 0, 0, 0]],
|
|
23897
|
+
[9, [0, 0, 12, 12, 11, 0, 0, 0, 0, 0]],
|
|
23898
|
+
[11, [0, 0, 11, 12, 11, 9, 9, 0, 0, 9]],
|
|
23899
|
+
[13, [0, 0, 10, 11, 10, 11, 10, 10, 10, 10]],
|
|
23900
|
+
[16, [0, 0, 10, 10, 9, 10, 9, 9, 9, 9]]
|
|
23901
|
+
];
|
|
23902
|
+
function buildPlaceNameLayers(sourceId) {
|
|
23903
|
+
const sortKey = ["to-number", ["coalesce", ["get", "rank"], 9999999]];
|
|
23904
|
+
const make = (idSuffix, classes, font, haloColor, letterSpacing, stops) => ({
|
|
23905
|
+
id: `chrt-placename-${idSuffix}`,
|
|
23906
|
+
type: "symbol",
|
|
23907
|
+
source: sourceId,
|
|
23908
|
+
"source-layer": PLACENAME_SOURCE_LAYER,
|
|
23909
|
+
minzoom: 3,
|
|
23910
|
+
filter: [
|
|
23911
|
+
"all",
|
|
23912
|
+
["match", ["get", "cls"], [...classes], true, false],
|
|
23913
|
+
PLACENAME_FITS,
|
|
23914
|
+
PLACENAME_RETIRES
|
|
23915
|
+
],
|
|
23916
|
+
layout: {
|
|
23917
|
+
"text-field": ["get", "name"],
|
|
23918
|
+
"text-font": font,
|
|
23919
|
+
"text-size": tieredSizeCurve(PLACENAME_TIER, stops),
|
|
23920
|
+
"text-letter-spacing": letterSpacing,
|
|
23921
|
+
"text-max-width": 9,
|
|
23922
|
+
"text-padding": 4,
|
|
23923
|
+
"text-allow-overlap": false,
|
|
23924
|
+
"text-ignore-placement": false,
|
|
23925
|
+
"text-optional": true,
|
|
23926
|
+
"text-variable-anchor": ["center", "top", "bottom", "left", "right"],
|
|
23927
|
+
"text-radial-offset": 0.3,
|
|
23928
|
+
"text-justify": "auto",
|
|
23929
|
+
"symbol-sort-key": sortKey
|
|
23930
|
+
},
|
|
23931
|
+
paint: {
|
|
23932
|
+
"text-color": DARK_BG,
|
|
23933
|
+
"text-halo-color": haloColor,
|
|
23934
|
+
"text-halo-width": ORIENTATION_HALO_WIDTH,
|
|
23935
|
+
"text-opacity": PLACENAME_TEXT_OPACITY
|
|
23936
|
+
},
|
|
23937
|
+
metadata: {
|
|
23938
|
+
"chrt:placename": true,
|
|
23939
|
+
"chrt:labelPriority": ORIENTATION_LABEL_PRIORITY
|
|
23940
|
+
}
|
|
23941
|
+
});
|
|
23942
|
+
return [
|
|
23943
|
+
make("water", PLACENAME_WATER_CLASSES, ["Open Sans Italic"], COLOR.WATER_DEEP, 0.05, PLACENAME_WATER_SIZE_STOPS),
|
|
23944
|
+
make("land", PLACENAME_LAND_CLASSES, ["Open Sans Regular"], COLOR.LAND_REGION, 0.02, PLACENAME_LAND_SIZE_STOPS)
|
|
23945
|
+
];
|
|
23946
|
+
}
|
|
23829
23947
|
|
|
23830
23948
|
// src/atlas/feature-decimation.ts
|
|
23831
23949
|
function getGridSizeForZoom(zoom) {
|
|
@@ -26644,6 +26762,13 @@ function buildSources(opts = {}) {
|
|
|
26644
26762
|
}
|
|
26645
26763
|
|
|
26646
26764
|
// src/atlas/layer-builder.ts
|
|
26765
|
+
var SCAMIN_DECLUTTER_CLASSES = /* @__PURE__ */ new Set([
|
|
26766
|
+
"OFSPLF",
|
|
26767
|
+
"PIPSOL",
|
|
26768
|
+
"PIPARE",
|
|
26769
|
+
"CBLSUB",
|
|
26770
|
+
"CBLARE"
|
|
26771
|
+
]);
|
|
26647
26772
|
var GEOM_FILTERS = {
|
|
26648
26773
|
fill: ["any", ["==", ["geometry-type"], "Polygon"], ["==", ["geometry-type"], "MultiPolygon"]],
|
|
26649
26774
|
line: ["any", ["==", ["geometry-type"], "LineString"], ["==", ["geometry-type"], "MultiLineString"]],
|
|
@@ -26802,7 +26927,7 @@ function buildLayersForClass(objectClass, ct, sourceId = DEFAULT_REGION, opts =
|
|
|
26802
26927
|
const layers = [];
|
|
26803
26928
|
const geomTypes = getGeomTypesForClass(objectClass, entry?.style.type);
|
|
26804
26929
|
for (const geomType of geomTypes) {
|
|
26805
|
-
const resolved = resolveStyle(objectClass, geomType, ct);
|
|
26930
|
+
const resolved = resolveStyle(objectClass, geomType, ct, { safetyContour: opts.safetyContour });
|
|
26806
26931
|
const layerId = `s52-${objectClass}-${resolved.type}`;
|
|
26807
26932
|
const layer = {
|
|
26808
26933
|
id: layerId,
|
|
@@ -26821,6 +26946,9 @@ function buildLayersForClass(objectClass, ct, sourceId = DEFAULT_REGION, opts =
|
|
|
26821
26946
|
} else if (GEOM_FILTERS[resolved.type]) {
|
|
26822
26947
|
layer.filter = GEOM_FILTERS[resolved.type];
|
|
26823
26948
|
}
|
|
26949
|
+
if (SCAMIN_DECLUTTER_CLASSES.has(objectClass)) {
|
|
26950
|
+
layer.filter = layer.filter ? ["all", layer.filter, scaminZoomGateFilter()] : ["all", scaminZoomGateFilter()];
|
|
26951
|
+
}
|
|
26824
26952
|
if (resolved.minzoom) {
|
|
26825
26953
|
layer.minzoom = resolved.minzoom;
|
|
26826
26954
|
}
|
|
@@ -28116,6 +28244,18 @@ function isExemptOpaqueFill(layer) {
|
|
|
28116
28244
|
}
|
|
28117
28245
|
return false;
|
|
28118
28246
|
}
|
|
28247
|
+
var FILL_FLOOR_FREE_BANDS = /* @__PURE__ */ new Set([
|
|
28248
|
+
"1",
|
|
28249
|
+
"2",
|
|
28250
|
+
"3"
|
|
28251
|
+
]);
|
|
28252
|
+
function bandVariantMinzoom(layer, B) {
|
|
28253
|
+
const classMinzoom = layer.minzoom ?? 0;
|
|
28254
|
+
if (isExemptOpaqueFill(layer) && FILL_FLOOR_FREE_BANDS.has(B)) {
|
|
28255
|
+
return classMinzoom;
|
|
28256
|
+
}
|
|
28257
|
+
return Math.max(classMinzoom, BAND_PRIORITY_RANGES[B].minzoom);
|
|
28258
|
+
}
|
|
28119
28259
|
var BAND_DRAW_ORDER = ["1", "2", "3", "4", "5", "6"];
|
|
28120
28260
|
var CHART_BAND_CODES = {
|
|
28121
28261
|
Overview: ["1"],
|
|
@@ -28234,9 +28374,7 @@ function collapsedDominanceGate(B, minzoom) {
|
|
|
28234
28374
|
return ["any", ...clauses];
|
|
28235
28375
|
}
|
|
28236
28376
|
function makeCollapsedBandVariant(layer, B, isExempt) {
|
|
28237
|
-
const
|
|
28238
|
-
const classMinzoom = layer.minzoom ?? 0;
|
|
28239
|
-
const minzoom = isExemptOpaqueFill(layer) ? classMinzoom : Math.max(classMinzoom, range.minzoom);
|
|
28377
|
+
const minzoom = bandVariantMinzoom(layer, B);
|
|
28240
28378
|
if (isExempt) {
|
|
28241
28379
|
const exempt = {
|
|
28242
28380
|
...layer,
|
|
@@ -28375,8 +28513,7 @@ function isDominanceExempt(layer) {
|
|
|
28375
28513
|
var TOP_STACK_LIGHT_CLASSES = /* @__PURE__ */ new Set(["LIGHTS"]);
|
|
28376
28514
|
function makeBandVariants(layer, B) {
|
|
28377
28515
|
const range = BAND_PRIORITY_RANGES[B];
|
|
28378
|
-
const
|
|
28379
|
-
const minzoom = isExemptOpaqueFill(layer) ? classMinzoom : Math.max(classMinzoom, range.minzoom);
|
|
28516
|
+
const minzoom = bandVariantMinzoom(layer, B);
|
|
28380
28517
|
const variants = [];
|
|
28381
28518
|
if (isDominanceExempt(layer)) {
|
|
28382
28519
|
const exempt = {
|
|
@@ -28606,9 +28743,12 @@ function generateStyle(palette = "DAY", opts = {}) {
|
|
|
28606
28743
|
emitChartFeatureVariants(topLightBundles);
|
|
28607
28744
|
const chartLabelBundles = byLabelPriorityBottomUp(
|
|
28608
28745
|
bundles.filter(
|
|
28609
|
-
(b) => b.label !== null
|
|
28746
|
+
(b) => b.label !== null && (opts.labels !== "placename" || getLabelBehavior(b.objectClass) !== "orientation-cross-band")
|
|
28610
28747
|
)
|
|
28611
28748
|
);
|
|
28749
|
+
if (opts.labels === "placename") {
|
|
28750
|
+
labelLayers.push(...buildPlaceNameLayers(sourceId));
|
|
28751
|
+
}
|
|
28612
28752
|
for (const { label } of chartLabelBundles) {
|
|
28613
28753
|
if (bandFan === "collapsed") {
|
|
28614
28754
|
labelLayers.push(
|
|
@@ -28653,10 +28793,14 @@ function generateStyle(palette = "DAY", opts = {}) {
|
|
|
28653
28793
|
}
|
|
28654
28794
|
}
|
|
28655
28795
|
}
|
|
28656
|
-
|
|
28657
|
-
|
|
28658
|
-
|
|
28659
|
-
|
|
28796
|
+
if (opts.labels === "placename") {
|
|
28797
|
+
labelLayers.push(...buildPlaceNameLayers(sourceId));
|
|
28798
|
+
} else {
|
|
28799
|
+
for (const { objectClass, label } of bundles) {
|
|
28800
|
+
if (!label) continue;
|
|
28801
|
+
if (getLabelBehavior(objectClass) === "orientation-cross-band") {
|
|
28802
|
+
labelLayers.push(...fanOrientationLabelByCellBand(label, bandFan));
|
|
28803
|
+
}
|
|
28660
28804
|
}
|
|
28661
28805
|
}
|
|
28662
28806
|
const featureLabelBundles = byLabelPriorityBottomUp(
|
|
@@ -28677,6 +28821,12 @@ function generateStyle(palette = "DAY", opts = {}) {
|
|
|
28677
28821
|
}
|
|
28678
28822
|
const symbolSet = opts.symbolSet ?? "s52";
|
|
28679
28823
|
const spriteBase = `${opts.tileBaseUrl ?? "https://tiles.chrt.co"}/v1/sprites`;
|
|
28824
|
+
const isLndareFill = (l) => /^s52-LNDARE-fill-band\d+$/.test(l.id);
|
|
28825
|
+
const emitted = opts.land ? (() => {
|
|
28826
|
+
const fills = layers.filter(isLndareFill);
|
|
28827
|
+
const rest = layers.filter((l) => !isLndareFill(l));
|
|
28828
|
+
return [rest[0], ...fills, ...rest.slice(1)];
|
|
28829
|
+
})() : layers;
|
|
28680
28830
|
const style = {
|
|
28681
28831
|
version: 8,
|
|
28682
28832
|
name: `CHRT ${SYMBOL_SET_LABELS[symbolSet]} ${PALETTE_NAMES[palette]}${opts.chartMode ? ` \u2014 chart:${opts.chartMode.band}` : ""}`,
|
|
@@ -28685,7 +28835,7 @@ function generateStyle(palette = "DAY", opts = {}) {
|
|
|
28685
28835
|
"chrt:symbol-set": symbolSet,
|
|
28686
28836
|
"chrt:color-table": palette,
|
|
28687
28837
|
"chrt:generated-at": (/* @__PURE__ */ new Date()).toISOString(),
|
|
28688
|
-
"chrt:layer-count":
|
|
28838
|
+
"chrt:layer-count": emitted.length,
|
|
28689
28839
|
"chrt:land": Boolean(opts.land),
|
|
28690
28840
|
"chrt:relief": Boolean(opts.relief),
|
|
28691
28841
|
"chrt:render-mode": opts.chartMode ? `chart:${opts.chartMode.band}` : "continuous",
|
|
@@ -28708,7 +28858,7 @@ function generateStyle(palette = "DAY", opts = {}) {
|
|
|
28708
28858
|
sprite: `${spriteBase}/${symbolSet}-${palette.toLowerCase()}`
|
|
28709
28859
|
},
|
|
28710
28860
|
glyphs: "https://fonts.openmaptiles.org/{fontstack}/{range}.pbf",
|
|
28711
|
-
layers
|
|
28861
|
+
layers: emitted
|
|
28712
28862
|
};
|
|
28713
28863
|
if (symbolSet === "s101") return applyS101SymbolSet(style);
|
|
28714
28864
|
if (symbolSet === "chrt") return applyChrtSymbolSet(style, palette);
|
|
@@ -29536,6 +29686,9 @@ export {
|
|
|
29536
29686
|
NON_SOLAS_DISCLAIMER_SHORT,
|
|
29537
29687
|
OfflineError,
|
|
29538
29688
|
OfflineStyleError,
|
|
29689
|
+
PLACENAME_LAND_CLASSES,
|
|
29690
|
+
PLACENAME_SOURCE_LAYER,
|
|
29691
|
+
PLACENAME_WATER_CLASSES,
|
|
29539
29692
|
RASTER_ATON_CLASSES,
|
|
29540
29693
|
RASTER_GLYPH_NAMES,
|
|
29541
29694
|
RASTER_ICON_PREFIX,
|
|
@@ -29575,10 +29728,18 @@ export {
|
|
|
29575
29728
|
applyS101SymbolSet,
|
|
29576
29729
|
atonIconExpression,
|
|
29577
29730
|
bandFilterExpression,
|
|
29731
|
+
buildAirportTierExpression,
|
|
29732
|
+
buildBuiltUpAreaTierExpression,
|
|
29578
29733
|
buildFlashPattern,
|
|
29579
29734
|
buildLabelLayer,
|
|
29735
|
+
buildLakeTierExpression,
|
|
29736
|
+
buildLandAreaTierExpression,
|
|
29737
|
+
buildLandRegionTierExpression,
|
|
29580
29738
|
buildLayersForClass,
|
|
29581
29739
|
buildOfflineStyle,
|
|
29740
|
+
buildPlaceNameLayers,
|
|
29741
|
+
buildRiverTierExpression,
|
|
29742
|
+
buildSeaAreaTierExpression,
|
|
29582
29743
|
buildSectorArcGeoJSON,
|
|
29583
29744
|
buildSectorArcsFC,
|
|
29584
29745
|
buildSectorsFromFeatures,
|