From 3ebb062e99dbd8a63d5642d67ba4be753e61a34d Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Wed, 19 Nov 2025 22:58:40 +0100 Subject: feat: Enhance map attribution feature; improve styles and add toggle functionality in StopMapSheet component --- src/frontend/app/components/StopMapSheet.tsx | 31 +++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'src/frontend/app/components/StopMapSheet.tsx') diff --git a/src/frontend/app/components/StopMapSheet.tsx b/src/frontend/app/components/StopMapSheet.tsx index e1f0bf7..71a1095 100644 --- a/src/frontend/app/components/StopMapSheet.tsx +++ b/src/frontend/app/components/StopMapSheet.tsx @@ -1,10 +1,6 @@ import maplibregl from "maplibre-gl"; import React, { useEffect, useMemo, useRef, useState } from "react"; -import Map, { - AttributionControl, - Marker, - type MapRef, -} from "react-map-gl/maplibre"; +import Map, { Marker, type MapRef } from "react-map-gl/maplibre"; import { useApp } from "~/AppContext"; import type { RegionId } from "~/config/RegionConfig"; import { getLineColor } from "~/data/LineColors"; @@ -47,6 +43,7 @@ export const StopMap: React.FC = ({ const geoWatchId = useRef(null); const [zoom, setZoom] = useState(16); const [moveTick, setMoveTick] = useState(0); + const [showAttribution, setShowAttribution] = useState(false); type Pt = { lat: number; lon: number }; const haversineKm = (a: Pt, b: Pt) => { @@ -311,8 +308,6 @@ export const StopMap: React.FC = ({ setMoveTick((t) => (t + 1) % 1000000); }} > - {/* Compact attribution (closed by default) */} - {/* Stop marker (center) */} {stop.latitude && stop.longitude && ( @@ -490,6 +485,28 @@ export const StopMap: React.FC = ({ + +
+ +
+ OpenFreeMap © OpenMapTiles data from + + OpenStreetMap + +
+
); }; -- cgit v1.3