mirror of
https://github.com/zvx-echo6/navi.git
synced 2026-05-20 22:54:42 +02:00
fix(map): Set exact label zoom ranges for hierarchy
places_country: z1-z4 (countries visible at world view, fade at z4) places_region: z4-z7 (states appear at z4, fade as cities dominate) places_locality: unchanged (follows natural min_zoom in tiles) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
83e8ffeb2d
commit
5fcd6cda9a
1 changed files with 5 additions and 5 deletions
|
|
@ -267,15 +267,15 @@ function applyBaseLabelStyling(map) {
|
||||||
})
|
})
|
||||||
|
|
||||||
// Adjust label zoom ranges for proper hierarchy:
|
// Adjust label zoom ranges for proper hierarchy:
|
||||||
// - Countries at z2+
|
// - Countries: z1-z4 (fade out as states appear)
|
||||||
// - States/provinces at z3+
|
// - States/provinces: z4-z7 (appear as countries fade, fade as cities dominate)
|
||||||
// - Cities follow their natural min_zoom in the data
|
// - Cities: unchanged (natural min_zoom in tile data)
|
||||||
try {
|
try {
|
||||||
if (map.getLayer('places_country')) {
|
if (map.getLayer('places_country')) {
|
||||||
map.setLayerZoomRange('places_country', 2, 24)
|
map.setLayerZoomRange('places_country', 1, 4)
|
||||||
}
|
}
|
||||||
if (map.getLayer('places_region')) {
|
if (map.getLayer('places_region')) {
|
||||||
map.setLayerZoomRange('places_region', 3, 24)
|
map.setLayerZoomRange('places_region', 4, 7)
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Ignore if layers don't exist
|
// Ignore if layers don't exist
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue