-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move some stuff into stores here, mimicking the LTN app structure
- Loading branch information
1 parent
803e674
commit 66a8034
Showing
7 changed files
with
87 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<script lang="ts"> | ||
import { mapContents, sidebarContents } from "./stores"; | ||
// The kinda weird hack is that this must itself be nested underneath the | ||
// MapLibre bit, so it has context. The sidebar is the "remote" part. | ||
// TODO Maybe simplify accordingly | ||
</script> | ||
|
||
<div bind:this={$sidebarContents}> | ||
<slot name="sidebar" /> | ||
</div> | ||
<div bind:this={$mapContents}> | ||
<slot name="map" /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { MapModel } from "backend"; | ||
import type { Map } from "maplibre-gl"; | ||
import { writable, type Writable } from "svelte/store"; | ||
|
||
export let sidebarContents: Writable<HTMLDivElement | null> = writable(null); | ||
export let mapContents: Writable<HTMLDivElement | null> = writable(null); | ||
|
||
export type Mode = "score" | "route"; | ||
|
||
export let mode: Writable<Mode> = writable("score"); | ||
export let model: Writable<MapModel | null> = writable(null); | ||
export let map: Writable<Map | null> = writable(null); |