Skip to content

Commit

Permalink
added resetCQLFilters function that clears the predefined filters whe…
Browse files Browse the repository at this point in the history
…n changing a layer in the time travel view
  • Loading branch information
Tjalling-dejong committed Jan 29, 2025
1 parent 8d58e07 commit 81d3055
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/store/modules/data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ export default {
SET_CQL_FILTER(state, filter) {
state.cqlFilter = filter
},
RESET_CQL_FILTER(state) {
state.cqlFilter = null
},
RESET_TIME_EXTENT(state) {
state.timeExtent = []
},
Expand Down Expand Up @@ -172,6 +175,9 @@ export default {
},
setCQLFilter({ commit }, filter) {
commit('SET_CQL_FILTER', filter)
},
resetCQLFilter({commit}) {
commit('RESET_CQL_FILTER')
},
setOpenedFolders({ commit }, folders) {
commit('SET_OPENED_FOLDERS', folders)
Expand Down
3 changes: 2 additions & 1 deletion src/views/Filters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
selectedLayer() {
if (this.selectedLayer) {
this.setTimeExtent(this.selectedLayer.timeExtent)
this.resetCQLFilter()
}
},
selectedLayerCode( ) {
Expand All @@ -124,7 +125,7 @@
},
},
methods: {
...mapActions('data', [ 'setTimeExtent', 'setCQLFilter' ] ),
...mapActions('data', [ 'setTimeExtent', 'setCQLFilter', 'resetCQLFilter' ] ),
...mapActions('map', [ 'setFilteredLayerId', 'reloadLayerOnMap' ]),
setFilter(value) {
const filter = `${ this.filterName }='${ value }'`
Expand Down

0 comments on commit 81d3055

Please sign in to comment.