Skip to content

Commit

Permalink
Move draw controls into the map toolbox, out of the sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Oct 21, 2024
1 parent b575126 commit 82cafc8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"humanize-string": "^3.0.0",
"js-cookie": "^3.0.5",
"maplibre-gl": "^4.0.2",
"scheme-sketcher-lib": "github:acteng/scheme-sketcher-lib",
"scheme-sketcher-lib": "github:acteng/scheme-sketcher-lib#move_draw_controls",
"svelte": "^4.2.10",
"svelte-maplibre": "^0.9.7",
"uuid": "^9.0.1"
Expand Down
14 changes: 8 additions & 6 deletions src/pages/SketchSchemes.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import About from "lib/sketch/About.svelte";
import FileManagement from "lib/sketch/FileManagement.svelte";
import Instructions from "lib/sketch/Instructions.svelte";
import { PerModeControls } from "scheme-sketcher-lib/sidebar";
import { ListMode, EditForm } from "scheme-sketcher-lib/sidebar";
import { map, mapStyle, schema } from "stores";
import { onMount } from "svelte";
import { cfg } from "lib/sketch/config";
Expand Down Expand Up @@ -97,7 +97,6 @@
return authorityName;
}
// Need this to set up PerModeControls
$: if ($map) {
sketchMapStore.set($map);
}
Expand Down Expand Up @@ -128,7 +127,11 @@
</ButtonGroup>
{/if}
<FileManagement {cfg} {gjSchemes} {authorityName} />
<PerModeControls {cfg} {gjSchemes} {routeSnapperUrl} />
{#if $mode.mode == "list"}
<ListMode {cfg} {gjSchemes} />
{:else if $mode.mode == "edit-form"}
<EditForm {cfg} {gjSchemes} id={$mode.id} />
{/if}
{#if $mode.mode != "list"}
<hr />
{/if}
Expand All @@ -141,9 +144,8 @@
<BoundaryLayer {cfg} {boundaryGeojson} />
<InterventionLayer {cfg} {gjSchemes} />
<ImageLayer {cfg} />
{#if $mode.mode == "list"}
<Toolbox {cfg} {gjSchemes} />
{:else if $mode.mode == "split-route"}
<Toolbox {cfg} {gjSchemes} {routeSnapperUrl} />
{#if $mode.mode == "split-route"}
<SplitRouteMode {cfg} {gjSchemes} />
{/if}
<RouteSnapperLayer {cfg} />
Expand Down

0 comments on commit 82cafc8

Please sign in to comment.