diff --git a/src/modules/infobox/components/ImportContent.vue b/src/modules/infobox/components/ImportContent.vue deleted file mode 100644 index b7d83f50f..000000000 --- a/src/modules/infobox/components/ImportContent.vue +++ /dev/null @@ -1,502 +0,0 @@ - - - - diff --git a/src/modules/infobox/components/ImportContentResultItem.vue b/src/modules/infobox/components/ImportContentResultItem.vue deleted file mode 100644 index 2db8b4851..000000000 --- a/src/modules/infobox/components/ImportContentResultItem.vue +++ /dev/null @@ -1,197 +0,0 @@ - - - - - diff --git a/src/modules/infobox/components/ImportContentResultList.vue b/src/modules/infobox/components/ImportContentResultList.vue deleted file mode 100644 index 4cd7cdc8b..000000000 --- a/src/modules/infobox/components/ImportContentResultList.vue +++ /dev/null @@ -1,194 +0,0 @@ - - - - - diff --git a/src/modules/menu/components/LayerCatalogueItem.vue b/src/modules/menu/components/LayerCatalogueItem.vue index 0b6d49fa3..0d5d25452 100644 --- a/src/modules/menu/components/LayerCatalogueItem.vue +++ b/src/modules/menu/components/LayerCatalogueItem.vue @@ -4,7 +4,7 @@ * layers or a single layer. */ -import { FontAwesomeIcon, FontAwesomeLayers } from '@fortawesome/vue-fontawesome' +import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' // importing directly the vue component, see https://github.com/ivanvermeyen/vue-collapse-transition/issues/5 import CollapseTransition from '@ivanv/vue-collapse-transition/src/CollapseTransition.vue' import { computed, onMounted, ref, watch } from 'vue' @@ -14,6 +14,7 @@ import AbstractLayer from '@/api/layers/AbstractLayer.class' import GeoAdminGroupOfLayers from '@/api/layers/GeoAdminGroupOfLayers.class' import LayerLegendPopup from '@/modules/menu/components/LayerLegendPopup.vue' import { ActiveLayerConfig } from '@/utils/layerUtils' +import log from '@/utils/logging' const { item, compact, depth } = defineProps({ item: { @@ -41,6 +42,8 @@ const activeLayers = computed(() => store.state.layers.activeLayers) const openThemesIds = computed(() => store.state.topics.openedTreeThemesIds) const hasChildren = computed(() => item?.layers?.length > 0) +const hasLegend = computed(() => canBeAddedToTheMap.value && (!item.isExternal || item.abstract)) + /** * Flag telling if this layer can be added to the map (so if the UI should include the necessary * element to do so) @@ -73,46 +76,56 @@ function startLayerPreview() { store.dispatch('setPreviewLayer', item) } } + +function addLayer() { + // if this is a group of a layer then simply add it to the map + const matchingActiveLayer = store.getters.getActiveLayerById(item.getID()) + if (matchingActiveLayer) { + store.dispatch('toggleLayerVisibility', matchingActiveLayer) + } else if (item.isExternal) { + store.dispatch('addLayer', item) + } else { + store.dispatch('addLayer', new ActiveLayerConfig(item.getID(), true)) + } +} + function onItemClick() { - if (hasChildren.value) { + if (canBeAddedToTheMap.value) { + addLayer() + } else if (hasChildren.value) { showChildren.value = !showChildren.value - } else { - const matchingActiveLayer = store.getters.getActiveLayerById(item.getID()) - if (matchingActiveLayer) { - store.dispatch('toggleLayerVisibility', matchingActiveLayer) - } else { - store.dispatch('addLayer', new ActiveLayerConfig(item.getID(), true)) - } } } + +function onCollapseClick() { + showChildren.value = !showChildren.value +} + +function zoomToLayer() { + log.debug(`Zoom to layer ${item.name}`, item.extent) + store.dispatch('zoomToExtent', item.extent) +} @@ -177,6 +206,9 @@ function onItemClick() { } } } +.menu-catalogue-item-title:hover { + background-color: $list-item-hover-bg-color; +} .menu-catalogue-item-name { @extend .menu-name; } diff --git a/src/modules/menu/components/LayerLegendPopup.vue b/src/modules/menu/components/LayerLegendPopup.vue index 64cf7b40b..2eb87b52c 100644 --- a/src/modules/menu/components/LayerLegendPopup.vue +++ b/src/modules/menu/components/LayerLegendPopup.vue @@ -1,55 +1,85 @@ + + - -