Mercurial > gemma
changeset 4864:6a148617e012
right click deactivates other layers
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Tue, 10 Dec 2019 11:20:22 +0100 |
parents | 544e5a2eacb6 |
children | e51b9b265df0 |
files | client/src/components/layers/Layerselect.vue |
diffstat | 1 files changed, 13 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/components/layers/Layerselect.vue Thu Dec 05 13:01:15 2019 +0100 +++ b/client/src/components/layers/Layerselect.vue Tue Dec 10 11:20:22 2019 +0100 @@ -3,7 +3,7 @@ class="d-flex flex-column flex-start px-2 border-bottom" style="border-bottom-style: dashed !important;" > - <div class="d-flex"> + <div class="d-flex" @click.right.prevent="selectSingle"> <input v-for="map in openLayersMaps" :key="map.getTarget()" @@ -13,7 +13,10 @@ :checked="isVisible(map)" /> <LegendElement class="pointer" :layer="layer" @click.native="toggle()" /> - <label class="pointer layername form-check-label ml-1" @click="toggle()"> + <label + class="pointer layername form-check-label ml-1" + @click.left="toggle()" + > {{ label }} </label> </div> @@ -75,6 +78,14 @@ } }, methods: { + selectSingle() { + console.log("right click"); + this.openLayersMaps.forEach(m => { + m.getLayers().forEach(l => { + l.setVisible(l.get("id") == this.layerId); + }); + }); + }, refreshLegend() { if (this.layer.get("id") === "BOTTLENECKISOLINE") { this.loadLegendImage(