diff --git a/src/mapper/src/constants/baseLayers.ts b/src/mapper/src/constants/baseLayers.ts new file mode 100644 index 0000000000..d1a77e4f58 --- /dev/null +++ b/src/mapper/src/constants/baseLayers.ts @@ -0,0 +1,78 @@ +let stamenStyle = { + id: 'Stamen Raster', + version: 8, + name: 'Black & White', + sources: { + stamen: { + type: 'raster', + tiles: ['https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png'], + minzoom: 0, + maxzoom: 19, + attribution: `© Stadia Maps + © Stamen Design + © OpenMapTiles + `, + }, + }, + layers: [ + { + id: 'stamen', + type: 'raster', + source: 'stamen', + layout: { + visibility: 'visible', + }, + }, + ], +}; + +let esriStyle = { + id: 'ESRI Raster', + version: 8, + name: 'ESRI', + sources: { + esri: { + type: 'raster', + tiles: ['https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}'], + minzoom: 0, + maxzoom: 19, + attribution: '© ESRI', + }, + }, + layers: [ + { + id: 'esri', + type: 'raster', + source: 'esri', + layout: { + visibility: 'visible', + }, + }, + ], +}; + +let satellite = { + id: 'Satellite', + version: 8, + name: 'Satellite', + sources: { + satellite: { + type: 'raster', + tiles: ['https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}'], + tileSize: 256, + attribution: 'ArcGIS', + }, + }, + layers: [ + { + id: 'satellite', + type: 'raster', + source: 'satellite', + layout: { + visibility: 'visible', + }, + }, + ], +}; + +export const baseLayers = [stamenStyle, esriStyle, satellite]; diff --git a/src/mapper/src/lib/components/map/geolocation.svelte b/src/mapper/src/lib/components/map/geolocation.svelte index 9c25faf329..65a012c7a7 100644 --- a/src/mapper/src/lib/components/map/geolocation.svelte +++ b/src/mapper/src/lib/components/map/geolocation.svelte @@ -1,8 +1,8 @@ - - + + diff --git a/src/mapper/src/lib/components/map/layer-switcher.svelte b/src/mapper/src/lib/components/map/layer-switcher.svelte index 33e98495be..77f0e2e0c3 100644 --- a/src/mapper/src/lib/components/map/layer-switcher.svelte +++ b/src/mapper/src/lib/components/map/layer-switcher.svelte @@ -1,22 +1,218 @@ - -
(isOpen = false)} class="relative"> -
(isOpen = !isOpen)}> - +
(isOpen = false)}> +
(isOpen = !isOpen)} + role="button" + onkeydown={(e) => { + if (e.key === 'Enter') { + isOpen = !isOpen; + } + }} + tabindex="0" + > + Basemap Icon
- Layer Switcher +

Base Maps

+
+ {#each allStyles as style, _} +
selectStyle(style)} + role="button" + onkeydown={(e) => { + if (e.key === 'Enter') selectStyle(style); + }} + tabindex="0" + > + Style Thumbnail + {style.name} +
{/each} +
- + diff --git a/src/mapper/src/lib/components/map/legend.svelte b/src/mapper/src/lib/components/map/legend.svelte index a78b795c4d..e700146779 100644 --- a/src/mapper/src/lib/components/map/legend.svelte +++ b/src/mapper/src/lib/components/map/legend.svelte @@ -19,7 +19,17 @@
(isOpen = false)} class="relative"> -
(isOpen = !isOpen)}> +
(isOpen = !isOpen)} + role="button" + onkeydown={(e) => { + if (e.key === 'Enter') { + isOpen = !isOpen; + } + }} + tabindex="0" + > -

Legend

+

Legend

{#each taskStatuses as taskStatus}
{#if !taskStatus.color} @@ -37,7 +47,10 @@
{:else} -
+
{/if}

{taskStatus?.status}

diff --git a/src/mapper/src/lib/components/map/main.svelte b/src/mapper/src/lib/components/map/main.svelte index 2372a4db9b..a9c5ce7d61 100644 --- a/src/mapper/src/lib/components/map/main.svelte +++ b/src/mapper/src/lib/components/map/main.svelte @@ -33,6 +33,7 @@ import { getProjectSetupStepStore } from '$store/common.svelte.ts'; // import { entityFeatcolStore, selectedEntityId } from '$store/entities'; import { projectSetupStep as projectSetupStepEnum } from '$constants/enums.ts'; + import { baseLayers } from '$constants/baseLayers.ts'; type bboxType = [number, number, number, number]; @@ -220,10 +221,10 @@ manageHoverState /> -
- + + -
+ {#if projectSetupStep === projectSetupStepEnum['task_selection']}

please select a task / feature for mapping