Skip to content

Commit

Permalink
Hide severances sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Dec 7, 2023
1 parent e828cb3 commit 54fcad5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
7 changes: 6 additions & 1 deletion web/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
let route_b = null;
let route_gj = null;
let route_err = "";
let showSeverances = true;
onMount(async () => {
await init();
Expand Down Expand Up @@ -117,6 +118,10 @@
/>

{#if mode == "route"}
<label>
<input type="checkbox" bind:checked={showSeverances} />
Show severances
</label>
{#if route_err}
<p>{route_err}</p>
{/if}
Expand All @@ -140,7 +145,7 @@
>
{#if model}
{#if mode == "route"}
<NetworkLayer {model} />
<NetworkLayer {model} {showSeverances} />
<RouteLayer bind:route_a bind:route_b {route_gj} />
{:else if mode == "score"}
<ScoreLayer {model} />
Expand Down
11 changes: 11 additions & 0 deletions web/src/NetworkLayer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import { constructMatchExpression } from "./common";
export let model;
// TODO Use filter expressions?
export let showSeverances: boolean;
</script>

<GeoJSON data={JSON.parse(model.render())}>
Expand All @@ -22,6 +24,15 @@
},
"yellow"
),
"line-opacity": showSeverances
? 1.0
: constructMatchExpression(
["get", "kind"],
{
Severance: 0.0,
},
1.0
),
}}
on:click={(e) => window.open(e.detail.features[0].properties.way, "_blank")}
hoverCursor="pointer"
Expand Down

0 comments on commit 54fcad5

Please sign in to comment.