Skip to content

Commit 17b53a2

Browse files
bramkragtenclaude
andcommitted
Keep the map's zoom floor inside MapLibre's range
At Leaflet zoom 0 the adapter drives the MapLibre map to -1, below the range MapLibre is specified for. Measured, no drift was observable there and the centres stayed in sync, but the adapter's own README recommends a floor of 1 and nobody views a home automation dashboard from world zoom, so there is nothing to weigh against staying inside spec. Spotted in #53836 by @birkskyum, which set this correctly where this branch did not. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 2b39054 commit 17b53a2

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/common/map/base-layer.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ const CONTEXT_RESTORE_GRACE = 2000;
3636
// The zoom range belongs to the map rather than to the base layer: only Leaflet
3737
// tile layers report their own limits, and marker clustering needs the map to
3838
// have a maximum zoom whichever base layer is in use.
39-
export const MAP_MIN_ZOOM = 0;
39+
//
40+
// The floor is 1 rather than 0 on the adapter's own advice: at Leaflet zoom 0 it
41+
// drives the MapLibre map to -1, below the range MapLibre is specified for. No
42+
// drift was measurable there, but nobody looks at their house from world zoom,
43+
// so there is nothing to weigh against staying inside spec.
44+
export const MAP_MIN_ZOOM = 1;
4045
export const MAP_MAX_ZOOM = 20;
4146

4247
export interface MapBaseLayer {

0 commit comments

Comments
 (0)