Mercurial > gemma
annotate client/src/components/map/styles.js @ 4279:30f26bf7ff24
Reordering of elements
In order to improve user experience the configuration of avail, forceast vs. real and accuracy was
changed in such a way, that it now mirrors the optics of the displayed triangle.
The order in the identify tool was changed accordingly 1) avail 2) forcast vs. real 3) accuracy
"Currency" was cleaned up to "recency"
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Thu, 29 Aug 2019 15:04:02 +0200 |
parents | 1d4e588a61df |
children | be7c23af783c |
rev | line source |
---|---|
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 import { Icon, Stroke, Style, Fill, Text, Circle } from "ol/style"; |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
2 import Point from "ol/geom/Point"; |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
3 import { getCenter } from "ol/extent"; |
3434
9fba1be118e7
client: data accuracy: Show diagrams for gauges, bottlenecks and stretches on map.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3433
diff
changeset
|
4 import store from "@/store/index"; |
3472
71022e6bd98e
client: Use classifications for bottleneck diagrams on map and extracted classification algos
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3457
diff
changeset
|
5 import classifications from "../../lib/classifications"; |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
6 |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
7 const styles = { |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
8 blue1: new Style({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
9 stroke: new Stroke({ |
3571
9e296d686f16
client: cross profiles: support gabs in fairway and improved display in diagram and legend
Markus Kottlaender <markus@intevation.de>
parents:
3548
diff
changeset
|
10 color: [0, 0, 255, 0.8], |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
11 lineDash: [2, 4], |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
12 lineCap: "round", |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
13 width: 2 |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
14 }), |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
15 fill: new Fill({ |
3571
9e296d686f16
client: cross profiles: support gabs in fairway and improved display in diagram and legend
Markus Kottlaender <markus@intevation.de>
parents:
3548
diff
changeset
|
16 color: [240, 230, 0, 0.2] |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
17 }) |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
18 }), |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
19 blue2: new Style({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
20 stroke: new Stroke({ |
3571
9e296d686f16
client: cross profiles: support gabs in fairway and improved display in diagram and legend
Markus Kottlaender <markus@intevation.de>
parents:
3548
diff
changeset
|
21 color: [0, 0, 255, 0.9], |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
22 lineDash: [3, 6], |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
23 lineCap: "round", |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
24 width: 2 |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
25 }), |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
26 fill: new Fill({ |
3571
9e296d686f16
client: cross profiles: support gabs in fairway and improved display in diagram and legend
Markus Kottlaender <markus@intevation.de>
parents:
3548
diff
changeset
|
27 color: [240, 230, 0, 0.1] |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
28 }) |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
29 }), |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
30 blue3: new Style({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
31 stroke: new Stroke({ |
3571
9e296d686f16
client: cross profiles: support gabs in fairway and improved display in diagram and legend
Markus Kottlaender <markus@intevation.de>
parents:
3548
diff
changeset
|
32 color: [0, 0, 255, 1.0], |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
33 width: 2 |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
34 }), |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
35 fill: new Fill({ |
3571
9e296d686f16
client: cross profiles: support gabs in fairway and improved display in diagram and legend
Markus Kottlaender <markus@intevation.de>
parents:
3548
diff
changeset
|
36 color: [255, 255, 255, 0.4] |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
37 }) |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
38 }), |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
39 yellow1: new Style({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
40 stroke: new Stroke({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
41 color: "rgba(230, 230, 10, .8)", |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
42 width: 4 |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
43 }), |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
44 fill: new Fill({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
45 color: "rgba(230, 230, 10, .3)" |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
46 }) |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
47 }), |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
48 yellow2: new Style({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
49 stroke: new Stroke({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
50 color: "rgba(250, 200, 0, .8)", |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
51 width: 2 |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
52 }), |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
53 fill: new Fill({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
54 color: "rgba(250, 200, 10, .3)" |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
55 }) |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
56 }), |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
57 yellow3: new Style({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
58 stroke: new Stroke({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
59 color: "rgba(250, 240, 10, .9)", |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
60 width: 5 |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
61 }), |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
62 fill: new Fill({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
63 color: "rgba(250, 240, 0, .7)" |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
64 }) |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
65 }), |
3309
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3011
diff
changeset
|
66 orange1: new Style({ |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3011
diff
changeset
|
67 stroke: new Stroke({ |
3312
00548f0e81c3
client: sections layer: adjusted colors
Markus Kottlaender <markus@intevation.de>
parents:
3309
diff
changeset
|
68 color: "rgba(255, 150, 10, .8)", |
3309
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3011
diff
changeset
|
69 width: 2 |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3011
diff
changeset
|
70 }), |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3011
diff
changeset
|
71 fill: new Fill({ |
3312
00548f0e81c3
client: sections layer: adjusted colors
Markus Kottlaender <markus@intevation.de>
parents:
3309
diff
changeset
|
72 color: "rgba(255, 150, 0, .3)" |
3309
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3011
diff
changeset
|
73 }) |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3011
diff
changeset
|
74 }), |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3011
diff
changeset
|
75 orange2: new Style({ |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3011
diff
changeset
|
76 stroke: new Stroke({ |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3011
diff
changeset
|
77 color: "rgba(255, 166, 10, .9)", |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3011
diff
changeset
|
78 width: 5 |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3011
diff
changeset
|
79 }), |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3011
diff
changeset
|
80 fill: new Fill({ |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3011
diff
changeset
|
81 color: "rgba(255, 166, 0, .7)" |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3011
diff
changeset
|
82 }) |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3011
diff
changeset
|
83 }), |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
84 red1: new Style({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
85 stroke: new Stroke({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
86 color: "rgba(255, 0, 0, 1)", |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
87 width: 4 |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
88 }) |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
89 }), |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
90 circleBlue: new Style({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
91 image: new Circle({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
92 radius: 5, |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
93 fill: new Fill({ color: "rgba(255, 0, 0, 0.1)" }), |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
94 stroke: new Stroke({ color: "blue", width: 1 }) |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
95 }) |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
96 }), |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
97 textFW1: new Style({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
98 text: new Text({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
99 font: 'bold 12px "Open Sans", "sans-serif"', |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
100 placement: "line", |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
101 fill: new Fill({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
102 color: "black" |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
103 }), |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
104 text: "LOS: 1" |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
105 //, zIndex: 10 |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
106 }) |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
107 }), |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
108 textFW2: new Style({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
109 text: new Text({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
110 font: 'bold 12px "Open Sans", "sans-serif"', |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
111 placement: "line", |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
112 fill: new Fill({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
113 color: "black" |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
114 }), |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
115 text: "LOS: 2" |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
116 //, zIndex: 10 |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
117 }) |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
118 }), |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
119 textFW3: new Style({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
120 text: new Text({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
121 font: 'bold 12px "Open Sans", "sans-serif"', |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
122 placement: "line", |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
123 fill: new Fill({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
124 color: "black" |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
125 }), |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
126 text: "LOS: 3" |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
127 //, zIndex: 10 |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
128 }) |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
129 }) |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
130 }; |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
131 |
4241
27434b0d4d96
Map: setting styles correctly for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4233
diff
changeset
|
132 const styleFactory = function(mapId) { |
4267
c5642480eb9b
styles: rename 'currency' to recency
Thomas Junk <thomas.junk@intevation.de>
parents:
4266
diff
changeset
|
133 const recencyColorCodes = { |
4266
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
134 OK: "lime", |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
135 WARNING: "yellow", |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
136 DANGER: "red", |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
137 NEUTRAL: "white" |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
138 }; |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
139 const gmAvailabilityColorCodes = { |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
140 OK: "lime", |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
141 WARNING: "yellow", |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
142 DANGER: "red", |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
143 NEUTRAL: "white" |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
144 }; |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
145 const forecastAccuracyColorCodes = { |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
146 OK: "lime", |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
147 WARNING: "yellow", |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
148 DANGER: "red", |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
149 NEUTRAL: "white" |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
150 }; |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
151 |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
152 const forecastVsRealityColorCodes = { |
4265
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
153 OK: "lime", |
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
154 WARNING: "yellow", |
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
155 DANGER: "red", |
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
156 NEUTRAL: "white" |
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
157 }; |
3548
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
158 return { |
4267
c5642480eb9b
styles: rename 'currency' to recency
Thomas Junk <thomas.junk@intevation.de>
parents:
4266
diff
changeset
|
159 recencyColorCodes: recencyColorCodes, |
4266
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
160 gmAvailabilityColorCodes: gmAvailabilityColorCodes, |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
161 forecastAccuracyColorCodes: forecastAccuracyColorCodes, |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
162 forecastVsRealityColorCodes: forecastVsRealityColorCodes, |
3548
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
163 stretches(feature) { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
164 let style = styles.yellow2; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
165 if (feature.get("highlighted")) { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
166 style = styles.yellow3; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
167 } |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
168 return style; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
169 }, |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
170 sections(feature) { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
171 let style = styles.orange1; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
172 if (feature.get("highlighted")) { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
173 style = styles.orange2; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
174 } |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
175 return style; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
176 }, |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
177 fwd1() { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
178 return [styles.blue1, styles.textFW1]; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
179 }, |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
180 fwd2() { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
181 return [styles.blue2, styles.textFW2]; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
182 }, |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
183 fwd3() { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
184 return [styles.blue3, styles.textFW3]; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
185 }, |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
186 bottleneck() { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
187 return styles.yellow1; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
188 }, |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
189 bottleneckStatus(feature, resolution, isLegend) { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
190 let s = []; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
191 if ((feature.get("fa_critical") && resolution > 15) || isLegend) { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
192 let bnCenter = getCenter(feature.getGeometry().getExtent()); |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
193 s.push( |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
194 new Style({ |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
195 geometry: new Point(bnCenter), |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
196 image: new Icon({ |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
197 src: require("@/assets/marker-bottleneck-critical.png"), |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
198 anchor: [0.5, 0.5], |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
199 scale: isLegend ? 0.5 : 1 |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
200 }) |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
201 }) |
3548
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
202 ); |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
203 } |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
204 if (feature.get("fa_critical") && !isLegend) { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
205 s.push(styles.red1); |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
206 } |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
207 return s; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
208 }, |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
209 bottleneckFairwayAvailability(feature, resolution, isLegend) { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
210 let s = []; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
211 if (isLegend) { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
212 s.push( |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
213 new Style({ |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
214 image: new Icon({ |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
215 src: require("@/assets/fa-diagram.png"), |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
216 anchor: [0.5, 0.5], |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
217 scale: 1 |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
218 }) |
3335
59db0b5921c5
client: added layer for fairway availability diagrams with demo diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3312
diff
changeset
|
219 }) |
3548
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
220 ); |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
221 } |
4222
c5cc6540940e
client: improve LOD for one layer
Bernhard Reiter <bernhard@intevation.de>
parents:
3843
diff
changeset
|
222 if (feature.get("fa_critical") && feature.get("fa_data")) { |
3548
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
223 let data = feature.get("fa_data"); |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
224 let lnwlHeight = (80 / 100) * data.ldc; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
225 let belowThresholdHeight = (80 / 100) * data.below; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
226 let betweenThresholdHeight = (80 / 100) * data.between; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
227 let aboveThresholdHeight = (80 / 100) * data.above; |
3433
e56b280582ae
client: spuc05: use real data for diagrams on map
Markus Kottlaender <markus@intevation.de>
parents:
3390
diff
changeset
|
228 |
3548
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
229 let frame = `<rect x='0' y='0' width='32' height='84' stroke-width='0' fill='white'/>`; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
230 let lnwl = `<rect x='2' y='${80 - |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
231 lnwlHeight + |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
232 2}' width='10' height='${lnwlHeight}' stroke-width='0' fill='aqua'/>`; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
233 let range1 = `<rect x='12' y='2' width='18' height='${belowThresholdHeight}' stroke-width='0' fill='hotpink'/>`; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
234 let range2 = `<rect x='12' y='${belowThresholdHeight + |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
235 2}' width='18' height='${betweenThresholdHeight}' stroke-width='0' fill='darksalmon'/>`; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
236 let range3 = `<rect x='12' y='${80 - |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
237 aboveThresholdHeight + |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
238 2}' width='18' height='${aboveThresholdHeight}' stroke-width='0' fill='blue'/>`; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
239 let svg = `data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='84'><g>${frame}${lnwl}${range1}${range2}${range3}</g></svg>`; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
240 let bnCenter = getCenter(feature.getGeometry().getExtent()); |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
241 s.push( |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
242 new Style({ |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
243 geometry: new Point(bnCenter), |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
244 image: new Icon({ |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
245 src: svg, |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
246 anchor: [1.2, 1.2] |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
247 }) |
3335
59db0b5921c5
client: added layer for fairway availability diagrams with demo diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3312
diff
changeset
|
248 }) |
3548
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
249 ); |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
250 } |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
251 return s; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
252 }, |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
253 dataAvailability(feature, resolution, isLegend) { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
254 let s = []; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
255 if (isLegend) { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
256 s.push( |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
257 new Style({ |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
258 image: new Icon({ |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
259 src: require("@/assets/da-diagram.png"), |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
260 anchor: [0.5, 0.5], |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
261 scale: 1 |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
262 }) |
3434
9fba1be118e7
client: data accuracy: Show diagrams for gauges, bottlenecks and stretches on map.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3433
diff
changeset
|
263 }) |
3548
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
264 ); |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
265 } else { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
266 // TODO: Get information from feature and check the ranges according to #423, #424, #425 |
4266
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
267 let colorWaterlevel = |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
268 gmAvailabilityColorCodes[classifications.gmAvailability(feature)]; |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
269 let colorComparison = |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
270 forecastVsRealityColorCodes[ |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
271 classifications.forecastVsReality(feature) |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
272 ]; |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
273 let colorAccuracy = |
fbe2f1aa2757
styles: refactor color coding accuracy colors
Thomas Junk <thomas.junk@intevation.de>
parents:
4265
diff
changeset
|
274 forecastAccuracyColorCodes[classifications.forecastAccuracy(feature)]; |
3548
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
275 let map = store.getters["map/openLayersMap"](mapId); |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
276 let geom = feature.getGeometry(); |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
277 if (!(geom instanceof Point)) { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
278 geom = new Point(getCenter(feature.getGeometry().getExtent())); |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
279 } |
3516
6cdfc05fd6b0
client: data accuracy layer: show only diagrams for layers that are active
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
280 if ( |
3548
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
281 (map.getLayer("BOTTLENECKS").getVisible() && |
3516
6cdfc05fd6b0
client: data accuracy layer: show only diagrams for layers that are active
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
282 feature.getId().indexOf("bottlenecks") > -1) || |
3548
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
283 (map.getLayer("SECTIONS").getVisible() && |
3516
6cdfc05fd6b0
client: data accuracy layer: show only diagrams for layers that are active
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
284 feature.getId().indexOf("sections") > -1) || |
3548
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
285 (map.getLayer("STRETCHES").getVisible() && |
3516
6cdfc05fd6b0
client: data accuracy layer: show only diagrams for layers that are active
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
286 feature.getId().indexOf("stretches") > -1) || |
3548
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
287 (map.getLayer("GAUGES").getVisible() && |
3516
6cdfc05fd6b0
client: data accuracy layer: show only diagrams for layers that are active
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
288 feature.getId().indexOf("gauges") > -1) |
6cdfc05fd6b0
client: data accuracy layer: show only diagrams for layers that are active
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
289 ) { |
3843
cc585e068ca0
client: made triangles in data accuracy layer equilateral
Markus Kottlaender <markus@intevation.de>
parents:
3720
diff
changeset
|
290 let frame = `<polyline points='16,0 32,28 0,28 16,0' stroke='grey' stroke-width='1' fill='white'/>`; |
cc585e068ca0
client: made triangles in data accuracy layer equilateral
Markus Kottlaender <markus@intevation.de>
parents:
3720
diff
changeset
|
291 let waterlevel = `<polyline points="16,0 24,14 16,28 8,14 16,0" stroke='grey' stroke-width='1' fill='${colorWaterlevel}'/>`; |
cc585e068ca0
client: made triangles in data accuracy layer equilateral
Markus Kottlaender <markus@intevation.de>
parents:
3720
diff
changeset
|
292 let accuracy = `<polyline points="24,14 32,28 16,28 24,14" stroke='grey' stroke-width='1' fill='${colorAccuracy}'/>`; |
cc585e068ca0
client: made triangles in data accuracy layer equilateral
Markus Kottlaender <markus@intevation.de>
parents:
3720
diff
changeset
|
293 let comparison = `<polyline points="8,14 16,28 0,28 8,14" stroke='grey' stroke-width='1' fill='${colorComparison}'/>`; |
cc585e068ca0
client: made triangles in data accuracy layer equilateral
Markus Kottlaender <markus@intevation.de>
parents:
3720
diff
changeset
|
294 let svg = `data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='28'><g>${frame}${waterlevel}${comparison}${accuracy}</g></svg>`; |
3516
6cdfc05fd6b0
client: data accuracy layer: show only diagrams for layers that are active
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
295 s.push( |
6cdfc05fd6b0
client: data accuracy layer: show only diagrams for layers that are active
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
296 new Style({ |
6cdfc05fd6b0
client: data accuracy layer: show only diagrams for layers that are active
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
297 geometry: geom, |
6cdfc05fd6b0
client: data accuracy layer: show only diagrams for layers that are active
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
298 image: new Icon({ |
6cdfc05fd6b0
client: data accuracy layer: show only diagrams for layers that are active
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
299 src: svg, |
6cdfc05fd6b0
client: data accuracy layer: show only diagrams for layers that are active
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
300 anchor: [-0.5, 1] |
6cdfc05fd6b0
client: data accuracy layer: show only diagrams for layers that are active
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
301 }) |
3448
d0278e7399fb
client: data accuracy: use single color for bottlenecks in diagram.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3444
diff
changeset
|
302 }) |
3516
6cdfc05fd6b0
client: data accuracy layer: show only diagrams for layers that are active
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
303 ); |
6cdfc05fd6b0
client: data accuracy layer: show only diagrams for layers that are active
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
304 } |
3507
a606d003730c
client: spuc12: implemented diagram for reference gauge of bottlenecks
Markus Kottlaender <markus@intevation.de>
parents:
3501
diff
changeset
|
305 |
3448
d0278e7399fb
client: data accuracy: use single color for bottlenecks in diagram.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3444
diff
changeset
|
306 if ( |
3548
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
307 map.getLayer("BOTTLENECKS").getVisible() && |
3448
d0278e7399fb
client: data accuracy: use single color for bottlenecks in diagram.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3444
diff
changeset
|
308 feature.getId().indexOf("bottlenecks") > -1 |
d0278e7399fb
client: data accuracy: use single color for bottlenecks in diagram.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3444
diff
changeset
|
309 ) { |
4265
2596a028dc3a
Feature_info: display partial legend information for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
310 let colorUniformTriangle = |
4279
30f26bf7ff24
Reordering of elements
Thomas Junk <thomas.junk@intevation.de>
parents:
4278
diff
changeset
|
311 recencyColorCodes[classifications.surveyRecency(feature)]; |
3843
cc585e068ca0
client: made triangles in data accuracy layer equilateral
Markus Kottlaender <markus@intevation.de>
parents:
3720
diff
changeset
|
312 let frame = `<polyline points='16,0 32,28 0,28 16,0' stroke='grey' stroke-width='1' fill='${colorUniformTriangle}'/>`; |
cc585e068ca0
client: made triangles in data accuracy layer equilateral
Markus Kottlaender <markus@intevation.de>
parents:
3720
diff
changeset
|
313 let svg = `data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='28'><g>${frame}</g></svg>`; |
3434
9fba1be118e7
client: data accuracy: Show diagrams for gauges, bottlenecks and stretches on map.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3433
diff
changeset
|
314 s.push( |
9fba1be118e7
client: data accuracy: Show diagrams for gauges, bottlenecks and stretches on map.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3433
diff
changeset
|
315 new Style({ |
9fba1be118e7
client: data accuracy: Show diagrams for gauges, bottlenecks and stretches on map.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3433
diff
changeset
|
316 geometry: geom, |
9fba1be118e7
client: data accuracy: Show diagrams for gauges, bottlenecks and stretches on map.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3433
diff
changeset
|
317 image: new Icon({ |
9fba1be118e7
client: data accuracy: Show diagrams for gauges, bottlenecks and stretches on map.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3433
diff
changeset
|
318 src: svg, |
3507
a606d003730c
client: spuc12: implemented diagram for reference gauge of bottlenecks
Markus Kottlaender <markus@intevation.de>
parents:
3501
diff
changeset
|
319 anchor: [0.5, 1] |
3434
9fba1be118e7
client: data accuracy: Show diagrams for gauges, bottlenecks and stretches on map.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3433
diff
changeset
|
320 }) |
9fba1be118e7
client: data accuracy: Show diagrams for gauges, bottlenecks and stretches on map.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3433
diff
changeset
|
321 }) |
9fba1be118e7
client: data accuracy: Show diagrams for gauges, bottlenecks and stretches on map.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3433
diff
changeset
|
322 ); |
9fba1be118e7
client: data accuracy: Show diagrams for gauges, bottlenecks and stretches on map.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3433
diff
changeset
|
323 } |
3548
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
324 } |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
325 return s; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
326 }, |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
327 dma(feature, resolution) { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
328 if (resolution < 10) { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
329 var s = styles.circleBlue; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
330 if (resolution < 6) { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
331 s.setText( |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
332 new Text({ |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
333 offsetY: 12, |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
334 font: '10px "Open Sans", "sans-serif"', |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
335 fill: new Fill({ |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
336 color: "black" |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
337 }), |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
338 text: (feature.get("hectometre") / 10).toString() |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
339 }) |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
340 ); |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
341 } |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
342 return s; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
343 } |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
344 return []; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
345 }, |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
346 gauge(feature, resolution, isLegend) { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
347 let waterlevel = feature.get("gm_waterlevel"); |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
348 let text = feature.get("objname"); |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
349 let iconColor = "white"; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
350 if (waterlevel) { |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
351 text += "\n(" + waterlevel + " cm)"; |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
352 let refWaterlevels = JSON.parse(feature.get("reference_water_levels")); |
3720
1525ead37a2e
client: gauges map layer: handle gauges without reference waterlevels
Markus Kottlaender <markus@intevation.de>
parents:
3571
diff
changeset
|
353 if (refWaterlevels) { |
4278
1d4e588a61df
styles: only try to parse reflevels if any.
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
354 const HDC = |
1d4e588a61df
styles: only try to parse reflevels if any.
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
355 refWaterlevels[ |
1d4e588a61df
styles: only try to parse reflevels if any.
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
356 Object.keys(refWaterlevels).find(e => /HDC/.test(e)) |
1d4e588a61df
styles: only try to parse reflevels if any.
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
357 ]; |
1d4e588a61df
styles: only try to parse reflevels if any.
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
358 const LDC = |
1d4e588a61df
styles: only try to parse reflevels if any.
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
359 refWaterlevels[ |
1d4e588a61df
styles: only try to parse reflevels if any.
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
360 Object.keys(refWaterlevels).find(e => /LDC/.test(e)) |
1d4e588a61df
styles: only try to parse reflevels if any.
Thomas Junk <thomas.junk@intevation.de>
parents:
4267
diff
changeset
|
361 ]; |
4233
63b160379e06
gauge_style: allow different kinds of naming for HDC/LDC
Thomas Junk <thomas.junk@intevation.de>
parents:
4222
diff
changeset
|
362 if (waterlevel < LDC) iconColor = "brown"; |
63b160379e06
gauge_style: allow different kinds of naming for HDC/LDC
Thomas Junk <thomas.junk@intevation.de>
parents:
4222
diff
changeset
|
363 if (waterlevel > LDC && waterlevel < HDC) iconColor = "blue"; |
63b160379e06
gauge_style: allow different kinds of naming for HDC/LDC
Thomas Junk <thomas.junk@intevation.de>
parents:
4222
diff
changeset
|
364 if (waterlevel > HDC) iconColor = "red"; |
3720
1525ead37a2e
client: gauges map layer: handle gauges without reference waterlevels
Markus Kottlaender <markus@intevation.de>
parents:
3571
diff
changeset
|
365 } |
3548
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
366 } |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
367 |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
368 return [ |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
369 new Style({ |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
370 image: new Icon({ |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
371 src: require("@/assets/marker-gauge-" + iconColor + ".png"), |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
372 anchor: [0.5, isLegend ? 0.5 : 1], |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
373 scale: isLegend ? 0.5 : 1 |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
374 }), |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
375 text: new Text({ |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
376 font: '10px "Open Sans", "sans-serif"', |
3548
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
377 offsetY: 15, |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
378 fill: new Fill({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
379 color: "black" |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
380 }), |
3548
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
381 backgroundFill: new Fill({ |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
382 color: "rgba(255, 255, 255, 0.7)" |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
383 }), |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
384 padding: [2, 2, 2, 2], |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
385 text |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
386 }) |
3548
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
387 }) |
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
388 ]; |
3364
b62b9d5ce06d
client: gauges on map: display latest waterlevel and colored icons depending on waterlevel
Markus Kottlaender <markus@intevation.de>
parents:
3338
diff
changeset
|
389 } |
3548
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3516
diff
changeset
|
390 }; |
4241
27434b0d4d96
Map: setting styles correctly for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4233
diff
changeset
|
391 }; |
27434b0d4d96
Map: setting styles correctly for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4233
diff
changeset
|
392 |
27434b0d4d96
Map: setting styles correctly for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4233
diff
changeset
|
393 export { styles, styleFactory }; |