fix: error when rendering null alternates
This commit is contained in:
@ -90,11 +90,13 @@
|
||||
]);
|
||||
const res = await fetchRoute(ROUTING_SERVER, req);
|
||||
routes = [res.trip];
|
||||
if(res.alternates) {
|
||||
for (const alternate of res.alternates) {
|
||||
if (alternate.trip) {
|
||||
routes.push(alternate.trip);
|
||||
}
|
||||
}
|
||||
}
|
||||
drawAllRoutes(routes);
|
||||
zoomToPoints(FROM, TO, map.value!);
|
||||
}}>Calculate</Button
|
||||
|
||||
Reference in New Issue
Block a user