@@ -2,7 +2,7 @@ import { useEffect, useState, useRef, useCallback } from 'react'
22import L from 'leaflet'
33import 'leaflet/dist/leaflet.css'
44import { 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
5151export 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 ) ;
0 commit comments