@chrtco/sdk 0.7.4 → 0.7.5
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 +278 -227
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +278 -227
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6358,30 +6358,141 @@ function buildSeabedLabelExpression() {
|
|
|
6358
6358
|
const natsurJoined = ["slice", natsurParts, 1];
|
|
6359
6359
|
return ["concat", natquaPrefix, natsurJoined];
|
|
6360
6360
|
}
|
|
6361
|
+
function underseaFeatureNameMatch(objnam) {
|
|
6362
|
+
const terms = [
|
|
6363
|
+
"Canyon",
|
|
6364
|
+
"Seamount",
|
|
6365
|
+
"Ridge",
|
|
6366
|
+
"Basin",
|
|
6367
|
+
"Swell",
|
|
6368
|
+
"Knoll",
|
|
6369
|
+
"Shoal",
|
|
6370
|
+
"Ledge",
|
|
6371
|
+
"Bank",
|
|
6372
|
+
"Valley",
|
|
6373
|
+
"Spur",
|
|
6374
|
+
"Escarpment"
|
|
6375
|
+
];
|
|
6376
|
+
return ["any", ...terms.map((t) => [">=", ["index-of", t, objnam], 0])];
|
|
6377
|
+
}
|
|
6378
|
+
var CATSEA_RELIEF_CODES = [
|
|
6379
|
+
2,
|
|
6380
|
+
// gat
|
|
6381
|
+
3,
|
|
6382
|
+
// bank
|
|
6383
|
+
4,
|
|
6384
|
+
// deep
|
|
6385
|
+
6,
|
|
6386
|
+
// trench
|
|
6387
|
+
7,
|
|
6388
|
+
// basin
|
|
6389
|
+
8,
|
|
6390
|
+
// mud flats
|
|
6391
|
+
9,
|
|
6392
|
+
// reef
|
|
6393
|
+
10,
|
|
6394
|
+
// ledge
|
|
6395
|
+
11,
|
|
6396
|
+
// canyon
|
|
6397
|
+
13,
|
|
6398
|
+
// shoal
|
|
6399
|
+
14,
|
|
6400
|
+
// knoll
|
|
6401
|
+
15,
|
|
6402
|
+
// ridge
|
|
6403
|
+
16,
|
|
6404
|
+
// seamount
|
|
6405
|
+
17,
|
|
6406
|
+
// pinnacle
|
|
6407
|
+
18,
|
|
6408
|
+
// abyssal plain
|
|
6409
|
+
19,
|
|
6410
|
+
// plateau
|
|
6411
|
+
20,
|
|
6412
|
+
// spur
|
|
6413
|
+
21,
|
|
6414
|
+
// shelf
|
|
6415
|
+
22,
|
|
6416
|
+
// trough
|
|
6417
|
+
23,
|
|
6418
|
+
// saddle
|
|
6419
|
+
24,
|
|
6420
|
+
// abyssal hills
|
|
6421
|
+
25,
|
|
6422
|
+
// apron
|
|
6423
|
+
26,
|
|
6424
|
+
// archipelagic apron
|
|
6425
|
+
27,
|
|
6426
|
+
// borderland
|
|
6427
|
+
28,
|
|
6428
|
+
// continental margin
|
|
6429
|
+
29,
|
|
6430
|
+
// continental rise
|
|
6431
|
+
30,
|
|
6432
|
+
// escarpment
|
|
6433
|
+
31,
|
|
6434
|
+
// fan
|
|
6435
|
+
32,
|
|
6436
|
+
// fracture zone
|
|
6437
|
+
33,
|
|
6438
|
+
// gap
|
|
6439
|
+
34,
|
|
6440
|
+
// guyot
|
|
6441
|
+
35,
|
|
6442
|
+
// hill
|
|
6443
|
+
36,
|
|
6444
|
+
// hole
|
|
6445
|
+
37,
|
|
6446
|
+
// hollow
|
|
6447
|
+
39,
|
|
6448
|
+
// levee
|
|
6449
|
+
40,
|
|
6450
|
+
// median valley
|
|
6451
|
+
41,
|
|
6452
|
+
// moat
|
|
6453
|
+
42,
|
|
6454
|
+
// mountains
|
|
6455
|
+
43,
|
|
6456
|
+
// peak
|
|
6457
|
+
44,
|
|
6458
|
+
// province
|
|
6459
|
+
45,
|
|
6460
|
+
// rise
|
|
6461
|
+
47,
|
|
6462
|
+
// seamount chain
|
|
6463
|
+
48,
|
|
6464
|
+
// shelf-edge
|
|
6465
|
+
49,
|
|
6466
|
+
// sill
|
|
6467
|
+
50,
|
|
6468
|
+
// slope
|
|
6469
|
+
51,
|
|
6470
|
+
// terrace
|
|
6471
|
+
52
|
|
6472
|
+
// valley
|
|
6473
|
+
];
|
|
6361
6474
|
function buildSeaAreaTierExpression() {
|
|
6362
|
-
const catsea = ["coalesce", ["get", "CATSEA"], ["get", "catsea"], 0];
|
|
6475
|
+
const catsea = ["to-number", ["coalesce", ["get", "CATSEA"], ["get", "catsea"], 0]];
|
|
6363
6476
|
const objnam = ["coalesce", ["get", "OBJNAM"], ""];
|
|
6364
6477
|
return [
|
|
6365
6478
|
"case",
|
|
6366
|
-
// Tier
|
|
6367
|
-
// anchorage
|
|
6368
|
-
["==", ["to-number", catsea], 31],
|
|
6369
|
-
1,
|
|
6370
|
-
["any", ["==", ["to-number", catsea], 29], ["==", ["to-number", catsea], 30]],
|
|
6371
|
-
2,
|
|
6372
|
-
[
|
|
6373
|
-
"any",
|
|
6374
|
-
["==", ["to-number", catsea], 4],
|
|
6375
|
-
["==", ["to-number", catsea], 11],
|
|
6376
|
-
["==", ["to-number", catsea], 27],
|
|
6377
|
-
["==", ["to-number", catsea], 28]
|
|
6378
|
-
],
|
|
6379
|
-
3,
|
|
6380
|
-
// Tier 4 — Anchorage detail (must be checked before OBJNAM-substring
|
|
6381
|
-
// promotion so "Boston Harbor, MA …" anchorages don't bubble up).
|
|
6479
|
+
// Tier 4 — Anchorage detail (before all promotions so "Boston Harbor,
|
|
6480
|
+
// MA …" anchorage compound names don't bubble up).
|
|
6382
6481
|
[">=", ["index-of", "Anchorage Area", objnam], 0],
|
|
6383
6482
|
4,
|
|
6384
|
-
//
|
|
6483
|
+
// Tier 5 — undersea relief, by authoritative CATSEA code first
|
|
6484
|
+
// (Georges Bank=3, Georges Shoal=13, …), then by name for
|
|
6485
|
+
// uncategorised features. Before promotion shims; see
|
|
6486
|
+
// underseaFeatureNameMatch.
|
|
6487
|
+
["match", catsea, CATSEA_RELIEF_CODES, true, false],
|
|
6488
|
+
5,
|
|
6489
|
+
underseaFeatureNameMatch(objnam),
|
|
6490
|
+
5,
|
|
6491
|
+
// Tier 3 by authoritative CATSEA: bay / narrows.
|
|
6492
|
+
["match", catsea, [5, 12], true, false],
|
|
6493
|
+
3,
|
|
6494
|
+
// OBJNAM promotion shims (CATSEA has no ocean/sea/gulf/sound/strait
|
|
6495
|
+
// codes, so names are the only signal for the headline tiers):
|
|
6385
6496
|
[">=", ["index-of", "Atlantic Ocean", objnam], 0],
|
|
6386
6497
|
1,
|
|
6387
6498
|
[">=", ["index-of", "Pacific Ocean", objnam], 0],
|
|
@@ -6390,9 +6501,6 @@ function buildSeaAreaTierExpression() {
|
|
|
6390
6501
|
1,
|
|
6391
6502
|
[">=", ["index-of", "Gulf of", objnam], 0],
|
|
6392
6503
|
2,
|
|
6393
|
-
// Bay/Sound/Sea/Strait/Channel as a tier-3 shim (matches "Massachusetts
|
|
6394
|
-
// Bay", "Buzzards Bay", "Long Island Sound", "Block Island Sound",
|
|
6395
|
-
// "Vineyard Sound", "Cape Cod Bay", etc. without needing CATSEA).
|
|
6396
6504
|
[">=", ["index-of", " Bay", objnam], 0],
|
|
6397
6505
|
3,
|
|
6398
6506
|
[">=", ["index-of", " Sound", objnam], 0],
|
|
@@ -6426,6 +6534,11 @@ function buildLandRegionTierExpression() {
|
|
|
6426
6534
|
const nameLen = ["length", objnam];
|
|
6427
6535
|
return [
|
|
6428
6536
|
"case",
|
|
6537
|
+
// NOAA also encodes undersea relief names (e.g. "Block Canyon", 12
|
|
6538
|
+
// chars, no comma) as LNDRGN — without this demotion they'd qualify
|
|
6539
|
+
// as tier-1 "major region" and paint at overview zoom.
|
|
6540
|
+
underseaFeatureNameMatch(objnam),
|
|
6541
|
+
2,
|
|
6429
6542
|
["all", ["<=", nameLen, 12], ["==", ["index-of", ",", objnam], -1]],
|
|
6430
6543
|
1,
|
|
6431
6544
|
2
|
|
@@ -6507,6 +6620,36 @@ function orientationLabelLayout(extras = {}) {
|
|
|
6507
6620
|
...extras
|
|
6508
6621
|
};
|
|
6509
6622
|
}
|
|
6623
|
+
function tieredSizeCurve(tierExpr, stops) {
|
|
6624
|
+
const withHolds = [];
|
|
6625
|
+
for (let i = 0; i < stops.length; i++) {
|
|
6626
|
+
if (i > 0) {
|
|
6627
|
+
const [pz, pv] = stops[i - 1];
|
|
6628
|
+
const [nz, nv] = stops[i];
|
|
6629
|
+
if (pv.some((v, t) => v === 0 && nv[t] > 0)) {
|
|
6630
|
+
const hz = Math.round((nz - 0.2) * 10) / 10;
|
|
6631
|
+
if (hz > pz) {
|
|
6632
|
+
const f = (hz - pz) / (nz - pz);
|
|
6633
|
+
withHolds.push([
|
|
6634
|
+
hz,
|
|
6635
|
+
pv.map(
|
|
6636
|
+
(v, t) => v === 0 && nv[t] > 0 ? 0 : Math.round((v + (nv[t] - v) * f) * 10) / 10
|
|
6637
|
+
)
|
|
6638
|
+
]);
|
|
6639
|
+
}
|
|
6640
|
+
}
|
|
6641
|
+
}
|
|
6642
|
+
withHolds.push(stops[i]);
|
|
6643
|
+
}
|
|
6644
|
+
const expr = ["interpolate", ["linear"], ["zoom"]];
|
|
6645
|
+
for (const [z, vals] of withHolds) {
|
|
6646
|
+
const m = ["match", tierExpr];
|
|
6647
|
+
for (let t = 0; t < vals.length - 1; t++) m.push(t + 1, vals[t]);
|
|
6648
|
+
m.push(vals[vals.length - 1]);
|
|
6649
|
+
expr.push(z, m);
|
|
6650
|
+
}
|
|
6651
|
+
return expr;
|
|
6652
|
+
}
|
|
6510
6653
|
var ORIENTATION_HALO_WIDTH = [
|
|
6511
6654
|
"interpolate",
|
|
6512
6655
|
["linear"],
|
|
@@ -6636,35 +6779,23 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
6636
6779
|
}
|
|
6637
6780
|
case "LNDRGN": {
|
|
6638
6781
|
const tierExpr = buildLandRegionTierExpression();
|
|
6639
|
-
const sizeAt = (t1, t2) => [
|
|
6640
|
-
"match",
|
|
6641
|
-
tierExpr,
|
|
6642
|
-
1,
|
|
6643
|
-
t1,
|
|
6644
|
-
2,
|
|
6645
|
-
t2,
|
|
6646
|
-
t2
|
|
6647
|
-
];
|
|
6648
6782
|
return {
|
|
6649
6783
|
type: "symbol",
|
|
6650
6784
|
textField: ["get", "OBJNAM"],
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
11,
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
16,
|
|
6666
|
-
sizeAt(10, 10)
|
|
6667
|
-
],
|
|
6785
|
+
// Tier-1 entry moved from z5 to z7: undersea-relief names without a
|
|
6786
|
+
// generic keyword ("Three Dory", "Outer Fall") can't be demoted by
|
|
6787
|
+
// pattern, so the overview/general bands stay clean by holding ALL
|
|
6788
|
+
// LNDRGN labels until coastal zoom. The Carto basemap already labels
|
|
6789
|
+
// major land regions at z5-z6. Columns: t1 major region, t2 local
|
|
6790
|
+
// point (also the default).
|
|
6791
|
+
textSize: tieredSizeCurve(tierExpr, [
|
|
6792
|
+
[5, [0, 0]],
|
|
6793
|
+
[7, [11, 0]],
|
|
6794
|
+
[9, [12, 0]],
|
|
6795
|
+
[11, [12, 9]],
|
|
6796
|
+
[13, [11, 11]],
|
|
6797
|
+
[16, [10, 10]]
|
|
6798
|
+
]),
|
|
6668
6799
|
textColor: DARK_BG,
|
|
6669
6800
|
textHaloColor: COLOR.LAND_REGION,
|
|
6670
6801
|
textHaloWidth: ORIENTATION_HALO_WIDTH,
|
|
@@ -6804,19 +6935,6 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
6804
6935
|
}
|
|
6805
6936
|
case "SEAARE": {
|
|
6806
6937
|
const tierExpr = buildSeaAreaTierExpression();
|
|
6807
|
-
const sizeAt = (t1, t2, t3, t4, def) => [
|
|
6808
|
-
"match",
|
|
6809
|
-
tierExpr,
|
|
6810
|
-
1,
|
|
6811
|
-
t1,
|
|
6812
|
-
2,
|
|
6813
|
-
t2,
|
|
6814
|
-
3,
|
|
6815
|
-
t3,
|
|
6816
|
-
4,
|
|
6817
|
-
t4,
|
|
6818
|
-
def
|
|
6819
|
-
];
|
|
6820
6938
|
return {
|
|
6821
6939
|
type: "symbol",
|
|
6822
6940
|
textField: ["get", "OBJNAM"],
|
|
@@ -6825,26 +6943,17 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
6825
6943
|
// it floods the overview with hundreds of small italic labels that
|
|
6826
6944
|
// crowd out the headline Ocean/Sea/Gulf names. It becomes visible only
|
|
6827
6945
|
// at approach scale (z9) when the user has zoomed in enough that
|
|
6828
|
-
// individual banks are useful context.
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
[
|
|
6832
|
-
[
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
9,
|
|
6840
|
-
sizeAt(12, 13, 14, 0, 9),
|
|
6841
|
-
11,
|
|
6842
|
-
sizeAt(10, 12, 13, 0, 11),
|
|
6843
|
-
13,
|
|
6844
|
-
sizeAt(9, 11, 12, 10, 11),
|
|
6845
|
-
16,
|
|
6846
|
-
sizeAt(9, 10, 11, 11, 10)
|
|
6847
|
-
],
|
|
6946
|
+
// individual banks are useful context. Columns: t1 ocean, t2 sea/gulf,
|
|
6947
|
+
// t3 bay/sound, t4 anchorage, default.
|
|
6948
|
+
textSize: tieredSizeCurve(tierExpr, [
|
|
6949
|
+
[3, [14, 8, 0, 0, 0]],
|
|
6950
|
+
[5, [16, 13, 9, 0, 0]],
|
|
6951
|
+
[7, [14, 14, 12, 0, 0]],
|
|
6952
|
+
[9, [12, 13, 14, 0, 9]],
|
|
6953
|
+
[11, [10, 12, 13, 0, 11]],
|
|
6954
|
+
[13, [9, 11, 12, 10, 11]],
|
|
6955
|
+
[16, [9, 10, 11, 11, 10]]
|
|
6956
|
+
]),
|
|
6848
6957
|
textColor: DARK_BG,
|
|
6849
6958
|
textHaloColor: COLOR.WATER_DEEP,
|
|
6850
6959
|
textHaloWidth: ORIENTATION_HALO_WIDTH,
|
|
@@ -6853,39 +6962,38 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
6853
6962
|
minzoom: 5,
|
|
6854
6963
|
layout: orientationLabelLayout({
|
|
6855
6964
|
"text-letter-spacing": 0.15,
|
|
6856
|
-
"text-max-width": 9
|
|
6965
|
+
"text-max-width": 9,
|
|
6966
|
+
// SEAARE is always-paint, unlike the other orientation classes.
|
|
6967
|
+
// MapLibre places symbols topmost-layer-first, so with
|
|
6968
|
+
// allow-overlap:false the dense sounding field (drawn above)
|
|
6969
|
+
// collision-starves big-water names — observed on staging at z8:
|
|
6970
|
+
// only 2 SEAARE labels survived viewport-wide, with Cape Cod Bay
|
|
6971
|
+
// and Gulf of Maine dropped entirely. Always-paint is safe for
|
|
6972
|
+
// this class because (a) the dominance composition in
|
|
6973
|
+
// fanOrientationLabelByCellBand suppresses cross-band duplicate
|
|
6974
|
+
// copies, and (b) tier sizing zeroes relief/anchorage names at
|
|
6975
|
+
// the zooms where density is a problem. Rivers/lakes/land keep
|
|
6976
|
+
// collision-dedup — their within-band multi-polygon stacking was
|
|
6977
|
+
// the original complaint, and they lack big-water headline value.
|
|
6978
|
+
"text-allow-overlap": true,
|
|
6979
|
+
"text-ignore-placement": true,
|
|
6980
|
+
"text-optional": false,
|
|
6981
|
+
"text-padding": 2
|
|
6857
6982
|
})
|
|
6858
6983
|
};
|
|
6859
6984
|
}
|
|
6860
6985
|
case "LAKARE": {
|
|
6861
6986
|
const tierExpr = buildLakeTierExpression();
|
|
6862
|
-
const sizeAt = (t1, t2) => [
|
|
6863
|
-
"match",
|
|
6864
|
-
tierExpr,
|
|
6865
|
-
1,
|
|
6866
|
-
t1,
|
|
6867
|
-
2,
|
|
6868
|
-
t2,
|
|
6869
|
-
t2
|
|
6870
|
-
];
|
|
6871
6987
|
return {
|
|
6872
6988
|
type: "symbol",
|
|
6873
6989
|
textField: ["get", "OBJNAM"],
|
|
6874
|
-
textSize: [
|
|
6875
|
-
|
|
6876
|
-
[
|
|
6877
|
-
[
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
sizeAt(11, 0),
|
|
6882
|
-
11,
|
|
6883
|
-
sizeAt(11, 9),
|
|
6884
|
-
13,
|
|
6885
|
-
sizeAt(10, 11),
|
|
6886
|
-
16,
|
|
6887
|
-
sizeAt(9, 10)
|
|
6888
|
-
],
|
|
6990
|
+
textSize: tieredSizeCurve(tierExpr, [
|
|
6991
|
+
[7, [9, 0]],
|
|
6992
|
+
[9, [11, 0]],
|
|
6993
|
+
[11, [11, 9]],
|
|
6994
|
+
[13, [10, 11]],
|
|
6995
|
+
[16, [9, 10]]
|
|
6996
|
+
]),
|
|
6889
6997
|
textColor: DARK_BG,
|
|
6890
6998
|
textHaloColor: COLOR.WATER,
|
|
6891
6999
|
textHaloWidth: ORIENTATION_HALO_WIDTH,
|
|
@@ -6897,33 +7005,16 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
6897
7005
|
}
|
|
6898
7006
|
case "RIVERS": {
|
|
6899
7007
|
const tierExpr = buildRiverTierExpression();
|
|
6900
|
-
const sizeAt = (t1, t2) => [
|
|
6901
|
-
"match",
|
|
6902
|
-
tierExpr,
|
|
6903
|
-
1,
|
|
6904
|
-
t1,
|
|
6905
|
-
2,
|
|
6906
|
-
t2,
|
|
6907
|
-
t2
|
|
6908
|
-
];
|
|
6909
7008
|
return {
|
|
6910
7009
|
type: "symbol",
|
|
6911
7010
|
textField: ["get", "OBJNAM"],
|
|
6912
|
-
textSize: [
|
|
6913
|
-
|
|
6914
|
-
[
|
|
6915
|
-
[
|
|
6916
|
-
|
|
6917
|
-
|
|
6918
|
-
|
|
6919
|
-
sizeAt(11, 0),
|
|
6920
|
-
11,
|
|
6921
|
-
sizeAt(11, 9),
|
|
6922
|
-
13,
|
|
6923
|
-
sizeAt(10, 10),
|
|
6924
|
-
16,
|
|
6925
|
-
sizeAt(9, 10)
|
|
6926
|
-
],
|
|
7011
|
+
textSize: tieredSizeCurve(tierExpr, [
|
|
7012
|
+
[7, [9, 0]],
|
|
7013
|
+
[9, [11, 0]],
|
|
7014
|
+
[11, [11, 9]],
|
|
7015
|
+
[13, [10, 10]],
|
|
7016
|
+
[16, [9, 10]]
|
|
7017
|
+
]),
|
|
6927
7018
|
textColor: DARK_BG,
|
|
6928
7019
|
textHaloColor: COLOR.WATER,
|
|
6929
7020
|
textHaloWidth: ORIENTATION_HALO_WIDTH,
|
|
@@ -6958,35 +7049,17 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
6958
7049
|
};
|
|
6959
7050
|
case "LNDARE": {
|
|
6960
7051
|
const tierExpr = buildLandAreaTierExpression();
|
|
6961
|
-
const sizeAt = (t1, t2) => [
|
|
6962
|
-
"match",
|
|
6963
|
-
tierExpr,
|
|
6964
|
-
1,
|
|
6965
|
-
t1,
|
|
6966
|
-
2,
|
|
6967
|
-
t2,
|
|
6968
|
-
t2
|
|
6969
|
-
];
|
|
6970
7052
|
return {
|
|
6971
7053
|
type: "symbol",
|
|
6972
7054
|
textField: ["get", "OBJNAM"],
|
|
6973
|
-
textSize: [
|
|
6974
|
-
|
|
6975
|
-
[
|
|
6976
|
-
[
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
9,
|
|
6982
|
-
sizeAt(11, 0),
|
|
6983
|
-
11,
|
|
6984
|
-
sizeAt(11, 9),
|
|
6985
|
-
13,
|
|
6986
|
-
sizeAt(10, 10),
|
|
6987
|
-
16,
|
|
6988
|
-
sizeAt(9, 10)
|
|
6989
|
-
],
|
|
7055
|
+
textSize: tieredSizeCurve(tierExpr, [
|
|
7056
|
+
[5, [8, 0]],
|
|
7057
|
+
[7, [10, 0]],
|
|
7058
|
+
[9, [11, 0]],
|
|
7059
|
+
[11, [11, 9]],
|
|
7060
|
+
[13, [10, 10]],
|
|
7061
|
+
[16, [9, 10]]
|
|
7062
|
+
]),
|
|
6990
7063
|
textColor: DARK_BG,
|
|
6991
7064
|
textHaloColor: COLOR.LAND_NATURAL,
|
|
6992
7065
|
textHaloWidth: ORIENTATION_HALO_WIDTH,
|
|
@@ -6998,39 +7071,18 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
6998
7071
|
}
|
|
6999
7072
|
case "BUAARE": {
|
|
7000
7073
|
const tierExpr = buildBuiltUpAreaTierExpression();
|
|
7001
|
-
const sizeAt = (t1, t2, t3) => [
|
|
7002
|
-
"match",
|
|
7003
|
-
tierExpr,
|
|
7004
|
-
1,
|
|
7005
|
-
t1,
|
|
7006
|
-
2,
|
|
7007
|
-
t2,
|
|
7008
|
-
3,
|
|
7009
|
-
t3,
|
|
7010
|
-
t3
|
|
7011
|
-
];
|
|
7012
7074
|
return {
|
|
7013
7075
|
type: "symbol",
|
|
7014
7076
|
textField: ["get", "OBJNAM"],
|
|
7015
|
-
textSize: [
|
|
7016
|
-
|
|
7017
|
-
[
|
|
7018
|
-
[
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
sizeAt(13, 9, 0),
|
|
7025
|
-
9,
|
|
7026
|
-
sizeAt(12, 12, 0),
|
|
7027
|
-
11,
|
|
7028
|
-
sizeAt(11, 12, 10),
|
|
7029
|
-
13,
|
|
7030
|
-
sizeAt(10, 11, 12),
|
|
7031
|
-
16,
|
|
7032
|
-
sizeAt(10, 10, 11)
|
|
7033
|
-
],
|
|
7077
|
+
textSize: tieredSizeCurve(tierExpr, [
|
|
7078
|
+
[3, [11, 0, 0]],
|
|
7079
|
+
[5, [13, 0, 0]],
|
|
7080
|
+
[7, [13, 9, 0]],
|
|
7081
|
+
[9, [12, 12, 0]],
|
|
7082
|
+
[11, [11, 12, 10]],
|
|
7083
|
+
[13, [10, 11, 12]],
|
|
7084
|
+
[16, [10, 10, 11]]
|
|
7085
|
+
]),
|
|
7034
7086
|
textColor: DARK_BG,
|
|
7035
7087
|
textHaloColor: COLOR.CITY,
|
|
7036
7088
|
textHaloWidth: ORIENTATION_HALO_WIDTH,
|
|
@@ -7111,33 +7163,16 @@ function getLabelConfig(layerName, opts = {}) {
|
|
|
7111
7163
|
};
|
|
7112
7164
|
case "AIRARE": {
|
|
7113
7165
|
const tierExpr = buildAirportTierExpression();
|
|
7114
|
-
const sizeAt = (t1, t2) => [
|
|
7115
|
-
"match",
|
|
7116
|
-
tierExpr,
|
|
7117
|
-
1,
|
|
7118
|
-
t1,
|
|
7119
|
-
2,
|
|
7120
|
-
t2,
|
|
7121
|
-
t2
|
|
7122
|
-
];
|
|
7123
7166
|
return {
|
|
7124
7167
|
type: "symbol",
|
|
7125
7168
|
textField: ["get", "OBJNAM"],
|
|
7126
|
-
textSize: [
|
|
7127
|
-
|
|
7128
|
-
[
|
|
7129
|
-
[
|
|
7130
|
-
|
|
7131
|
-
|
|
7132
|
-
|
|
7133
|
-
sizeAt(11, 0),
|
|
7134
|
-
11,
|
|
7135
|
-
sizeAt(11, 9),
|
|
7136
|
-
13,
|
|
7137
|
-
sizeAt(10, 10),
|
|
7138
|
-
16,
|
|
7139
|
-
sizeAt(9, 9)
|
|
7140
|
-
],
|
|
7169
|
+
textSize: tieredSizeCurve(tierExpr, [
|
|
7170
|
+
[7, [9, 0]],
|
|
7171
|
+
[9, [11, 0]],
|
|
7172
|
+
[11, [11, 9]],
|
|
7173
|
+
[13, [10, 10]],
|
|
7174
|
+
[16, [9, 9]]
|
|
7175
|
+
]),
|
|
7141
7176
|
textColor: DARK_BG,
|
|
7142
7177
|
textHaloColor: COLOR.AIRPORT,
|
|
7143
7178
|
textHaloWidth: ORIENTATION_HALO_WIDTH,
|
|
@@ -10409,7 +10444,10 @@ function buildLayersForClass(objectClass, ct, sourceId = DEFAULT_REGION) {
|
|
|
10409
10444
|
}
|
|
10410
10445
|
if (objectClass === "TUNNEL" && resolved.type === "line") {
|
|
10411
10446
|
layers.push({
|
|
10412
|
-
|
|
10447
|
+
// NOT `s52-TUNNEL-line` — that id is already taken by the main layer
|
|
10448
|
+
// (`s52-${objectClass}-${resolved.type}`), and duplicate layer ids
|
|
10449
|
+
// are a Mapbox style-spec violation (caught by style-integrity.test).
|
|
10450
|
+
id: `s52-TUNNEL-linestring`,
|
|
10413
10451
|
type: "line",
|
|
10414
10452
|
source: sourceId,
|
|
10415
10453
|
"source-layer": "TUNNEL",
|
|
@@ -10783,24 +10821,37 @@ function fanOrientationLabelByCellBand(label) {
|
|
|
10783
10821
|
const curve = CELL_BAND_OPACITY_CURVE[code];
|
|
10784
10822
|
const opacityExpr = ["interpolate", ["linear"], ["zoom"]];
|
|
10785
10823
|
for (const [z, o] of curve) opacityExpr.push(z, o);
|
|
10786
|
-
const
|
|
10787
|
-
|
|
10788
|
-
|
|
10789
|
-
|
|
10790
|
-
|
|
10791
|
-
|
|
10792
|
-
|
|
10793
|
-
|
|
10794
|
-
|
|
10795
|
-
|
|
10796
|
-
|
|
10797
|
-
paint: {
|
|
10798
|
-
...label.paint ?? {},
|
|
10799
|
-
"text-opacity": opacityExpr
|
|
10800
|
-
}
|
|
10824
|
+
const cellFiltered = combineWithBandFilter(
|
|
10825
|
+
label.filter,
|
|
10826
|
+
["==", cellBandExpr, code]
|
|
10827
|
+
);
|
|
10828
|
+
const minzoom = Math.max(
|
|
10829
|
+
label.minzoom ?? range.minzoom,
|
|
10830
|
+
range.minzoom
|
|
10831
|
+
);
|
|
10832
|
+
const paint = {
|
|
10833
|
+
...label.paint ?? {},
|
|
10834
|
+
"text-opacity": opacityExpr
|
|
10801
10835
|
};
|
|
10802
|
-
|
|
10803
|
-
|
|
10836
|
+
variants.push({
|
|
10837
|
+
...label,
|
|
10838
|
+
id: `${label.id}-cell${code}-notdom`,
|
|
10839
|
+
filter: combineWithBandFilter(cellFiltered, NOT_DOMINATED_FILTER),
|
|
10840
|
+
minzoom,
|
|
10841
|
+
paint
|
|
10842
|
+
});
|
|
10843
|
+
for (const D of BAND_DRAW_ORDER) {
|
|
10844
|
+
const dom = BAND_PRIORITY_RANGES[D];
|
|
10845
|
+
if (dom.minzoom <= minzoom) continue;
|
|
10846
|
+
variants.push({
|
|
10847
|
+
...label,
|
|
10848
|
+
id: `${label.id}-cell${code}-domBy${D}`,
|
|
10849
|
+
filter: combineWithBandFilter(cellFiltered, dominatedByMinFilter(D)),
|
|
10850
|
+
minzoom,
|
|
10851
|
+
maxzoom: dom.minzoom,
|
|
10852
|
+
paint
|
|
10853
|
+
});
|
|
10854
|
+
}
|
|
10804
10855
|
}
|
|
10805
10856
|
return variants;
|
|
10806
10857
|
}
|