From 0f36f3b71a50944997293d1b00ff697d29f70de0 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Mon, 31 Jul 2023 13:58:52 +0100 Subject: [PATCH] Add ward layer. #285 --- ...iamentaryConstituenciesLayerControl.svelte | 1 + src/lib/browse/WardsLayerControl.svelte | 91 +++++++++++++++++++ src/lib/browse/colors.ts | 1 + src/maplibre_helpers.ts | 2 + src/pages/BrowseSchemes.svelte | 2 + 5 files changed, 97 insertions(+) create mode 100644 src/lib/browse/WardsLayerControl.svelte diff --git a/src/lib/browse/ParliamentaryConstituenciesLayerControl.svelte b/src/lib/browse/ParliamentaryConstituenciesLayerControl.svelte index cd11f546a..1fe29bcb9 100644 --- a/src/lib/browse/ParliamentaryConstituenciesLayerControl.svelte +++ b/src/lib/browse/ParliamentaryConstituenciesLayerControl.svelte @@ -62,6 +62,7 @@ let name = e.detail.properties.Name; name = name.replace(/ Boro Const$/, ""); name = name.replace(/ Co Const$/, ""); + name = encodeURIComponent(name); // Help people find the MP for this area window.open( diff --git a/src/lib/browse/WardsLayerControl.svelte b/src/lib/browse/WardsLayerControl.svelte new file mode 100644 index 000000000..dec8db8af --- /dev/null +++ b/src/lib/browse/WardsLayerControl.svelte @@ -0,0 +1,91 @@ + + + + + Wards + + +

+ Data from + ONS Geography + , as of May 2023. +

+

+ License: + Open Government License + . Contains OS data © Crown copyright and database + right 2023. +

+
+
+
+ + diff --git a/src/lib/browse/colors.ts b/src/lib/browse/colors.ts index e43629011..dff91a225 100644 --- a/src/lib/browse/colors.ts +++ b/src/lib/browse/colors.ts @@ -4,6 +4,7 @@ export const colors = { hospitals: "#B73D25", mrn: "#006478", parliamentary_constituencies: "#006E59", + wards: "purple", atf2: "#00AFFF", atf3: "#FF62DC", diff --git a/src/maplibre_helpers.ts b/src/maplibre_helpers.ts index 5f8504abf..dd2b1a403 100644 --- a/src/maplibre_helpers.ts +++ b/src/maplibre_helpers.ts @@ -318,6 +318,8 @@ const layerZorder = [ "mrn", "parliamentary_constituencies", "parliamentary_constituencies-outline", + "wards", + "wards-outline", // Draw most things beneath text road labels. This is the only layer in this // list generated by the MapTiler basemap we use. diff --git a/src/pages/BrowseSchemes.svelte b/src/pages/BrowseSchemes.svelte index 5e2bb43b6..7fc69d616 100644 --- a/src/pages/BrowseSchemes.svelte +++ b/src/pages/BrowseSchemes.svelte @@ -12,6 +12,7 @@ import ParliamentaryConstituenciesLayerControl from "../lib/browse/ParliamentaryConstituenciesLayerControl.svelte"; import SchemeCard from "../lib/browse/SchemeCard.svelte"; import SchoolsLayerControl from "../lib/browse/SchoolsLayerControl.svelte"; + import WardsLayerControl from "../lib/browse/WardsLayerControl.svelte"; import { BaselayerSwitcher, CollapsibleCard, @@ -142,6 +143,7 @@ +