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:
Matt 2026-05-02 19:17:56 +00:00
commit 5fcd6cda9a

View file

@ -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