fix(map): keep bathymetry visible when overzooming
This commit is contained in:
부모
dc702728be
커밋
0899223c75
@ -859,7 +859,8 @@ function injectOceanBathymetryLayers(style: StyleSpecification, maptilerKey: str
|
||||
// which may exceed MapLibre's per-segment 16-bit vertex limit and render incorrectly.
|
||||
// We keep the fill starting at a more reasonable zoom.
|
||||
minzoom: 6,
|
||||
maxzoom: 12,
|
||||
// Source maxzoom is 12, but we allow overzoom so the bathymetry doesn't disappear when zooming in.
|
||||
maxzoom: 24,
|
||||
paint: {
|
||||
// Dark-mode friendly palette (shallow = slightly brighter; deep = near-black).
|
||||
"fill-color": bathyFillColor,
|
||||
@ -875,7 +876,7 @@ function injectOceanBathymetryLayers(style: StyleSpecification, maptilerKey: str
|
||||
source: oceanSourceId,
|
||||
"source-layer": "contour",
|
||||
minzoom: 6,
|
||||
maxzoom: 14,
|
||||
maxzoom: 24,
|
||||
paint: {
|
||||
"line-color": "rgba(255,255,255,0.06)",
|
||||
"line-opacity": ["interpolate", ["linear"], ["zoom"], 4, 0.12, 8, 0.18, 12, 0.22],
|
||||
@ -923,7 +924,7 @@ function injectOceanBathymetryLayers(style: StyleSpecification, maptilerKey: str
|
||||
source: oceanSourceId,
|
||||
"source-layer": "contour_line",
|
||||
minzoom: 8,
|
||||
maxzoom: 14,
|
||||
maxzoom: 24,
|
||||
filter: bathyMajorDepthFilter as unknown as unknown[],
|
||||
paint: {
|
||||
"line-color": "rgba(255,255,255,0.16)",
|
||||
@ -939,7 +940,7 @@ function injectOceanBathymetryLayers(style: StyleSpecification, maptilerKey: str
|
||||
source: oceanSourceId,
|
||||
"source-layer": "contour",
|
||||
minzoom: 4,
|
||||
maxzoom: 14,
|
||||
maxzoom: 24,
|
||||
filter: bathyMajorDepthFilter as unknown as unknown[],
|
||||
paint: {
|
||||
"line-color": "rgba(255,255,255,0.14)",
|
||||
@ -1031,9 +1032,11 @@ type BathyZoomRange = {
|
||||
};
|
||||
|
||||
const BATHY_ZOOM_RANGES: BathyZoomRange[] = [
|
||||
{ id: "bathymetry-fill", mercator: [6, 12], globe: [8, 12] },
|
||||
{ id: "bathymetry-borders", mercator: [6, 14], globe: [8, 14] },
|
||||
{ id: "bathymetry-borders-major", mercator: [4, 14], globe: [8, 14] },
|
||||
// MapTiler Ocean tiles maxzoom=12; beyond that we overzoom the z12 geometry.
|
||||
// Keep rendering at high zoom so the sea doesn't revert to the basemap's flat water color.
|
||||
{ id: "bathymetry-fill", mercator: [6, 24], globe: [8, 24] },
|
||||
{ id: "bathymetry-borders", mercator: [6, 24], globe: [8, 24] },
|
||||
{ id: "bathymetry-borders-major", mercator: [4, 24], globe: [8, 24] },
|
||||
];
|
||||
|
||||
function applyBathymetryZoomProfile(map: maplibregl.Map, baseMap: BaseMapId, projection: MapProjectionId) {
|
||||
|
||||
불러오는 중...
Reference in New Issue
Block a user