Mercurial > gemma
annotate client/src/components/layers/Layerselect.vue @ 3787:f86220aa8a72 yworks-svg2pdf
Waterlevel: prefetch images of template and convert to dataURI
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Wed, 03 Jul 2019 16:42:38 +0200 |
parents | 1559566662f5 |
children | 224ee5a3acb1 |
rev | line source |
---|---|
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 <template> |
3055
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
2 <div |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
3 class="d-flex flex-column flex-start px-2 border-bottom" |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
4 style="border-bottom-style: dashed !important;" |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
5 > |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
6 <div class="d-flex"> |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1277
diff
changeset
|
7 <input |
3055
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
8 v-for="map in openLayersMaps" |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
9 :key="map.getTarget()" |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
10 class="mt-1 mr-1" |
2957
b74ebeb2bdc8
client: layers: improved structure of layer configuration
Markus Kottlaender <markus@intevation.de>
parents:
2953
diff
changeset
|
11 type="checkbox" |
3055
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
12 @change="toggle(map)" |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
13 :checked="isVisible(map)" |
1480 | 14 /> |
3055
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
15 <LegendElement class="pointer" :layer="layer" @click.native="toggle()" /> |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
16 <label class="pointer layername form-check-label ml-1" @click="toggle()"> |
2957
b74ebeb2bdc8
client: layers: improved structure of layer configuration
Markus Kottlaender <markus@intevation.de>
parents:
2953
diff
changeset
|
17 {{ label }} |
2952
a3017800e045
client: map legend: reduced code
Markus Kottlaender <markus@intevation.de>
parents:
2951
diff
changeset
|
18 </label> |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
19 </div> |
3055
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
20 <div> |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
21 <div v-if="isVisible() && layer.get('id') === 'BOTTLENECKISOLINE'"> |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
22 <img class="rounded my-1 d-block" :src="isolinesLegendImgDataURL" /> |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
23 </div> |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
24 <div v-if="isVisible() && layer.get('id') === 'DIFFERENCES'"> |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
25 <img class="rounded my-1 d-block" :src="differencesLegendImgDataURL" /> |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
26 </div> |
2932
173ce013a021
layers: difference layer now contains legend
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
27 </div> |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1277
diff
changeset
|
28 </div> |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
29 </template> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
30 |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
31 <script> |
1362
ca33ad696594
remove the first empyty lines
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1361
diff
changeset
|
32 /* 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
|
33 * 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:
1277
diff
changeset
|
34 * |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
35 * SPDX-License-Identifier: AGPL-3.0-or-later |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
36 * 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:
1277
diff
changeset
|
37 * |
1926
1220cfe96efd
client: prepare isoline legend graphic for reuse
Bernhard Reiter <bernhard@intevation.de>
parents:
1669
diff
changeset
|
38 * Copyright (C) 2018, 2019 by via donau |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
39 * – Österreichische Wasserstraßen-Gesellschaft mbH |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
40 * 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:
1277
diff
changeset
|
41 * |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
42 * Author(s): |
1926
1220cfe96efd
client: prepare isoline legend graphic for reuse
Bernhard Reiter <bernhard@intevation.de>
parents:
1669
diff
changeset
|
43 * * Thomas Junk <thomas.junk@intevation.de> |
1220cfe96efd
client: prepare isoline legend graphic for reuse
Bernhard Reiter <bernhard@intevation.de>
parents:
1669
diff
changeset
|
44 * * Bernhard Reiter <bernhard.reiter@intevation.de> |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
45 */ |
1613
f2d24dceecc7
refac: cleanup import paths
Thomas Junk <thomas.junk@intevation.de>
parents:
1558
diff
changeset
|
46 import { HTTP } from "@/lib/http"; |
2960
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
47 import { displayError } from "@/lib/errors"; |
3055
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
48 import { mapState, mapGetters } from "vuex"; |
2920
c1f2b9148cc8
client: removed more unnecessary closing tags and opzimized imports
Markus Kottlaender <markus@intevation.de>
parents:
2851
diff
changeset
|
49 |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
50 export default { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
51 components: { |
2960
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
52 LegendElement: () => import("./LegendElement") |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
53 }, |
3055
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
54 props: ["layerId"], |
1927
5a37ee321651
client: make isolines legend graphic internally availableo
Bernhard Reiter <bernhard@intevation.de>
parents:
1926
diff
changeset
|
55 computed: { |
2932
173ce013a021
layers: difference layer now contains legend
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
56 ...mapState("map", [ |
3055
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
57 "openLayersMaps", |
2932
173ce013a021
layers: difference layer now contains legend
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
58 "isolinesLegendImgDataURL", |
173ce013a021
layers: difference layer now contains legend
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
59 "differencesLegendImgDataURL" |
173ce013a021
layers: difference layer now contains legend
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
60 ]), |
3055
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
61 ...mapGetters("map", ["openLayersMap"]), |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
62 layer() { |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3055
diff
changeset
|
63 return this.openLayersMap().getLayer(this.layerId); |
3055
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
64 }, |
2957
b74ebeb2bdc8
client: layers: improved structure of layer configuration
Markus Kottlaender <markus@intevation.de>
parents:
2953
diff
changeset
|
65 label() { |
b74ebeb2bdc8
client: layers: improved structure of layer configuration
Markus Kottlaender <markus@intevation.de>
parents:
2953
diff
changeset
|
66 return this.$gettext(this.layer.get("label")); |
2343
33d2ef9f9e5d
client: use the name constants for Layer names
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2154
diff
changeset
|
67 } |
1927
5a37ee321651
client: make isolines legend graphic internally availableo
Bernhard Reiter <bernhard@intevation.de>
parents:
1926
diff
changeset
|
68 }, |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
69 methods: { |
3055
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
70 toggle(map) { |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
71 if (map) { |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
72 map |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
73 .getLayer(this.layerId) |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
74 .setVisible(!map.getLayer(this.layerId).getVisible()); |
3434
9fba1be118e7
client: data accuracy: Show diagrams for gauges, bottlenecks and stretches on map.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
75 if ( |
9fba1be118e7
client: data accuracy: Show diagrams for gauges, bottlenecks and stretches on map.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
76 this.layerId === "GAUGES" || |
9fba1be118e7
client: data accuracy: Show diagrams for gauges, bottlenecks and stretches on map.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
77 this.layerId === "STRETCHES" || |
3444
1559566662f5
client: data accuracy: Add diagram for sections.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3434
diff
changeset
|
78 this.layerId === "BOTTLENECKS" || |
1559566662f5
client: data accuracy: Add diagram for sections.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3434
diff
changeset
|
79 this.layerId === "SECTIONS" |
3434
9fba1be118e7
client: data accuracy: Show diagrams for gauges, bottlenecks and stretches on map.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
80 ) { |
9fba1be118e7
client: data accuracy: Show diagrams for gauges, bottlenecks and stretches on map.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
81 map.getLayer("DATAAVAILABILITY").changed(); |
9fba1be118e7
client: data accuracy: Show diagrams for gauges, bottlenecks and stretches on map.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
82 } |
3055
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
83 } else { |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
84 this.openLayersMaps.forEach(m => { |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
85 m.getLayer(this.layerId).setVisible( |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
86 !m.getLayer(this.layerId).getVisible() |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
87 ); |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
88 }); |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
89 } |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
90 }, |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
91 isVisible(map) { |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
92 if (map) { |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
93 return map.getLayer(this.layerId).getVisible(); |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
94 } else { |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
95 let isVisible = false; |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
96 this.openLayersMaps.forEach(m => { |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
97 if (m.getLayer(this.layerId).getVisible()) { |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
98 isVisible = true; |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
99 } |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
100 }); |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
101 return isVisible; |
b3c24c47931c
client: layers legend: support multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3006
diff
changeset
|
102 } |
2960
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
103 }, |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
104 loadLegendImage(layer, storeTarget) { |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
105 HTTP.get( |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
106 `/internal/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=${layer}&legend_options=columns:4;fontAntiAliasing:true`, |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
107 { |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
108 headers: { |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
109 Accept: "image/png", |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
110 "X-Gemma-Auth": localStorage.getItem("token") |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
111 }, |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
112 responseType: "blob" |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
113 } |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
114 ) |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
115 .then(response => { |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
116 const reader = new FileReader(); |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
117 reader.onload = event => { |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
118 this.$store.commit("map/" + storeTarget, event.target.result); |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
119 }; |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
120 reader.readAsDataURL(response.data); |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
121 }) |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
122 .catch(error => { |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
123 displayError({ |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
124 title: this.$gettext("Backend Error"), |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
125 message: `${error.response.status}: ${error.response.statusText}` |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
126 }); |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
127 }); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
128 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
129 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
130 created() { |
3006
44493664d40e
client: refactored layers config
Markus Kottlaender <markus@intevation.de>
parents:
2960
diff
changeset
|
131 if (this.layer.get("id") === "BOTTLENECKISOLINE") { |
2960
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
132 this.loadLegendImage( |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
133 "sounding_results_contour_lines_geoserver", |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
134 "isolinesLegendImgDataURL" |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
135 ); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
136 } |
3006
44493664d40e
client: refactored layers config
Markus Kottlaender <markus@intevation.de>
parents:
2960
diff
changeset
|
137 if (this.layer.get("id") === "DIFFERENCES") { |
2960
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
138 this.loadLegendImage( |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
139 "sounding_differences", |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
140 "differencesLegendImgDataURL" |
41cdff9b7f4a
client: layer legend: removed unnecessary methods, added method for legend image loading and added error handling
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
141 ); |
2932
173ce013a021
layers: difference layer now contains legend
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
142 } |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
143 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
144 }; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
145 </script> |