fix(map): field labels visible at all zooms (pixel-size gated), not gated by FIELD_ZOOM_LABELS

This commit is contained in:
atsunatsu committed 2026-09-08 01:51:14 +08:00
1 parent cb648caf65
commit 052ba79c94
1 file changed
+4 -6
@@ -201,12 +201,10 @@ class MaidenheadGridOverlay : Overlay() {
} }
// Labels: centered in each cell, only when the cell is large enough on // Labels: centered in each cell, only when the cell is large enough on
// screen to hold a label (avoid clutter at low zoom) // screen to hold a label (avoid clutter at low zoom).
val showLabels = when { // Field (2-char) labels show at every zoom, subject only to the pixel-
zoom >= GRID_ZOOM_SUB -> true // size check below; sub-square (4-char) labels only from GRID_ZOOM_SUB.
zoom >= FIELD_ZOOM_LABELS -> true val showLabels = zoom >= GRID_ZOOM_SUB || cellLat == FIELD_LAT
else -> false
}
if (!showLabels) return if (!showLabels) return
// Estimate on-screen cell height to avoid clutter at low zoom: // Estimate on-screen cell height to avoid clutter at low zoom:
// project two points 1° apart in latitude and measure the pixel distance. // project two points 1° apart in latitude and measure the pixel distance.