diff --git a/drb-frontend/components/MapView.tsx b/drb-frontend/components/MapView.tsx index 13f0529..ece572f 100644 --- a/drb-frontend/components/MapView.tsx +++ b/drb-frontend/components/MapView.tsx @@ -25,15 +25,15 @@ L.Icon.Default.mergeOptions({ }); // ── Basemap tiles ───────────────────────────────────────────────────────────── -// Default is CARTO's keyless dark raster basemap — no token, fits the dark UI. -// Overridable via NEXT_PUBLIC_MAP_TILE_URL so a keyed style (a CARTO account -// style, MapTiler, Mapbox, …) can be dropped in for prod without a code change. -// Whatever is supplied must use Leaflet's {s}/{z}/{x}/{y}{r} placeholder scheme. +// Prod sets NEXT_PUBLIC_MAP_TILE_URL to a keyed style (a CARTO account style, +// MapTiler, Mapbox, …). The in-code fallback is plain OpenStreetMap so the map +// still renders if that var is missing — CARTO's keyless CDN has proven flaky. +// Whatever is supplied must use Leaflet's {s}/{z}/{x}/{y}{r} placeholder scheme; +// the {z}/{x}/{y} tokens below are substituted by Leaflet at runtime. const MAP_TILE_URL = process.env.NEXT_PUBLIC_MAP_TILE_URL || - "https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png"; -const MAP_TILE_ATTRIBUTION = - '© OpenStreetMap contributors © CARTO'; + "https://tile.openstreetmap.org/{z}/{x}/{y}.png"; +const MAP_TILE_ATTRIBUTION = "© OpenStreetMap contributors"; // ── Colour ──────────────────────────────────────────────────────────────────── // Severity is the only hue on this map — see UI_REDESIGN.md §2.3. Incident @@ -459,9 +459,6 @@ export default function MapView({ nodes, activeCalls, incidents = [], calls = [] const [drawerOpen, setDrawerOpen] = useState(false); const [agoClock, setAgoClock] = useState(0); const [radarEpoch, setRadarEpoch] = useState(() => Date.now()); - const [clockStr, setClockStr] = useState(() => - new Date().toLocaleTimeString([], { hour12: false, hour: "2-digit", minute: "2-digit", second: "2-digit" }) - ); useEffect(() => { const id = setInterval(() => setAgoClock((t: number) => t + 1), 10_000); @@ -474,15 +471,6 @@ export default function MapView({ nodes, activeCalls, incidents = [], calls = [] return () => clearInterval(id); }, []); - // Live clock for TOC situational awareness - useEffect(() => { - const id = setInterval(() => - setClockStr(new Date().toLocaleTimeString([], { hour12: false, hour: "2-digit", minute: "2-digit", second: "2-digit" })), - 1000 - ); - return () => clearInterval(id); - }, []); - // eslint-disable-next-line react-hooks/exhaustive-deps const ago = useMemo(() => (lastUpdated ? timeAgo(lastUpdated) : null), [lastUpdated, agoClock]); @@ -623,13 +611,8 @@ export default function MapView({ nodes, activeCalls, incidents = [], calls = [] )} - {/* ── Clock — bottom-left for TOC situational awareness ───────────────── */} -
Severity
{(["major", "moderate", "minor", "routine"] as Severity[]).map((sev) => ( @@ -673,15 +656,19 @@ export default function MapView({ nodes, activeCalls, incidents = [], calls = [] {/* ── Incident overlay panel ───────────────────────────────────────────── */} {incidents.length > 0 && ( <> - {/* Desktop: left sidebar — starts below zoom controls + fit-all button */} -