From acca2aba14194b3515de9fec2cc224789abafb5c Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Tue, 11 Feb 2020 10:24:53 +0700 Subject: [PATCH] fixed gpx importing --- src/utils/gpx.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/utils/gpx.ts b/src/utils/gpx.ts index 4134b8e..67e3560 100644 --- a/src/utils/gpx.ts +++ b/src/utils/gpx.ts @@ -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, }, ];