refactoring for tools and start waypoint

This commit is contained in:
vcoppe
2024-04-28 18:59:31 +02:00
parent 6b201d8341
commit 583af07412
10 changed files with 202 additions and 95 deletions

View File

@@ -4,6 +4,7 @@ import mapboxgl from 'mapbox-gl';
import { GPXFile, buildGPX, parseGPX, type AnyGPXTreeElement } from 'gpx';
import { tick } from 'svelte';
import { _ } from 'svelte-i18n';
import type { GPXLayer } from '$lib/components/gpx-layer/GPXLayer';
export const map = writable<mapboxgl.Map | null>(null);
export const files = writable<Writable<GPXFile>[]>([]);
@@ -16,8 +17,19 @@ export const settings = writable<{ [key: string]: any }>({
temperatureUnits: 'celsius',
mode: 'system'
});
export const gpxLayers: Writable<Map<Writable<GPXFile>, GPXLayer>> = writable(new Map());
export enum Tool {
ROUTING
ROUTING,
TIME,
REVERSE,
MERGE,
EXTRACT,
WAYPOINT,
REDUCE,
CLEAN,
STYLE,
STRUCTURE
}
export const currentTool = writable<Tool | null>(null);