mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
better gpx route error handling
This commit is contained in:
parent
e995b46641
commit
3ffba24994
2 changed files with 19 additions and 13 deletions
|
@ -384,13 +384,15 @@ function* uploadGpx({ file }: ReturnType<typeof editorUploadGpx>) {
|
|||
editorSetGpx({
|
||||
list: [
|
||||
...list,
|
||||
...gpx.map(item => ({
|
||||
enabled: true,
|
||||
latlngs: item.latlngs,
|
||||
color: getRandomColor(),
|
||||
name: item.name || `Track #${list.length + 1}`,
|
||||
id: uuid() as string,
|
||||
})),
|
||||
...gpx
|
||||
.filter(item => item.latlngs && item.latlngs.length)
|
||||
.map(item => ({
|
||||
enabled: true,
|
||||
latlngs: item.latlngs,
|
||||
color: getRandomColor(),
|
||||
name: item.name || `Track #${list.length + 1}`,
|
||||
id: uuid() as string,
|
||||
})),
|
||||
],
|
||||
})
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue