aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/app/routes/map.tsx
diff options
context:
space:
mode:
authorAriel Costas Guerrero <ariel@costas.dev>2025-12-12 18:23:46 +0100
committerAriel Costas Guerrero <ariel@costas.dev>2025-12-12 18:23:46 +0100
commitffb8ee87898bffe5fee706abb047133585bb5d0d (patch)
tree1735caa33ddce3fb9d847c5e9121451dc5aa76a7 /src/frontend/app/routes/map.tsx
parent9d38db605e25febc81f8832f4756cbb6cfc010b8 (diff)
feat: enhance OTP service logic, improve planner overlay, and update NavBar styles
Diffstat (limited to 'src/frontend/app/routes/map.tsx')
-rw-r--r--src/frontend/app/routes/map.tsx30
1 files changed, 2 insertions, 28 deletions
diff --git a/src/frontend/app/routes/map.tsx b/src/frontend/app/routes/map.tsx
index 3d59efb..39fc062 100644
--- a/src/frontend/app/routes/map.tsx
+++ b/src/frontend/app/routes/map.tsx
@@ -45,38 +45,11 @@ export default function StopMap() {
const { mapState, updateMapState, theme } = useApp();
const mapRef = useRef<MapRef>(null);
- const { searchRoute, origin, setOrigin } = usePlanner();
+ const { searchRoute } = usePlanner();
// Style state for Map component
const [mapStyle, setMapStyle] = useState<StyleSpecification>(DEFAULT_STYLE);
- // Set default origin to current location on first load (map page)
- useEffect(() => {
- // On the map page, always default to current location on load,
- // overriding any previously used address. The user can change it after.
- if (!navigator.geolocation) return;
- navigator.geolocation.getCurrentPosition(
- async (pos) => {
- try {
- // Keep display as "Current location" until a search is performed
- setOrigin({
- name: t("planner.current_location"),
- label: "GPS",
- lat: pos.coords.latitude,
- lon: pos.coords.longitude,
- layer: "current-location",
- });
- } catch (_) {
- // ignore
- }
- },
- () => {
- // ignore geolocation errors; user can set origin manually
- },
- { enableHighAccuracy: true, timeout: 10000 }
- );
- }, [setOrigin, t]);
-
// Handle click events on clusters and individual stops
const onMapClick = (e: MapLayerMouseEvent) => {
const features = e.features;
@@ -222,6 +195,7 @@ export default function StopMap() {
onNavigateToPlanner={() => navigate("/planner")}
clearPickerOnOpen={true}
showLastDestinationWhenCollapsed={false}
+ cardBackground="bg-white/95 dark:bg-slate-900/90"
/>
<Map