Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with open tree-structure #120

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"vue-router": "^3.2.0",
"vue-tour": "^2.0.0",
"vue2mapbox-gl": "^0.15.0",
"vuetify": "^2.2.11",
"vuetify": "2.7.2",
"vuex": "^3.4.0",
"wkt": "^0.1.1",
"xml-js": "^1.6.11"
Expand Down
26 changes: 22 additions & 4 deletions src/components/LayerChooser/LayerChooser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
</div>
<div class="layers-scrollable">
<v-treeview
data-v-step="2"
:key="keyForceTreeUpdate"
ref="tree"
data-v-step="2"
class="layer-chooser__tree"
:value="activeFlattenedLayerIds"
hoverable
Expand Down Expand Up @@ -147,6 +148,7 @@
value: [],
onlyActive: false,
openedItems: [],
keyForceTreeUpdate:0,
}),

computed: {
Expand All @@ -163,30 +165,44 @@

watch: {
searchString(newValue, oldValue) {
console.log('searchString')
if (oldValue === '') {
this.$refs.tree.updateAll(true)
}
},
onlyActive(newValue) {
console.log('only Active')
this.$refs.tree.updateAll(newValue)
},
'$route.query'() {
console.log('route.query')
if (this.$route.query.folders) {
this.openedItems = (this.$route.query.folders || '').split(',')
}
},
openedItems() {
console.log('this.openedItems', this.openedItems)
},
},
mounted () {
console.log('mounted')
const searchParams = new URLSearchParams(window.location.search)
const folders = (searchParams.get('folders') || '').split(',')
this.openedItems = folders

setTimeout(() => {
this.openedItems = folders
}, '500')



},
methods: {
...mapActions('map', [ 'updateWmsLayerOpacity', 'updateZoomExtent' ]),
handleOpenedFolders(newValue, oldValue) {
if (newValue.length === 0 && !oldValue) {
console.log('hanldeOpenedFolders newValue and OldValue', newValue, oldValue)
/* if (newValue.length === 0 && !oldValue) {
return
}
} */
const url = new URL(window.location.href)
if (url.searchParams.get('folders') === newValue.join(',')) {
return
Expand All @@ -211,9 +227,11 @@
}
},
expandAll() {
console.log('expand all')
this.$refs.tree.updateAll(true)
},
collapseAll() {
console.log('collapseAll')
this.$refs.tree.updateAll(false)
},
activeFilter(item, input, textKey) {
Expand Down
1 change: 1 addition & 0 deletions src/components/LayersDialog/LayersDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
this.$emit('close')
},
showLayer(id) {
console.log('showLayer calls the loadLayerOnMap')
this.resetLayers()
const layer = this.flattenedLayers.find(({ id: layerId }) => id === layerId)
this.loadLayerOnMap({ layers: [ layer ] })
Expand Down
2 changes: 0 additions & 2 deletions src/store/modules/data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export default {
actions: {
async getAppData({ dispatch }, { route, locale }) {
const viewer = route?.params?.config

//Set viewer configuration
const { mapCenter, mapZoom, defaultLayer, privacyStatement, userAgreement } = await getViewerConfiguration(viewer)

Expand All @@ -84,7 +83,6 @@ export default {
initialLayerIds.push(defaultLayer.id)
layersById = getLayersById(layers, initialLayerIds)
}

if (layersById.length) {
dispatch('map/loadLayerOnMap', { layers: layersById }, { root: true })
}
Expand Down
1 change: 0 additions & 1 deletion src/store/modules/map/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ export default {
commit('SET_MAP_LOADED')
},
loadLayerOnMap({ commit, state }, { layers }) {

const layersToAdd = difference(layers, state.activeFlattenedLayers)

layersToAdd.forEach((layer) => {
Expand Down
1 change: 0 additions & 1 deletion src/views/DownloadGeoserver.vue
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@
},

onAreaSelection(id) {
console.log('id',id)
this.setDrawMode({ mode: null })

if (id === NO_SELECTION_ID) {
Expand Down
Loading