Mercurial > gemma
annotate client/src/components/importoverview/FairwayDimensionDetail.vue @ 5307:4ba3fda13c50 zpg-exception
Fixed typo in migration script.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 28 May 2021 11:17:12 +0200 |
parents | a17c2a0b8e44 |
children |
rev | line source |
---|---|
2917
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 <template> |
4368
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4336
diff
changeset
|
2 <div class="d-flex flex-column"> |
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4336
diff
changeset
|
3 <div> |
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4336
diff
changeset
|
4 Fairwaydimensions |
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4336
diff
changeset
|
5 </div> |
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4336
diff
changeset
|
6 <template v-if="LOS"> |
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4336
diff
changeset
|
7 <span class="ml-2 mt-1">LOS: {{ LOS }}</span> |
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4336
diff
changeset
|
8 <span class="ml-2 mb-3" |
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4336
diff
changeset
|
9 ><translate>Source</translate>: {{ organization }}</span |
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4336
diff
changeset
|
10 > |
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4336
diff
changeset
|
11 </template> |
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4336
diff
changeset
|
12 </div> |
2917
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
13 </template> |
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
14 |
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
15 <script> |
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
16 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
17 * without warranty, see README.md and license for details. |
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
18 * |
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
19 * SPDX-License-Identifier: AGPL-3.0-or-later |
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
20 * License-Filename: LICENSES/AGPL-3.0.txt |
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
21 * |
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
22 * Copyright (C) 2018 by via donau |
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
23 * – Österreichische Wasserstraßen-Gesellschaft mbH |
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
24 * Software engineering by Intevation GmbH |
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
25 * |
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
26 * Author(s): |
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
27 * Thomas Junk <thomas.junk@intevation.de> |
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
28 */ |
5266
855e586b42e2
client: adjust filters for review layer
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5076
diff
changeset
|
29 import { |
855e586b42e2
client: adjust filters for review layer
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5076
diff
changeset
|
30 or as orFilter, |
855e586b42e2
client: adjust filters for review layer
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5076
diff
changeset
|
31 and as andFilter, |
855e586b42e2
client: adjust filters for review layer
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5076
diff
changeset
|
32 greaterThanOrEqualTo, |
855e586b42e2
client: adjust filters for review layer
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5076
diff
changeset
|
33 lessThanOrEqualTo, |
855e586b42e2
client: adjust filters for review layer
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5076
diff
changeset
|
34 equalTo as equalToFilter |
855e586b42e2
client: adjust filters for review layer
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5076
diff
changeset
|
35 } from "ol/format/filter"; |
4336
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
2917
diff
changeset
|
36 //import { displayError } from "@/lib/errors"; |
5267
aca4bf7af270
client: remove mapState from import statement
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5266
diff
changeset
|
37 import { mapGetters } from "vuex"; |
4374
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
38 import VectorSource from "ol/source/Vector"; |
5076
96a544504818
move layer.js and styles.js to layers directory
Thomas Junk <thomas.junk@intevation.de>
parents:
4378
diff
changeset
|
39 import { buildVectorLoader } from "@/components/layers/layers.js"; |
4374
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
40 import { bbox as bboxStrategy } from "ol/loadingstrategy"; |
4376
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
41 import { WFS } from "ol/format"; |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
42 import { HTTP } from "@/lib/http"; |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
43 |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
44 const getFromWFS = (type, filter) => { |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
45 return new Promise((resolve, reject) => { |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
46 var featureCollectionRequest = new WFS().writeGetFeature({ |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
47 srsName: "EPSG:4326", |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
48 featureNS: "gemma", |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
49 featurePrefix: "gemma", |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
50 featureTypes: [type], |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
51 outputFormat: "application/json", |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
52 filter: filter |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
53 }); |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
54 HTTP.post( |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
55 "/internal/wfs", |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
56 new XMLSerializer().serializeToString(featureCollectionRequest), |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
57 { |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
58 headers: { |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
59 "X-Gemma-Auth": localStorage.getItem("token"), |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
60 "Content-type": "text/xml; charset=UTF-8" |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
61 } |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
62 } |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
63 ) |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
64 .then(response => { |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
65 resolve(response); |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
66 }) |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
67 .catch(error => { |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
68 reject(error); |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
69 }); |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
70 }); |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
71 }; |
4336
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
2917
diff
changeset
|
72 |
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
2917
diff
changeset
|
73 export default { |
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
2917
diff
changeset
|
74 props: ["summary"], |
4368
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4336
diff
changeset
|
75 data() { |
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4336
diff
changeset
|
76 return { |
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4336
diff
changeset
|
77 organization: "", |
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4336
diff
changeset
|
78 LOS: "" |
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4336
diff
changeset
|
79 }; |
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4336
diff
changeset
|
80 }, |
4336
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
2917
diff
changeset
|
81 mounted() { |
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
2917
diff
changeset
|
82 const ids = this.fairWayDimensionIDs.map(id => { |
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
2917
diff
changeset
|
83 return equalToFilter("id", id); |
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
2917
diff
changeset
|
84 }); |
4374
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
85 const fairwaydimensionLayer = this.openLayersMap().getLayer( |
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
86 "FDREVIEWLAYER" |
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
87 ); |
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
88 const source = new VectorSource({ strategy: bboxStrategy }); |
5279
a17c2a0b8e44
client: use current time in the review layer request
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5267
diff
changeset
|
89 source.setProperties({ useCurrentTime: true }); |
4374
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
90 this.$store.commit("map/reviewActive", true); |
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
91 fairwaydimensionLayer.setVisible(true); |
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
92 source.setLoader( |
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
93 buildVectorLoader( |
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 geometryName: "area", |
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
96 featureTypes: ["fairway_dimensions"], |
5266
855e586b42e2
client: adjust filters for review layer
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5076
diff
changeset
|
97 filter: andFilter( |
855e586b42e2
client: adjust filters for review layer
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5076
diff
changeset
|
98 lessThanOrEqualTo("valid_from", new Date().toISOString()), |
855e586b42e2
client: adjust filters for review layer
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5076
diff
changeset
|
99 greaterThanOrEqualTo("valid_to", new Date().toISOString()), |
855e586b42e2
client: adjust filters for review layer
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5076
diff
changeset
|
100 orFilter(...ids) |
855e586b42e2
client: adjust filters for review layer
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5076
diff
changeset
|
101 ) |
4374
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
102 }, |
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
103 source, |
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
104 false |
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
105 ) |
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
106 ); |
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
107 fairwaydimensionLayer.setSource(source); |
4376
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
108 getFromWFS("fairway_dimensions", ids[0]).then(response => { |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
109 const { |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
110 level_of_service, |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
111 source_organization |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
112 } = response.data.features[0].properties; |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
113 this.LOS = level_of_service; |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
114 this.organization = source_organization; |
8949b4d714ee
importoverview: improve identification of features to review
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
115 }); |
4336
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
2917
diff
changeset
|
116 }, |
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
2917
diff
changeset
|
117 computed: { |
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
2917
diff
changeset
|
118 ...mapGetters("map", ["openLayersMap"]), |
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
2917
diff
changeset
|
119 fairWayDimensionIDs() { |
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
2917
diff
changeset
|
120 return this.summary["fd-area"].map(e => e.id); |
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
2917
diff
changeset
|
121 } |
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
2917
diff
changeset
|
122 } |
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
2917
diff
changeset
|
123 }; |
2917
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
124 </script> |