Starting to implement a selection mechanism to define what should be drawn

This commit is contained in:
vdv committed 2023-08-03 18:46:08 +02:00
1 parent b9c2cf3448
commit 68d1f8140a
8 files changed
+124

No files matched your search

+2
View File
@@ -8,6 +8,7 @@ import { getOverlays } from './overlays';
import { getRte } from './rte';
import { getTrk } from './trk';
import { getTrkseg } from './trkseg';
import { getDrawingSelections } from './drawing-selections';
declare global {
var watches: Map<string, any>;
@@ -21,6 +22,7 @@ const methods = {
getWpt,
getRte,
getOverlays,
getDrawingSelections,
};
const sendUpdate = async (params: any) => {
+18
View File
@@ -0,0 +1,18 @@
import { get, put } from './lib';
export const getDrawingSelections = async (params: any) => {
const { id, defaultDrawingSelections } = params;
try {
const drawingSelections = await get(id, true);
return drawingSelections.doc;
} catch (error: any) {
console.error({ caller: 'defaultDrawingSelections', error });
return defaultDrawingSelections;
}
};
export const putDrawingSelections = async (params: any) => {
const { id, drawingSelections } = params;
await put(id, 'drawingSelections', (doc) => drawingSelections, {}, true);
return drawingSelections;
};