-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLayerSwitcher.vue
More file actions
39 lines (36 loc) · 1.19 KB
/
LayerSwitcher.vue
File metadata and controls
39 lines (36 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<script setup lang="ts">
import { useMapStore } from "@/stores/map"
import { DataType, DataTypeToLabel } from "@/utils/enum"
import { computed } from "vue"
import { updateMapRoute } from "@/utils/route"
import { useRouter } from "vue-router"
const mapStore = useMapStore()
const router = useRouter()
const selectedDataType = computed({
get: () => mapStore.selectedDataType,
set: (value: DataType) => {
console.log("changeLayer 0.0")
console.log("changeLayer 0.1", value)
mapStore.changeDataType(value)
updateMapRoute(router, {})
}
})
</script>
<template>
<div data-cy="layer-switcher">
<label for="layer-select" class="font-accent">Choix du calque</label>
<select
id="layer-select"
v-model="selectedDataType"
class="w-full p-2 rounded border border-gray-300 bg-white text-base"
>
<option :value="DataType.PLANTABILITY">{{ DataTypeToLabel[DataType.PLANTABILITY] }}</option>
<option :value="DataType.LOCAL_CLIMATE_ZONES">
{{ DataTypeToLabel[DataType.LOCAL_CLIMATE_ZONES] }}
</option>
<option :value="DataType.VULNERABILITY">
{{ DataTypeToLabel[DataType.VULNERABILITY] }}
</option>
</select>
</div>
</template>