Support uploading .geojson files directly
A .geojson file needs no GPX/FIT conversion — it's already the shape gpx.js expects — so GpxStore#geojson now just reads and returns it as-is, no cache sidecar. save/tree/the upload dropzone and its zip handling all pick it up through the existing TRACK_EXTENSIONS list. Also fixes a bug the new "cached" tree icon would have shipped with: a GPX/FIT's own .geojson cache sidecar (e.g. "ride.gpx.geojson") also matches the new .geojson branch in list_children, which would have listed it as a second, phantom tree entry — excluded explicitly, with a regression test.
This commit is contained in:
1 parent
44d235bbcf
commit
b4f205667b
8 files changed
+110
-19
No files matched your search
+6
-3
@@ -620,9 +620,12 @@ export class GpxPanelControl {
|
||||
|
||||
async _uploadFiles(fileList, folder) {
|
||||
// .zip: Garmin's bulk/FIT export format — the server expands it into
|
||||
// its .gpx/.fit entries, so it's accepted here even though the tree
|
||||
// never shows a .zip itself.
|
||||
const files = [...fileList].filter((file) => /\.(gpx|fit|zip)$/i.test(file.name));
|
||||
// its .gpx/.fit/.geojson entries, so it's accepted here even though the
|
||||
// tree never shows a .zip itself. .geojson needs no server-side
|
||||
// conversion (GpxStore#geojson serves it as-is) — accepted here so a
|
||||
// file already in this app's own shape (e.g. a previous /api/gpx/file
|
||||
// response, saved and re-uploaded) can skip GPX/FIT entirely.
|
||||
const files = [...fileList].filter((file) => /\.(gpx|fit|geojson|zip)$/i.test(file.name));
|
||||
if (files.length === 0) return;
|
||||
|
||||
this._setStatus(files.length === 1 ? "Uploading…" : `Uploading ${files.length} files…`);
|
||||
|
||||
Reference in new issue
Block a user