@chrtco/sdk 0.10.28 → 0.10.30
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 +37 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +37 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -28845,6 +28845,7 @@ function worldMinusBboxPolygon(bbox) {
|
|
|
28845
28845
|
// src/atlas/land-layers.ts
|
|
28846
28846
|
var LAND_SURFACE_MINZOOM = BAND_PRIORITY_RANGES["5"].minzoom;
|
|
28847
28847
|
var LAND_SURFACE_LAYERS = (id) => id === "chrtland-base" || id === "chrtland-cover" || id === "chrtland-contour" || id === "chrtland-hillshade" || id.startsWith("chrtland-fade-");
|
|
28848
|
+
var isLandGroundOverlay = (id) => LAND_SURFACE_LAYERS(id) && id !== "chrtland-base" || id === "chrtland-road";
|
|
28848
28849
|
var FADE_PX = 80;
|
|
28849
28850
|
var FADE_BANDS = 16;
|
|
28850
28851
|
function fadeAlpha(r) {
|
|
@@ -28976,14 +28977,20 @@ function landLayers(opts = {}) {
|
|
|
28976
28977
|
}
|
|
28977
28978
|
}));
|
|
28978
28979
|
}
|
|
28980
|
+
const isIndexContour = [
|
|
28981
|
+
"any",
|
|
28982
|
+
["<=", ["coalesce", ["get", "index_z"], 99], ["zoom"]],
|
|
28983
|
+
["==", ["get", "is_index"], 1]
|
|
28984
|
+
];
|
|
28979
28985
|
layers.push(L({
|
|
28980
28986
|
id: "chrtland-contour",
|
|
28981
28987
|
type: "line",
|
|
28982
28988
|
source: src,
|
|
28983
28989
|
"source-layer": "land_contour",
|
|
28990
|
+
filter: ["<=", ["coalesce", ["get", "min_z"], 0], ["zoom"]],
|
|
28984
28991
|
paint: {
|
|
28985
|
-
"line-color": ["case",
|
|
28986
|
-
"line-width": ["case",
|
|
28992
|
+
"line-color": ["case", isIndexContour, T.contourIndex, T.contour],
|
|
28993
|
+
"line-width": ["case", isIndexContour, 0.8, 0.4],
|
|
28987
28994
|
"line-opacity": 0.7
|
|
28988
28995
|
}
|
|
28989
28996
|
}));
|
|
@@ -30289,21 +30296,37 @@ function generateStyle(palette = "DAY", opts = {}) {
|
|
|
30289
30296
|
];
|
|
30290
30297
|
}
|
|
30291
30298
|
{
|
|
30292
|
-
const
|
|
30293
|
-
|
|
30294
|
-
|
|
30299
|
+
const assembled = [
|
|
30300
|
+
restFinal[0],
|
|
30301
|
+
...baseBlock,
|
|
30302
|
+
...seaare,
|
|
30303
|
+
...ordered,
|
|
30304
|
+
...restFinal.slice(1)
|
|
30305
|
+
];
|
|
30306
|
+
const idOf = (l) => l.id;
|
|
30307
|
+
const isRepaint = (l) => /-overpair(-|$)/.test(idOf(l));
|
|
30295
30308
|
let lastRepaint = -1;
|
|
30296
|
-
|
|
30297
|
-
if (
|
|
30309
|
+
assembled.forEach((l, i) => {
|
|
30310
|
+
if (isRepaint(l)) lastRepaint = i;
|
|
30298
30311
|
});
|
|
30299
|
-
if (
|
|
30300
|
-
|
|
30301
|
-
|
|
30302
|
-
|
|
30303
|
-
|
|
30304
|
-
|
|
30312
|
+
if (lastRepaint === -1) return assembled;
|
|
30313
|
+
const surface = [];
|
|
30314
|
+
const kept = [];
|
|
30315
|
+
assembled.forEach((l, i) => {
|
|
30316
|
+
if (i < lastRepaint && isLandGroundOverlay(idOf(l))) surface.push(l);
|
|
30317
|
+
else kept.push(l);
|
|
30318
|
+
});
|
|
30319
|
+
if (surface.length === 0) return assembled;
|
|
30320
|
+
let landing = -1;
|
|
30321
|
+
kept.forEach((l, i) => {
|
|
30322
|
+
if (isRepaint(l)) landing = i;
|
|
30323
|
+
});
|
|
30324
|
+
return [
|
|
30325
|
+
...kept.slice(0, landing + 1),
|
|
30326
|
+
...surface,
|
|
30327
|
+
...kept.slice(landing + 1)
|
|
30328
|
+
];
|
|
30305
30329
|
}
|
|
30306
|
-
return [restFinal[0], ...baseBlock, ...seaare, ...ordered, ...restFinal.slice(1)];
|
|
30307
30330
|
})() : layers;
|
|
30308
30331
|
for (const id of [
|
|
30309
30332
|
"chrtbase-country-boundary",
|