fix: v0.2.1 — clamp map zoom to 3–14

This commit is contained in:
2026-09-16 19:50:26 +00:00
parent eef3430ad5
commit abdeca2a6a
4 changed files with 89 additions and 1 deletions
+6
View File
@@ -7,6 +7,10 @@ import { pitchForZoom } from '@/lib/camera';
const EUROPE_CENTER: [number, number] = [10, 52];
const INITIAL_ZOOM = 4;
// Useful gameplay range: continent overview → city detail (10–100 m/px). The
// zoom→pitch camera transition completes at z12; street-level zoom has no value.
export const MIN_ZOOM = 3;
export const MAX_ZOOM = 14;
const OPENFREEMAP_STYLE = 'https://tiles.openfreemap.org/styles/liberty';
const TERRAIN_TILES = ['https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png'];
@@ -35,6 +39,8 @@ export default function Map() {
center: EUROPE_CENTER,
zoom: INITIAL_ZOOM,
pitch: 0,
minZoom: MIN_ZOOM,
maxZoom: MAX_ZOOM,
});
// Dev/e2e hook so tests can project coordinates to screen space.
(window as unknown as Record<string, unknown>).__flightMap = map;