Skip to content

Commit

Permalink
Don't accidentally share route click behavior in score mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Dec 11, 2023
1 parent fe3e3ac commit 9d7c9ae
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion web/src/App.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import turfBbox from "@turf/bbox";
import { GeoJSON, LineLayer, MapLibre, Marker, Popup } from "svelte-maplibre";
import { GeoJSON, LineLayer, MapLibre, Popup } from "svelte-maplibre";
import { colorScale, limits } from "./colors";
import { Layout, Legend, SequentialLegend } from "./common";
import Directions from "./Directions.svelte";
Expand Down
15 changes: 13 additions & 2 deletions web/src/ScoreLayer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { GeoJSON, LineLayer, Popup } from "svelte-maplibre";
import { colorScale, limits } from "./colors";
import { constructMatchExpression, makeColorRamp } from "./common";
import RouteLayer from "./RouteLayer.svelte";
export let model;
export let map;
Expand Down Expand Up @@ -91,4 +90,16 @@
>
</LineLayer>
</GeoJSON>
<RouteLayer {route_gj} route_a={null} route_b={null} {map} />
{#if route_gj}
<GeoJSON data={route_gj}>
<LineLayer
id="route"
beforeId="network"
paint={{
"line-width": 20,
"line-color": "cyan",
"line-opacity": 0.5,
}}
/>
</GeoJSON>
{/if}

0 comments on commit 9d7c9ae

Please sign in to comment.