@@ -62,6 +75,9 @@
to see the route
+
diff --git a/web/src/stores.ts b/web/src/stores.ts
index 21cc64d..10f4495 100644
--- a/web/src/stores.ts
+++ b/web/src/stores.ts
@@ -1,19 +1,36 @@
import { MapModel } from "backend";
import type { FeatureCollection } from "geojson";
import type { Map } from "maplibre-gl";
-import { writable, type Writable } from "svelte/store";
+import { get, writable, type Writable } from "svelte/store";
export let maptilerApiKey = "MZEJTanw3WpxRvt7qDfo";
-export type Mode = "title" | "score" | "route" | "debug";
+export type Mode =
+ | { kind: "title" }
+ | { kind: "score" }
+ | { kind: "route"; route_a: [number, number]; route_b: [number, number] }
+ | { kind: "debug" };
export interface RouteGJ extends FeatureCollection {
direct_length: number;
route_length: number;
}
-export let mode: Writable = writable("title");
+export let mode: Writable = writable({ kind: "title" });
export let model: Writable = writable(null);
export let map: Writable