-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ce7d52
commit 5a6164d
Showing
5 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/style/main.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<script lang="ts"> | ||
import type { MapGeoJSONFeature } from "maplibre-gl"; | ||
import { | ||
overwriteCircleLayer, | ||
overwritePmtilesSource, | ||
} from "../../maplibre_helpers"; | ||
import { map } from "../../stores"; | ||
import { | ||
ColorLegend, | ||
ExternalLink, | ||
HelpButton, | ||
InteractiveLayer, | ||
} from "../common"; | ||
import { Checkbox } from "../govuk"; | ||
import { colors } from "./colors"; | ||
let name = "cycle_parking"; | ||
let color = colors.cycle_parking; | ||
overwritePmtilesSource( | ||
$map, | ||
name, | ||
`https://atip.uk/layers/v1/${name}.pmtiles` | ||
); | ||
overwriteCircleLayer($map, { | ||
id: name, | ||
source: name, | ||
sourceLayer: name, | ||
color, | ||
radius: 5, | ||
}); | ||
let show = false; | ||
function tooltip(feature: MapGeoJSONFeature): string { | ||
let capacity = feature.properties.capacity ?? "unknown"; | ||
return `<p>Capacity: ${capacity}</p>`; | ||
} | ||
</script> | ||
|
||
<Checkbox id={name} bind:checked={show}> | ||
<ColorLegend {color} /> | ||
Cycle parking | ||
<span slot="right"> | ||
<HelpButton> | ||
<p> | ||
Cycle parking, according to <ExternalLink | ||
href="https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dbicycle_parking" | ||
> | ||
OpenStreetMap | ||
</ExternalLink> (as of 9 August 2023). The type of parking, public/private | ||
access, and whether it's covered are not shown. | ||
</p> | ||
<p> | ||
License: <ExternalLink href="https://www.openstreetmap.org/copyright"> | ||
Open Data Commons Open Database License | ||
</ExternalLink> | ||
</p> | ||
</HelpButton> | ||
</span> | ||
</Checkbox> | ||
|
||
<InteractiveLayer layer={name} {tooltip} {show} clickable={false} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters