From 8cd8d4ee603c8861c0a4a8e3db0c72e8eb1aea31 Mon Sep 17 00:00:00 2001 From: NSUWAL123 Date: Thu, 24 Oct 2024 12:06:31 +0545 Subject: [PATCH 01/17] fix(legend): style fix --- src/mapper/src/lib/components/page/legend.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mapper/src/lib/components/page/legend.svelte b/src/mapper/src/lib/components/page/legend.svelte index 91ca4a2357..50ea94a13e 100644 --- a/src/mapper/src/lib/components/page/legend.svelte +++ b/src/mapper/src/lib/components/page/legend.svelte @@ -18,8 +18,8 @@ ]; -
(isOpen = false)} class="relative"> -
(isOpen = !isOpen)}> +
(isOpen = false)} class="relative w-fit ml-auto"> +
(isOpen = !isOpen)}> Date: Thu, 24 Oct 2024 12:08:51 +0545 Subject: [PATCH 02/17] fix(legend): use absolute imports --- src/mapper/src/lib/components/page/legend.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mapper/src/lib/components/page/legend.svelte b/src/mapper/src/lib/components/page/legend.svelte index 50ea94a13e..21b777c0a7 100644 --- a/src/mapper/src/lib/components/page/legend.svelte +++ b/src/mapper/src/lib/components/page/legend.svelte @@ -1,7 +1,7 @@ -
(isOpen = false)} class="relative"> -
(isOpen = !isOpen)}> - -
-
- Layer Switcher -
+
+ {#each allStyles as style, _} + + {/each}
- + From a9b3eb56c92b555839276ff39f30adabed749898 Mon Sep 17 00:00:00 2001 From: NSUWAL123 Date: Thu, 24 Oct 2024 12:52:51 +0545 Subject: [PATCH 04/17] feat(baseLayers): base layer list add --- src/mapper/src/constants/baseLayers.ts | 105 +++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 src/mapper/src/constants/baseLayers.ts diff --git a/src/mapper/src/constants/baseLayers.ts b/src/mapper/src/constants/baseLayers.ts new file mode 100644 index 0000000000..5eccd6c735 --- /dev/null +++ b/src/mapper/src/constants/baseLayers.ts @@ -0,0 +1,105 @@ +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: 'background', + 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: 'background', + type: 'raster', + source: 'esri', + layout: { + visibility: 'visible', + }, + }, + ], +}; + +let osm = { + id: 'OSM', + version: 8, + name: 'OSM', + sources: { + osm: { + type: 'raster', + tiles: ['https://tile.openstreetmap.org/{z}/{x}/{y}.png'], + // minzoom: 0, + // maxzoom: 19, + tileSize: 256, + attribution: + 'Map tiles by OpenStreetMap tile servers, under the tile usage policy. Data by OpenStreetMap', + }, + }, + layers: [ + { + id: 'osm', + type: 'raster', + source: 'osm', + 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, osm, satellite]; From 70b0bea131c743fa74b7f46eadb37f377a30850b Mon Sep 17 00:00:00 2001 From: NSUWAL123 Date: Thu, 24 Oct 2024 12:54:38 +0545 Subject: [PATCH 05/17] fix(+page): base layer switcher add to component --- src/mapper/src/routes/[projectId]/+page.svelte | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/mapper/src/routes/[projectId]/+page.svelte b/src/mapper/src/routes/[projectId]/+page.svelte index d5eadd6cdc..736441ad1a 100644 --- a/src/mapper/src/routes/[projectId]/+page.svelte +++ b/src/mapper/src/routes/[projectId]/+page.svelte @@ -49,6 +49,7 @@ import LocationArcImg from '$assets/images/locationArc.png'; import LocationDotImg from '$assets/images/locationDot.png'; import { setAlert } from '$store/common'; + import { baseLayers } from '$constants/baseLayers.ts'; export let data: PageData; @@ -355,6 +356,10 @@ > + + + + (toggleGeolocationStatus = !toggleGeolocationStatus)} @@ -363,8 +368,8 @@ class={`!text-[1.2rem] cursor-pointer duration-200 ${toggleGeolocationStatus ? 'text-red-600' : 'text-[#52525B]'}`} > - + + {#if toggleGeolocationStatus} -
- - -
{#if $selectedTaskId && selectedTab === 'map' && toggleTaskActionModal && ($selectedTaskStatus === 'RELEASED_FOR_MAPPING' || $selectedTaskStatus === 'LOCKED_FOR_MAPPING')} From b4e64de6bc0b1d39eecca60116544bc75569ea44 Mon Sep 17 00:00:00 2001 From: NSUWAL123 Date: Thu, 24 Oct 2024 13:22:15 +0545 Subject: [PATCH 06/17] fix(layer-switcher): close layer switcher on outside click --- .../src/lib/components/page/layer-switcher.svelte | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mapper/src/lib/components/page/layer-switcher.svelte b/src/mapper/src/lib/components/page/layer-switcher.svelte index 64301aba27..d39acb1205 100644 --- a/src/mapper/src/lib/components/page/layer-switcher.svelte +++ b/src/mapper/src/lib/components/page/layer-switcher.svelte @@ -24,6 +24,7 @@ map = new Map({ -
+
(isClosed = true)} + tabindex="-1" + role="button" + class={`style-control ${expandDirection} ${isClosed ? 'closed' : 'open'}`} +> {#each allStyles as style, _} - {/each} +
(isOpen = false)}> +
(isOpen = !isOpen)} + role="button" + onkeydown={(e) => { + if (e.key === 'Enter') { + isOpen = !isOpen; + } + }} + tabindex="0" + > + Basemap Icon +
+
+

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} +
+
From a4e807bc8ea144faa21059c3050edd8ca0b8f515 Mon Sep 17 00:00:00 2001 From: NSUWAL123 Date: Mon, 18 Nov 2024 13:17:20 +0545 Subject: [PATCH 16/17] fix(geolocation): geolocation layer id change --- src/mapper/src/lib/components/map/geolocation.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mapper/src/lib/components/map/geolocation.svelte b/src/mapper/src/lib/components/map/geolocation.svelte index 3d56fc19f5..65a012c7a7 100644 --- a/src/mapper/src/lib/components/map/geolocation.svelte +++ b/src/mapper/src/lib/components/map/geolocation.svelte @@ -108,7 +108,7 @@ }); - + Date: Mon, 18 Nov 2024 13:22:56 +0545 Subject: [PATCH 17/17] fix(baseLayers): remove duplicate osm layer --- src/mapper/src/constants/baseLayers.ts | 29 +------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/src/mapper/src/constants/baseLayers.ts b/src/mapper/src/constants/baseLayers.ts index 8eeeba46d7..d1a77e4f58 100644 --- a/src/mapper/src/constants/baseLayers.ts +++ b/src/mapper/src/constants/baseLayers.ts @@ -51,33 +51,6 @@ let esriStyle = { ], }; -let osm = { - id: 'OSM', - version: 8, - name: 'OSM', - sources: { - osm: { - type: 'raster', - tiles: ['https://tile.openstreetmap.org/{z}/{x}/{y}.png'], - // minzoom: 0, - // maxzoom: 19, - tileSize: 256, - attribution: - 'Map tiles by OpenStreetMap tile servers, under the tile usage policy. Data by OpenStreetMap', - }, - }, - layers: [ - { - id: 'osm', - type: 'raster', - source: 'osm', - layout: { - visibility: 'visible', - }, - }, - ], -}; - let satellite = { id: 'Satellite', version: 8, @@ -102,4 +75,4 @@ let satellite = { ], }; -export const baseLayers = [stamenStyle, esriStyle, osm, satellite]; +export const baseLayers = [stamenStyle, esriStyle, satellite];