-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(map): Refactor Atlas component
- Loading branch information
Showing
3 changed files
with
90 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
vue/src/views/map/components/Atlases/MyMapAtlasDetails.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<template> | ||
<div class="MyMapAtlas__maps"> | ||
<div class="d-flex flex-row flex-wrap"> | ||
<v-btn | ||
size="small" | ||
icon="mdi-arrow-left" | ||
class="text-dark-grey" | ||
@click="hideDetails = true" | ||
></v-btn> | ||
<div class="MyMapAtlas__desc ml-2"> | ||
<div class="MyMapAtlas__title">{{ atlas.name }}</div> | ||
<div class="MyMapAtlas__details"> | ||
{{ atlas.maps.length }} {{ $t('myMap.atlases.data', { count: atlas.maps.length }) }} | ||
</div> | ||
</div> | ||
</div> | ||
<template v-if="type === AtlasGroup.THEMATIC_DATA"> | ||
<MyMapLayerPicker | ||
v-for="(qgisMap, index) in myMapStore.atlasThematicMaps.filter( | ||
(map) => map.atlasId === atlas['@id'] | ||
)" | ||
:class="index === 0 ? 'mt-6' : 'mt-2'" | ||
:key="qgisMap.id" | ||
v-model:main-layer=" | ||
myMapStore.atlasThematicMaps.filter((x) => x.atlasId === atlas['@id'])[index].mainLayer | ||
" | ||
v-model:sub-layers=" | ||
myMapStore.atlasThematicMaps.filter((x) => x.atlasId === atlas['@id'])[index].subLayers | ||
" | ||
@update="updateThematicData(qgisMap.id)" | ||
/> | ||
</template> | ||
<template v-else> ICI ON AFFICHE LES MAPS PRE DEFINIES </template> | ||
</div> | ||
</template> | ||
<script setup lang="ts"> | ||
import { AtlasGroup } from '@/models/enums/geo/AtlasGroup' | ||
import type { Atlas } from '@/models/interfaces/Atlas' | ||
import { inject } from 'vue' | ||
import { useMyMapStore } from '@/stores/myMapStore' | ||
import MyMapLayerPicker from '@/views/map/components/MyMapLayerPicker.vue' | ||
const hideDetails = inject('hideDetails') | ||
const myMapStore = useMyMapStore() | ||
defineProps<{ | ||
atlas: Atlas | ||
type: AtlasGroup | ||
}>() | ||
const updateThematicData = (qgismapId: string) => { | ||
myMapStore.updateAtlasLayersVisibility(qgismapId) | ||
} | ||
</script> |
30 changes: 30 additions & 0 deletions
30
vue/src/views/map/components/Atlases/MyMapAtlasSummary.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<template> | ||
<div class="d-flex flex-row flex-wrap"> | ||
<div class="MyMapAtlas__logo" :type="type"> | ||
<img :src="atlas.logo.contentUrl" v-if="atlas.logo" /> | ||
</div> | ||
<div class="MyMapAtlas__desc"> | ||
<div class="MyMapAtlas__title">{{ atlas.name }}</div> | ||
<div class="MyMapAtlas__details"> | ||
{{ atlas.maps.length }} {{ $t('myMap.atlases.data', { count: atlas.maps.length }) }} | ||
</div> | ||
</div> | ||
</div> | ||
<v-btn | ||
size="small" | ||
icon="mdi-arrow-right" | ||
class="text-dark-grey" | ||
@click="hideDetails = false" | ||
></v-btn> | ||
</template> | ||
<script setup lang="ts"> | ||
import type { AtlasGroup } from '@/models/enums/geo/AtlasGroup' | ||
import type { Atlas } from '@/models/interfaces/Atlas' | ||
import { inject } from 'vue' | ||
const hideDetails = inject('hideDetails') | ||
defineProps<{ | ||
atlas: Atlas | ||
type: AtlasGroup | ||
}>() | ||
</script> |