mirror of
https://github.com/task-17-lct/frontend.git
synced 2024-11-22 03:26:34 +03:00
sss
This commit is contained in:
parent
c27fa3c472
commit
6b07040476
|
@ -25,13 +25,16 @@ export const MyMap: React.FC<MapIE> = (props) =>{
|
||||||
});
|
});
|
||||||
|
|
||||||
const [route, setRoute] = useState()
|
const [route, setRoute] = useState()
|
||||||
|
|
||||||
console.log(route)
|
console.log(route)
|
||||||
|
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
axios.get('https://api.mapbox.com/directions/v5/mapbox/walking/'+pathString+'?alternatives=true&continue_straight=true&geometries=geojson&language=en&overview=simplified&steps=true&access_token=pk.eyJ1IjoiZmlyZXNpZWh0IiwiYSI6ImNrdW9kemYzbTB4ZGkycHAxbXN2YnIzaGMifQ.G0fl-qVbecucfOvn8OtU4Q').then(
|
setTimeout(()=> axios.get('https://api.mapbox.com/directions/v5/mapbox/walking/'+pathString+'?alternatives=true&continue_straight=true&geometries=geojson&language=en&overview=simplified&steps=true&access_token=pk.eyJ1IjoiZmlyZXNpZWh0IiwiYSI6ImNrdW9kemYzbTB4ZGkycHAxbXN2YnIzaGMifQ.G0fl-qVbecucfOvn8OtU4Q').then(
|
||||||
(data:any) => setRoute(data.data.routes[0].geometry)
|
(data:any) => setRoute(data.data.routes[0].geometry)
|
||||||
)
|
), 1000)
|
||||||
})
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user