comparison client/src/components/map/layers/Layers.vue @ 1272:bc55ffaeb639

cleaned up client/src directory better organization of files and directories, better naming, separation of admin and map context
author Markus Kottlaender <markus@intevation.de>
date Thu, 22 Nov 2018 07:07:12 +0100
parents
children dc3fb8ad8f86
comparison
equal deleted inserted replaced
1268:aca692e73028 1272:bc55ffaeb639
1 <template>
2 <div :class="['box ui-element rounded bg-white mb-auto text-nowrap', { expanded: showLayers }]">
3 <div style="width: 20rem">
4 <h6 class="mb-0 py-2 px-3 border-bottom d-flex align-items-center bg-info text-white">
5 <i class="fa fa-th-list mr-2"></i>
6 Layers
7 <i class="fa fa-times ml-auto" @click="$store.commit('application/showLayers', false)"></i>
8 </h6>
9 <div class="d-flex flex-column p-3 small">
10 <Layerselect
11 v-for="(layer, index) in layersForLegend"
12 :layerindex="index"
13 :layername="layer.name"
14 :key="layer.name"
15 :isVisible="layer.isVisible"
16 @visibilityToggled="visibilityToggled"
17 ></Layerselect>
18 </div>
19 </div>
20 </div>
21 </template>
22
23 <script>
24 /*
25 * This is Free Software under GNU Affero General Public License v >= 3.0
26 * without warranty, see README.md and license for details.
27 *
28 * SPDX-License-Identifier: AGPL-3.0-or-later
29 * License-Filename: LICENSES/AGPL-3.0.txt
30 *
31 * Copyright (C) 2018 by via donau
32 * – Österreichische Wasserstraßen-Gesellschaft mbH
33 * Software engineering by Intevation GmbH
34 *
35 * Author(s):
36 * Thomas Junk <thomas.junk@intevation.de>
37 * Markus Kottländer <markus.kottlaender@intevation.de>
38 */
39 import Layerselect from "./Layerselect";
40 import { mapGetters, mapState } from "vuex";
41 export default {
42 name: "layers",
43 components: {
44 Layerselect
45 },
46 computed: {
47 ...mapGetters("map", ["layersForLegend"]),
48 ...mapState("application", ["showLayers"])
49 },
50 methods: {
51 visibilityToggled(layer) {
52 this.$store.commit("map/toggleVisibility", layer);
53 }
54 }
55 };
56 </script>