From 83e8ffeb2d522c564b18fa7841446f96a910dcbe Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 2 May 2026 19:10:45 +0000 Subject: [PATCH] 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 --- src/components/MapView.jsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/components/MapView.jsx b/src/components/MapView.jsx index e5a90f1..1226044 100644 --- a/src/components/MapView.jsx +++ b/src/components/MapView.jsx @@ -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 */