Trying to save a simple GPX.

This commit is contained in:
Eric van der Vlist 2022-11-07 17:04:02 +01:00
parent 510736a33a
commit 2f362916da
4 changed files with 28 additions and 26 deletions

View File

@ -95,6 +95,7 @@ export const setCenterAtom = atom(null, (get, set, center: geoPoint) => {
// initDb(db);
dispatch({ action: 'initDb' });
dispatch({ action: 'putNewGpx', params: 'gpxid' });
/**
*

View File

@ -37,21 +37,21 @@ describe('The gpx module', () => {
'xsi:schemaLocation':
'http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www8.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/WaypointExtension/v1 http://www8.garmin.com/xmlschemas/WaypointExtensionv1.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd',
},
extensions: undefined,
extensions: '',
metadata: {
author: undefined,
bounds: undefined,
copyright: undefined,
desc: undefined,
extensions: undefined,
keywords: undefined,
link: undefined,
name: undefined,
author: '',
bounds: '',
copyright: '',
desc: '',
extensions: '',
keywords: '',
link: '',
name: '',
time: '1970-01-01T00:00:00.000Z',
},
rte: undefined,
trk: undefined,
wpt: undefined,
rte: [],
trk: [],
wpt: [],
},
type: 'gpx',
});

View File

@ -20,20 +20,20 @@ const emptyGpx: Gpx = {
'xmlns:dyo': 'http://xmlns.dyomedea.com/',
},
metadata: {
name: undefined,
desc: undefined,
author: undefined,
copyright: undefined,
link: undefined,
time: undefined,
keywords: undefined,
bounds: undefined,
extensions: undefined,
name: '',
desc: '',
author: '',
copyright: '',
link: '',
time: '',
keywords: '',
bounds: '',
extensions: '',
},
wpt: undefined,
rte: undefined,
trk: undefined,
extensions: undefined,
wpt: [],
rte: [],
trk: [],
extensions: '',
};
export const putNewGpx = (id: string) => {

View File

@ -1,8 +1,9 @@
import { initDb } from '../db';
import { putNewGpx } from '../db/gpx';
const self = globalThis as unknown as SharedWorkerGlobalScope;
const actions = { initDb };
const actions = { initDb, putNewGpx };
self.onconnect = function (e) {
var port = e.ports[0];