mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 02:56:41 +07:00
fixed gpx importing
This commit is contained in:
parent
b03c5ce0de
commit
acca2aba14
1 changed files with 1 additions and 6 deletions
|
@ -18,10 +18,6 @@ type GpxImportRaw = {
|
|||
trkseg: GpxImportTrkSeg[];
|
||||
}[];
|
||||
};
|
||||
// export interface IRoutePoint {
|
||||
// lat: number;
|
||||
// lng: number;
|
||||
// }
|
||||
|
||||
interface IGPXSticker {
|
||||
latlng: LatLng;
|
||||
|
@ -88,7 +84,6 @@ export const importGpxTrack = async (file: File) => {
|
|||
});
|
||||
|
||||
const gpx: GpxImportRaw = GPX.parse(content);
|
||||
console.log(gpx);
|
||||
|
||||
if (!gpx || !gpx.trk) return null;
|
||||
|
||||
|
@ -107,7 +102,7 @@ export const importGpxTrack = async (file: File) => {
|
|||
|
||||
return [
|
||||
{
|
||||
name: gpx.metadata.name || '',
|
||||
name: (gpx.metadata && gpx.metadata.name) || (gpx.trk && gpx.trk[0] && gpx.trk[0].name) || '',
|
||||
latlngs,
|
||||
},
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue