diff --git a/app/src/frontend/map/layers/city-base-map-layer.tsx b/app/src/frontend/map/layers/city-base-map-layer.tsx index 315b7573..bfa58f4e 100644 --- a/app/src/frontend/map/layers/city-base-map-layer.tsx +++ b/app/src/frontend/map/layers/city-base-map-layer.tsx @@ -9,25 +9,30 @@ const OS_API_KEY = 'UVWEspgInusDKKYANE5bmyddoEmCSD4r'; * Base raster layer for the map. * @param theme map theme */ -export function CityBaseMapLayer({theme}: {theme: MapTheme}) { +export function CityBaseMapLayer({ theme }: { theme: MapTheme }) { /** * Ordnance Survey maps - UK / London specific * (replace with appropriate base map for other cities/countries) */ const apiKey = OS_API_KEY; - const layer = theme === 'light' ? 'Light_3857' : 'Night 3857'; - + + // Note that OS APIs does not provide dark theme + const layer = 'Light_3857'; + + // In either theme case, we will use OS's light theme, but add our own filter + const theme_class = theme === 'light' ? "light-theme" : "night-theme"; + const baseUrl = `https://api.os.uk/maps/raster/v1/zxy/${layer}/{z}/{x}/{y}.png?key=${apiKey}`; const attribution = 'Building attribute data is © Colouring London contributors. Maps contain OS data © Crown copyright: OS Maps baselayers and building outlines. OS licence'; - + return ; } diff --git a/app/src/frontend/map/map.tsx b/app/src/frontend/map/map.tsx index c2a3dda2..6df2bac4 100644 --- a/app/src/frontend/map/map.tsx +++ b/app/src/frontend/map/map.tsx @@ -144,7 +144,7 @@ export const ColouringMap : FC = ({ } - {/* */} + } diff --git a/app/src/frontend/map/theme-switcher.css b/app/src/frontend/map/theme-switcher.css index 19187414..eaa78dcb 100644 --- a/app/src/frontend/map/theme-switcher.css +++ b/app/src/frontend/map/theme-switcher.css @@ -1,3 +1,11 @@ +.night-theme { + filter: grayscale(100%) invert(1); +} + +.light-theme { + filter: none; +} + .theme-switcher { z-index: 1000; position: absolute;