diff --git a/frontend/src/lib/overlays.ts b/frontend/src/lib/overlays.ts index 72d4d44..fb192cc 100644 --- a/frontend/src/lib/overlays.ts +++ b/frontend/src/lib/overlays.ts @@ -12,6 +12,8 @@ export interface OverlayDefinition { label: string; description: string; detail: string; + /** Enabled on a fresh visit (no `overlay` URL params). */ + defaultEnabled?: boolean; } export const OVERLAYS: OverlayDefinition[] = [ @@ -28,6 +30,7 @@ export const OVERLAYS: OverlayDefinition[] = [ description: 'Approximate police.uk street-crime heatmap', detail: 'Client-side heatmap of street-level crimes published by police.uk over the most recent months. Police.uk coordinates are anonymised snap-to-grid points, not exact offence locations, so the heatmap should be read as an approximation of relative density rather than a precise map of incidents.', + defaultEnabled: true, }, { id: 'trees-outside-woodlands', @@ -35,6 +38,7 @@ export const OVERLAYS: OverlayDefinition[] = [ description: 'Tree canopy and woodland polygons', detail: 'Forest Research Trees Outside Woodland (TOW) v1 canopy polygons — lone trees and groups of trees — unioned with National Forest Inventory (NFI) woodland blocks (≥0.5 ha) that TOW deliberately excludes. Together they cover both street trees and actual woods. Polygon opacity scales with canopy area.', + defaultEnabled: true, }, { id: 'property-borders', @@ -45,6 +49,11 @@ export const OVERLAYS: OverlayDefinition[] = [ }, ]; +/** Overlays shown on a fresh visit, before any `overlay` URL params apply. */ +export const DEFAULT_OVERLAY_IDS: OverlayId[] = OVERLAYS.filter((o) => o.defaultEnabled).map( + (o) => o.id +); + const OVERLAY_ID_SET = new Set(OVERLAY_IDS); export function isOverlayId(value: string): value is OverlayId {