Skip to content

Commit

Permalink
feat(download): download as TCX
Browse files Browse the repository at this point in the history
  • Loading branch information
devshred committed Mar 12, 2024
1 parent 478785d commit e50c4ed
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/components/merge/MergeFiles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,24 @@ const MergeFiles = () => {
<a
href={
mergedFile.href +
'?m=dl' +
'?mode=dl&type=gpx' +
(trackname.length > 0 ? `&name=${trackname}` : '')
}
>
<FiDownload className='inline mr-1' />
{trackname}.gpx
</a>
<br />
<a
href={
mergedFile.href +
'?mode=dl&type=tcx' +
(trackname.length > 0 ? `&name=${trackname}` : '')
}
>
<FiDownload className='inline mr-1' />
{trackname}.tcx
</a>
</div>
<br />
<button className='btn btn-active mb-7' onClick={handleReset}>
Expand Down
7 changes: 6 additions & 1 deletion src/components/merge/VisualizeTrack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ const VisualizeTrack: React.FC<VisualizeTrackProps> = ({

useEffect(() => {
setIsLoading(true)
API.get('/files/' + trackId).then((file) => {
const config = {
headers: {
accept: 'application/gpx+xml',
},
}
API.get('/files/' + trackId, config).then((file) => {
var gpx = new GpxParser()
gpx.parse(file.data)

Expand Down

0 comments on commit e50c4ed

Please sign in to comment.