From 854065d04756ded3e2f6a5992264c0c780f9399f Mon Sep 17 00:00:00 2001 From: Luigi Pirelli Date: Mon, 17 Mar 2025 13:56:18 +0100 Subject: [PATCH 1/6] had to do this.map.updateSize(); to allow visualization of the basemap --- src/components/maps/MapSelect.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/maps/MapSelect.vue b/src/components/maps/MapSelect.vue index 6c378afb1..f2e140c29 100644 --- a/src/components/maps/MapSelect.vue +++ b/src/components/maps/MapSelect.vue @@ -46,6 +46,10 @@ export default { type: Object, default: null }, + value: { + type: Array, + default: null + }, value: { type: Array, default: null @@ -86,6 +90,9 @@ export default { methods: { async initMap() { this.map = null; + if (this.initExtent) { + this.extent = this.initExtent; + } await this.createMap(this.$refs.map, this.stac, true); @@ -144,8 +151,10 @@ export default { } } if (extent) { + this.map.updateSize(); this.map.getView().fit(extent, { padding: [50,50,50,50] }); } + }, addMask(stac) { // Darken areas outside of the available area From ef9f9b7553514347f26d1885ef0fa2670d8ca00f Mon Sep 17 00:00:00 2001 From: Luigi Pirelli Date: Mon, 17 Mar 2025 14:11:26 +0100 Subject: [PATCH 2/6] added some IT translated text --- src/locales/it/texts.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/locales/it/texts.json b/src/locales/it/texts.json index 45fca7046..487e26e92 100644 --- a/src/locales/it/texts.json +++ b/src/locales/it/texts.json @@ -156,7 +156,17 @@ "label": "i", "collapseLabel": "✕" }, + "bboxSelect": { + "add": "Cliccare sulla mappa per aggiungere un box di selezione.", + "remove": "Cliccare dentro il box per eliminarlo." + }, "close": "Chiudi", + "fit": "Adatta alla estensione", + "location": { + "description": "Vai alla tua posizione attuale" + }, + "nobasemap": "Mappa base non disponibile.", + "nodata": "Indormazione spaziale mancante nei metadati.", "zoom": { "in": { "description": "Zoom avanti", From 7f6db83df927e6eb19301fb85ccd066093d505e9 Mon Sep 17 00:00:00 2001 From: Luigi Pirelli Date: Fri, 4 Apr 2025 12:38:34 +0200 Subject: [PATCH 3/6] add feature to setup defaultExtent for SpatialFilter --- src/components/SearchFilter.vue | 5 ++++- src/store/index.js | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/SearchFilter.vue b/src/components/SearchFilter.vue index 2ec09187d..af8d5c044 100644 --- a/src/components/SearchFilter.vue +++ b/src/components/SearchFilter.vue @@ -217,7 +217,7 @@ export default { }, computed: { ...mapState(['itemsPerPage', 'maxItemsPerPage', 'uiLanguage']), - ...mapGetters(['canSearchCollections', 'supportsConformance']), + ...mapGetters(['canSearchCollections', 'supportsConformance', 'defaultSearchExtent']), collectionSelectOptions() { let taggable = !this.hasAllCollections; let isResult = this.collections.length > 0 && !this.hasAllCollections; @@ -258,6 +258,9 @@ export default { } return null; }, + defaultExtent() { + return this.query?.bbox? this.query.bbox : this.defaultSearchExtent; + }, andOrOptions() { return [ { value: 'and', text: this.$t('search.logical.and') }, diff --git a/src/store/index.js b/src/store/index.js index 033c48fdd..4d9920ac9 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -63,6 +63,9 @@ function getStore(config, router) { uiLanguage: config.locale }), getters: { + defaultSearchExtent: state => { + return state.defaultSearchExtent? state.defaultSearchExtent : null; + }, loading: state => !state.url || !state.data || state.database[state.url] instanceof Loading, getApiItemsLoading: state => data => { let id = ''; From c9ff5226e378fbd9d9395db1b70e61424c706326 Mon Sep 17 00:00:00 2001 From: Luigi Pirelli Date: Wed, 12 Mar 2025 17:00:27 +0100 Subject: [PATCH 4/6] enable by default spatial query and fixed prop that can't be value --- src/components/SearchFilter.vue | 8 ++++---- src/components/maps/MapSelect.vue | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/SearchFilter.vue b/src/components/SearchFilter.vue index af8d5c044..e448ff100 100644 --- a/src/components/SearchFilter.vue +++ b/src/components/SearchFilter.vue @@ -27,8 +27,8 @@ - {{ $t('search.filterBySpatialExtent') }} - + {{ $t('search.filterBySpatialExtent') }} + @@ -153,7 +153,7 @@ function getDefaults() { return { sortOrder: 1, sortTerm: null, - provideBBox: false, + provideBBox: true, // Store previous bbox so that it survives when the map is temporarily hidden bbox: null, query: getQueryDefaults(), @@ -295,7 +295,7 @@ export default { set(val) { this.query.datetime = Array.isArray(val) ? val.map(d => Utils.dateToUTC(d)) : null; } - } + }, }, watch: { parent: { diff --git a/src/components/maps/MapSelect.vue b/src/components/maps/MapSelect.vue index f2e140c29..0dad6b52e 100644 --- a/src/components/maps/MapSelect.vue +++ b/src/components/maps/MapSelect.vue @@ -46,7 +46,7 @@ export default { type: Object, default: null }, - value: { + initExtent: { type: Array, default: null }, @@ -58,8 +58,8 @@ export default { data() { return { crs: 'EPSG:4326', - extent: this.value, - dragging: false + extent: this.initExtent, + dragging: true }; }, computed: { From 851bd201708a422a33aec5e5e47c00174db50446 Mon Sep 17 00:00:00 2001 From: Luigi Pirelli Date: Fri, 4 Apr 2025 16:19:08 +0200 Subject: [PATCH 5/6] added conf parameter with example --- config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config.js b/config.js index 93732d8c5..fe64ca82e 100644 --- a/config.js +++ b/config.js @@ -45,5 +45,7 @@ module.exports = { requestQueryParameters: {}, socialSharing: ['email', 'bsky', 'mastodon', 'x'], preprocessSTAC: null, - authConfig: null + authConfig: null, + // defaultSearchExtent e.g. [12.227593034455793, 41.78656913683952, 12.652310726657447, 42.02970865107619] + defaultSearchExtent: null, }; From 1f14f963d0d8436fa3a28cf382ed5d7f125a2c21 Mon Sep 17 00:00:00 2001 From: Luigi Pirelli Date: Mon, 7 Apr 2025 07:35:54 +0200 Subject: [PATCH 6/6] set bbox only if shown getting from old query or default extent --- src/components/SearchFilter.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/SearchFilter.vue b/src/components/SearchFilter.vue index 5108ca043..56aa1f2ab 100644 --- a/src/components/SearchFilter.vue +++ b/src/components/SearchFilter.vue @@ -152,7 +152,7 @@ function getDefaults() { return { sortOrder: 1, sortTerm: null, - provideBBox: true, + provideBBox: false, // Store previous bbox so that it survives when the map is temporarily hidden bbox: null, query: getQueryDefaults(), @@ -340,7 +340,7 @@ export default { this.query.bbox = null; } else { - this.query.bbox = this.bbox; + this.query.bbox = this.bbox? this.bbox : this.defaultExtent; } } },