From 56ef3a2c406bcf80c34df5d2615aaccefc404f61 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Fri, 10 Jan 2025 11:11:06 +0000 Subject: [PATCH] Start splitting RenderNeighbourhood into layers --- web/src/DebugMode.svelte | 60 +++++++++------- web/src/ImpactOneDestinationMode.svelte | 2 +- web/src/NetworkMode.svelte | 2 +- web/src/RenderNeighbourhood.svelte | 75 +------------------- web/src/RouteMode.svelte | 12 +++- web/src/ViewShortcutsMode.svelte | 13 +++- web/src/edit/NeighbourhoodMode.svelte | 15 +++- web/src/layers/CellLayer.svelte | 33 +++++++++ web/src/layers/HighlightBoundaryLayer.svelte | 41 +++++++++++ web/src/{ => layers}/ModalFilterLayer.svelte | 4 +- web/src/{ => layers}/OneWayLayer.svelte | 2 +- web/src/layers/index.ts | 4 ++ 12 files changed, 155 insertions(+), 108 deletions(-) create mode 100644 web/src/layers/CellLayer.svelte create mode 100644 web/src/layers/HighlightBoundaryLayer.svelte rename web/src/{ => layers}/ModalFilterLayer.svelte (87%) rename web/src/{ => layers}/OneWayLayer.svelte (93%) create mode 100644 web/src/layers/index.ts diff --git a/web/src/DebugMode.svelte b/web/src/DebugMode.svelte index 17f3fa5..9810894 100644 --- a/web/src/DebugMode.svelte +++ b/web/src/DebugMode.svelte @@ -5,6 +5,7 @@ import { SplitComponent } from "svelte-utils/top_bar_layout"; import BackButton from "./BackButton.svelte"; import { layerId, Link } from "./common"; + import { CellLayer, HighlightBoundaryLayer, OneWayLayer } from "./layers"; import RenderNeighbourhood from "./RenderNeighbourhood.svelte"; import { backend, mode } from "./stores"; @@ -38,6 +39,39 @@
+ + + + + + + + + + + + + + + + + + +
- - - - - - - - - - - - diff --git a/web/src/ImpactOneDestinationMode.svelte b/web/src/ImpactOneDestinationMode.svelte index a247160..7b0f607 100644 --- a/web/src/ImpactOneDestinationMode.svelte +++ b/web/src/ImpactOneDestinationMode.svelte @@ -11,7 +11,7 @@ import { SplitComponent } from "svelte-utils/top_bar_layout"; import BackButton from "./BackButton.svelte"; import { DotMarker, layerId, Link } from "./common"; - import ModalFilterLayer from "./ModalFilterLayer.svelte"; + import { ModalFilterLayer } from "./layers"; import { backend, mode, diff --git a/web/src/NetworkMode.svelte b/web/src/NetworkMode.svelte index 2983d23..537d748 100644 --- a/web/src/NetworkMode.svelte +++ b/web/src/NetworkMode.svelte @@ -8,7 +8,7 @@ import editIcon from "../assets/edit.svg?url"; import { HelpButton, layerId, Link } from "./common"; import { pickNeighbourhoodName } from "./common/pick_names"; - import ModalFilterLayer from "./ModalFilterLayer.svelte"; + import { ModalFilterLayer } from "./layers"; import { autosave, backend, diff --git a/web/src/RenderNeighbourhood.svelte b/web/src/RenderNeighbourhood.svelte index d5eb990..d5c9139 100644 --- a/web/src/RenderNeighbourhood.svelte +++ b/web/src/RenderNeighbourhood.svelte @@ -1,14 +1,8 @@ - - - - - - - - - {/if} - - - - diff --git a/web/src/RouteMode.svelte b/web/src/RouteMode.svelte index 765d374..4a334d0 100644 --- a/web/src/RouteMode.svelte +++ b/web/src/RouteMode.svelte @@ -5,7 +5,12 @@ import { SplitComponent } from "svelte-utils/top_bar_layout"; import BackButton from "./BackButton.svelte"; import { DotMarker, layerId, Link } from "./common"; - import ModalFilterLayer from "./ModalFilterLayer.svelte"; + import { + CellLayer, + HighlightBoundaryLayer, + ModalFilterLayer, + OneWayLayer, + } from "./layers"; import RenderNeighbourhood from "./RenderNeighbourhood.svelte"; import { backend, @@ -77,6 +82,11 @@
{#if prevMode == "neighbourhood"} + + + + +
+ + + + + + {#if state.state == "neutral"}
+ + + + + + + import { FillLayer, LineLayer } from "svelte-maplibre"; + import { layerId } from "../common"; + import { roadStyle } from "../stores"; + + + + + + diff --git a/web/src/layers/HighlightBoundaryLayer.svelte b/web/src/layers/HighlightBoundaryLayer.svelte new file mode 100644 index 0000000..3ad0f39 --- /dev/null +++ b/web/src/layers/HighlightBoundaryLayer.svelte @@ -0,0 +1,41 @@ + + + + + diff --git a/web/src/ModalFilterLayer.svelte b/web/src/layers/ModalFilterLayer.svelte similarity index 87% rename from web/src/ModalFilterLayer.svelte rename to web/src/layers/ModalFilterLayer.svelte index 6ecee87..3fc5f50 100644 --- a/web/src/ModalFilterLayer.svelte +++ b/web/src/layers/ModalFilterLayer.svelte @@ -1,8 +1,8 @@