fix(globe): avoid bathymetry overflow; fix ship halo expr
This commit is contained in:
부모
d4859eb361
커밋
84d602d25b
@ -754,11 +754,21 @@ export function Map3D({
|
|||||||
|
|
||||||
const apply = () => {
|
const apply = () => {
|
||||||
if (!map.isStyleLoaded()) return;
|
if (!map.isStyleLoaded()) return;
|
||||||
const disableBathy3D = projection === "globe" && baseMap === "enhanced";
|
const disableBathyHeavy = projection === "globe" && baseMap === "enhanced";
|
||||||
const vis = disableBathy3D ? "none" : "visible";
|
const visHeavy = disableBathyHeavy ? "none" : "visible";
|
||||||
for (const id of ["bathymetry-extrusion", "bathymetry-hillshade"]) {
|
|
||||||
|
// Globe + our injected bathymetry fill polygons can exceed MapLibre's per-segment vertex limit
|
||||||
|
// (65535), causing broken ocean rendering. Keep globe mode stable by disabling the heavy fill.
|
||||||
|
const heavyIds = [
|
||||||
|
"bathymetry-fill",
|
||||||
|
"bathymetry-borders",
|
||||||
|
"bathymetry-borders-major",
|
||||||
|
"bathymetry-extrusion",
|
||||||
|
"bathymetry-hillshade",
|
||||||
|
];
|
||||||
|
for (const id of heavyIds) {
|
||||||
try {
|
try {
|
||||||
if (map.getLayer(id)) map.setLayoutProperty(id, "visibility", vis);
|
if (map.getLayer(id)) map.setLayoutProperty(id, "visibility", visHeavy);
|
||||||
} catch {
|
} catch {
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
@ -1019,12 +1029,21 @@ export function Map3D({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const visibility = settings.showShips ? "visible" : "none";
|
const visibility = settings.showShips ? "visible" : "none";
|
||||||
|
const isSelected = ["boolean", ["feature-state", "selected"], false] as const;
|
||||||
|
// Style-spec restriction: only one zoom-based step/interpolate is allowed in an expression.
|
||||||
const circleRadius = [
|
const circleRadius = [
|
||||||
"case",
|
"interpolate",
|
||||||
["boolean", ["feature-state", "selected"], false],
|
["linear"],
|
||||||
["interpolate", ["linear"], ["zoom"], 3, 5, 7, 8, 10, 10, 14, 14],
|
["zoom"],
|
||||||
["interpolate", ["linear"], ["zoom"], 3, 4, 7, 6, 10, 8, 14, 11],
|
3,
|
||||||
] as unknown as number[];
|
["case", isSelected, 5, 4],
|
||||||
|
7,
|
||||||
|
["case", isSelected, 8, 6],
|
||||||
|
10,
|
||||||
|
["case", isSelected, 10, 8],
|
||||||
|
14,
|
||||||
|
["case", isSelected, 14, 11],
|
||||||
|
] as const;
|
||||||
|
|
||||||
// Put ships at the top so they're always visible (especially important under globe projection).
|
// Put ships at the top so they're always visible (especially important under globe projection).
|
||||||
const before = undefined;
|
const before = undefined;
|
||||||
|
|||||||
불러오는 중...
Reference in New Issue
Block a user