annotate client/src/components/importoverview/BottleneckDetail.vue @ 5580:0f258757e73a surveysperbottleneckid

Change objnam in Soundingresults.vue to bottleneck_id. Add comments for places where objnam is okay.
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 14 Feb 2022 11:31:15 +0100
parents 7afe411eeb48
children 84d01a536bec
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2602
5d0e5159190f overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
1 <template>
2717
5b990f612420 import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents: 2708
diff changeset
2 <div
5b990f612420 import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents: 2708
diff changeset
3 :class="{
5b990f612420 import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents: 2708
diff changeset
4 bottleneckdetails: true,
2880
c40540889b53 client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents: 2732
diff changeset
5 full: !showLogs,
c40540889b53 client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents: 2732
diff changeset
6 split: showLogs
2717
5b990f612420 import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents: 2708
diff changeset
7 }"
5b990f612420 import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents: 2708
diff changeset
8 >
2944
73f537379203 client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents: 2942
diff changeset
9 <div v-for="(bottleneck, index) in bottlenecks" :key="index">
73f537379203 client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents: 2942
diff changeset
10 <div class="d-flex pl-2">
2942
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
11 <div
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
12 @click="showBottleneckDetails(index)"
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
13 class="mt-auto mb-auto text-info text-left"
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
14 >
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
15 <UISpinnerButton
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
16 :state="showBottleneckDetail === index"
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
17 :icons="['angle-right', 'angle-down']"
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
18 class="text-info"
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
19 />
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
20 </div>
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
21 <a @click="moveToBottleneck(index)" href="#">
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
22 {{ bottleneck.properties.objnam }}
5580
0f258757e73a Change objnam in Soundingresults.vue to bottleneck_id. Add comments for places where objnam is okay.
Thomas Junk <thomas.junk@intevation.de>
parents: 4101
diff changeset
23 <!-- objnam for Text is okay-->
2942
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
24 </a>
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
25 </div>
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
26
2944
73f537379203 client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents: 2942
diff changeset
27 <div class="d-flex properties" v-if="showBottleneckDetail === index">
73f537379203 client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents: 2942
diff changeset
28 <table class="w-100">
2942
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
29 <tr
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
30 v-for="(info, index) in Object.keys(bottleneck.properties)"
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
31 :key="index"
2647
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
32 >
2944
73f537379203 client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents: 2942
diff changeset
33 <td class="pl-4">{{ info }}</td>
73f537379203 client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents: 2942
diff changeset
34 <td>
2942
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
35 {{ bottleneck.properties[info] }}
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
36 </td>
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
37 </tr>
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
38 </table>
2647
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
39 </div>
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
40 </div>
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
41 </div>
2602
5d0e5159190f overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
42 </template>
5d0e5159190f overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
43
2882
6538ee93df72 client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents: 2880
diff changeset
44 <style lang="sass" scoped>
6538ee93df72 client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents: 2880
diff changeset
45 .bottleneckdetails
6538ee93df72 client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents: 2880
diff changeset
46 width: 100%
6538ee93df72 client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents: 2880
diff changeset
47 overflow-y: auto
2942
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
48 > div
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
49 border-top: dashed 1px #dee2e6
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
50 &:first-child
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
51 border-top: none
2944
73f537379203 client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents: 2942
diff changeset
52 .properties
73f537379203 client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents: 2942
diff changeset
53 position: relative
73f537379203 client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents: 2942
diff changeset
54 overflow: hidden
73f537379203 client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents: 2942
diff changeset
55 &::after
73f537379203 client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents: 2942
diff changeset
56 content: ''
73f537379203 client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents: 2942
diff changeset
57 position: absolute
73f537379203 client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents: 2942
diff changeset
58 top: 0
73f537379203 client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents: 2942
diff changeset
59 right: -5px
73f537379203 client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents: 2942
diff changeset
60 bottom: 0
73f537379203 client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents: 2942
diff changeset
61 left: -5px
73f537379203 client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents: 2942
diff changeset
62 box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.4)
73f537379203 client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents: 2942
diff changeset
63 tr
73f537379203 client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents: 2942
diff changeset
64 font-size: 0.7rem
73f537379203 client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents: 2942
diff changeset
65 &:nth-child(odd)
73f537379203 client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents: 2942
diff changeset
66 background-color: #f8f9fa
2882
6538ee93df72 client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents: 2880
diff changeset
67
6538ee93df72 client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents: 2880
diff changeset
68 .split
6538ee93df72 client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents: 2880
diff changeset
69 max-height: 35vh
6538ee93df72 client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents: 2880
diff changeset
70 </style>
6538ee93df72 client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents: 2880
diff changeset
71
2602
5d0e5159190f overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
72 <script>
5d0e5159190f overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
73 /* This is Free Software under GNU Affero General Public License v >= 3.0
5d0e5159190f overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
74 * without warranty, see README.md and license for details.
5d0e5159190f overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
75 *
5d0e5159190f overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
76 * SPDX-License-Identifier: AGPL-3.0-or-later
5d0e5159190f overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
77 * License-Filename: LICENSES/AGPL-3.0.txt
5d0e5159190f overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
78 *
5d0e5159190f overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
79 * Copyright (C) 2018 by via donau
5d0e5159190f overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
80 * – Österreichische Wasserstraßen-Gesellschaft mbH
5d0e5159190f overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
81 * Software engineering by Intevation GmbH
5d0e5159190f overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
82 *
5d0e5159190f overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
83 * Author(s):
5d0e5159190f overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
84 * Thomas Junk <thomas.junk@intevation.de>
5d0e5159190f overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
85 */
2647
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
86
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
87 import { HTTP } from "@/lib/http";
2985
1b8bb4f89227 client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents: 2957
diff changeset
88 import { WFS } from "ol/format";
1b8bb4f89227 client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents: 2957
diff changeset
89 import { or as orFilter, equalTo as equalToFilter } from "ol/format/filter";
1b8bb4f89227 client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents: 2957
diff changeset
90 import { displayError } from "@/lib/errors";
3044
c71373594719 client: map: prepared store to hold multiple map objects
Markus Kottlaender <markus@intevation.de>
parents: 3017
diff changeset
91 import { mapState, mapGetters } from "vuex";
2647
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
92
2602
5d0e5159190f overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
93 export default {
2647
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
94 data() {
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
95 return {
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
96 bottlenecks: [],
2942
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
97 showBottleneckDetail: null
2647
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
98 };
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
99 },
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
100 mounted() {
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
101 this.loadBottlenecks();
4101
7afe411eeb48 import review: on opening bottleneckreview details, the bottleneck source is refreshed
Thomas Junk <thomas.junk@intevation.de>
parents: 3127
diff changeset
102 this.reloadBottleneckLayer();
2647
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
103 },
2717
5b990f612420 import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents: 2708
diff changeset
104 computed: {
4101
7afe411eeb48 import review: on opening bottleneckreview details, the bottleneck source is refreshed
Thomas Junk <thomas.junk@intevation.de>
parents: 3127
diff changeset
105 ...mapState("map", ["openLayersMaps"]),
2957
b74ebeb2bdc8 client: layers: improved structure of layer configuration
Markus Kottlaender <markus@intevation.de>
parents: 2948
diff changeset
106 ...mapState("imports", ["showLogs", "details"]),
3044
c71373594719 client: map: prepared store to hold multiple map objects
Markus Kottlaender <markus@intevation.de>
parents: 3017
diff changeset
107 ...mapGetters("map", ["openLayersMap"])
2717
5b990f612420 import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents: 2708
diff changeset
108 },
2647
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
109 methods: {
4101
7afe411eeb48 import review: on opening bottleneckreview details, the bottleneck source is refreshed
Thomas Junk <thomas.junk@intevation.de>
parents: 3127
diff changeset
110 reloadBottleneckLayer() {
7afe411eeb48 import review: on opening bottleneckreview details, the bottleneck source is refreshed
Thomas Junk <thomas.junk@intevation.de>
parents: 3127
diff changeset
111 this.openLayersMaps.forEach(map => {
7afe411eeb48 import review: on opening bottleneckreview details, the bottleneck source is refreshed
Thomas Junk <thomas.junk@intevation.de>
parents: 3127
diff changeset
112 map
7afe411eeb48 import review: on opening bottleneckreview details, the bottleneck source is refreshed
Thomas Junk <thomas.junk@intevation.de>
parents: 3127
diff changeset
113 .getLayer("BOTTLENECKISOLINE")
7afe411eeb48 import review: on opening bottleneckreview details, the bottleneck source is refreshed
Thomas Junk <thomas.junk@intevation.de>
parents: 3127
diff changeset
114 .getSource()
7afe411eeb48 import review: on opening bottleneckreview details, the bottleneck source is refreshed
Thomas Junk <thomas.junk@intevation.de>
parents: 3127
diff changeset
115 .refresh();
7afe411eeb48 import review: on opening bottleneckreview details, the bottleneck source is refreshed
Thomas Junk <thomas.junk@intevation.de>
parents: 3127
diff changeset
116 });
7afe411eeb48 import review: on opening bottleneckreview details, the bottleneck source is refreshed
Thomas Junk <thomas.junk@intevation.de>
parents: 3127
diff changeset
117 },
2647
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
118 loadBottlenecks() {
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
119 const generateFilter = () => {
2685
39a05f8c34e6 import_overview: Refactoring of detailed information.
Thomas Junk <thomas.junk@intevation.de>
parents: 2647
diff changeset
120 const { bottlenecks } = this.details.summary;
2647
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
121 if (bottlenecks.length === 1)
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
122 return equalToFilter("bottleneck_id", bottlenecks[0]);
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
123 const orExpressions = bottlenecks.map(x => {
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
124 return equalToFilter("bottleneck_id", x);
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
125 });
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
126 return orFilter(...orExpressions);
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
127 };
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
128 const filterExpression = generateFilter();
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
129 const bottleneckFeatureCollectionRequest = new WFS().writeGetFeature({
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
130 srsName: "EPSG:4326",
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
131 featureNS: "gemma",
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
132 featurePrefix: "gemma",
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
133 featureTypes: ["bottlenecks_geoserver"],
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
134 outputFormat: "application/json",
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
135 filter: filterExpression
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
136 });
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
137 HTTP.post(
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
138 "/internal/wfs",
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
139 new XMLSerializer().serializeToString(
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
140 bottleneckFeatureCollectionRequest
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
141 ),
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
142 {
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
143 headers: {
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
144 "X-Gemma-Auth": localStorage.getItem("token"),
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
145 "Content-type": "text/xml; charset=UTF-8"
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
146 }
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
147 }
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
148 )
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
149 .then(response => {
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
150 this.bottlenecks = response.data.features;
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
151 })
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
152 .catch(error => {
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
153 const { status, data } = error.response;
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
154 displayError({
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
155 title: this.$gettext("Backend Error"),
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
156 message: `${status}: ${data.message || data}`
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
157 });
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
158 });
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
159 },
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
160 moveToBottleneck(index) {
3127
0374197c384f client: fix openLayersMap getter calls
Markus Kottlaender <markus@intevation.de>
parents: 3054
diff changeset
161 this.openLayersMap()
0374197c384f client: fix openLayersMap getter calls
Markus Kottlaender <markus@intevation.de>
parents: 3054
diff changeset
162 .getLayer("BOTTLENECKS")
0374197c384f client: fix openLayersMap getter calls
Markus Kottlaender <markus@intevation.de>
parents: 3054
diff changeset
163 .setVisible(true);
3054
1ef2f4179d30 client: map store: merged/renamed method(s)
Markus Kottlaender <markus@intevation.de>
parents: 3044
diff changeset
164 this.$store.dispatch("map/moveToFeauture", {
3017
9a408a8b74b8 client: inlined some functions that were used only once
Markus Kottlaender <markus@intevation.de>
parents: 3006
diff changeset
165 feature: this.bottlenecks[index],
2647
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
166 zoom: 17,
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
167 preventZoomOut: true
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
168 });
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
169 },
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
170 showBottleneckDetails(index) {
2942
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
171 if (index === this.showBottleneckDetail) {
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
172 this.showBottleneckDetail = null;
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
173 } else {
30c906733154 client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents: 2935
diff changeset
174 this.showBottleneckDetail = index;
2647
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
175 }
c52bf6f994c0 overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents: 2602
diff changeset
176 }
2880
c40540889b53 client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents: 2732
diff changeset
177 }
2602
5d0e5159190f overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
178 };
5d0e5159190f overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
179 </script>