Skip to content

Commit c32f7dd

Browse files
refactor(routes): Removed unused routestep
1 parent dda3654 commit c32f7dd

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

frontend/src/components/LeafletMap.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useEffect, useState, useRef, useCallback } from 'react'
22
import L from 'leaflet'
33
import 'leaflet/dist/leaflet.css'
44
import {Loader2 } from 'lucide-react'
5-
import { RouteStep,LeafletMapProps} from '@/types/LeafletMaps';
5+
import {LeafletMapProps} from '@/types/LeafletMaps';
66

77

88
// Fix for default markers not showing in bundled environments
@@ -50,7 +50,6 @@ const createTurnIcon = () => {
5050

5151
export default function LeafletMap({ from, to, animateKey, isPredicting }: LeafletMapProps) {
5252
const [isRouteLoading, setIsRouteLoading] = useState(false)
53-
const [routeSteps, setRouteSteps] = useState<RouteStep[]>([])
5453
const [routeError, setRouteError] = useState<string | null>(null);
5554

5655
// Refs to hold Leaflet instances, preventing re-initialization on re-renders
@@ -136,7 +135,6 @@ export default function LeafletMap({ from, to, animateKey, isPredicting }: Leafl
136135
setIsRouteLoading(true);
137136
clearTurnMarkers();
138137
setRouteError(null);
139-
setRouteSteps([]);
140138
if (routeLayerRef.current) routeLayerRef.current.remove();
141139

142140
try {
@@ -166,7 +164,6 @@ export default function LeafletMap({ from, to, animateKey, isPredicting }: Leafl
166164
if (!routeData?.features?.[0]) throw new Error("No route feature found.");
167165

168166
animateRoute(routeData.features[0]);
169-
setRouteSteps(routeData.features[0]?.properties?.legs?.[0]?.steps || []);
170167
} catch (error) {
171168
if (error instanceof Error) {
172169
console.error("Final routing error:", error.message);

frontend/src/types/LeafletMaps.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,3 @@ export interface LeafletMapProps {
1111
animateKey?: string | number
1212
isPredicting?: boolean
1313
}
14-
15-
export interface RouteStep {
16-
instruction: {
17-
text: string
18-
}
19-
}

0 commit comments

Comments
 (0)