fix(zoom): hide Leaflet tile seams that appear when the map is CSS-zoomed

Under our CSS zoom the map tiles scale by a fractional factor, opening ~1px gaps
between adjacent tiles that read as a faint grid over the map. Tag the document
with data-uizoom and, only while zoomed, enlarge each 256px tile by 1px so
neighbours overlap and cover the seams. The 100% view is untouched.
This commit is contained in:
2026-07-25 13:30:43 +02:00
parent 6a1103bf5f
commit b7bfd39652
2 changed files with 13 additions and 0 deletions
+3
View File
@@ -860,6 +860,9 @@ export default function App() {
const apply = () => {
// Zoom the whole document (so portalled menus/modals/tooltips scale too)…
(document.documentElement.style as any).zoom = String(z);
// Flag the zoom state so the Leaflet tile-seam fix (style.css) only kicks in
// when actually zoomed (fractional scaling opens 1px gaps between tiles).
document.documentElement.setAttribute('data-uizoom', String(z));
// …and counter-size the app root: `zoom` doesn't rescale vh/vw, so a 100vh
// root leaves an empty strip when zoomed out. (100/z)vh zoomed by z = 100vh.
const el = appRootRef.current;