annotate client/src/components/identify/formatter.js @ 3081:9107c959bb3b

client: Changed distance marks ashore to WMS layer.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 18 Apr 2019 13:26:02 +0200
parents 4063adda3095
children 80037790032d
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 const formatter = {
2441
9de710bdb535 client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents: 2439
diff changeset
2 all(p) {
9de710bdb535 client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents: 2439
diff changeset
3 if (p.key === "objnam") p.key = "Name";
2573
4486ca003b55 client: added objname to identify formatter
Markus Kottlaender <markus@intevation.de>
parents: 2509
diff changeset
4 if (p.key === "objname") p.key = "Name";
2509
3dc7c0f60a62 client: identify box: formatted fa_date_info and fa_critical
Markus Kottlaender <markus@intevation.de>
parents: 2458
diff changeset
5 if (p.key === "staging_done" || p.key === "fa_critical")
3dc7c0f60a62 client: identify box: formatted fa_date_info and fa_critical
Markus Kottlaender <markus@intevation.de>
parents: 2458
diff changeset
6 p.val = p.val ? "yes" : "no";
3dc7c0f60a62 client: identify box: formatted fa_date_info and fa_critical
Markus Kottlaender <markus@intevation.de>
parents: 2458
diff changeset
7 if (p.key === "date_info" || p.key === "fa_date_info") {
2441
9de710bdb535 client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents: 2439
diff changeset
8 p.val = new Date(p.val).toLocaleString();
9de710bdb535 client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents: 2439
diff changeset
9 }
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: 2573
diff changeset
10
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: 2573
diff changeset
11 // remove certain props
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: 2573
diff changeset
12 let propsToRemove = ["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: 2573
diff changeset
13 if (propsToRemove.indexOf(p.key) !== -1) return null;
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: 2573
diff changeset
14
2441
9de710bdb535 client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents: 2439
diff changeset
15 return p;
9de710bdb535 client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents: 2439
diff changeset
16 },
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
17 bottlenecks_geoserver: {
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
18 label: "Bottleneck",
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
19 props: p => {
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
20 if (p.key === "bottleneck_id") p.key = "ID";
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
21 if (p.key === "responsible_country") p.key = "Responsible Country";
2509
3dc7c0f60a62 client: identify box: formatted fa_date_info and fa_critical
Markus Kottlaender <markus@intevation.de>
parents: 2458
diff changeset
22 if (p.key === "fa_date_info") p.key = "Fairway Date";
3dc7c0f60a62 client: identify box: formatted fa_date_info and fa_critical
Markus Kottlaender <markus@intevation.de>
parents: 2458
diff changeset
23 if (p.key === "fa_critical") p.key = "Fairway Critical";
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
24
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
25 // remove certain props
2405
ef928c63388a client: handle json values in identify box
Markus Kottlaender <markus@intevation.de>
parents: 2371
diff changeset
26 let propsToRemove = ["nobjnm", "reference_water_levels"];
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
27 if (propsToRemove.indexOf(p.key) !== -1) return null;
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
28
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
29 return p;
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
30 }
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
31 },
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
32 fairway_dimensions: {
2441
9de710bdb535 client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents: 2439
diff changeset
33 label: "Fairway Dimensions"
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
34 },
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
35 waterway_area: {
2441
9de710bdb535 client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents: 2439
diff changeset
36 label: "Waterway Area"
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
37 },
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
38 distance_marks_geoserver: {
2441
9de710bdb535 client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents: 2439
diff changeset
39 label: "Distance Mark"
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
40 },
3081
9107c959bb3b client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2743
diff changeset
41 distance_marks_ashore_geoserver: {
9107c959bb3b client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2743
diff changeset
42 label: "Distance Mark ashore"
9107c959bb3b client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2743
diff changeset
43 },
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
44 waterway_axis: {
2441
9de710bdb535 client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents: 2439
diff changeset
45 label: "Waterway Axis"
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
46 },
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
47 waterway_profiles: {
2441
9de710bdb535 client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents: 2439
diff changeset
48 label: "Waterway Profile"
2439
c3c014435e88 client: identify box: formatted streches
Markus Kottlaender <markus@intevation.de>
parents: 2405
diff changeset
49 },
c3c014435e88 client: identify box: formatted streches
Markus Kottlaender <markus@intevation.de>
parents: 2405
diff changeset
50 stretches_geoserver: {
2441
9de710bdb535 client: improved identify box formatter
Markus Kottlaender <markus@intevation.de>
parents: 2439
diff changeset
51 label: "Stretch"
2458
204b0baac93c client: identified box: added gauges to formatter
Markus Kottlaender <markus@intevation.de>
parents: 2441
diff changeset
52 },
204b0baac93c client: identified box: added gauges to formatter
Markus Kottlaender <markus@intevation.de>
parents: 2441
diff changeset
53 gauges_geoserver: {
204b0baac93c client: identified box: added gauges to formatter
Markus Kottlaender <markus@intevation.de>
parents: 2441
diff changeset
54 label: "Gauge"
2371
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
55 }
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
56 };
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
57
045bac575294 client: fixed broken previous commit
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
58 export { formatter };