comparison client/src/store/map.js @ 2125:ea5a0e771b71

Distinct fairway layers per LOS There are now distinct layers for LOS1-3, which can be enabled/disabled in the legend. LOS2 has no data yet but works. Cross profiles show only LOS3 still. issue 261
author Markus Kottlaender <markus@intevation.de>
date Wed, 06 Feb 2019 11:47:02 +0100
parents cac5d2fba591
children 7a2eedc182f7
comparison
equal deleted inserted replaced
2124:af136b1a854e 2125:ea5a0e771b71
103 }), 103 }),
104 isVisible: false, 104 isVisible: false,
105 showInLegend: true 105 showInLegend: true
106 }, 106 },
107 { 107 {
108 name: "Fairway Dimensions", 108 name: "Fairway Dimensions LOS 1",
109 data: new VectorLayer({ 109 data: new VectorLayer({
110 source: new VectorSource(), 110 source: new VectorSource(),
111 style: function(feature) { 111 style: function() {
112 let strokeColor =
113 feature.get("level_of_service").toString() === "3"
114 ? "rgba(0, 0, 255, 1.0)"
115 : "rgba(0, 100, 150, 1.0)";
116 return [ 112 return [
117 new Style({ 113 new Style({
118 stroke: new Stroke({ 114 stroke: new Stroke({
119 color: strokeColor, 115 color: "rgba(76, 76, 255, 1.0)",
120 width: 2 116 width: 2
121 }) 117 })
122 }), 118 }),
123 new Style({ 119 new Style({
124 text: new Text({ 120 text: new Text({
125 font: 'bold 12px "Open Sans", "sans-serif"', 121 font: 'bold 12px "Open Sans", "sans-serif"',
126 placement: "line", 122 placement: "line",
127 fill: new Fill({ 123 fill: new Fill({
128 color: "black" 124 color: "black"
129 }), 125 }),
130 text: "LOS: " + feature.get("level_of_service").toString() 126 text: "LOS: 1"
127 //, zIndex: 10
128 })
129 })
130 ];
131 }
132 }),
133 isVisible: true,
134 showInLegend: true
135 },
136 {
137 name: "Fairway Dimensions LOS 2",
138 data: new VectorLayer({
139 source: new VectorSource(),
140 style: function() {
141 return [
142 new Style({
143 stroke: new Stroke({
144 color: "rgba(38, 38, 127, 1.0)",
145 width: 2
146 })
147 }),
148 new Style({
149 text: new Text({
150 font: 'bold 12px "Open Sans", "sans-serif"',
151 placement: "line",
152 fill: new Fill({
153 color: "black"
154 }),
155 text: "LOS: 2"
156 //, zIndex: 10
157 })
158 })
159 ];
160 }
161 }),
162 isVisible: true,
163 showInLegend: true
164 },
165 {
166 name: "Fairway Dimensions LOS 3",
167 data: new VectorLayer({
168 source: new VectorSource(),
169 style: function() {
170 return [
171 new Style({
172 stroke: new Stroke({
173 color: "rgba(0, 0, 255, 1.0)",
174 width: 2
175 })
176 }),
177 new Style({
178 text: new Text({
179 font: 'bold 12px "Open Sans", "sans-serif"',
180 placement: "line",
181 fill: new Fill({
182 color: "black"
183 }),
184 text: "LOS: 3"
131 //, zIndex: 10 185 //, zIndex: 10
132 }) 186 })
133 }) 187 })
134 ]; 188 ];
135 } 189 }