annotate client/src/components/layers/Layers.vue @ 2952:a3017800e045

client: map legend: reduced code
author Markus Kottlaender <markus@intevation.de>
date Fri, 05 Apr 2019 16:13:04 +0200
parents 1ac58e024942
children b74ebeb2bdc8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
1 <template>
1480
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
2 <div
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
3 :class="[
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
4 'box ui-element rounded bg-white text-nowrap',
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
5 { expanded: showLayers }
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
6 ]"
9b81ac91a43e fix: linting
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
7 >
2260
531e776cb81d client: reduced width of pdf-, profile- and identify-box
Markus Kottlaender <markus@intevation.de>
parents: 2154
diff changeset
8 <div style="width: 18rem">
2754
d0f6c222f4f9 client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2534
diff changeset
9 <UIBoxHeader
d0f6c222f4f9 client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2534
diff changeset
10 icon="layer-group"
d0f6c222f4f9 client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2534
diff changeset
11 :title="layersLabel"
d0f6c222f4f9 client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2534
diff changeset
12 :closeCallback="close"
d0f6c222f4f9 client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2534
diff changeset
13 />
2534
bb5286acfee2 client: reduced spacings between and inside boxes and more compact main menu
Markus Kottlaender <markus@intevation.de>
parents: 2387
diff changeset
14 <div class="box-body small">
1361
ea3a89a1813a remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1299
diff changeset
15 <Layerselect
2951
1ac58e024942 client: map layers: optimized setting visibility
Markus Kottlaender <markus@intevation.de>
parents: 2870
diff changeset
16 v-for="(layer, name) in layersForLegend"
2952
a3017800e045 client: map legend: reduced code
Markus Kottlaender <markus@intevation.de>
parents: 2951
diff changeset
17 :layer="layer"
a3017800e045 client: map legend: reduced code
Markus Kottlaender <markus@intevation.de>
parents: 2951
diff changeset
18 :name="name"
2951
1ac58e024942 client: map layers: optimized setting visibility
Markus Kottlaender <markus@intevation.de>
parents: 2870
diff changeset
19 :key="name"
1361
ea3a89a1813a remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1299
diff changeset
20 ></Layerselect>
ea3a89a1813a remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1299
diff changeset
21 </div>
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
22 </div>
1361
ea3a89a1813a remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1299
diff changeset
23 </div>
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
24 </template>
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
25
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
26 <script>
1362
ca33ad696594 remove the first empyty lines
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1361
diff changeset
27 /* This is Free Software under GNU Affero General Public License v >= 3.0
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
28 * without warranty, see README.md and license for details.
1361
ea3a89a1813a remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1299
diff changeset
29 *
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
30 * SPDX-License-Identifier: AGPL-3.0-or-later
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
31 * License-Filename: LICENSES/AGPL-3.0.txt
1361
ea3a89a1813a remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1299
diff changeset
32 *
ea3a89a1813a remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1299
diff changeset
33 * Copyright (C) 2018 by via donau
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
34 * – Österreichische Wasserstraßen-Gesellschaft mbH
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
35 * Software engineering by Intevation GmbH
1361
ea3a89a1813a remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1299
diff changeset
36 *
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
37 * Author(s):
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
38 * Thomas Junk <thomas.junk@intevation.de>
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
39 * Markus Kottländer <markus.kottlaender@intevation.de>
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
40 */
2870
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
41 import { mapState } from "vuex";
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
42 import { LAYERS } from "@/store/map.js";
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
43
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
44 export default {
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
45 name: "layers",
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
46 components: {
1669
16fb9667ddf8 refac: use dynamic imports for components
Thomas Junk <thomas.junk@intevation.de>
parents: 1558
diff changeset
47 Layerselect: () => import("./Layerselect")
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
48 },
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
49 computed: {
2870
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
50 ...mapState("map", ["layers"]),
2754
d0f6c222f4f9 client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2534
diff changeset
51 ...mapState("application", ["showLayers"]),
d0f6c222f4f9 client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2534
diff changeset
52 layersLabel() {
d0f6c222f4f9 client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2534
diff changeset
53 return this.$gettext("Layers");
2870
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
54 },
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
55 layersForLegend() {
2951
1ac58e024942 client: map layers: optimized setting visibility
Markus Kottlaender <markus@intevation.de>
parents: 2870
diff changeset
56 let orderedLayers = {};
1ac58e024942 client: map layers: optimized setting visibility
Markus Kottlaender <markus@intevation.de>
parents: 2870
diff changeset
57 this.$options.LAYOUT.forEach(el => (orderedLayers[el] = this.layers[el]));
1ac58e024942 client: map layers: optimized setting visibility
Markus Kottlaender <markus@intevation.de>
parents: 2870
diff changeset
58 return orderedLayers;
2754
d0f6c222f4f9 client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2534
diff changeset
59 }
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
60 },
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
61 methods: {
2387
f185503ef35a client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents: 2260
diff changeset
62 close() {
f185503ef35a client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents: 2260
diff changeset
63 this.$store.commit("application/showLayers", false);
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
64 }
2870
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
65 },
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
66 LAYOUT: [
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
67 LAYERS.OPENSTREETMAP,
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
68 LAYERS.INLANDECDIS,
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
69 LAYERS.WATERWAYAREA,
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
70 LAYERS.STRETCHES,
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
71 LAYERS.FAIRWAYDIMENSIONSLOS3,
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
72 LAYERS.FAIRWAYDIMENSIONSLOS2,
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
73 LAYERS.FAIRWAYDIMENSIONSLOS1,
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
74 LAYERS.WATERWAYAXIS,
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
75 LAYERS.WATERWAYPROFILES,
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
76 LAYERS.BOTTLENECKS,
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
77 LAYERS.BOTTLENECKISOLINE,
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
78 LAYERS.DIFFERENCES,
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
79 LAYERS.BOTTLENECKSTATUS,
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
80 LAYERS.DISTANCEMARKS,
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
81 LAYERS.DISTANCEMARKSAXIS,
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
82 LAYERS.GAUGES
35f6e4383161 layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents: 2851
diff changeset
83 ]
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
84 };
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
85 </script>