From 9c46f11a945b70ed925c6a8649674af734ba5cbf Mon Sep 17 00:00:00 2001 From: muerwre Date: Mon, 18 Feb 2019 12:21:29 +0700 Subject: [PATCH] gpx fix --- src/utils/gpx.ts | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/src/utils/gpx.ts b/src/utils/gpx.ts index 3297644..413f112 100644 --- a/src/utils/gpx.ts +++ b/src/utils/gpx.ts @@ -9,37 +9,35 @@ interface IGetGPXString { points: Array, title?: string, } - -export const getGPXString = ({ points, title }: IGetGPXString): string => (` - - - - ${title || 'GPX Track'} - ${ - points.reduce((cat, { lat, lng }, index) => ( - ` ${cat} - ` - ), '') - } - - -`); - -// export const getGPXString = ({ points, title }: IGetGPXString): string => (` -// +// +// export const getGPXString = ({ points, title }: IGetGPXString): string => (` // // // ${title || 'GPX Track'} // ${ // points.reduce((cat, { lat, lng }, index) => ( -// `${cat} -// ` +// ` ${cat} +// ` // ), '') // } // // // `); +export const getGPXString = ({ points, title }: IGetGPXString): string => (` + + + ${title || 'GPX Track'} + ${ + points.reduce((cat, { lat, lng }, index) => ( + `${cat} +` + ), '') + } + + +`); + export const downloadGPXTrack = ({ track, title }: { track: string, title?: string }) => ( saveAs( new Blob([track], { type: 'application/gpx+xml;charset=utf-8' }),