Mercurial > gemma
comparison client/src/components/toolbar/Polygontool.vue @ 3006:44493664d40e
client: refactored layers config
Layers are not stored in the vuex store anymore but instead they are served from a factory function, so that
different maps can haved individual layer objects
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Thu, 11 Apr 2019 11:44:11 +0200 |
parents | b74ebeb2bdc8 |
children | c71373594719 |
comparison
equal
deleted
inserted
replaced
3005:870d2a0e866b | 3006:44493664d40e |
---|---|
28 import { mapState } from "vuex"; | 28 import { mapState } from "vuex"; |
29 | 29 |
30 export default { | 30 export default { |
31 name: "polygontool", | 31 name: "polygontool", |
32 computed: { | 32 computed: { |
33 ...mapState("map", ["layers", "lineTool", "polygonTool", "cutTool"]), | 33 ...mapState("map", ["openLayersMap", "lineTool", "polygonTool", "cutTool"]), |
34 label() { | 34 label() { |
35 return this.$gettext("Measure Area"); | 35 return this.$gettext("Measure Area"); |
36 } | 36 } |
37 }, | 37 }, |
38 methods: { | 38 methods: { |
39 togglePolygonTool() { | 39 togglePolygonTool() { |
40 this.polygonTool.setActive(!this.polygonTool.getActive()); | 40 this.polygonTool.setActive(!this.polygonTool.getActive()); |
41 this.lineTool.setActive(false); | 41 this.lineTool.setActive(false); |
42 this.cutTool.setActive(false); | 42 this.cutTool.setActive(false); |
43 this.$store.commit("map/setCurrentMeasurement", null); | 43 this.$store.commit("map/setCurrentMeasurement", null); |
44 this.layers.DRAWTOOL.getSource().clear(); | 44 this.openLayersMap |
45 .getLayer("DRAWTOOL") | |
46 .getSource() | |
47 .clear(); | |
45 } | 48 } |
46 } | 49 } |
47 }; | 50 }; |
48 </script> | 51 </script> |