@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.js
CHANGED
|
@@ -28621,6 +28621,7 @@ function worldMinusBboxPolygon(bbox) {
|
|
|
28621
28621
|
// src/atlas/land-layers.ts
|
|
28622
28622
|
var LAND_SURFACE_MINZOOM = BAND_PRIORITY_RANGES["5"].minzoom;
|
|
28623
28623
|
var LAND_SURFACE_LAYERS = (id) => id === "chrtland-base" || id === "chrtland-cover" || id === "chrtland-contour" || id === "chrtland-hillshade" || id.startsWith("chrtland-fade-");
|
|
28624
|
+
var isLandGroundOverlay = (id) => LAND_SURFACE_LAYERS(id) && id !== "chrtland-base" || id === "chrtland-road";
|
|
28624
28625
|
var FADE_PX = 80;
|
|
28625
28626
|
var FADE_BANDS = 16;
|
|
28626
28627
|
function fadeAlpha(r) {
|
|
@@ -28752,14 +28753,20 @@ function landLayers(opts = {}) {
|
|
|
28752
28753
|
}
|
|
28753
28754
|
}));
|
|
28754
28755
|
}
|
|
28756
|
+
const isIndexContour = [
|
|
28757
|
+
"any",
|
|
28758
|
+
["<=", ["coalesce", ["get", "index_z"], 99], ["zoom"]],
|
|
28759
|
+
["==", ["get", "is_index"], 1]
|
|
28760
|
+
];
|
|
28755
28761
|
layers.push(L({
|
|
28756
28762
|
id: "chrtland-contour",
|
|
28757
28763
|
type: "line",
|
|
28758
28764
|
source: src,
|
|
28759
28765
|
"source-layer": "land_contour",
|
|
28766
|
+
filter: ["<=", ["coalesce", ["get", "min_z"], 0], ["zoom"]],
|
|
28760
28767
|
paint: {
|
|
28761
|
-
"line-color": ["case",
|
|
28762
|
-
"line-width": ["case",
|
|
28768
|
+
"line-color": ["case", isIndexContour, T.contourIndex, T.contour],
|
|
28769
|
+
"line-width": ["case", isIndexContour, 0.8, 0.4],
|
|
28763
28770
|
"line-opacity": 0.7
|
|
28764
28771
|
}
|
|
28765
28772
|
}));
|
|
@@ -30065,21 +30072,37 @@ function generateStyle(palette = "DAY", opts = {}) {
|
|
|
30065
30072
|
];
|
|
30066
30073
|
}
|
|
30067
30074
|
{
|
|
30068
|
-
const
|
|
30069
|
-
|
|
30070
|
-
|
|
30075
|
+
const assembled = [
|
|
30076
|
+
restFinal[0],
|
|
30077
|
+
...baseBlock,
|
|
30078
|
+
...seaare,
|
|
30079
|
+
...ordered,
|
|
30080
|
+
...restFinal.slice(1)
|
|
30081
|
+
];
|
|
30082
|
+
const idOf = (l) => l.id;
|
|
30083
|
+
const isRepaint = (l) => /-overpair(-|$)/.test(idOf(l));
|
|
30071
30084
|
let lastRepaint = -1;
|
|
30072
|
-
|
|
30073
|
-
if (
|
|
30085
|
+
assembled.forEach((l, i) => {
|
|
30086
|
+
if (isRepaint(l)) lastRepaint = i;
|
|
30074
30087
|
});
|
|
30075
|
-
if (
|
|
30076
|
-
|
|
30077
|
-
|
|
30078
|
-
|
|
30079
|
-
|
|
30080
|
-
|
|
30088
|
+
if (lastRepaint === -1) return assembled;
|
|
30089
|
+
const surface = [];
|
|
30090
|
+
const kept = [];
|
|
30091
|
+
assembled.forEach((l, i) => {
|
|
30092
|
+
if (i < lastRepaint && isLandGroundOverlay(idOf(l))) surface.push(l);
|
|
30093
|
+
else kept.push(l);
|
|
30094
|
+
});
|
|
30095
|
+
if (surface.length === 0) return assembled;
|
|
30096
|
+
let landing = -1;
|
|
30097
|
+
kept.forEach((l, i) => {
|
|
30098
|
+
if (isRepaint(l)) landing = i;
|
|
30099
|
+
});
|
|
30100
|
+
return [
|
|
30101
|
+
...kept.slice(0, landing + 1),
|
|
30102
|
+
...surface,
|
|
30103
|
+
...kept.slice(landing + 1)
|
|
30104
|
+
];
|
|
30081
30105
|
}
|
|
30082
|
-
return [restFinal[0], ...baseBlock, ...seaare, ...ordered, ...restFinal.slice(1)];
|
|
30083
30106
|
})() : layers;
|
|
30084
30107
|
for (const id of [
|
|
30085
30108
|
"chrtbase-country-boundary",
|