Mercurial > gemma
comparison client/src/components/toolbar/Polygontool.vue @ 1558:0ded4c56978e
refac: component filestructure. remove admin/map hierarchy
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Wed, 12 Dec 2018 09:22:20 +0100 |
parents | client/src/components/map/toolbar/Polygontool.vue@9b81ac91a43e |
children | 31a1dcdba068 |
comparison
equal
deleted
inserted
replaced
1557:62171cd9a42b | 1558:0ded4c56978e |
---|---|
1 <template> | |
2 <div @click="togglePolygonTool" class="toolbar-button"> | |
3 <font-awesome-icon | |
4 icon="draw-polygon" | |
5 :class="{ 'text-info': polygonTool && polygonTool.getActive() }" | |
6 ></font-awesome-icon> | |
7 </div> | |
8 </template> | |
9 | |
10 <script> | |
11 /* This is Free Software under GNU Affero General Public License v >= 3.0 | |
12 * without warranty, see README.md and license for details. | |
13 * | |
14 * SPDX-License-Identifier: AGPL-3.0-or-later | |
15 * License-Filename: LICENSES/AGPL-3.0.txt | |
16 * | |
17 * Copyright (C) 2018 by via donau | |
18 * – Österreichische Wasserstraßen-Gesellschaft mbH | |
19 * Software engineering by Intevation GmbH | |
20 * | |
21 * Author(s): | |
22 * Markus Kottländer <markus.kottlaender@intevation.de> | |
23 */ | |
24 import { mapState, mapGetters } from "vuex"; | |
25 | |
26 export default { | |
27 name: "polygontool", | |
28 computed: { | |
29 ...mapGetters("map", ["getLayerByName"]), | |
30 ...mapState("map", ["lineTool", "polygonTool", "cutTool"]) | |
31 }, | |
32 methods: { | |
33 togglePolygonTool() { | |
34 this.polygonTool.setActive(!this.polygonTool.getActive()); | |
35 this.lineTool.setActive(false); | |
36 this.cutTool.setActive(false); | |
37 this.$store.commit("map/setCurrentMeasurement", null); | |
38 this.getVSourceByName("Draw Tool").clear(); | |
39 } | |
40 } | |
41 }; | |
42 </script> |