Mercurial > gemma
comparison client/src/application/Morphtool.vue @ 823:d7ae7338872d
client: add morphtool again
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Thu, 27 Sep 2018 19:26:38 +0200 |
parents | |
children | 90a601884ff2 |
comparison
equal
deleted
inserted
replaced
822:8926c413db21 | 823:d7ae7338872d |
---|---|
1 <template> | |
2 <div v-if="selectedBottleneck" @click="clearSelection" class="float-right ui-element d-flex shadow morphtool"> | |
3 <i class="fa fa-object-ungroup"></i> | |
4 </div> | |
5 </template> | |
6 | |
7 <style lang="scss"> | |
8 .morphtool { | |
9 position: relative; | |
10 background-color: white; | |
11 padding: $small-offset; | |
12 border-radius: $border-radius; | |
13 margin-left: $offset; | |
14 height: $icon-width; | |
15 width: $icon-height; | |
16 margin-bottom: $offset; | |
17 margin-right: 55px; | |
18 z-index: 2; | |
19 } | |
20 </style> | |
21 | |
22 <script> | |
23 import { mapGetters, mapState } from "vuex"; | |
24 | |
25 export default { | |
26 name: "morphtool", | |
27 data() { | |
28 return { | |
29 surveyList: null | |
30 }; | |
31 }, | |
32 computed: { | |
33 ...mapGetters("application", ["drawMode"]), | |
34 ...mapState("mapstore", ["identifiedFeatures", "selectedMorph"]), | |
35 selectedBottleneck: function() { | |
36 if (this.identifiedFeatures) { | |
37 for (let feature of this.identifiedFeatures) { | |
38 if (feature.getId().replace(/[.][^.]*$/, "") === "bottlenecks") { | |
39 return feature; | |
40 } | |
41 } | |
42 } | |
43 return null; | |
44 } | |
45 }, | |
46 watch: { | |
47 selectedBottleneck: function(bottleneck) { | |
48 console.log("now query for", bottleneck); | |
49 this.surveyList = [{ a: "b" }, { c: "d" }]; | |
50 } | |
51 }, | |
52 methods: { | |
53 clearSelection() { | |
54 this.$store.commit("mapstore/setIdentifiedFeatures", []); | |
55 } | |
56 } | |
57 }; | |
58 </script> |