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:
Matt 2026-05-02 19:10:45 +00:00
commit 83e8ffeb2d

View file

@ -265,6 +265,21 @@ function applyBaseLabelStyling(map) {
'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 */