annotate client/src/components/identify/Identify.vue @ 4401:9842812b92e0

identify: fix numbers for nsc
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 16 Sep 2019 16:46:29 +0200
parents 5356fd2ea3f6
children a66275cf4490
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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>
4265
2596a028dc3a Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 4258
diff changeset
42 <div
2596a028dc3a Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 4258
diff changeset
43 v-if="showBottleneckMeta(feature)"
4270
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
44 class="ml-2 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
45 >
4270
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
46 <div>
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
47 <font-awesome-icon
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
48 icon="caret-up"
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
49 fixed-width
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
50 :style="{
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
51 color: recencyColor(feature),
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
52 'font-size': 'x-large'
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
53 }"
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
54 />
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
55 <small class="my-auto">
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
56 {{ recency(feature) }}
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
57 </small>
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
58 </div>
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
59 <div>
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
60 <small><translate>According gauge data:</translate></small>
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
61 </div>
4293
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
62 </div>
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
63 <div
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
64 v-if="showGaugeMeta(feature)"
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
65 class="ml-2 mb-1 text-left d-flex flex-column"
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
66 >
4349
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
67 <div class="d-flex">
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
68 <div class="d-flex flex-column">
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
69 <font-awesome-icon
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
70 icon="caret-up"
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
71 fixed-width
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
72 :style="{
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
73 color: gmAvailabilityColor(feature),
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
74 'font-size': 'x-large',
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
75 position: 'relative',
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
76 top: '0.28em'
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
77 }"
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
78 />
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
79 <font-awesome-icon
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
80 icon="caret-down"
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
81 fixed-width
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
82 :style="{
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
83 color: gmAvailabilityColor(feature),
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
84 'font-size': 'x-large',
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
85 position: 'relative',
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
86 top: '-0.45em'
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
87 }"
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
88 />
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
89 </div>
4270
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
90 <small class="my-auto">
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
91 {{ gmAvailability(feature) }}
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
92 </small>
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
93 </div>
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
94 <div>
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
95 <font-awesome-icon
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
96 icon="caret-up"
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
97 fixed-width
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
98 :style="{
4293
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
99 color: getGaugeStatusColor(feature),
4270
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
100 'font-size': 'x-large'
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
101 }"
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
102 />
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
103 <small class="my-auto">
4293
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
104 {{ getGaugeStatusText(feature) }}
4270
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
105 </small>
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
106 </div>
4279
30f26bf7ff24 Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents: 4277
diff changeset
107 <div>
30f26bf7ff24 Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents: 4277
diff changeset
108 <font-awesome-icon
30f26bf7ff24 Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents: 4277
diff changeset
109 icon="caret-up"
30f26bf7ff24 Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents: 4277
diff changeset
110 fixed-width
30f26bf7ff24 Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents: 4277
diff changeset
111 :style="{
30f26bf7ff24 Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents: 4277
diff changeset
112 color: forecastAccuracyColor(feature),
30f26bf7ff24 Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents: 4277
diff changeset
113 'font-size': 'x-large'
30f26bf7ff24 Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents: 4277
diff changeset
114 }"
30f26bf7ff24 Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents: 4277
diff changeset
115 />
30f26bf7ff24 Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents: 4277
diff changeset
116 <small class="my-auto">
30f26bf7ff24 Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents: 4277
diff changeset
117 {{ forecastAccuracy(feature) }}
30f26bf7ff24 Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents: 4277
diff changeset
118 </small>
30f26bf7ff24 Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents: 4277
diff changeset
119 </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
120 </div>
12398df5f414 Identify_tool: fixed nesting of divs which prevented infos from beeing shown
Thomas Junk <thomas.junk@intevation.de>
parents: 4270
diff changeset
121 <div>
4270
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
122 <small
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
123 v-for="prop in featureProps(feature)"
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
124 :key="prop.key"
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
125 v-if="prop.val"
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
126 class="d-flex justify-content-between px-2"
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
127 >
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
128 <b>{{ prop.key }}</b>
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
129 <span>{{ prop.val }}</span>
4265
2596a028dc3a Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 4258
diff changeset
130 </small>
2596a028dc3a Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 4258
diff changeset
131 </div>
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
132 </div>
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
133 <div
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
134 v-if="!currentMeasurement && !filteredIdentifiedFeatures.length"
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
135 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
136 >
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
137 <translate>No features identified.</translate>
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
138 </div>
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
139 </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
140 <div
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
141 v-if="userManualUrl"
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
142 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
143 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
144 >
3395
6075c4c25568 client: change user manual location
Fadi Abbud <fadi.abbud@intevation.de>
parents: 3369
diff changeset
145 <translate>Download</translate>
6075c4c25568 client: change user manual location
Fadi Abbud <fadi.abbud@intevation.de>
parents: 3369
diff changeset
146 <a
6075c4c25568 client: change user manual location
Fadi Abbud <fadi.abbud@intevation.de>
parents: 3369
diff changeset
147 :href="userManualUrl ? userManualUrl : '#'"
3509
0e91d40af23e client: fix User manual filename
Fadi Abbud <fadi.abbud@intevation.de>
parents: 3399
diff changeset
148 :download="usermanualFilename"
3395
6075c4c25568 client: change user manual location
Fadi Abbud <fadi.abbud@intevation.de>
parents: 3369
diff changeset
149 ><translate> User Manual</translate></a
6075c4c25568 client: change user manual location
Fadi Abbud <fadi.abbud@intevation.de>
parents: 3369
diff changeset
150 >
6075c4c25568 client: change user manual location
Fadi Abbud <fadi.abbud@intevation.de>
parents: 3369
diff changeset
151 </div>
2534
bb5286acfee2 client: reduced spacings between and inside boxes and more compact main menu
Markus Kottlaender <markus@intevation.de>
parents: 2441
diff changeset
152 <div class="versioninfo border-top box-body">
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
153 <span v-translate="{ license: 'AGPL-3.0-or-later' }">
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
154 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
155 %{ license } without warranty, see docs for details.
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
156 </span>
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
157 <br />
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
158 <a href="https://hg.intevation.de/gemma/file/tip">
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
159 <translate>source-code</translate>
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
160 </a>
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
161 {{ versionStr }} <br />© via donau. &#x24D4; Intevation. <br />
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
162 <span v-translate="{ name: 'OpenSteetMap' }"
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
163 >Some data ©
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
164 <a href="https://www.openstreetmap.org/copyright">%{ name }</a>
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
165 contributors.
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
166 </span>
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
167 <br />
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
168 <span v-translate="{ geoLicense: 'CC-BY-4.0' }">
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
169 Uses
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
170 <a href="https://download.geonames.org/export/dump/readme.txt"
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
171 >GeoNames</a
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
172 >
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
173 under %{ geoLicense }.
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
174 </span>
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
175 <translate>Generated PDFs use font: </translate>
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
176 <a href="http://libertine-fonts.org">LinBiolinum</a>
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
177 </div>
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
178 </div>
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
179 </div>
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
180 </template>
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
181
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
182 <style lang="scss" scoped>
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
183 .features {
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
184 max-height: 19rem;
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
185 overflow-y: auto;
2372
20e4efa64320 client: improved row colors in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2371
diff changeset
186 small {
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
187 .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
188 margin-top: -0.25rem;
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
189 margin-right: -0.5rem;
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
190 margin-bottom: -0.25rem;
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
191 svg {
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
192 vertical-align: middle;
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
193 }
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
194 }
2372
20e4efa64320 client: improved row colors in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2371
diff changeset
195 &:nth-child(even) {
20e4efa64320 client: improved row colors in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2371
diff changeset
196 background: #f8f8f8;
20e4efa64320 client: improved row colors in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2371
diff changeset
197 }
20e4efa64320 client: improved row colors in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2371
diff changeset
198 &:hover {
20e4efa64320 client: improved row colors in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2371
diff changeset
199 background: #eeeeee;
20e4efa64320 client: improved row colors in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2371
diff changeset
200 }
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
201 }
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
202 }
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
203
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
204 .versioninfo {
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
205 font-size: 60%;
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
206 white-space: normal;
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
207 }
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
208 </style>
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
209
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
210 <script>
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
211 /* 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
212 * without warranty, see README.md and license for details.
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
213 *
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
214 * SPDX-License-Identifier: AGPL-3.0-or-later
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
215 * License-Filename: LICENSES/AGPL-3.0.txt
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
216 *
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
217 * Copyright (C) 2018, 2019 by via donau
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
218 * – Österreichische Wasserstraßen-Gesellschaft mbH
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
219 * Software engineering by Intevation GmbH
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
220 *
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
221 * Author(s):
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
222 * Thomas Junk <thomas.junk@intevation.de>
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
223 * Bernhard E. Reiter <bernhard.reiter@intevation.de>
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
224 * Markus Kottländer <markus.kottlaender@intevation.de>
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
225 */
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
226 import { mapState, mapGetters } from "vuex";
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
227 import { formatter } from "./formatter";
2747
fb5deecb77f1 client:identified box: implement the bbox zoom button
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2743
diff changeset
228 import { getCenter } from "ol/extent";
4265
2596a028dc3a Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 4258
diff changeset
229 import classifications from "../../lib/classifications";
2596a028dc3a Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 4258
diff changeset
230 import { styleFactory } from "@/components/map/styles";
2596a028dc3a Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 4258
diff changeset
231
4267
c5642480eb9b styles: rename 'currency' to recency
Thomas Junk <thomas.junk@intevation.de>
parents: 4266
diff changeset
232 const {
4269
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
233 recencyColorCodes,
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
234 gmAvailabilityColorCodes,
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
235 forecastAccuracyColorCodes,
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
236 forecastVsRealityColorCodes
4267
c5642480eb9b styles: rename 'currency' to recency
Thomas Junk <thomas.junk@intevation.de>
parents: 4266
diff changeset
237 } = styleFactory();
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
238
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
239 export default {
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
240 name: "identify",
4291
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
241 data() {
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
242 return {
4293
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
243 refGaugeStatus: "",
4356
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
244 gaugeStatus: "",
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
245 gaugeCoeffs: null,
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
246 refGaugeCoeffs: null
4291
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
247 };
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
248 },
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
249 computed: {
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
250 ...mapGetters("application", ["versionStr"]),
4265
2596a028dc3a Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 4258
diff changeset
251 ...mapState("application", ["showIdentify", "userManualUrl", "config"]),
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
252 ...mapGetters("map", ["filteredIdentifiedFeatures"]),
2754
d0f6c222f4f9 client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2747
diff changeset
253 ...mapState("map", ["currentMeasurement"]),
4291
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
254 ...mapState("gauges", ["gauges"]),
2754
d0f6c222f4f9 client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2747
diff changeset
255 identifiedLabel() {
3187
5487abeb380c client: identify: edited title of box header
Markus Kottlaender <markus@intevation.de>
parents: 3044
diff changeset
256 return this.$gettext("Identified Features");
3509
0e91d40af23e client: fix User manual filename
Fadi Abbud <fadi.abbud@intevation.de>
parents: 3399
diff changeset
257 },
0e91d40af23e client: fix User manual filename
Fadi Abbud <fadi.abbud@intevation.de>
parents: 3399
diff changeset
258 usermanualFilename() {
0e91d40af23e client: fix User manual filename
Fadi Abbud <fadi.abbud@intevation.de>
parents: 3399
diff changeset
259 return this.$gettext("User Manual");
4291
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
260 },
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
261 gaugeStatusColor() {
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
262 return forecastVsRealityColorCodes[this.gaugeStatus];
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
263 },
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
264 gaugeStatusText() {
4401
9842812b92e0 identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents: 4356
diff changeset
265 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
266 2
9842812b92e0 identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents: 4356
diff changeset
267 );
9842812b92e0 identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents: 4356
diff changeset
268 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
269 2
9842812b92e0 identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents: 4356
diff changeset
270 );
9842812b92e0 identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents: 4356
diff changeset
271 const coeffWarn = this.gaugeCoeffs
9842812b92e0 identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents: 4356
diff changeset
272 ? Number(this.gaugeCoeffs[2].value).toFixed(2)
9842812b92e0 identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents: 4356
diff changeset
273 : "";
9842812b92e0 identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents: 4356
diff changeset
274 const coeffDanger = this.gaugeCoeffs
9842812b92e0 identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents: 4356
diff changeset
275 ? Number(this.gaugeCoeffs[0].value).toFixed(2)
9842812b92e0 identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents: 4356
diff changeset
276 : "";
4291
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
277 const messagesPerState = {
4356
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
278 OK:
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
279 this.$gettext("Nash-Sutcliffe") +
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
280 `(${coeffDanger} >${nsc24} /24h ${coeffWarn} >${nsc72} / 72h)`,
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
281 WARNING:
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
282 this.$gettext("Nash-Sutcliffe") + ` (${coeffWarn} < ${nsc72} / 72h)`,
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
283 DANGER:
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
284 this.$gettext("Nash-Sutcliffe") +
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
285 ` (${coeffDanger} < ${nsc24} / 72h)`,
4291
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
286 NEUTRAL: this.$gettext("Nash-Sutcliffe not available")
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
287 };
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
288 return messagesPerState[this.gaugeStatus];
4293
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
289 },
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
290 refGaugeStatusColor() {
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
291 return forecastVsRealityColorCodes[this.refGaugeStatus];
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
292 },
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
293 refGaugeStatusText() {
4401
9842812b92e0 identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents: 4356
diff changeset
294 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
295 2
9842812b92e0 identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents: 4356
diff changeset
296 );
9842812b92e0 identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents: 4356
diff changeset
297 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
298 2
9842812b92e0 identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents: 4356
diff changeset
299 );
9842812b92e0 identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents: 4356
diff changeset
300 const coeffWarn = this.refGaugeCoeffs
9842812b92e0 identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents: 4356
diff changeset
301 ? Number(this.refGaugeCoeffs[2].value).toFixed(2)
9842812b92e0 identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents: 4356
diff changeset
302 : "";
4356
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
303 const coeffDanger = this.refGaugeCoeffs
4401
9842812b92e0 identify: fix numbers for nsc
Thomas Junk <thomas.junk@intevation.de>
parents: 4356
diff changeset
304 ? 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
305 : "";
4293
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
306 const messagesPerState = {
4356
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
307 OK:
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
308 this.$gettext("Nash-Sutcliffe") +
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
309 `(${coeffDanger} >${nsc24} /24h ${coeffWarn} >${nsc72} / 72h)`,
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
310 WARNING:
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
311 this.$gettext("Nash-Sutcliffe") + ` (${coeffWarn} < ${nsc72} / 72h)`,
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
312 DANGER:
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
313 this.$gettext("Nash-Sutcliffe") +
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
314 ` (${coeffDanger} < ${nsc24} / 72h)`,
4293
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
315 NEUTRAL: this.$gettext("Nash-Sutcliffe not available")
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
316 };
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
317 return messagesPerState[this.refGaugeStatus];
4291
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
318 }
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
319 },
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
320 watch: {
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
321 filteredIdentifiedFeatures() {
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
322 const bottlecks = this.filteredIdentifiedFeatures.filter(f =>
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
323 /bottleneck/.test(f.id_)
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
324 );
4293
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
325 const gauges = this.filteredIdentifiedFeatures.filter(f =>
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
326 /gauge/.test(f.id_)
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
327 );
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
328 if (gauges.length > 0) {
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
329 const isrs = gauges[0].get("isrs_code");
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
330 this.$store
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
331 .dispatch("gauges/getNashSutcliffeForISRS", isrs)
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
332 .then(response => {
4356
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
333 this.gaugeCoeffs = response.coeffs;
4293
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
334 this.gaugeStatus = classifications.calcForecastVsRealityForNSC(
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
335 response
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
336 );
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
337 });
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
338 }
4291
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
339 if (bottlecks.length > 0) {
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
340 const gauge = this.gauges.find(
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
341 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
342 );
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
343 const isrs = gauge.properties.isrs_code;
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
344 this.$store
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
345 .dispatch("gauges/getNashSutcliffeForISRS", isrs)
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
346 .then(response => {
4356
5356fd2ea3f6 Identify: legend shows reference values from Nash Sutcliffe
Thomas Junk <thomas.junk@intevation.de>
parents: 4350
diff changeset
347 this.refGaugeCoeffs = response.coeffs;
4293
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
348 this.refGaugeStatus = classifications.calcForecastVsRealityForNSC(
4291
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
349 response
81ab34bd2d0d Legend: Improve display of data availability
Thomas Junk <thomas.junk@intevation.de>
parents: 4279
diff changeset
350 );
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 }
2754
d0f6c222f4f9 client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2747
diff changeset
353 }
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
354 },
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
355 methods: {
4293
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
356 getGaugeStatusText(feature) {
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
357 if (/bottleneck/.test(feature.getId())) return this.refGaugeStatusText;
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
358 return this.gaugeStatusText;
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
359 },
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
360 getGaugeStatusColor(feature) {
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
361 if (/bottleneck/.test(feature.getId())) return this.refGaugeStatusColor;
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
362 return this.gaugeStatusColor;
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
363 },
4269
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
364 gmAvailability(feature) {
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
365 const latestInHours = this.config.gm_latest_hours;
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
366 const measurementsIn14D = this.config.gm_min_values_14d;
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
367 const messagesPerState = {
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
368 OK:
4270
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
369 this.$gettext("Avail: Last measurement <") +
4269
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
370 ` ${latestInHours} (${measurementsIn14D} in 14d)`,
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
371 WARNING:
4270
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
372 this.$gettext("Avail: Below treshold") +
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
373 `: ${measurementsIn14D} in 14d`,
4269
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
374 DANGER:
4270
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
375 this.$gettext("Avail: Latest measurement older than") +
e4d6c6339cb4 identify_tool: accuracy legend improved
Thomas Junk <thomas.junk@intevation.de>
parents: 4269
diff changeset
376 ` ${latestInHours} d`
4269
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
377 };
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
378 return messagesPerState[[classifications.gmAvailability(feature)]];
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
379 },
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
380 gmAvailabilityColor(feature) {
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
381 return gmAvailabilityColorCodes[classifications.gmAvailability(feature)];
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
382 },
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
383 forecastAccuracy(feature) {
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
384 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
385 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
386 const fa3d = feature.get("forecast_accuracy_3d");
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
387 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
388 const messagesPerState = {
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
389 OK:
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
390 this.$gettext("Highest confidence") +
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
391 ` <${offset24} cm/24h, <${offset72} cm/72h`,
4349
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
392 WARNING:
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
393 this.$gettext("Confidence per 72h") +
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
394 ` (${fa3d} cm > ${offset72} cm)`,
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
395 DANGER:
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
396 this.$gettext("Confidence per 24h") + ` (${fa1d} cm > ${offset24} cm)`
4269
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
397 };
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
398 return messagesPerState[[classifications.forecastAccuracy(feature)]];
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
399 },
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
400 forecastAccuracyColor(feature) {
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
401 return forecastAccuracyColorCodes[
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
402 classifications.forecastAccuracy(feature)
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
403 ];
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
404 },
4267
c5642480eb9b styles: rename 'currency' to recency
Thomas Junk <thomas.junk@intevation.de>
parents: 4266
diff changeset
405 recency(feature) {
4265
2596a028dc3a Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 4258
diff changeset
406 const revisitingFactor = this.config.bn_revtime_multiplier;
4349
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
407 const revisitingTime = feature.get("revisiting_time");
4265
2596a028dc3a Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 4258
diff changeset
408 const messagesPerState = {
4349
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
409 OK:
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
410 this.$gettext("Data within the revisiting time") +
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
411 ` (${revisitingTime}d)`,
4265
2596a028dc3a Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 4258
diff changeset
412 WARNING:
4269
837f90680d4c identify: complete helper methods for legend
Thomas Junk <thomas.junk@intevation.de>
parents: 4267
diff changeset
413 this.$gettext("Data within revisiting treshold") +
4349
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
414 ` (${revisitingTime} * ${revisitingFactor})`,
4265
2596a028dc3a Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 4258
diff changeset
415 DANGER:
4349
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
416 this.$gettext("Data too old. Treshold:") +
4ed2708234b9 identify: improve legend. Add numbers
Thomas Junk <thomas.junk@intevation.de>
parents: 4293
diff changeset
417 ` (${revisitingTime}d * ${revisitingFactor})`
4265
2596a028dc3a Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 4258
diff changeset
418 };
4279
30f26bf7ff24 Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents: 4277
diff changeset
419 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
420 },
4267
c5642480eb9b styles: rename 'currency' to recency
Thomas Junk <thomas.junk@intevation.de>
parents: 4266
diff changeset
421 recencyColor(feature) {
4279
30f26bf7ff24 Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents: 4277
diff changeset
422 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
423 },
2596a028dc3a Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 4258
diff changeset
424 showBottleneckMeta(feature) {
2596a028dc3a Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 4258
diff changeset
425 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
426 return result;
2596a028dc3a Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 4258
diff changeset
427 },
4293
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
428 showGaugeMeta(feature) {
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
429 const result = /bottleneck|gauge/.test(feature.getId().toLowerCase());
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
430 return result;
dbd8d2416da7 Identify: Improve legend for gauges
Thomas Junk <thomas.junk@intevation.de>
parents: 4291
diff changeset
431 },
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
432 zoomTo(feature) {
3044
c71373594719 client: map: prepared store to hold multiple map objects
Markus Kottlaender <markus@intevation.de>
parents: 3029
diff changeset
433 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
434 coordinates: getCenter(
fb5deecb77f1 client:identified box: implement the bbox zoom button
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2743
diff changeset
435 feature
fb5deecb77f1 client:identified box: implement the bbox zoom button
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2743
diff changeset
436 .getGeometry()
fb5deecb77f1 client:identified box: implement the bbox zoom button
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2743
diff changeset
437 .clone()
fb5deecb77f1 client:identified box: implement the bbox zoom button
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2743
diff changeset
438 .transform("EPSG:3857", "EPSG:4326")
fb5deecb77f1 client:identified box: implement the bbox zoom button
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2743
diff changeset
439 .getExtent()
fb5deecb77f1 client:identified box: implement the bbox zoom button
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2743
diff changeset
440 ),
fb5deecb77f1 client:identified box: implement the bbox zoom button
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2743
diff changeset
441 zoom: 17,
fb5deecb77f1 client:identified box: implement the bbox zoom button
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2743
diff changeset
442 preventZoomOut: true
2735
3c2ac140ad30 identify_tool: zoom to BBox PoC implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 2534
diff changeset
443 });
3c2ac140ad30 identify_tool: zoom to BBox PoC implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 2534
diff changeset
444 },
2387
f185503ef35a client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents: 2372
diff changeset
445 close() {
f185503ef35a client: unified box's header styles by creating a reusable component
Markus Kottlaender <markus@intevation.de>
parents: 2372
diff changeset
446 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
447 },
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
448 featureId(feature) {
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
449 // 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
450 let id = "";
81c2e561fe03 Use distance marks an axis via WMS. Added legend and featureinfo.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2857
diff changeset
451 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
452 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
453 }
81c2e561fe03 Use distance marks an axis via WMS. Added legend and featureinfo.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2857
diff changeset
454 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
455 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
456 }
81c2e561fe03 Use distance marks an axis via WMS. Added legend and featureinfo.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2857
diff changeset
457 return id.replace(/[.][^.]*$/, "");
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
458 },
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
459 featureLabel(feature) {
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
460 if (formatter.hasOwnProperty(this.featureId(feature))) {
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
461 return formatter[this.featureId(feature)].label;
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
462 }
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
463 return this.featureId(feature);
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
464 },
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
465 featureProps(feature) {
2441
9de710bdb535 client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents: 2424
diff changeset
466 let featureId = this.featureId(feature);
9de710bdb535 client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents: 2424
diff changeset
467
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
468 // create array with {key, val} objects
4224
bb66e144dece client: fix identify for bottlenecks
Bernhard Reiter <bernhard@intevation.de>
parents: 3509
diff changeset
469 // skip geometry here, because it is slightly more robust
bb66e144dece client: fix identify for bottlenecks
Bernhard Reiter <bernhard@intevation.de>
parents: 3509
diff changeset
470 // 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
471 // to `feature` for doing so.
bb66e144dece client: fix identify for bottlenecks
Bernhard Reiter <bernhard@intevation.de>
parents: 3509
diff changeset
472 // 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
473 // 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
474 let skipList = [feature.getGeometryName()];
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
475 let propsArray = [];
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
476 Object.keys(feature.getProperties()).forEach(key => {
4224
bb66e144dece client: fix identify for bottlenecks
Bernhard Reiter <bernhard@intevation.de>
parents: 3509
diff changeset
477 if (skipList.indexOf(key) === -1) {
2423
3423cd4b3136 client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2405
diff changeset
478 let val = feature.getProperties()[key];
2405
ef928c63388a client: handle json values in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2387
diff changeset
479
4224
bb66e144dece client: fix identify for bottlenecks
Bernhard Reiter <bernhard@intevation.de>
parents: 3509
diff changeset
480 // if val is a valid json object string,
bb66e144dece client: fix identify for bottlenecks
Bernhard Reiter <bernhard@intevation.de>
parents: 3509
diff changeset
481 // spread its values into the array
2423
3423cd4b3136 client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2405
diff changeset
482 let jsonObj = this.getObjectFromString(val);
3423cd4b3136 client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2405
diff changeset
483 if (jsonObj) {
3423cd4b3136 client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2405
diff changeset
484 Object.keys(jsonObj).forEach(key => {
3423cd4b3136 client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2405
diff changeset
485 propsArray.push({ key, val: jsonObj[key] });
3423cd4b3136 client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2405
diff changeset
486 });
3423cd4b3136 client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2405
diff changeset
487 } else {
3423cd4b3136 client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2405
diff changeset
488 // 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
489 propsArray.push({ key, val });
3423cd4b3136 client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2405
diff changeset
490 }
2405
ef928c63388a client: handle json values in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2387
diff changeset
491 }
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
492 });
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
493
4224
bb66e144dece client: fix identify for bottlenecks
Bernhard Reiter <bernhard@intevation.de>
parents: 3509
diff changeset
494 // 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
495 propsArray = propsArray.map(formatter.all).filter(p => p);
4224
bb66e144dece client: fix identify for bottlenecks
Bernhard Reiter <bernhard@intevation.de>
parents: 3509
diff changeset
496 // run feature specific formatter
2441
9de710bdb535 client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents: 2424
diff changeset
497 if (
9de710bdb535 client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents: 2424
diff changeset
498 formatter.hasOwnProperty(featureId) &&
9de710bdb535 client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents: 2424
diff changeset
499 formatter[featureId].hasOwnProperty("props")
9de710bdb535 client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents: 2424
diff changeset
500 ) {
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
501 propsArray = propsArray.map(formatter[featureId].props).filter(p => p);
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
502 }
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
503 // remove underscores in labels that where not previously changed already
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
504 propsArray = propsArray.map(prop => {
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
505 return { key: prop.key.replace(/_/g, " "), val: prop.val };
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
506 });
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
507
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
508 return propsArray;
2423
3423cd4b3136 client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2405
diff changeset
509 },
3423cd4b3136 client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2405
diff changeset
510 getObjectFromString(val) {
3423cd4b3136 client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2405
diff changeset
511 // 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
512 // 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
513 // 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
514 if (
3423cd4b3136 client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2405
diff changeset
515 Object.prototype.toString.call(val) === "[object String]" &&
3423cd4b3136 client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2405
diff changeset
516 val[0] === "{"
3423cd4b3136 client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2405
diff changeset
517 ) {
3423cd4b3136 client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2405
diff changeset
518 try {
3423cd4b3136 client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2405
diff changeset
519 return JSON.parse(val);
2424
b6deb03ef13f client: fix linter error (empty block)
Markus Kottlaender <markus@intevation.de>
parents: 2423
diff changeset
520 } catch (e) {
b6deb03ef13f client: fix linter error (empty block)
Markus Kottlaender <markus@intevation.de>
parents: 2423
diff changeset
521 return null;
b6deb03ef13f client: fix linter error (empty block)
Markus Kottlaender <markus@intevation.de>
parents: 2423
diff changeset
522 }
2423
3423cd4b3136 client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2405
diff changeset
523 }
3423cd4b3136 client: fix json parsing in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2405
diff changeset
524 return null;
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
525 }
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
526 }
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
527 };
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
528 </script>