comparison client/src/components/layers/Layers.vue @ 2870:35f6e4383161

layer structure overhaul
author Thomas Junk <thomas.junk@intevation.de>
date Fri, 29 Mar 2019 13:37:17 +0100
parents a7e31594959d
children 1ac58e024942
comparison
equal deleted inserted replaced
2869:02f51054f648 2870:35f6e4383161
38 * 38 *
39 * Author(s): 39 * Author(s):
40 * Thomas Junk <thomas.junk@intevation.de> 40 * Thomas Junk <thomas.junk@intevation.de>
41 * Markus Kottländer <markus.kottlaender@intevation.de> 41 * Markus Kottländer <markus.kottlaender@intevation.de>
42 */ 42 */
43 import { mapGetters, mapState } from "vuex"; 43 import { mapState } from "vuex";
44 import { LAYERS } from "@/store/map.js";
45
44 export default { 46 export default {
45 name: "layers", 47 name: "layers",
46 components: { 48 components: {
47 Layerselect: () => import("./Layerselect") 49 Layerselect: () => import("./Layerselect")
48 }, 50 },
49 computed: { 51 computed: {
50 ...mapGetters("map", ["layersForLegend"]), 52 ...mapState("map", ["layers"]),
51 ...mapState("application", ["showLayers"]), 53 ...mapState("application", ["showLayers"]),
52 layersLabel() { 54 layersLabel() {
53 return this.$gettext("Layers"); 55 return this.$gettext("Layers");
56 },
57 layersForLegend() {
58 return this.$options.LAYOUT.map(el => this.layers[el]);
54 } 59 }
55 }, 60 },
56 methods: { 61 methods: {
57 close() { 62 close() {
58 this.$store.commit("application/showLayers", false); 63 this.$store.commit("application/showLayers", false);
59 }, 64 },
60 visibilityToggled(layername) { 65 visibilityToggled(layername) {
61 this.$store.commit("map/toggleVisibilityByName", layername); 66 this.$store.commit("map/toggleVisibilityByName", layername);
62 } 67 }
63 } 68 },
69 LAYOUT: [
70 LAYERS.OPENSTREETMAP,
71 LAYERS.INLANDECDIS,
72 LAYERS.WATERWAYAREA,
73 LAYERS.STRETCHES,
74 LAYERS.FAIRWAYDIMENSIONSLOS3,
75 LAYERS.FAIRWAYDIMENSIONSLOS2,
76 LAYERS.FAIRWAYDIMENSIONSLOS1,
77 LAYERS.WATERWAYAXIS,
78 LAYERS.WATERWAYPROFILES,
79 LAYERS.BOTTLENECKS,
80 LAYERS.BOTTLENECKISOLINE,
81 LAYERS.DIFFERENCES,
82 LAYERS.BOTTLENECKSTATUS,
83 LAYERS.DISTANCEMARKS,
84 LAYERS.DISTANCEMARKSAXIS,
85 LAYERS.GAUGES
86 ]
64 }; 87 };
65 </script> 88 </script>