mirror of
https://github.com/zvx-echo6/navi.git
synced 2026-05-20 22:54:42 +02:00
fix(map): Show state/province labels at lower zoom levels
Adjust label zoom ranges after style load for proper hierarchy: - Countries (places_country): visible from z2+ - States/provinces (places_region): visible from z3+ - Cities follow their natural min_zoom in the tile data This ensures states like Idaho and Oregon appear before cities like Boise and Portland when zoomed out. The setLayerZoomRange calls are made in applyBaseLabelStyling() which runs after style load and theme changes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
c14edb0e53
commit
83e8ffeb2d
1 changed files with 15 additions and 0 deletions
|
|
@ -265,6 +265,21 @@ function applyBaseLabelStyling(map) {
|
||||||
'text-halo-width': 1.8,
|
'text-halo-width': 1.8,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Adjust label zoom ranges for proper hierarchy:
|
||||||
|
// - Countries at z2+
|
||||||
|
// - States/provinces at z3+
|
||||||
|
// - Cities follow their natural min_zoom in the data
|
||||||
|
try {
|
||||||
|
if (map.getLayer('places_country')) {
|
||||||
|
map.setLayerZoomRange('places_country', 2, 24)
|
||||||
|
}
|
||||||
|
if (map.getLayer('places_region')) {
|
||||||
|
map.setLayerZoomRange('places_region', 3, 24)
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// Ignore if layers don't exist
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Build a full MapLibre style object for the given theme */
|
/** Build a full MapLibre style object for the given theme */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue