Mercurial > gemma
annotate client/src/components/layers/Layers.vue @ 4672:c7dc1a6da93d
fairway_profile: calculate scales
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Tue, 15 Oct 2019 15:55:12 +0200 |
parents | 75d1126f7299 |
children | c4d84be3a476 |
rev | line source |
---|---|
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 <template> |
1480 | 2 <div |
3 :class="[ | |
4 'box ui-element rounded bg-white text-nowrap', | |
5 { expanded: showLayers } | |
6 ]" | |
7 > | |
4401
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
8 <div class="position-relative" style="width: 20rem; min-height: 350px;"> |
3167
85734c763652
client: layers: moved refresh button from zoom controls to layers dialog
Markus Kottlaender <markus@intevation.de>
parents:
3055
diff
changeset
|
9 <UIBoxHeader |
85734c763652
client: layers: moved refresh button from zoom controls to layers dialog
Markus Kottlaender <markus@intevation.de>
parents:
3055
diff
changeset
|
10 icon="layer-group" |
85734c763652
client: layers: moved refresh button from zoom controls to layers dialog
Markus Kottlaender <markus@intevation.de>
parents:
3055
diff
changeset
|
11 :title="label" |
85734c763652
client: layers: moved refresh button from zoom controls to layers dialog
Markus Kottlaender <markus@intevation.de>
parents:
3055
diff
changeset
|
12 :closeCallback="close" |
3177
fc008b32c593
client: layers: loading animation for refreshing layer sources
Markus Kottlaender <markus@intevation.de>
parents:
3167
diff
changeset
|
13 :actions="[ |
3181
c122a064fd5e
client: map: fixed loading animation for layers
Markus Kottlaender <markus@intevation.de>
parents:
3177
diff
changeset
|
14 { |
c122a064fd5e
client: map: fixed loading animation for layers
Markus Kottlaender <markus@intevation.de>
parents:
3177
diff
changeset
|
15 callback: refreshLayers, |
c122a064fd5e
client: map: fixed loading animation for layers
Markus Kottlaender <markus@intevation.de>
parents:
3177
diff
changeset
|
16 icon: sourcesLoading ? 'spinner' : 'sync' |
c122a064fd5e
client: map: fixed loading animation for layers
Markus Kottlaender <markus@intevation.de>
parents:
3177
diff
changeset
|
17 } |
3177
fc008b32c593
client: layers: loading animation for refreshing layer sources
Markus Kottlaender <markus@intevation.de>
parents:
3167
diff
changeset
|
18 ]" |
3167
85734c763652
client: layers: moved refresh button from zoom controls to layers dialog
Markus Kottlaender <markus@intevation.de>
parents:
3055
diff
changeset
|
19 /> |
3055
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3044
diff
changeset
|
20 <div class="small" v-if="openLayersMaps.length"> |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3044
diff
changeset
|
21 <Layerselect layerId="OPENSTREETMAP" /> |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3044
diff
changeset
|
22 <Layerselect layerId="INLANDECDIS" /> |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3044
diff
changeset
|
23 <Layerselect layerId="WATERWAYAREA" /> |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3044
diff
changeset
|
24 <Layerselect layerId="STRETCHES" /> |
3309
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
25 <Layerselect layerId="SECTIONS" /> |
4600
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4401
diff
changeset
|
26 <Layerselect layerId="BOTTLENECKS" /> |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4401
diff
changeset
|
27 <Layerselect layerId="BOTTLENECKISOLINE" /> |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4401
diff
changeset
|
28 <Layerselect layerId="DIFFERENCES" /> |
3055
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3044
diff
changeset
|
29 <Layerselect layerId="FAIRWAYDIMENSIONSLOS3" /> |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3044
diff
changeset
|
30 <Layerselect layerId="FAIRWAYDIMENSIONSLOS2" /> |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3044
diff
changeset
|
31 <Layerselect layerId="FAIRWAYDIMENSIONSLOS1" /> |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3044
diff
changeset
|
32 <Layerselect layerId="WATERWAYAXIS" /> |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3044
diff
changeset
|
33 <Layerselect layerId="WATERWAYPROFILES" /> |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3044
diff
changeset
|
34 <Layerselect layerId="BOTTLENECKSTATUS" /> |
3335
59db0b5921c5
client: added layer for fairway availability diagrams with demo diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3309
diff
changeset
|
35 <Layerselect layerId="BOTTLENECKFAIRWAYAVAILABILITY" /> |
3434
9fba1be118e7
client: data accuracy: Show diagrams for gauges, bottlenecks and stretches on map.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3425
diff
changeset
|
36 <Layerselect layerId="DATAAVAILABILITY" /> |
3055
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3044
diff
changeset
|
37 <Layerselect layerId="DISTANCEMARKS" /> |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3044
diff
changeset
|
38 <Layerselect layerId="DISTANCEMARKSAXIS" /> |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3044
diff
changeset
|
39 <Layerselect layerId="GAUGES" /> |
4368
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4271
diff
changeset
|
40 <Layerselect v-if="reviewActive" layerId="FDREVIEWLAYER" /> |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1299
diff
changeset
|
41 </div> |
3055
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3044
diff
changeset
|
42 <UISpinnerOverlay v-else style="top: 34px;" /> |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
43 </div> |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1299
diff
changeset
|
44 </div> |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
45 </template> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
46 |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
47 <script> |
1362
ca33ad696594
remove the first empyty lines
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1361
diff
changeset
|
48 /* 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
|
49 * 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
|
50 * |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
51 * SPDX-License-Identifier: AGPL-3.0-or-later |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
52 * 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
|
53 * |
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1299
diff
changeset
|
54 * Copyright (C) 2018 by via donau |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
55 * – Österreichische Wasserstraßen-Gesellschaft mbH |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
56 * 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
|
57 * |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
58 * Author(s): |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
59 * Thomas Junk <thomas.junk@intevation.de> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
60 * Markus Kottländer <markus.kottlaender@intevation.de> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
61 */ |
4374
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
62 import { mapState, mapGetters } from "vuex"; |
2870
35f6e4383161
layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents:
2851
diff
changeset
|
63 |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
64 export default { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
65 components: { |
1669
16fb9667ddf8
refac: use dynamic imports for components
Thomas Junk <thomas.junk@intevation.de>
parents:
1558
diff
changeset
|
66 Layerselect: () => import("./Layerselect") |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
67 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
68 computed: { |
2754
d0f6c222f4f9
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
69 ...mapState("application", ["showLayers"]), |
4368
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4271
diff
changeset
|
70 ...mapState("map", ["openLayersMaps", "reviewActive"]), |
4374
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
71 ...mapGetters("map", ["openLayersMap"]), |
3055
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3044
diff
changeset
|
72 label() { |
3425
cb2f67a07400
client: toolbar/dialogs: unified toolbar tooltips and dialog titles
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
73 return this.$gettext("Map Layers"); |
3181
c122a064fd5e
client: map: fixed loading animation for layers
Markus Kottlaender <markus@intevation.de>
parents:
3177
diff
changeset
|
74 }, |
c122a064fd5e
client: map: fixed loading animation for layers
Markus Kottlaender <markus@intevation.de>
parents:
3177
diff
changeset
|
75 sourcesLoading() { |
c122a064fd5e
client: map: fixed loading animation for layers
Markus Kottlaender <markus@intevation.de>
parents:
3177
diff
changeset
|
76 let counter = 0; |
c122a064fd5e
client: map: fixed loading animation for layers
Markus Kottlaender <markus@intevation.de>
parents:
3177
diff
changeset
|
77 this.openLayersMaps.forEach(map => { |
c122a064fd5e
client: map: fixed loading animation for layers
Markus Kottlaender <markus@intevation.de>
parents:
3177
diff
changeset
|
78 let layers = map.getLayers().getArray(); |
c122a064fd5e
client: map: fixed loading animation for layers
Markus Kottlaender <markus@intevation.de>
parents:
3177
diff
changeset
|
79 for (let i = 0; i < layers.length; i++) { |
c122a064fd5e
client: map: fixed loading animation for layers
Markus Kottlaender <markus@intevation.de>
parents:
3177
diff
changeset
|
80 if (layers[i].getSource().loading) counter++; |
c122a064fd5e
client: map: fixed loading animation for layers
Markus Kottlaender <markus@intevation.de>
parents:
3177
diff
changeset
|
81 } |
c122a064fd5e
client: map: fixed loading animation for layers
Markus Kottlaender <markus@intevation.de>
parents:
3177
diff
changeset
|
82 }); |
c122a064fd5e
client: map: fixed loading animation for layers
Markus Kottlaender <markus@intevation.de>
parents:
3177
diff
changeset
|
83 return counter; |
2754
d0f6c222f4f9
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
84 } |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
85 }, |
4374
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
86 watch: { |
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
87 reviewActive() { |
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
88 if (!this.reviewActive) { |
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
89 const fairwaydimensionLayer = this.openLayersMap().getLayer( |
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
90 "FDREVIEWLAYER" |
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
91 ); |
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
92 fairwaydimensionLayer.setVisible(false); |
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
93 } |
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
94 } |
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
95 }, |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
96 methods: { |
2387
f185503ef35a
client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents:
2260
diff
changeset
|
97 close() { |
f185503ef35a
client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents:
2260
diff
changeset
|
98 this.$store.commit("application/showLayers", false); |
3167
85734c763652
client: layers: moved refresh button from zoom controls to layers dialog
Markus Kottlaender <markus@intevation.de>
parents:
3055
diff
changeset
|
99 }, |
85734c763652
client: layers: moved refresh button from zoom controls to layers dialog
Markus Kottlaender <markus@intevation.de>
parents:
3055
diff
changeset
|
100 refreshLayers() { |
4271
315474a66589
Map: refreshing layers triggers reloading of styles
Thomas Junk <thomas.junk@intevation.de>
parents:
4122
diff
changeset
|
101 this.$store.commit("map/startRefreshLayers"); |
4122
d85d8de8c28c
refresh layers deletes nashsutcliffecache
Thomas Junk <thomas.junk@intevation.de>
parents:
3434
diff
changeset
|
102 this.$store.commit("gauges/deleteNashSutcliffeCache"); |
3409
c0f5f62343c9
client: import review: refresh map layers after accepting/declining imports
Markus Kottlaender <markus@intevation.de>
parents:
3335
diff
changeset
|
103 this.$store.dispatch("map/refreshLayers"); |
4271
315474a66589
Map: refreshing layers triggers reloading of styles
Thomas Junk <thomas.junk@intevation.de>
parents:
4122
diff
changeset
|
104 this.$nextTick(() => { |
315474a66589
Map: refreshing layers triggers reloading of styles
Thomas Junk <thomas.junk@intevation.de>
parents:
4122
diff
changeset
|
105 this.$store.commit("map/finishRefreshLayers"); |
315474a66589
Map: refreshing layers triggers reloading of styles
Thomas Junk <thomas.junk@intevation.de>
parents:
4122
diff
changeset
|
106 }); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
107 } |
2957
b74ebeb2bdc8
client: layers: improved structure of layer configuration
Markus Kottlaender <markus@intevation.de>
parents:
2952
diff
changeset
|
108 } |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
109 }; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
110 </script> |