Mercurial > gemma
annotate client/src/components/Maplayer.vue @ 2920:c1f2b9148cc8
client: removed more unnecessary closing tags and opzimized imports
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Wed, 03 Apr 2019 16:23:25 +0200 |
parents | c8c7122047a2 |
children | 1ac58e024942 |
rev | line source |
---|---|
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 <template> |
2549
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
2 <div |
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
3 id="map" |
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
4 :class="{ |
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
5 splitscreen: this.splitscreen, |
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
6 nocursor: this.hasActiveInteractions |
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
7 }" |
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
8 ></div> |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
9 </template> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
10 |
2549
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
11 <style lang="sass" scoped> |
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
12 #map |
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
13 height: 100vh |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
14 |
2549
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
15 &.splitscreen |
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
16 height: 50vh |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
17 |
2549
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
18 &.nocursor |
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
19 cursor: none |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
20 </style> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
21 |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
22 <script> |
1362
ca33ad696594
remove the first empyty lines
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1313
diff
changeset
|
23 /* 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
|
24 * without warranty, see README.md and license for details. |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
25 * |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
26 * SPDX-License-Identifier: AGPL-3.0-or-later |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
27 * License-Filename: LICENSES/AGPL-3.0.txt |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
28 * |
1932
e734d48ef964
client: cleanup code: remove browser based printing css attempt
Bernhard Reiter <bernhard@intevation.de>
parents:
1794
diff
changeset
|
29 * Copyright (C) 2018, 2019 by via donau |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
30 * – Österreichische Wasserstraßen-Gesellschaft mbH |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
31 * Software engineering by Intevation GmbH |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
32 * |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
33 * Author(s): |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
34 * * Thomas Junk <thomas.junk@intevation.de> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
35 * * Bernhard E. Reiter <bernhard.reiter@intevation.de> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
36 */ |
1613
f2d24dceecc7
refac: cleanup import paths
Thomas Junk <thomas.junk@intevation.de>
parents:
1558
diff
changeset
|
37 import { HTTP } from "@/lib/http"; |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
38 import { mapGetters, mapState } from "vuex"; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
39 import "ol/ol.css"; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
40 import { Map, View } from "ol"; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
41 import { WFS, GeoJSON } from "ol/format.js"; |
2125
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
1983
diff
changeset
|
42 import { equalTo } from "ol/format/filter.js"; |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
43 import { Stroke, Style, Fill } from "ol/style.js"; |
2190 | 44 import { displayError } from "@/lib/errors.js"; |
2273
4eeaba4ef573
client: rename the Fairway Dimensions layers
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2190
diff
changeset
|
45 import { LAYERS } from "@/store/map.js"; |
1272
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 /* for the sake of debugging */ |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
48 /* eslint-disable no-console */ |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
49 export default { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
50 name: "maplayer", |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
51 data() { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
52 return { |
2549
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
53 projection: "EPSG:3857", |
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
54 splitscreen: false |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
55 }; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
56 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
57 computed: { |
1424
4afbc615cfc2
little code cleanup
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
58 ...mapGetters("map", ["getLayerByName", "getVSourceByName"]), |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
59 ...mapState("map", [ |
2310
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
60 "initialLoad", |
1313
e4e35fb2d995
save map extent (center/zoom) in store, to not lose it when switching between map and admin area
Markus Kottlaender <markus@intevation.de>
parents:
1296
diff
changeset
|
61 "extent", |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
62 "layers", |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
63 "openLayersMap", |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
64 "lineTool", |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
65 "polygonTool", |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
66 "cutTool" |
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 ...mapState("bottlenecks", ["selectedSurvey"]), |
1394
b350b0b5cb6c
refactored fairwayprofile cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1372
diff
changeset
|
69 ...mapState("application", ["showSplitscreen"]), |
2910
c8c7122047a2
client: stretches: select/unselect stretches by clicking on them on the map
Markus Kottlaender <markus@intevation.de>
parents:
2909
diff
changeset
|
70 ...mapState("imports", ["selectedStretchId"]), |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
71 hasActiveInteractions() { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
72 return ( |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
73 (this.lineTool && this.lineTool.getActive()) || |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
74 (this.polygonTool && this.polygonTool.getActive()) || |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
75 (this.cutTool && this.cutTool.getActive()) |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
76 ); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
77 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
78 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
79 methods: { |
2909
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2870
diff
changeset
|
80 buildVectorLoader( |
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2870
diff
changeset
|
81 featureRequestOptions, |
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2870
diff
changeset
|
82 endpoint, |
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2870
diff
changeset
|
83 vectorSource, |
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2870
diff
changeset
|
84 featurePostProcessor |
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2870
diff
changeset
|
85 ) { |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
86 // build a function to be used for VectorSource.setLoader() |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
87 // make use of WFS().writeGetFeature to build the request |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
88 // and use our HTTP library to actually do it |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
89 // NOTE: a) the geometryName has to be given in featureRequestOptions, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
90 // because we want to load depending on the bbox |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
91 // b) the VectorSource has to have the option strategy: bbox |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
92 featureRequestOptions["outputFormat"] = "application/json"; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
93 var loader = function(extent, resolution, projection) { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
94 featureRequestOptions["bbox"] = extent; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
95 featureRequestOptions["srsName"] = projection.getCode(); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
96 var featureRequest = new WFS().writeGetFeature(featureRequestOptions); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
97 // DEBUG console.log(featureRequest); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
98 HTTP.post( |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
99 endpoint, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
100 new XMLSerializer().serializeToString(featureRequest), |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
101 { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
102 headers: { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
103 "X-Gemma-Auth": localStorage.getItem("token"), |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
104 "Content-type": "text/xml; charset=UTF-8" |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
105 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
106 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
107 ) |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
108 .then(response => { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
109 var features = new GeoJSON().readFeatures( |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
110 JSON.stringify(response.data) |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
111 ); |
2909
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2870
diff
changeset
|
112 if (featurePostProcessor) { |
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2870
diff
changeset
|
113 features.map(f => featurePostProcessor(f)); |
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2870
diff
changeset
|
114 } |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
115 vectorSource.addFeatures(features); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
116 // console.log( |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
117 // "loaded", |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
118 // features.length, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
119 // featureRequestOptions.featureTypes, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
120 // "features" |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
121 // ); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
122 // DEBUG console.log("loaded ", features, "for", vectorSource); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
123 // eslint-disable-next-line |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
124 }) |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
125 .catch(() => { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
126 vectorSource.removeLoadedExtent(extent); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
127 }); |
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 return loader; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
130 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
131 updateBottleneckFilter(bottleneck_id, datestr) { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
132 console.log("updating filter with", bottleneck_id, datestr); |
2324
edaf0d22fc9c
client:use the name of constants instead of strings
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2310
diff
changeset
|
133 const layer = this.getLayerByName(LAYERS.BOTTLENECKISOLINE); |
1424
4afbc615cfc2
little code cleanup
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
134 const wmsSrc = layer.data.getSource(); |
4afbc615cfc2
little code cleanup
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
135 const exists = bottleneck_id != "does_not_exist"; |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
136 |
1424
4afbc615cfc2
little code cleanup
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
137 if (exists) { |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
138 wmsSrc.updateParams({ |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
139 cql_filter: |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
140 "date_info='" + |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
141 datestr + |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
142 "' AND bottleneck_id='" + |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
143 bottleneck_id + |
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 }); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
146 } |
1424
4afbc615cfc2
little code cleanup
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
147 layer.isVisible = exists; |
4afbc615cfc2
little code cleanup
Markus Kottlaender <markus@intevation.de>
parents:
1394
diff
changeset
|
148 layer.data.setVisible(exists); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
149 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
150 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
151 watch: { |
2549
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
152 showSplitscreen(show) { |
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
153 if (show) { |
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
154 setTimeout(() => { |
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
155 this.splitscreen = true; |
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
156 }, 350); |
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
157 } else { |
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
158 this.splitscreen = false; |
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
159 } |
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
160 }, |
9bf6b767a56a
client: refactored and improved splitscreen for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
161 splitscreen() { |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
162 const map = this.openLayersMap; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
163 this.$nextTick(() => { |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
164 map && map.updateSize(); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
165 }); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
166 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
167 selectedSurvey(newSelectedSurvey) { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
168 if (newSelectedSurvey) { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
169 this.updateBottleneckFilter( |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
170 newSelectedSurvey.bottleneck_id, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
171 newSelectedSurvey.date_info |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
172 ); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
173 } else { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
174 this.updateBottleneckFilter("does_not_exist", "1999-10-01"); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
175 } |
2910
c8c7122047a2
client: stretches: select/unselect stretches by clicking on them on the map
Markus Kottlaender <markus@intevation.de>
parents:
2909
diff
changeset
|
176 }, |
c8c7122047a2
client: stretches: select/unselect stretches by clicking on them on the map
Markus Kottlaender <markus@intevation.de>
parents:
2909
diff
changeset
|
177 selectedStretchId(id) { |
c8c7122047a2
client: stretches: select/unselect stretches by clicking on them on the map
Markus Kottlaender <markus@intevation.de>
parents:
2909
diff
changeset
|
178 this.getVSourceByName(LAYERS.STRETCHES) |
c8c7122047a2
client: stretches: select/unselect stretches by clicking on them on the map
Markus Kottlaender <markus@intevation.de>
parents:
2909
diff
changeset
|
179 .getFeatures() |
c8c7122047a2
client: stretches: select/unselect stretches by clicking on them on the map
Markus Kottlaender <markus@intevation.de>
parents:
2909
diff
changeset
|
180 .forEach(f => { |
c8c7122047a2
client: stretches: select/unselect stretches by clicking on them on the map
Markus Kottlaender <markus@intevation.de>
parents:
2909
diff
changeset
|
181 f.set("highlighted", false); |
c8c7122047a2
client: stretches: select/unselect stretches by clicking on them on the map
Markus Kottlaender <markus@intevation.de>
parents:
2909
diff
changeset
|
182 if (id === f.getId()) { |
c8c7122047a2
client: stretches: select/unselect stretches by clicking on them on the map
Markus Kottlaender <markus@intevation.de>
parents:
2909
diff
changeset
|
183 f.set("highlighted", true); |
c8c7122047a2
client: stretches: select/unselect stretches by clicking on them on the map
Markus Kottlaender <markus@intevation.de>
parents:
2909
diff
changeset
|
184 } |
c8c7122047a2
client: stretches: select/unselect stretches by clicking on them on the map
Markus Kottlaender <markus@intevation.de>
parents:
2909
diff
changeset
|
185 }); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
186 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
187 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
188 mounted() { |
2870
35f6e4383161
layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents:
2549
diff
changeset
|
189 const Layers = Object.keys(this.layers).map(x => this.layers[x].data); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
190 let map = new Map({ |
2870
35f6e4383161
layer structure overhaul
Thomas Junk <thomas.junk@intevation.de>
parents:
2549
diff
changeset
|
191 layers: [...Layers], |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
192 target: "map", |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
193 controls: [], |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
194 view: new View({ |
1313
e4e35fb2d995
save map extent (center/zoom) in store, to not lose it when switching between map and admin area
Markus Kottlaender <markus@intevation.de>
parents:
1296
diff
changeset
|
195 center: [this.extent.lon, this.extent.lat], |
2139
22bbd0d0500e
client: limit zooming out to roughly Europe
Bernhard Reiter <bernhard@intevation.de>
parents:
2125
diff
changeset
|
196 minZoom: 5, // restrict zooming out to ~size of Europe for width 1000px |
1313
e4e35fb2d995
save map extent (center/zoom) in store, to not lose it when switching between map and admin area
Markus Kottlaender <markus@intevation.de>
parents:
1296
diff
changeset
|
197 zoom: this.extent.zoom, |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
198 projection: this.projection |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
199 }) |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
200 }); |
1313
e4e35fb2d995
save map extent (center/zoom) in store, to not lose it when switching between map and admin area
Markus Kottlaender <markus@intevation.de>
parents:
1296
diff
changeset
|
201 map.on("moveend", event => { |
e4e35fb2d995
save map extent (center/zoom) in store, to not lose it when switching between map and admin area
Markus Kottlaender <markus@intevation.de>
parents:
1296
diff
changeset
|
202 const center = event.map.getView().getCenter(); |
e4e35fb2d995
save map extent (center/zoom) in store, to not lose it when switching between map and admin area
Markus Kottlaender <markus@intevation.de>
parents:
1296
diff
changeset
|
203 this.$store.commit("map/extent", { |
e4e35fb2d995
save map extent (center/zoom) in store, to not lose it when switching between map and admin area
Markus Kottlaender <markus@intevation.de>
parents:
1296
diff
changeset
|
204 lat: center[1], |
e4e35fb2d995
save map extent (center/zoom) in store, to not lose it when switching between map and admin area
Markus Kottlaender <markus@intevation.de>
parents:
1296
diff
changeset
|
205 lon: center[0], |
e4e35fb2d995
save map extent (center/zoom) in store, to not lose it when switching between map and admin area
Markus Kottlaender <markus@intevation.de>
parents:
1296
diff
changeset
|
206 zoom: event.map.getView().getZoom() |
e4e35fb2d995
save map extent (center/zoom) in store, to not lose it when switching between map and admin area
Markus Kottlaender <markus@intevation.de>
parents:
1296
diff
changeset
|
207 }); |
e4e35fb2d995
save map extent (center/zoom) in store, to not lose it when switching between map and admin area
Markus Kottlaender <markus@intevation.de>
parents:
1296
diff
changeset
|
208 }); |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
209 this.$store.dispatch("map/openLayersMap", map); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
210 |
2310
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
211 if (this.initialLoad) { |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
212 this.$store.commit("map/initialLoad", false); |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
213 var currentUser = this.$store.state.user.user; |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
214 HTTP.get("/users/" + currentUser, { |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
215 headers: { |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
216 "X-Gemma-Auth": localStorage.getItem("token"), |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
217 "Content-type": "text/xml; charset=UTF-8" |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
218 } |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
219 }) |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
220 .then(response => { |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
221 this.$store.commit("map/moveToBoundingBox", { |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
222 boundingBox: [ |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
223 response.data.extent.x1, |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
224 response.data.extent.y1, |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
225 response.data.extent.x2, |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
226 response.data.extent.y2 |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
227 ], |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
228 zoom: 17, |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
229 preventZoomOut: true |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
230 }); |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
231 }) |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
232 .catch(error => { |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
233 const { status, data } = error.response; |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
234 displayError({ |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
235 title: this.$gettext("Backend Error"), |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
236 message: `${status}: ${data.message || data}` |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
237 }); |
2190 | 238 }); |
2310
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2308
diff
changeset
|
239 } |
2188
005da2c21b11
client: Zoom to users responisbility area on startup.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2185
diff
changeset
|
240 |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
241 // TODO make display of layers more dynamic, e.g. from a list |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
242 |
2125
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
1983
diff
changeset
|
243 // load different fairway dimension layers (level of service) |
2273
4eeaba4ef573
client: rename the Fairway Dimensions layers
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2190
diff
changeset
|
244 [ |
4eeaba4ef573
client: rename the Fairway Dimensions layers
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2190
diff
changeset
|
245 LAYERS.FAIRWAYDIMENSIONSLOS1, |
4eeaba4ef573
client: rename the Fairway Dimensions layers
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2190
diff
changeset
|
246 LAYERS.FAIRWAYDIMENSIONSLOS2, |
4eeaba4ef573
client: rename the Fairway Dimensions layers
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2190
diff
changeset
|
247 LAYERS.FAIRWAYDIMENSIONSLOS3 |
4eeaba4ef573
client: rename the Fairway Dimensions layers
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2190
diff
changeset
|
248 ].forEach((los, i) => { |
2184
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
249 // loading the full WFS layer without bboxStrategy |
2273
4eeaba4ef573
client: rename the Fairway Dimensions layers
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2190
diff
changeset
|
250 var source = this.getVSourceByName(los); |
2190 | 251 /*eslint-disable no-unused-vars */ |
2184
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
252 var loader = function(extent, resolution, projection) { |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
253 var featureRequest = new WFS().writeGetFeature({ |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
254 srsName: "EPSG:3857", |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
255 featureNS: "gemma", |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
256 featurePrefix: "gemma", |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
257 featureTypes: ["fairway_dimensions"], |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
258 outputFormat: "application/json", |
2273
4eeaba4ef573
client: rename the Fairway Dimensions layers
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2190
diff
changeset
|
259 filter: equalTo("level_of_service", i + 1) |
2184
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
260 }); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
261 |
2184
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
262 featureRequest["outputFormat"] = "application/json"; |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
263 // NOTE: loading the full fairway_dimensions makes sure |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
264 // that all are available for the intersection with the profile |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
265 HTTP.post( |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
266 "/internal/wfs", |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
267 new XMLSerializer().serializeToString(featureRequest), |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
268 { |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
269 headers: { |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
270 "X-Gemma-Auth": localStorage.getItem("token"), |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
271 "Content-type": "text/xml; charset=UTF-8" |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
272 } |
2125
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
1983
diff
changeset
|
273 } |
2184
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
274 ).then(response => { |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
275 source.addFeatures( |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
276 new GeoJSON().readFeatures(JSON.stringify(response.data)) |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
277 ); |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
278 // would scale to the extend of all resulting features |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
279 // this.openLayersMap.getView().fit(vectorSrc.getExtent()); |
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
280 }); |
2185 | 281 }; |
2184
826fc7309370
client: Added refresh button to reload the WFS layer data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2157
diff
changeset
|
282 |
2273
4eeaba4ef573
client: rename the Fairway Dimensions layers
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2190
diff
changeset
|
283 layer = this.getLayerByName(los); |
2185 | 284 layer.data.getSource().setLoader(loader); |
2308
f42a7ba05979
client: honor isVisible attribute for more layers
Bernhard Reiter <bernhard@intevation.de>
parents:
2300
diff
changeset
|
285 layer.data.setVisible(layer.isVisible); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
286 }); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
287 |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
288 // load following layers with bboxStrategy (using our request builder) |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
289 var layer = null; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
290 |
2324
edaf0d22fc9c
client:use the name of constants instead of strings
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2310
diff
changeset
|
291 layer = this.getLayerByName(LAYERS.WATERWAYAREA); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
292 layer.data.getSource().setLoader( |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
293 this.buildVectorLoader( |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
294 { |
1794
de4543bfbad5
Use internal waterway area data for map (not d4d wfs).
Sascha Wilde <wilde@intevation.de>
parents:
1719
diff
changeset
|
295 featureNS: "gemma", |
de4543bfbad5
Use internal waterway area data for map (not d4d wfs).
Sascha Wilde <wilde@intevation.de>
parents:
1719
diff
changeset
|
296 featurePrefix: "gemma", |
de4543bfbad5
Use internal waterway area data for map (not d4d wfs).
Sascha Wilde <wilde@intevation.de>
parents:
1719
diff
changeset
|
297 featureTypes: ["waterway_area"], |
de4543bfbad5
Use internal waterway area data for map (not d4d wfs).
Sascha Wilde <wilde@intevation.de>
parents:
1719
diff
changeset
|
298 geometryName: "area" |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
299 }, |
1794
de4543bfbad5
Use internal waterway area data for map (not d4d wfs).
Sascha Wilde <wilde@intevation.de>
parents:
1719
diff
changeset
|
300 "/internal/wfs", |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
301 layer.data.getSource() |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
302 ) |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
303 ); |
2308
f42a7ba05979
client: honor isVisible attribute for more layers
Bernhard Reiter <bernhard@intevation.de>
parents:
2300
diff
changeset
|
304 layer.data.setVisible(layer.isVisible); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
305 |
2324
edaf0d22fc9c
client:use the name of constants instead of strings
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2310
diff
changeset
|
306 layer = this.getLayerByName(LAYERS.WATERWAYAXIS); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
307 layer.data.getSource().setLoader( |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
308 this.buildVectorLoader( |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
309 { |
1719
a005816388b7
Use internal waterway axis data for map (not d4d wfs).
Sascha Wilde <wilde@intevation.de>
parents:
1613
diff
changeset
|
310 featureNS: "gemma", |
a005816388b7
Use internal waterway axis data for map (not d4d wfs).
Sascha Wilde <wilde@intevation.de>
parents:
1613
diff
changeset
|
311 featurePrefix: "gemma", |
a005816388b7
Use internal waterway axis data for map (not d4d wfs).
Sascha Wilde <wilde@intevation.de>
parents:
1613
diff
changeset
|
312 featureTypes: ["waterway_axis"], |
a005816388b7
Use internal waterway axis data for map (not d4d wfs).
Sascha Wilde <wilde@intevation.de>
parents:
1613
diff
changeset
|
313 geometryName: "wtwaxs" |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
314 }, |
1719
a005816388b7
Use internal waterway axis data for map (not d4d wfs).
Sascha Wilde <wilde@intevation.de>
parents:
1613
diff
changeset
|
315 "/internal/wfs", |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
316 layer.data.getSource() |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
317 ) |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
318 ); |
2308
f42a7ba05979
client: honor isVisible attribute for more layers
Bernhard Reiter <bernhard@intevation.de>
parents:
2300
diff
changeset
|
319 layer.data.setVisible(layer.isVisible); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
320 |
2324
edaf0d22fc9c
client:use the name of constants instead of strings
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2310
diff
changeset
|
321 layer = this.getLayerByName(LAYERS.WATERWAYPROFILES); |
2157
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2139
diff
changeset
|
322 layer.data.getSource().setLoader( |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2139
diff
changeset
|
323 this.buildVectorLoader( |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2139
diff
changeset
|
324 { |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2139
diff
changeset
|
325 featureNS: "gemma", |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2139
diff
changeset
|
326 featurePrefix: "gemma", |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2139
diff
changeset
|
327 featureTypes: ["waterway_profiles"], |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2139
diff
changeset
|
328 geometryName: "geom" |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2139
diff
changeset
|
329 }, |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2139
diff
changeset
|
330 "/internal/wfs", |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2139
diff
changeset
|
331 layer.data.getSource() |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2139
diff
changeset
|
332 ) |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2139
diff
changeset
|
333 ); |
2308
f42a7ba05979
client: honor isVisible attribute for more layers
Bernhard Reiter <bernhard@intevation.de>
parents:
2300
diff
changeset
|
334 layer.data.setVisible(layer.isVisible); |
2157
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2139
diff
changeset
|
335 |
2324
edaf0d22fc9c
client:use the name of constants instead of strings
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2310
diff
changeset
|
336 layer = this.getLayerByName(LAYERS.DISTANCEMARKS); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
337 layer.data.getSource().setLoader( |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
338 this.buildVectorLoader( |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
339 { |
2300
3dd2de314b1b
Use distance marks from wamos db in map.
Sascha Wilde <wilde@intevation.de>
parents:
2273
diff
changeset
|
340 featureNS: "gemma", |
3dd2de314b1b
Use distance marks from wamos db in map.
Sascha Wilde <wilde@intevation.de>
parents:
2273
diff
changeset
|
341 featurePrefix: "gemma", |
3dd2de314b1b
Use distance marks from wamos db in map.
Sascha Wilde <wilde@intevation.de>
parents:
2273
diff
changeset
|
342 featureTypes: ["distance_marks_ashore_geoserver"], |
3dd2de314b1b
Use distance marks from wamos db in map.
Sascha Wilde <wilde@intevation.de>
parents:
2273
diff
changeset
|
343 geometryName: "geom" |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
344 }, |
2300
3dd2de314b1b
Use distance marks from wamos db in map.
Sascha Wilde <wilde@intevation.de>
parents:
2273
diff
changeset
|
345 "/internal/wfs", |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
346 layer.data.getSource() |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
347 ) |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
348 ); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
349 layer.data.setVisible(layer.isVisible); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
350 |
2324
edaf0d22fc9c
client:use the name of constants instead of strings
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2310
diff
changeset
|
351 layer = this.getLayerByName(LAYERS.DISTANCEMARKSAXIS); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
352 layer.data.getSource().setLoader( |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
353 this.buildVectorLoader( |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
354 { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
355 featureNS: "gemma", |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
356 featurePrefix: "gemma", |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
357 featureTypes: ["distance_marks_geoserver"], |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
358 geometryName: "geom" |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
359 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
360 "/internal/wfs", |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
361 layer.data.getSource() |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
362 ) |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
363 ); |
2308
f42a7ba05979
client: honor isVisible attribute for more layers
Bernhard Reiter <bernhard@intevation.de>
parents:
2300
diff
changeset
|
364 layer.data.setVisible(layer.isVisible); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
365 |
2451 | 366 layer = this.getLayerByName(LAYERS.GAUGES); |
367 layer.data.getSource().setLoader( | |
368 this.buildVectorLoader( | |
369 { | |
370 featureNS: "gemma", | |
371 featurePrefix: "gemma", | |
372 featureTypes: ["gauges_geoserver"], | |
373 geometryName: "geom" | |
374 }, | |
375 "/internal/wfs", | |
376 layer.data.getSource() | |
377 ) | |
378 ); | |
379 layer.data.setVisible(layer.isVisible); | |
380 | |
2324
edaf0d22fc9c
client:use the name of constants instead of strings
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2310
diff
changeset
|
381 layer = this.getLayerByName(LAYERS.STRETCHES); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
382 layer.data.getSource().setLoader( |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
383 this.buildVectorLoader( |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
384 { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
385 featureNS: "gemma", |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
386 featurePrefix: "gemma", |
1943
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1932
diff
changeset
|
387 featureTypes: ["stretches_geoserver"], |
1983
f9f1babe52ae
Fix area generation from multipolygon input
Tom Gottfried <tom@intevation.de>
parents:
1963
diff
changeset
|
388 geometryName: "area" |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
389 }, |
1943
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1932
diff
changeset
|
390 "/internal/wfs", |
2909
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2870
diff
changeset
|
391 layer.data.getSource(), |
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2870
diff
changeset
|
392 f => { |
2910
c8c7122047a2
client: stretches: select/unselect stretches by clicking on them on the map
Markus Kottlaender <markus@intevation.de>
parents:
2909
diff
changeset
|
393 if (f.getId() === this.selectedStretchId) { |
2909
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2870
diff
changeset
|
394 f.set("highlighted", true); |
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2870
diff
changeset
|
395 } |
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2870
diff
changeset
|
396 return f; |
5105f6ad0176
client: stretches: fixed highlighting of selected stretch
Markus Kottlaender <markus@intevation.de>
parents:
2870
diff
changeset
|
397 } |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
398 ) |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
399 ); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
400 layer.data.setVisible(layer.isVisible); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
401 |
2482
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
402 layer = this.getLayerByName(LAYERS.BOTTLENECKSTATUS); |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
403 layer.data.getSource().setLoader( |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
404 this.buildVectorLoader( |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
405 { |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
406 featureNS: "gemma", |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
407 featurePrefix: "gemma", |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
408 featureTypes: ["bottlenecks_geoserver"], |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
409 geometryName: "area" |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
410 }, |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
411 "/internal/wfs", |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
412 layer.data.getSource() |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
413 ) |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
414 ); |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
415 |
2324
edaf0d22fc9c
client:use the name of constants instead of strings
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2310
diff
changeset
|
416 layer = this.getLayerByName(LAYERS.BOTTLENECKS); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
417 layer.data.getSource().setLoader( |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
418 this.buildVectorLoader( |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
419 { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
420 featureNS: "gemma", |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
421 featurePrefix: "gemma", |
1963
f7a35ba9f409
Added view for publishing bottlenecks
Sascha Wilde <wilde@intevation.de>
parents:
1958
diff
changeset
|
422 featureTypes: ["bottlenecks_geoserver"], |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
423 geometryName: "area" |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
424 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
425 "/internal/wfs", |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
426 layer.data.getSource() |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
427 ) |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
428 ); |
2308
f42a7ba05979
client: honor isVisible attribute for more layers
Bernhard Reiter <bernhard@intevation.de>
parents:
2300
diff
changeset
|
429 layer.data.setVisible(layer.isVisible); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
430 HTTP.get("/system/style/Bottlenecks/stroke", { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
431 headers: { "X-Gemma-Auth": localStorage.getItem("token") } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
432 }) |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
433 .then(response => { |
2482
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
434 let btlnStrokeC = response.data.code; |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
435 HTTP.get("/system/style/Bottlenecks/fill", { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
436 headers: { "X-Gemma-Auth": localStorage.getItem("token") } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
437 }) |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
438 .then(response => { |
2482
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
439 let btlnFillC = response.data.code; |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
440 var newStyle = new Style({ |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
441 stroke: new Stroke({ |
2482
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
442 color: btlnStrokeC, |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
443 width: 4 |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
444 }), |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
445 fill: new Fill({ |
2482
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
446 color: btlnFillC |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
447 }) |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
448 }); |
2506
89c439721db2
client: new symbold for critical bottlenecks, normal bottlenecks are not marked anymore
Markus Kottlaender <markus@intevation.de>
parents:
2491
diff
changeset
|
449 layer.data.setStyle(newStyle); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
450 }) |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
451 .catch(error => { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
452 console.log(error); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
453 }); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
454 }) |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
455 .catch(error => { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
456 console.log(error); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
457 }); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
458 |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
459 // so none is shown |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
460 this.updateBottleneckFilter("does_not_exist", "1999-10-01"); |
1958
ae4ada3933af
clean state on identify tool on mount of component
Thomas Junk <thomas.junk@intevation.de>
parents:
1943
diff
changeset
|
461 this.$store.dispatch("map/disableIdentifyTool"); |
1435
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1424
diff
changeset
|
462 this.$store.dispatch("map/enableIdentifyTool"); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
463 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
464 }; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
465 </script> |