Skip to content

Commit

Permalink
Feedback for #343
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Sep 18, 2023
1 parent 323778d commit f8a1c2a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
20 changes: 10 additions & 10 deletions src/lib/browse/layers/CrossingsLayerControl.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
let show = false;
function tooltip(feature: MapGeoJSONFeature): string {
const crossingTypeString = feature.properties.crossing;
if (crossingTypeString === "no")
return "Location where crossing is impossible/illegal but where there is a clear desire line to cross.";
let result = "Crossing with the following features.";
const initialTooltipSentence =
initialTooltipSentences.get(crossingTypeString);
if (initialTooltipSentence) result = initialTooltipSentence;
return `<p>${result}. Click for details.</p>`;
const crossingType = feature.properties.crossing;
let description =
descriptions.get(crossingType) ??
`Crossing with unknown type (${crossingType}).`;
return `<p>${description}. Click for details.</p>`;
}
const initialTooltipSentences: Map<string, string> = new Map<string, string>([
const descriptions: Map<string, string> = new Map([
[
"no",
"Location where crossing is impossible/illegal but where there is a clear desire line to cross.",
],
["traffic_signals", "Signalised crossing"],
["marked", "Crossing with no traffic signals"],
["uncontrolled", "Crossing with no traffic signals"],
Expand Down
8 changes: 1 addition & 7 deletions src/lib/browse/layers/RailwayStationsLayerControl.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,4 @@
</span>
</Checkbox>

<InteractiveLayer
layer={name}
{tooltip}
{show}
clickable={false}
on:click={() => {}}
/>
<InteractiveLayer layer={name} {tooltip} {show} clickable={false} />

0 comments on commit f8a1c2a

Please sign in to comment.