Mercurial > gemma
annotate client/src/components/identify/Identify.vue @ 5736:55892008ec96 default tip
Fixed a bunch of corner cases in WG import.
author | Sascha Wilde <wilde@sha-bang.de> |
---|---|
date | Wed, 29 May 2024 19:02:42 +0200 |
parents | 57af2b37a37e |
children |
rev | line source |
---|---|
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 <template> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
2 <div |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
3 :class="[ |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
4 'box ui-element rounded bg-white text-nowrap', |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
5 { expanded: showIdentify } |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
6 ]" |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
7 > |
4401
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
8 <div style="width: 20rem"> |
2754
d0f6c222f4f9
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2747
diff
changeset
|
9 <UIBoxHeader |
d0f6c222f4f9
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2747
diff
changeset
|
10 icon="info" |
d0f6c222f4f9
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2747
diff
changeset
|
11 :title="identifiedLabel" |
d0f6c222f4f9
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2747
diff
changeset
|
12 :closeCallback="close" |
d0f6c222f4f9
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2747
diff
changeset
|
13 /> |
2534
bb5286acfee2
client: reduced spacings between and inside boxes and more compact main menu
Markus Kottlaender <markus@intevation.de>
parents:
2441
diff
changeset
|
14 <div class="features"> |
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
15 <div v-if="currentMeasurement"> |
2857
f59cff59a630
client: identify: made header text left aligned for measurements
Markus Kottlaender <markus@intevation.de>
parents:
2856
diff
changeset
|
16 <small class="d-block bg-secondary text-light px-2 py-1"> |
4258
57c38087fe18
client: correct strings-marking for translations (identify box)
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4224
diff
changeset
|
17 <translate> Measurement</translate> |
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
18 </small> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
19 <small class="d-flex justify-content-between px-2"> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
20 <b> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
21 {{ currentMeasurement.quantity }} |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
22 </b> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
23 {{ currentMeasurement.value }} {{ currentMeasurement.unitSymbol }} |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
24 </small> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
25 </div> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
26 <div |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
27 v-for="feature of filteredIdentifiedFeatures" |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
28 :key="feature.getId()" |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
29 > |
2743
4063adda3095
client: identified box: moved bbox zoom button to feature headers and removed bbox from the feature's properties list
Markus Kottlaender <markus@intevation.de>
parents:
2735
diff
changeset
|
30 <small |
2835
202a153a3361
client: identify box: made headers lighter
Markus Kottlaender <markus@intevation.de>
parents:
2754
diff
changeset
|
31 class="d-flex justify-content-between bg-secondary text-light px-2 py-1" |
2743
4063adda3095
client: identified box: moved bbox zoom button to feature headers and removed bbox from the feature's properties list
Markus Kottlaender <markus@intevation.de>
parents:
2735
diff
changeset
|
32 > |
4258
57c38087fe18
client: correct strings-marking for translations (identify box)
Fadi Abbud <fadi.abbud@intevation.de>
parents:
4224
diff
changeset
|
33 {{ featureLabel(feature) }} |
2743
4063adda3095
client: identified box: moved bbox zoom button to feature headers and removed bbox from the feature's properties list
Markus Kottlaender <markus@intevation.de>
parents:
2735
diff
changeset
|
34 <a |
4063adda3095
client: identified box: moved bbox zoom button to feature headers and removed bbox from the feature's properties list
Markus Kottlaender <markus@intevation.de>
parents:
2735
diff
changeset
|
35 v-if="feature.getProperties().hasOwnProperty('bbox')" |
4063adda3095
client: identified box: moved bbox zoom button to feature headers and removed bbox from the feature's properties list
Markus Kottlaender <markus@intevation.de>
parents:
2735
diff
changeset
|
36 @click="zoomTo(feature)" |
4063adda3095
client: identified box: moved bbox zoom button to feature headers and removed bbox from the feature's properties list
Markus Kottlaender <markus@intevation.de>
parents:
2735
diff
changeset
|
37 class="btn btn-info btn-xs pointer rounded-0 zoom-btn" |
4063adda3095
client: identified box: moved bbox zoom button to feature headers and removed bbox from the feature's properties list
Markus Kottlaender <markus@intevation.de>
parents:
2735
diff
changeset
|
38 > |
4063adda3095
client: identified box: moved bbox zoom button to feature headers and removed bbox from the feature's properties list
Markus Kottlaender <markus@intevation.de>
parents:
2735
diff
changeset
|
39 <font-awesome-icon icon="crosshairs" /> |
4063adda3095
client: identified box: moved bbox zoom button to feature headers and removed bbox from the feature's properties list
Markus Kottlaender <markus@intevation.de>
parents:
2735
diff
changeset
|
40 </a> |
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
41 </small> |
4439 | 42 <div |
43 class="text-left mt-2" | |
44 v-if="showBottleneckMeta(feature) || showGaugeMeta(feature)" | |
45 > | |
46 <small class="ml-2 text-muted bg-white"> | |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
47 Meta: |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
48 </small> |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
49 <hr style="margin-top:0.25em;margin-bottom:0.5em;" /> |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
50 </div> |
4265
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4258
diff
changeset
|
51 <div |
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4258
diff
changeset
|
52 v-if="showBottleneckMeta(feature)" |
4436
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
53 class="ml-1 mb-1 text-left d-flex flex-column" |
4265
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4258
diff
changeset
|
54 > |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
55 <div class="d-flex"> |
4270
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
56 <font-awesome-icon |
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
57 icon="caret-up" |
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
58 fixed-width |
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
59 :style="{ |
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
60 color: recencyColor(feature), |
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
61 'font-size': 'x-large' |
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
62 }" |
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
63 /> |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
64 <div class="d-flex flex-column"> |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
65 <small |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
66 v-for="(line, index) in recency(feature)" |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
67 :key="index" |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
68 class="bg-white my-auto text-wrap" |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
69 > |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
70 {{ line }} |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
71 </small> |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
72 </div> |
4270
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
73 </div> |
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
74 <div> |
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
75 <small><translate>According gauge data:</translate></small> |
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
76 </div> |
4293
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
77 </div> |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
78 <div |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
79 v-if="showGaugeMeta(feature)" |
4436
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
80 class="ml-1 mb-1 text-left d-flex flex-column" |
4293
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
81 > |
4349
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
82 <div class="d-flex"> |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
83 <div class="d-flex flex-column"> |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
84 <font-awesome-icon |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
85 icon="caret-up" |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
86 fixed-width |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
87 :style="{ |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
88 color: gmAvailabilityColor(feature), |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
89 'font-size': 'x-large', |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
90 position: 'relative', |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
91 top: '0.28em' |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
92 }" |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
93 /> |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
94 <font-awesome-icon |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
95 icon="caret-down" |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
96 fixed-width |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
97 :style="{ |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
98 color: gmAvailabilityColor(feature), |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
99 'font-size': 'x-large', |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
100 position: 'relative', |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
101 top: '-0.45em' |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
102 }" |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
103 /> |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
104 </div> |
4436
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
105 <div class="d-flex flex-column"> |
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
106 <small |
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
107 v-for="(line, index) in gmAvailability(feature)" |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
108 class="bg-white my-auto" |
4436
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
109 :key="index" |
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
110 > |
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
111 {{ line }} |
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
112 </small> |
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
113 </div> |
4270
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
114 </div> |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
115 <div class="mt-2 d-flex"> |
4270
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
116 <font-awesome-icon |
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
117 icon="caret-up" |
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
118 fixed-width |
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
119 :style="{ |
4293
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
120 color: getGaugeStatusColor(feature), |
4270
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
121 'font-size': 'x-large' |
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
122 }" |
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
123 /> |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
124 <div class="d-flex flex-column"> |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
125 <small |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
126 v-for="(line, index) in getGaugeStatusText(feature)" |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
127 :key="index" |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
128 class="bg-white my-auto" |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
129 > |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
130 {{ line }} |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
131 </small> |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
132 </div> |
4270
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
133 </div> |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
134 <div class="mt-2 d-flex"> |
4279
30f26bf7ff24
Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents:
4277
diff
changeset
|
135 <font-awesome-icon |
30f26bf7ff24
Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents:
4277
diff
changeset
|
136 icon="caret-up" |
30f26bf7ff24
Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents:
4277
diff
changeset
|
137 fixed-width |
30f26bf7ff24
Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents:
4277
diff
changeset
|
138 :style="{ |
30f26bf7ff24
Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents:
4277
diff
changeset
|
139 color: forecastAccuracyColor(feature), |
30f26bf7ff24
Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents:
4277
diff
changeset
|
140 'font-size': 'x-large' |
30f26bf7ff24
Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents:
4277
diff
changeset
|
141 }" |
30f26bf7ff24
Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents:
4277
diff
changeset
|
142 /> |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
143 <div style="line-height:1.1em" class="d-flex flex-column"> |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
144 <small |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
145 v-for="(line, index) in forecastAccuracy(feature)" |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
146 :key="index" |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
147 class="bg-white my-auto" |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
148 > |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
149 {{ line }} |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
150 </small> |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
151 </div> |
4279
30f26bf7ff24
Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents:
4277
diff
changeset
|
152 </div> |
4277
12398df5f414
Identify_tool: fixed nesting of divs which prevented infos from beeing shown
Thomas Junk <thomas.junk@intevation.de>
parents:
4270
diff
changeset
|
153 </div> |
4439 | 154 <hr |
155 v-if="showBottleneckMeta(feature) || showGaugeMeta(feature)" | |
156 style="margin-top:0.5em;margin-bottom:0.25em;" | |
157 /> | |
4277
12398df5f414
Identify_tool: fixed nesting of divs which prevented infos from beeing shown
Thomas Junk <thomas.junk@intevation.de>
parents:
4270
diff
changeset
|
158 <div> |
4270
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
159 <small |
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
160 v-for="prop in featureProps(feature)" |
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
161 :key="prop.key" |
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
162 v-if="prop.val" |
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
163 class="d-flex justify-content-between px-2" |
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
164 > |
5667
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
165 <template v-if="prop.key != 'gauge objname'"> |
4863
544e5a2eacb6
Prepare formatting of ref gauges as links
Thomas Junk <thomas.junk@intevation.de>
parents:
4508
diff
changeset
|
166 <b>{{ prop.key }}</b> |
544e5a2eacb6
Prepare formatting of ref gauges as links
Thomas Junk <thomas.junk@intevation.de>
parents:
4508
diff
changeset
|
167 <span>{{ prop.val }}</span> |
544e5a2eacb6
Prepare formatting of ref gauges as links
Thomas Junk <thomas.junk@intevation.de>
parents:
4508
diff
changeset
|
168 </template> |
544e5a2eacb6
Prepare formatting of ref gauges as links
Thomas Junk <thomas.junk@intevation.de>
parents:
4508
diff
changeset
|
169 <template v-else> |
544e5a2eacb6
Prepare formatting of ref gauges as links
Thomas Junk <thomas.junk@intevation.de>
parents:
4508
diff
changeset
|
170 <b><translate>Reference Gauge</translate></b> |
5667
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
171 <a @click="selectGauge(prop.val)" href="#">{{ prop.val }}</a> |
4863
544e5a2eacb6
Prepare formatting of ref gauges as links
Thomas Junk <thomas.junk@intevation.de>
parents:
4508
diff
changeset
|
172 </template> |
4265
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4258
diff
changeset
|
173 </small> |
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4258
diff
changeset
|
174 </div> |
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
175 </div> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
176 <div |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
177 v-if="!currentMeasurement && !filteredIdentifiedFeatures.length" |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
178 class="text-muted small text-center my-auto py-3 px-2" |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
179 > |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
180 <translate>No features identified.</translate> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
181 </div> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
182 </div> |
3399
e5df2cbb4d48
client: user manual: fix console error and hide it when url is not cofigured
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3395
diff
changeset
|
183 <div |
5339
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
184 v-if="hasDownloads" |
3399
e5df2cbb4d48
client: user manual: fix console error and hide it when url is not cofigured
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3395
diff
changeset
|
185 class="border-top text-left pl-2" |
e5df2cbb4d48
client: user manual: fix console error and hide it when url is not cofigured
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3395
diff
changeset
|
186 style="font-size: 90%;" |
e5df2cbb4d48
client: user manual: fix console error and hide it when url is not cofigured
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3395
diff
changeset
|
187 > |
3395
6075c4c25568
client: change user manual location
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3369
diff
changeset
|
188 <translate>Download</translate> |
5339
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
189 <div class="d-flex flex-column"> |
5356
3216b4a19023
spinner added to info tool's download link for DQL reports
Thomas Junk <thomas.junk@intevation.de>
parents:
5353
diff
changeset
|
190 <font-awesome-icon |
3216b4a19023
spinner added to info tool's download link for DQL reports
Thomas Junk <thomas.junk@intevation.de>
parents:
5353
diff
changeset
|
191 v-if="loadingDQL" |
3216b4a19023
spinner added to info tool's download link for DQL reports
Thomas Junk <thomas.junk@intevation.de>
parents:
5353
diff
changeset
|
192 icon="spinner" |
3216b4a19023
spinner added to info tool's download link for DQL reports
Thomas Junk <thomas.junk@intevation.de>
parents:
5353
diff
changeset
|
193 :spin="true" |
3216b4a19023
spinner added to info tool's download link for DQL reports
Thomas Junk <thomas.junk@intevation.de>
parents:
5353
diff
changeset
|
194 fixed-width |
3216b4a19023
spinner added to info tool's download link for DQL reports
Thomas Junk <thomas.junk@intevation.de>
parents:
5353
diff
changeset
|
195 /> |
5396
064ac1014713
Make DQL-Downloads a bit more dynamic
Thomas Junk <thomas.junk@intevation.de>
parents:
5373
diff
changeset
|
196 <template v-if="DQLDownloadAllowed"> |
064ac1014713
Make DQL-Downloads a bit more dynamic
Thomas Junk <thomas.junk@intevation.de>
parents:
5373
diff
changeset
|
197 <a |
064ac1014713
Make DQL-Downloads a bit more dynamic
Thomas Junk <thomas.junk@intevation.de>
parents:
5373
diff
changeset
|
198 v-for="(reportName, index) in availableReports" |
064ac1014713
Make DQL-Downloads a bit more dynamic
Thomas Junk <thomas.junk@intevation.de>
parents:
5373
diff
changeset
|
199 :key="index" |
064ac1014713
Make DQL-Downloads a bit more dynamic
Thomas Junk <thomas.junk@intevation.de>
parents:
5373
diff
changeset
|
200 href="#" |
064ac1014713
Make DQL-Downloads a bit more dynamic
Thomas Junk <thomas.junk@intevation.de>
parents:
5373
diff
changeset
|
201 @click="downloadDataQualityReport(reportName)" |
064ac1014713
Make DQL-Downloads a bit more dynamic
Thomas Junk <thomas.junk@intevation.de>
parents:
5373
diff
changeset
|
202 > |
064ac1014713
Make DQL-Downloads a bit more dynamic
Thomas Junk <thomas.junk@intevation.de>
parents:
5373
diff
changeset
|
203 {{ |
064ac1014713
Make DQL-Downloads a bit more dynamic
Thomas Junk <thomas.junk@intevation.de>
parents:
5373
diff
changeset
|
204 reportName |
064ac1014713
Make DQL-Downloads a bit more dynamic
Thomas Junk <thomas.junk@intevation.de>
parents:
5373
diff
changeset
|
205 .split("-") |
064ac1014713
Make DQL-Downloads a bit more dynamic
Thomas Junk <thomas.junk@intevation.de>
parents:
5373
diff
changeset
|
206 .map(s => (s && s[0].toUpperCase() + s.slice(1)) || "") |
064ac1014713
Make DQL-Downloads a bit more dynamic
Thomas Junk <thomas.junk@intevation.de>
parents:
5373
diff
changeset
|
207 .join(" ") |
064ac1014713
Make DQL-Downloads a bit more dynamic
Thomas Junk <thomas.junk@intevation.de>
parents:
5373
diff
changeset
|
208 }} |
064ac1014713
Make DQL-Downloads a bit more dynamic
Thomas Junk <thomas.junk@intevation.de>
parents:
5373
diff
changeset
|
209 </a> |
064ac1014713
Make DQL-Downloads a bit more dynamic
Thomas Junk <thomas.junk@intevation.de>
parents:
5373
diff
changeset
|
210 </template> |
5339
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
211 <a |
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
212 v-if="userManualUrl" |
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
213 :href="userManualUrl ? userManualUrl : '#'" |
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
214 :download="usermanualFilename" |
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
215 ><translate> User Manual</translate></a |
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
216 > |
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
217 </div> |
3395
6075c4c25568
client: change user manual location
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3369
diff
changeset
|
218 </div> |
2534
bb5286acfee2
client: reduced spacings between and inside boxes and more compact main menu
Markus Kottlaender <markus@intevation.de>
parents:
2441
diff
changeset
|
219 <div class="versioninfo border-top box-body"> |
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
220 <span v-translate="{ license: 'AGPL-3.0-or-later' }"> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
221 This app uses <i>gemma</i>, which is Free Software under <br /> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
222 %{ license } without warranty, see docs for details. |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
223 </span> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
224 <br /> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
225 <a href="https://hg.intevation.de/gemma/file/tip"> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
226 <translate>source-code</translate> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
227 </a> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
228 {{ versionStr }} <br />© via donau. ⓔ Intevation. <br /> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
229 <span v-translate="{ name: 'OpenSteetMap' }" |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
230 >Some data © |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
231 <a href="https://www.openstreetmap.org/copyright">%{ name }</a> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
232 contributors. |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
233 </span> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
234 <br /> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
235 <span v-translate="{ geoLicense: 'CC-BY-4.0' }"> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
236 Uses |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
237 <a href="https://download.geonames.org/export/dump/readme.txt" |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
238 >GeoNames</a |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
239 > |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
240 under %{ geoLicense }. |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
241 </span> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
242 <translate>Generated PDFs use font: </translate> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
243 <a href="http://libertine-fonts.org">LinBiolinum</a> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
244 </div> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
245 </div> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
246 </div> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
247 </template> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
248 |
5629
84d01a536bec
Transformed scss and sass styles into css
Luisa Beerboom <lbeerboom@intevation.de>
parents:
5396
diff
changeset
|
249 <style scoped> |
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
250 .features { |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
251 max-height: 19rem; |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
252 overflow-y: auto; |
5629
84d01a536bec
Transformed scss and sass styles into css
Luisa Beerboom <lbeerboom@intevation.de>
parents:
5396
diff
changeset
|
253 } |
84d01a536bec
Transformed scss and sass styles into css
Luisa Beerboom <lbeerboom@intevation.de>
parents:
5396
diff
changeset
|
254 |
84d01a536bec
Transformed scss and sass styles into css
Luisa Beerboom <lbeerboom@intevation.de>
parents:
5396
diff
changeset
|
255 .features small { |
84d01a536bec
Transformed scss and sass styles into css
Luisa Beerboom <lbeerboom@intevation.de>
parents:
5396
diff
changeset
|
256 } |
84d01a536bec
Transformed scss and sass styles into css
Luisa Beerboom <lbeerboom@intevation.de>
parents:
5396
diff
changeset
|
257 .features small .zoom-btn { |
84d01a536bec
Transformed scss and sass styles into css
Luisa Beerboom <lbeerboom@intevation.de>
parents:
5396
diff
changeset
|
258 margin-top: -0.25rem; |
84d01a536bec
Transformed scss and sass styles into css
Luisa Beerboom <lbeerboom@intevation.de>
parents:
5396
diff
changeset
|
259 margin-right: -0.5rem; |
84d01a536bec
Transformed scss and sass styles into css
Luisa Beerboom <lbeerboom@intevation.de>
parents:
5396
diff
changeset
|
260 margin-bottom: -0.25rem; |
84d01a536bec
Transformed scss and sass styles into css
Luisa Beerboom <lbeerboom@intevation.de>
parents:
5396
diff
changeset
|
261 } |
84d01a536bec
Transformed scss and sass styles into css
Luisa Beerboom <lbeerboom@intevation.de>
parents:
5396
diff
changeset
|
262 .features small .zoom-btn svg { |
84d01a536bec
Transformed scss and sass styles into css
Luisa Beerboom <lbeerboom@intevation.de>
parents:
5396
diff
changeset
|
263 vertical-align: middle; |
84d01a536bec
Transformed scss and sass styles into css
Luisa Beerboom <lbeerboom@intevation.de>
parents:
5396
diff
changeset
|
264 } |
84d01a536bec
Transformed scss and sass styles into css
Luisa Beerboom <lbeerboom@intevation.de>
parents:
5396
diff
changeset
|
265 .features small:nth-child(even) { |
84d01a536bec
Transformed scss and sass styles into css
Luisa Beerboom <lbeerboom@intevation.de>
parents:
5396
diff
changeset
|
266 background: #f8f8f8; |
84d01a536bec
Transformed scss and sass styles into css
Luisa Beerboom <lbeerboom@intevation.de>
parents:
5396
diff
changeset
|
267 } |
84d01a536bec
Transformed scss and sass styles into css
Luisa Beerboom <lbeerboom@intevation.de>
parents:
5396
diff
changeset
|
268 .features small:hover { |
84d01a536bec
Transformed scss and sass styles into css
Luisa Beerboom <lbeerboom@intevation.de>
parents:
5396
diff
changeset
|
269 background: #eeeeee; |
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
270 } |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
271 |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
272 .versioninfo { |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
273 font-size: 60%; |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
274 white-space: normal; |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
275 } |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
276 </style> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
277 |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
278 <script> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
279 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
280 * without warranty, see README.md and license for details. |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
281 * |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
282 * SPDX-License-Identifier: AGPL-3.0-or-later |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
283 * License-Filename: LICENSES/AGPL-3.0.txt |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
284 * |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
285 * Copyright (C) 2018, 2019 by via donau |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
286 * – Österreichische Wasserstraßen-Gesellschaft mbH |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
287 * Software engineering by Intevation GmbH |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
288 * |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
289 * Author(s): |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
290 * Thomas Junk <thomas.junk@intevation.de> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
291 * Bernhard E. Reiter <bernhard.reiter@intevation.de> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
292 * Markus Kottländer <markus.kottlaender@intevation.de> |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
293 */ |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
294 import { mapState, mapGetters } from "vuex"; |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
295 import { formatter } from "./formatter"; |
2747
fb5deecb77f1
client:identified box: implement the bbox zoom button
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2743
diff
changeset
|
296 import { getCenter } from "ol/extent"; |
4436
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
297 import classifications from "@/lib/classifications"; |
5076
96a544504818
move layer.js and styles.js to layers directory
Thomas Junk <thomas.junk@intevation.de>
parents:
4989
diff
changeset
|
298 import { styleFactory } from "@/components/layers/styles"; |
4436
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
299 import filters from "@/lib/filters"; |
5339
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
300 import { HTTP } from "@/lib/http"; |
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
301 import { format } from "date-fns"; |
5353
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
302 import { displayError } from "@/lib/errors"; |
4265
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4258
diff
changeset
|
303 |
4267
c5642480eb9b
styles: rename 'currency' to recency
Thomas Junk <thomas.junk@intevation.de>
parents:
4266
diff
changeset
|
304 const { |
4269
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
305 recencyColorCodes, |
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
306 gmAvailabilityColorCodes, |
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
307 forecastAccuracyColorCodes, |
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
308 forecastVsRealityColorCodes |
4267
c5642480eb9b
styles: rename 'currency' to recency
Thomas Junk <thomas.junk@intevation.de>
parents:
4266
diff
changeset
|
309 } = styleFactory(); |
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
310 |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
311 export default { |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
312 name: "identify", |
4291
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
313 data() { |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
314 return { |
5356
3216b4a19023
spinner added to info tool's download link for DQL reports
Thomas Junk <thomas.junk@intevation.de>
parents:
5353
diff
changeset
|
315 loadingDQL: false, |
4293
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
316 refGaugeStatus: "", |
4356
5356fd2ea3f6
Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents:
4350
diff
changeset
|
317 gaugeStatus: "", |
5356fd2ea3f6
Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents:
4350
diff
changeset
|
318 gaugeCoeffs: null, |
5356fd2ea3f6
Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents:
4350
diff
changeset
|
319 refGaugeCoeffs: null |
4291
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
320 }; |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
321 }, |
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
322 computed: { |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
323 ...mapGetters("application", ["versionStr"]), |
4265
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4258
diff
changeset
|
324 ...mapState("application", ["showIdentify", "userManualUrl", "config"]), |
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
325 ...mapGetters("map", ["filteredIdentifiedFeatures"]), |
2754
d0f6c222f4f9
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2747
diff
changeset
|
326 ...mapState("map", ["currentMeasurement"]), |
5667
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
327 ...mapGetters("map", ["openLayersMap"]), |
4291
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
328 ...mapState("gauges", ["gauges"]), |
5339
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
329 ...mapGetters("user", ["isWaterwayAdmin", "isSysAdmin"]), |
5396
064ac1014713
Make DQL-Downloads a bit more dynamic
Thomas Junk <thomas.junk@intevation.de>
parents:
5373
diff
changeset
|
330 ...mapState("importschedule", ["availableReports"]), |
5667
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
331 gaugesLookUp: { |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
332 get() { |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
333 return this.gauges.reduce((o, gauge) => { |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
334 o[gauge.properties.objname] = gauge; |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
335 return o; |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
336 }, {}); |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
337 } |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
338 }, |
5339
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
339 DQLDownloadAllowed() { |
5356
3216b4a19023
spinner added to info tool's download link for DQL reports
Thomas Junk <thomas.junk@intevation.de>
parents:
5353
diff
changeset
|
340 if (this.loadingDQL) return false; |
5339
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
341 return this.isWaterwayAdmin || this.isSysAdmin; |
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
342 }, |
2754
d0f6c222f4f9
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2747
diff
changeset
|
343 identifiedLabel() { |
3187
5487abeb380c
client: identify: edited title of box header
Markus Kottlaender <markus@intevation.de>
parents:
3044
diff
changeset
|
344 return this.$gettext("Identified Features"); |
3509
0e91d40af23e
client: fix User manual filename
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3399
diff
changeset
|
345 }, |
5339
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
346 hasDownloads() { |
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
347 return this.DQLDownloadAllowed || this.userManualUrl; |
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
348 }, |
3509
0e91d40af23e
client: fix User manual filename
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3399
diff
changeset
|
349 usermanualFilename() { |
0e91d40af23e
client: fix User manual filename
Fadi Abbud <fadi.abbud@intevation.de>
parents:
3399
diff
changeset
|
350 return this.$gettext("User Manual"); |
4291
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
351 }, |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
352 gaugeStatusColor() { |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
353 return forecastVsRealityColorCodes[this.gaugeStatus]; |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
354 }, |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
355 gaugeStatusText() { |
4401
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
356 const nsc24 = Number(this.config.gm_forecast_vs_reality_nsc_24h).toFixed( |
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
357 2 |
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
358 ); |
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
359 const nsc72 = Number(this.config.gm_forecast_vs_reality_nsc_72h).toFixed( |
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
360 2 |
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
361 ); |
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
362 const coeffWarn = this.gaugeCoeffs |
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
363 ? Number(this.gaugeCoeffs[2].value).toFixed(2) |
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
364 : ""; |
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
365 const coeffDanger = this.gaugeCoeffs |
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
366 ? Number(this.gaugeCoeffs[0].value).toFixed(2) |
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
367 : ""; |
4291
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
368 const messagesPerState = { |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
369 OK: [ |
4356
5356fd2ea3f6
Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents:
4350
diff
changeset
|
370 this.$gettext("Nash-Sutcliffe") + |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
371 `(${coeffDanger} >${nsc24} /24h ${coeffWarn} >${nsc72} / 72h)` |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
372 ], |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
373 WARNING: [ |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
374 this.$gettext("Nash-Sutcliffe") + ` (${coeffWarn} < ${nsc72} / 72h)` |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
375 ], |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
376 DANGER: [ |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
377 this.$gettext("Nash-Sutcliffe") + ` (${coeffDanger} < ${nsc24} / 72h)` |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
378 ], |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
379 NEUTRAL: [this.$gettext("Nash-Sutcliffe not available")] |
4291
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
380 }; |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
381 return messagesPerState[this.gaugeStatus]; |
4293
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
382 }, |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
383 refGaugeStatusColor() { |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
384 return forecastVsRealityColorCodes[this.refGaugeStatus]; |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
385 }, |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
386 refGaugeStatusText() { |
4401
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
387 const nsc24 = Number(this.config.gm_forecast_vs_reality_nsc_24h).toFixed( |
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
388 2 |
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
389 ); |
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
390 const nsc72 = Number(this.config.gm_forecast_vs_reality_nsc_72h).toFixed( |
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
391 2 |
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
392 ); |
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
393 const coeffWarn = this.refGaugeCoeffs |
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
394 ? Number(this.refGaugeCoeffs[2].value).toFixed(2) |
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
395 : ""; |
4356
5356fd2ea3f6
Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents:
4350
diff
changeset
|
396 const coeffDanger = this.refGaugeCoeffs |
4401
9842812b92e0
identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents:
4356
diff
changeset
|
397 ? Number(this.refGaugeCoeffs[0].value).toFixed(2) |
4356
5356fd2ea3f6
Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents:
4350
diff
changeset
|
398 : ""; |
4293
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
399 const messagesPerState = { |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
400 OK: [ |
4356
5356fd2ea3f6
Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents:
4350
diff
changeset
|
401 this.$gettext("Nash-Sutcliffe") + |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
402 `(${coeffDanger} >${nsc24} /24h ${coeffWarn} >${nsc72} / 72h)` |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
403 ], |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
404 WARNING: [ |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
405 this.$gettext("Nash-Sutcliffe") + ` (${coeffWarn} < ${nsc72} / 72h)` |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
406 ], |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
407 DANGER: [ |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
408 this.$gettext("Nash-Sutcliffe") + ` (${coeffDanger} < ${nsc24} / 72h)` |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
409 ], |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
410 NEUTRAL: [this.$gettext("Nash-Sutcliffe not available")] |
4293
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
411 }; |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
412 return messagesPerState[this.refGaugeStatus]; |
4291
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
413 } |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
414 }, |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
415 watch: { |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
416 filteredIdentifiedFeatures() { |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
417 const bottlecks = this.filteredIdentifiedFeatures.filter(f => |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
418 /bottleneck/.test(f.id_) |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
419 ); |
4293
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
420 const gauges = this.filteredIdentifiedFeatures.filter(f => |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
421 /gauge/.test(f.id_) |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
422 ); |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
423 if (gauges.length > 0) { |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
424 const isrs = gauges[0].get("isrs_code"); |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
425 this.$store |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
426 .dispatch("gauges/getNashSutcliffeForISRS", isrs) |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
427 .then(response => { |
4356
5356fd2ea3f6
Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents:
4350
diff
changeset
|
428 this.gaugeCoeffs = response.coeffs; |
4293
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
429 this.gaugeStatus = classifications.calcForecastVsRealityForNSC( |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
430 response |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
431 ); |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
432 }); |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
433 } |
4291
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
434 if (bottlecks.length > 0) { |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
435 const gauge = this.gauges.find( |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
436 g => g.properties.objname === bottlecks[0].get("gauge_objname") |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
437 ); |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
438 const isrs = gauge.properties.isrs_code; |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
439 this.$store |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
440 .dispatch("gauges/getNashSutcliffeForISRS", isrs) |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
441 .then(response => { |
4356
5356fd2ea3f6
Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents:
4350
diff
changeset
|
442 this.refGaugeCoeffs = response.coeffs; |
4293
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
443 this.refGaugeStatus = classifications.calcForecastVsRealityForNSC( |
4291
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
444 response |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
445 ); |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
446 }); |
81ab34bd2d0d
Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents:
4279
diff
changeset
|
447 } |
2754
d0f6c222f4f9
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2747
diff
changeset
|
448 } |
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
449 }, |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
450 methods: { |
5667
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
451 selectGauge(gauge_name) { |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
452 const gauge = this.gaugesLookUp[gauge_name]; |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
453 const zoom = 16; |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
454 this.openLayersMap() |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
455 .getLayer("GAUGES") |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
456 .setVisible(true); |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
457 this.$store.dispatch( |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
458 "gauges/setSelectedGaugeISRS", |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
459 gauge.properties.isrs_code |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
460 ); |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
461 this.$store.dispatch("map/moveMap", { |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
462 coordinates: gauge.geometry.coordinates, |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
463 zoom, |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
464 preventZoomOut: true |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
465 }); |
57af2b37a37e
Make reference gauge clickable
Thomas Junk <thomas.junk@intevation.de>
parents:
5639
diff
changeset
|
466 }, |
5396
064ac1014713
Make DQL-Downloads a bit more dynamic
Thomas Junk <thomas.junk@intevation.de>
parents:
5373
diff
changeset
|
467 downloadDataQualityReport(reportName) { |
5356
3216b4a19023
spinner added to info tool's download link for DQL reports
Thomas Junk <thomas.junk@intevation.de>
parents:
5353
diff
changeset
|
468 this.loadingDQL = true; |
5396
064ac1014713
Make DQL-Downloads a bit more dynamic
Thomas Junk <thomas.junk@intevation.de>
parents:
5373
diff
changeset
|
469 HTTP.get(`/data/report/${reportName}`, { |
5339
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
470 responseType: "blob", |
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
471 headers: { |
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
472 "X-Gemma-Auth": localStorage.getItem("token") |
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
473 } |
5353
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
474 }) |
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
475 .then(response => { |
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
476 const link = document.createElement("a"); |
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
477 const now = new Date(); |
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
478 link.href = window.URL.createObjectURL(new Blob([response.data])); |
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
479 link.download = `DataQualityReport-${format(now, "YYYY-MM-DD")}.xlsx`; |
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
480 document.body.appendChild(link); |
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
481 link.click(); |
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
482 document.body.removeChild(link); |
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
483 }) |
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
484 .catch(error => { |
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
485 let message = "Backend not reachable"; |
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
486 if (error.response) { |
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
487 const { status, data } = error.response; |
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
488 message = `${status}: ${data.message || data}`; |
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
489 } |
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
490 displayError({ |
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
491 title: this.$gettext("Backend Error"), |
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
492 message: message |
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
493 }); |
5356
3216b4a19023
spinner added to info tool's download link for DQL reports
Thomas Junk <thomas.junk@intevation.de>
parents:
5353
diff
changeset
|
494 }) |
3216b4a19023
spinner added to info tool's download link for DQL reports
Thomas Junk <thomas.junk@intevation.de>
parents:
5353
diff
changeset
|
495 .finally(() => { |
3216b4a19023
spinner added to info tool's download link for DQL reports
Thomas Junk <thomas.junk@intevation.de>
parents:
5353
diff
changeset
|
496 this.loadingDQL = false; |
5353
2578fd6f4c63
changed DQL path to default. Added error handling.
Thomas Junk <thomas.junk@intevation.de>
parents:
5339
diff
changeset
|
497 }); |
5339
7365efe9f67d
Added downloadlink for DQLReports in Infotool
Thomas Junk <thomas.junk@intevation.de>
parents:
5076
diff
changeset
|
498 }, |
4293
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
499 getGaugeStatusText(feature) { |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
500 if (/bottleneck/.test(feature.getId())) return this.refGaugeStatusText; |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
501 return this.gaugeStatusText; |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
502 }, |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
503 getGaugeStatusColor(feature) { |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
504 if (/bottleneck/.test(feature.getId())) return this.refGaugeStatusColor; |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
505 return this.gaugeStatusColor; |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
506 }, |
4269
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
507 gmAvailability(feature) { |
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
508 const latestInHours = this.config.gm_latest_hours; |
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
509 const measurementsIn14D = this.config.gm_min_values_14d; |
4436
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
510 const gauge = classifications.getGauge(feature); |
4470
0d597cda8c6b
Identify: improve legend when no sr data available
Thomas Junk <thomas.junk@intevation.de>
parents:
4469
diff
changeset
|
511 const lastMeasureDate = gauge.get("gm_measuredate") |
0d597cda8c6b
Identify: improve legend when no sr data available
Thomas Junk <thomas.junk@intevation.de>
parents:
4469
diff
changeset
|
512 ? filters.surveyDate(new Date(gauge.get("gm_measuredate"))) |
0d597cda8c6b
Identify: improve legend when no sr data available
Thomas Junk <thomas.junk@intevation.de>
parents:
4469
diff
changeset
|
513 : this.$gettext("No measurement available"); |
4436
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
514 const in14Days = gauge.get("gm_n_14d"); |
4269
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
515 const messagesPerState = { |
4436
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
516 OK: [ |
4469
0d64913b184a
identify: add space to avail measurement
Thomas Junk <thomas.junk@intevation.de>
parents:
4439
diff
changeset
|
517 this.$gettext("Avail: Latest measurement from ") + |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
518 `${lastMeasureDate}`, |
4436
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
519 this.$gettext("Measurement is within") + ` ${latestInHours}h`, |
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
520 `${in14Days} / ${measurementsIn14D} ${this.$gettext( |
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
521 "measurements" |
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
522 )} in 14d` |
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
523 ], |
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
524 WARNING: [ |
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
525 this.$gettext("Avail: Below treshold"), |
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
526 `${in14Days} / ${measurementsIn14D} ${this.$gettext( |
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
527 "measurements" |
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
528 )} in 14d` |
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
529 ], |
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
530 DANGER: [ |
4270
e4d6c6339cb4
identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4269
diff
changeset
|
531 this.$gettext("Avail: Latest measurement older than") + |
4508
d53c78cd53f3
client: fix displayed unit for critical data availability
Bernhard Reiter <bernhard@intevation.de>
parents:
4487
diff
changeset
|
532 ` ${latestInHours}h`, |
4436
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
533 `(${lastMeasureDate})` |
a66275cf4490
identify: gm availability infotext improved. More 2 come
Thomas Junk <thomas.junk@intevation.de>
parents:
4401
diff
changeset
|
534 ] |
4269
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
535 }; |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
536 return messagesPerState[classifications.gmAvailability(feature)]; |
4269
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
537 }, |
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
538 gmAvailabilityColor(feature) { |
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
539 return gmAvailabilityColorCodes[classifications.gmAvailability(feature)]; |
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
540 }, |
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
541 forecastAccuracy(feature) { |
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
542 const offset24 = this.config.gm_forecast_offset_24h; |
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
543 const offset72 = this.config.gm_forecast_offset_72h; |
4349
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
544 const fa3d = feature.get("forecast_accuracy_3d"); |
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
545 const fa1d = feature.get("forecast_accuracy_1d"); |
4269
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
546 const messagesPerState = { |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
547 OK: [ |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
548 this.$gettext("Highest confidence"), |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
549 `${fa1d} < ${offset24} cm/24h`, |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
550 `${fa3d} < ${offset72} cm/72h` |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
551 ], |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
552 WARNING: [ |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
553 this.$gettext("Confidence per 72h") + ` (${fa3d} cm > ${offset72} cm)` |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
554 ], |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
555 DANGER: [ |
4349
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
556 this.$gettext("Confidence per 24h") + ` (${fa1d} cm > ${offset24} cm)` |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
557 ], |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
558 NEUTRAL: [this.$gettext("Predictions not available")] |
4269
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
559 }; |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
560 return messagesPerState[classifications.forecastAccuracy(feature)]; |
4269
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
561 }, |
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
562 forecastAccuracyColor(feature) { |
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
563 return forecastAccuracyColorCodes[ |
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
564 classifications.forecastAccuracy(feature) |
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
565 ]; |
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
566 }, |
4267
c5642480eb9b
styles: rename 'currency' to recency
Thomas Junk <thomas.junk@intevation.de>
parents:
4266
diff
changeset
|
567 recency(feature) { |
4265
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4258
diff
changeset
|
568 const revisitingFactor = this.config.bn_revtime_multiplier; |
4349
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
569 const revisitingTime = feature.get("revisiting_time"); |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
570 if (!revisitingTime) return [this.$gettext("No revisiting time defined")]; |
4487
80697ecc04e7
client: fix Identify problems with recency
Bernhard Reiter <bernhard@intevation.de>
parents:
4472
diff
changeset
|
571 const latest = feature.get("date_max"); |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
572 if (!latest) return [this.$gettext("No survey-data available")]; |
4487
80697ecc04e7
client: fix Identify problems with recency
Bernhard Reiter <bernhard@intevation.de>
parents:
4472
diff
changeset
|
573 const latestMeasurement = filters.surveyDate( |
80697ecc04e7
client: fix Identify problems with recency
Bernhard Reiter <bernhard@intevation.de>
parents:
4472
diff
changeset
|
574 // remove a tailing "Z" if there is one, as some versions of |
80697ecc04e7
client: fix Identify problems with recency
Bernhard Reiter <bernhard@intevation.de>
parents:
4472
diff
changeset
|
575 // firefox barf on it. The definition of Date Time String Format |
80697ecc04e7
client: fix Identify problems with recency
Bernhard Reiter <bernhard@intevation.de>
parents:
4472
diff
changeset
|
576 // used for new Date() assumes UTC so it is okay, see |
80697ecc04e7
client: fix Identify problems with recency
Bernhard Reiter <bernhard@intevation.de>
parents:
4472
diff
changeset
|
577 // http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15 |
80697ecc04e7
client: fix Identify problems with recency
Bernhard Reiter <bernhard@intevation.de>
parents:
4472
diff
changeset
|
578 new Date(latest.replace("Z", "")) |
80697ecc04e7
client: fix Identify problems with recency
Bernhard Reiter <bernhard@intevation.de>
parents:
4472
diff
changeset
|
579 ); |
4265
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4258
diff
changeset
|
580 const messagesPerState = { |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
581 OK: [ |
4349
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
582 this.$gettext("Data within the revisiting time") + |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
583 ` (${revisitingTime} mth)`, |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
584 `${this.$gettext("Latest measurement")} ${latestMeasurement}` |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
585 ], |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
586 WARNING: [ |
4269
837f90680d4c
identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
587 this.$gettext("Data within revisiting treshold") + |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
588 ` (${revisitingFactor} * ${revisitingTime})`, |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
589 `${this.$gettext("Latest measurement")} ${latestMeasurement}` |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
590 ], |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
591 DANGER: [ |
4349
4ed2708234b9
identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents:
4293
diff
changeset
|
592 this.$gettext("Data too old. Treshold:") + |
4438
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
593 ` (${revisitingFactor} * ${revisitingTime}mth)`, |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
594 `${this.$gettext("Latest measurement")} ${latestMeasurement}` |
04bdc1f444bc
identify: improve legend
Thomas Junk <thomas.junk@intevation.de>
parents:
4436
diff
changeset
|
595 ] |
4265
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4258
diff
changeset
|
596 }; |
4279
30f26bf7ff24
Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents:
4277
diff
changeset
|
597 return messagesPerState[classifications.surveyRecency(feature)]; |
4265
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4258
diff
changeset
|
598 }, |
4267
c5642480eb9b
styles: rename 'currency' to recency
Thomas Junk <thomas.junk@intevation.de>
parents:
4266
diff
changeset
|
599 recencyColor(feature) { |
4279
30f26bf7ff24
Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents:
4277
diff
changeset
|
600 return recencyColorCodes[classifications.surveyRecency(feature)]; |
4265
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4258
diff
changeset
|
601 }, |
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4258
diff
changeset
|
602 showBottleneckMeta(feature) { |
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4258
diff
changeset
|
603 const result = /bottleneck/.test(feature.getId().toLowerCase()); |
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4258
diff
changeset
|
604 return result; |
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4258
diff
changeset
|
605 }, |
4293
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
606 showGaugeMeta(feature) { |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
607 const result = /bottleneck|gauge/.test(feature.getId().toLowerCase()); |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
608 return result; |
dbd8d2416da7
Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents:
4291
diff
changeset
|
609 }, |
2743
4063adda3095
client: identified box: moved bbox zoom button to feature headers and removed bbox from the feature's properties list
Markus Kottlaender <markus@intevation.de>
parents:
2735
diff
changeset
|
610 zoomTo(feature) { |
3044
c71373594719
client: map: prepared store to hold multiple map objects
Markus Kottlaender <markus@intevation.de>
parents:
3029
diff
changeset
|
611 this.$store.dispatch("map/moveMap", { |
2747
fb5deecb77f1
client:identified box: implement the bbox zoom button
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2743
diff
changeset
|
612 coordinates: getCenter( |
fb5deecb77f1
client:identified box: implement the bbox zoom button
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2743
diff
changeset
|
613 feature |
fb5deecb77f1
client:identified box: implement the bbox zoom button
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2743
diff
changeset
|
614 .getGeometry() |
fb5deecb77f1
client:identified box: implement the bbox zoom button
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2743
diff
changeset
|
615 .clone() |
fb5deecb77f1
client:identified box: implement the bbox zoom button
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2743
diff
changeset
|
616 .transform("EPSG:3857", "EPSG:4326") |
fb5deecb77f1
client:identified box: implement the bbox zoom button
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2743
diff
changeset
|
617 .getExtent() |
fb5deecb77f1
client:identified box: implement the bbox zoom button
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2743
diff
changeset
|
618 ), |
fb5deecb77f1
client:identified box: implement the bbox zoom button
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2743
diff
changeset
|
619 zoom: 17, |
fb5deecb77f1
client:identified box: implement the bbox zoom button
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2743
diff
changeset
|
620 preventZoomOut: true |
2735
3c2ac140ad30
identify_tool: zoom to BBox PoC implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2534
diff
changeset
|
621 }); |
3c2ac140ad30
identify_tool: zoom to BBox PoC implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2534
diff
changeset
|
622 }, |
2387
f185503ef35a
client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents:
2372
diff
changeset
|
623 close() { |
f185503ef35a
client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents:
2372
diff
changeset
|
624 this.$store.commit("application/showIdentify", false); |
f185503ef35a
client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents:
2372
diff
changeset
|
625 }, |
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
626 featureId(feature) { |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
627 // cut away everything from the last . to the end |
3029
81c2e561fe03
Use distance marks an axis via WMS. Added legend and featureinfo.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2857
diff
changeset
|
628 let id = ""; |
81c2e561fe03
Use distance marks an axis via WMS. Added legend and featureinfo.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2857
diff
changeset
|
629 if (feature.getId) { |
81c2e561fe03
Use distance marks an axis via WMS. Added legend and featureinfo.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2857
diff
changeset
|
630 id = feature.getId(); |
81c2e561fe03
Use distance marks an axis via WMS. Added legend and featureinfo.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2857
diff
changeset
|
631 } |
81c2e561fe03
Use distance marks an axis via WMS. Added legend and featureinfo.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2857
diff
changeset
|
632 if (feature.id) { |
81c2e561fe03
Use distance marks an axis via WMS. Added legend and featureinfo.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2857
diff
changeset
|
633 id = feature.id; |
81c2e561fe03
Use distance marks an axis via WMS. Added legend and featureinfo.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2857
diff
changeset
|
634 } |
81c2e561fe03
Use distance marks an axis via WMS. Added legend and featureinfo.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2857
diff
changeset
|
635 return id.replace(/[.][^.]*$/, ""); |
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
636 }, |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
637 featureLabel(feature) { |
4989
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
638 const featureID = this.featureId(feature); |
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
639 if (formatter.hasOwnProperty(this.featureId(feature))) { |
4989
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
640 return formatter[featureID].label; |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
641 } |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
642 if (/fairway_marks/.test(featureID)) { |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
643 return this.captionFairwayMarks( |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
644 featureID.replace("fairway_marks_", "") |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
645 ); |
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
646 } |
4989
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
647 return featureID; |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
648 }, |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
649 captionFairwayMarks(id) { |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
650 const captions = { |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
651 bcnisd: this.$gettext( |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
652 "Beacon, isolated danger (MARITIME/Hydro feature)" |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
653 ), |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
654 bcnlat_hydro: this.$gettext("Beacon, lateral (MARITIME/Hydro feature)"), |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
655 bcnlat_ienc: this.$gettext("Beacon, lateral (IENC feature)"), |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
656 boycar: this.$gettext("Buoy, cardinal (MARITIME/Hydro feature)"), |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
657 boyisd: this.$gettext("Buoy, isolated danger (MARITIME/Hydro feature)"), |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
658 boylat_hydro: this.$gettext("Buoy, lateral (MARITIME/Hydro feature)"), |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
659 boylat_ienc: this.$gettext("Buoy, lateral (IENC feature)"), |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
660 boysaw: this.$gettext("Buoy, safe water (MARITIME/Hydro feature)"), |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
661 boyspp: this.$gettext( |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
662 "Buoy, special purpose/general (MARITIME/Hydro feature)" |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
663 ), |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
664 daymar_hydro: this.$gettext("Daymark (MARITIME/Hydro feature)"), |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
665 daymar_ienc: this.$gettext("Daymark (IENC feature)"), |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
666 lights: this.$gettext("Light (MARITIME/Hydro feature)"), |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
667 rtpbcn: this.$gettext( |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
668 "Radar transponder beacon (MARITIME/Hydro feature)" |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
669 ), |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
670 topmar: this.$gettext("Topmark (MARITIME/Hydro feature)"), |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
671 notmrk: this.$gettext("Notice mark (IENC feature)") |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
672 }; |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
673 if (captions[id]) return captions[id]; |
f879933cf671
add formatting for captions of infos about fairway_marks
Thomas Junk <thomas.junk@intevation.de>
parents:
4863
diff
changeset
|
674 return id; |
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
675 }, |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
676 featureProps(feature) { |
2441
9de710bdb535
client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents:
2424
diff
changeset
|
677 let featureId = this.featureId(feature); |
9de710bdb535
client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents:
2424
diff
changeset
|
678 |
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
679 // create array with {key, val} objects |
4224
bb66e144dece
client: fix identify for bottlenecks
Bernhard Reiter <bernhard@intevation.de>
parents:
3509
diff
changeset
|
680 // skip geometry here, because it is slightly more robust |
bb66e144dece
client: fix identify for bottlenecks
Bernhard Reiter <bernhard@intevation.de>
parents:
3509
diff
changeset
|
681 // to get the name of the property to skip and we need a reference |
bb66e144dece
client: fix identify for bottlenecks
Bernhard Reiter <bernhard@intevation.de>
parents:
3509
diff
changeset
|
682 // to `feature` for doing so. |
bb66e144dece
client: fix identify for bottlenecks
Bernhard Reiter <bernhard@intevation.de>
parents:
3509
diff
changeset
|
683 // The geometry is not needed (and previous comments in the code |
bb66e144dece
client: fix identify for bottlenecks
Bernhard Reiter <bernhard@intevation.de>
parents:
3509
diff
changeset
|
684 // mentioned a problem with it becoming cyclic when left in). |
bb66e144dece
client: fix identify for bottlenecks
Bernhard Reiter <bernhard@intevation.de>
parents:
3509
diff
changeset
|
685 let skipList = [feature.getGeometryName()]; |
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
686 let propsArray = []; |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
687 Object.keys(feature.getProperties()).forEach(key => { |
4224
bb66e144dece
client: fix identify for bottlenecks
Bernhard Reiter <bernhard@intevation.de>
parents:
3509
diff
changeset
|
688 if (skipList.indexOf(key) === -1) { |
2423
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
689 let val = feature.getProperties()[key]; |
2405
ef928c63388a
client: handle json values in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
690 |
4224
bb66e144dece
client: fix identify for bottlenecks
Bernhard Reiter <bernhard@intevation.de>
parents:
3509
diff
changeset
|
691 // if val is a valid json object string, |
bb66e144dece
client: fix identify for bottlenecks
Bernhard Reiter <bernhard@intevation.de>
parents:
3509
diff
changeset
|
692 // spread its values into the array |
2423
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
693 let jsonObj = this.getObjectFromString(val); |
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
694 if (jsonObj) { |
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
695 Object.keys(jsonObj).forEach(key => { |
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
696 propsArray.push({ key, val: jsonObj[key] }); |
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
697 }); |
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
698 } else { |
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
699 // otherwise just put the key value pair into the array |
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
700 propsArray.push({ key, val }); |
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
701 } |
2405
ef928c63388a
client: handle json values in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
702 } |
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
703 }); |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
704 |
4224
bb66e144dece
client: fix identify for bottlenecks
Bernhard Reiter <bernhard@intevation.de>
parents:
3509
diff
changeset
|
705 // run general formatter |
2743
4063adda3095
client: identified box: moved bbox zoom button to feature headers and removed bbox from the feature's properties list
Markus Kottlaender <markus@intevation.de>
parents:
2735
diff
changeset
|
706 propsArray = propsArray.map(formatter.all).filter(p => p); |
4224
bb66e144dece
client: fix identify for bottlenecks
Bernhard Reiter <bernhard@intevation.de>
parents:
3509
diff
changeset
|
707 // run feature specific formatter |
2441
9de710bdb535
client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents:
2424
diff
changeset
|
708 if ( |
9de710bdb535
client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents:
2424
diff
changeset
|
709 formatter.hasOwnProperty(featureId) && |
9de710bdb535
client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents:
2424
diff
changeset
|
710 formatter[featureId].hasOwnProperty("props") |
9de710bdb535
client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents:
2424
diff
changeset
|
711 ) { |
2743
4063adda3095
client: identified box: moved bbox zoom button to feature headers and removed bbox from the feature's properties list
Markus Kottlaender <markus@intevation.de>
parents:
2735
diff
changeset
|
712 propsArray = propsArray.map(formatter[featureId].props).filter(p => p); |
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
713 } |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
714 // remove underscores in labels that where not previously changed already |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
715 propsArray = propsArray.map(prop => { |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
716 return { key: prop.key.replace(/_/g, " "), val: prop.val }; |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
717 }); |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
718 |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
719 return propsArray; |
2423
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
720 }, |
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
721 getObjectFromString(val) { |
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
722 // JSON.parse() accepts integers and null as valid json. So to be sure to |
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
723 // get an object, we cannot just try JSON.parse() but we need to check if |
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
724 // the given value is a string and starts with a {. |
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
725 if ( |
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
726 Object.prototype.toString.call(val) === "[object String]" && |
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
727 val[0] === "{" |
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
728 ) { |
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
729 try { |
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
730 return JSON.parse(val); |
2424
b6deb03ef13f
client: fix linter error (empty block)
Markus Kottlaender <markus@intevation.de>
parents:
2423
diff
changeset
|
731 } catch (e) { |
b6deb03ef13f
client: fix linter error (empty block)
Markus Kottlaender <markus@intevation.de>
parents:
2423
diff
changeset
|
732 return null; |
b6deb03ef13f
client: fix linter error (empty block)
Markus Kottlaender <markus@intevation.de>
parents:
2423
diff
changeset
|
733 } |
2423
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
734 } |
3423cd4b3136
client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents:
2405
diff
changeset
|
735 return null; |
2371
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
736 } |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
737 } |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
738 }; |
045bac575294
client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
739 </script> |