comparison client/src/store/map.js @ 2445:e0f423606929

client: import soundingdata: fix npe bug Changes from bbc31150248c led to a null pointer exception, cause the default value of bottleneck was changed from empty string to null... for reasons. However, this was the inspiration to improve the UI behavior. The 'Download meta.json' button is now disabled as long as the form is lacking the necessary data.
author Markus Kottlaender <markus@intevation.de>
date Fri, 01 Mar 2019 12:42:52 +0100
parents 7fe2f5d334dc
children ba15d3534b2b
comparison
equal deleted inserted replaced
2444:7ca6bdb2d174 2445:e0f423606929
42 FAIRWAYDIMENSIONSLOS2: "LOS 2 Fairway Dimensions", 42 FAIRWAYDIMENSIONSLOS2: "LOS 2 Fairway Dimensions",
43 FAIRWAYDIMENSIONSLOS3: "LOS 3 Fairway Dimensions", 43 FAIRWAYDIMENSIONSLOS3: "LOS 3 Fairway Dimensions",
44 WATERWAYAXIS: "Waterway Axis", 44 WATERWAYAXIS: "Waterway Axis",
45 WATERWAYPROFILES: "Waterway Profiles", 45 WATERWAYPROFILES: "Waterway Profiles",
46 BOTTLENECKS: "Bottlenecks", 46 BOTTLENECKS: "Bottlenecks",
47 BOTTLENECKSTATUS: "Bottleneck Status",
47 BOTTLENECKISOLINE: "Bottleneck isolines", 48 BOTTLENECKISOLINE: "Bottleneck isolines",
48 DISTANCEMARKS: "Distance marks", 49 DISTANCEMARKS: "Distance marks",
49 DISTANCEMARKSAXIS: "Distance marks, Axis", 50 DISTANCEMARKSAXIS: "Distance marks, Axis",
50 DRAWTOOL: "Draw Tool", 51 DRAWTOOL: "Draw Tool",
51 CUTTOOL: "Cut Tool" 52 CUTTOOL: "Cut Tool"
277 name: LAYERS.BOTTLENECKS, 278 name: LAYERS.BOTTLENECKS,
278 data: new VectorLayer({ 279 data: new VectorLayer({
279 source: new VectorSource({ 280 source: new VectorSource({
280 strategy: bboxStrategy 281 strategy: bboxStrategy
281 }), 282 }),
282 style: new Style({ 283 style: function(feature, resolution) {
283 stroke: new Stroke({ 284 if (resolution <= 50) {
284 color: "rgba(230, 230, 10, .8)", 285 return new Style({
285 width: 4 286 stroke: new Stroke({
286 }), 287 color: "rgba(230, 230, 10, .8)",
287 fill: new Fill({ 288 width: 4
288 color: "rgba(230, 230, 10, .3)" 289 }),
289 }) 290 fill: new Fill({
290 }) 291 color: "rgba(230, 230, 10, .3)"
292 })
293 });
294 }
295 return [];
296 }
297 }),
298 isVisible: true,
299 showInLegend: true
300 },
301 {
302 name: LAYERS.BOTTLENECKSTATUS,
303 data: new VectorLayer({
304 source: new VectorSource({
305 strategy: bboxStrategy
306 }),
307 style: function(feature, resolution) {
308 if (resolution > 50) {
309 let bnCenter = getCenter(feature.getGeometry().getExtent());
310 let fillColor = feature.get("fa_critical")
311 ? "rgba(255, 0, 0, 0.5)"
312 : "rgba(0, 255, 0, 0.5)";
313 let strokeColor = feature.get("fa_critical") ? "red" : "green";
314 return new Style({
315 geometry: new Point(bnCenter),
316 image: new Circle({
317 radius: 10,
318 fill: new Fill({ color: fillColor }),
319 stroke: new Stroke({ color: strokeColor, width: 2 })
320 })
321 });
322 }
323 return [];
324 }
291 }), 325 }),
292 isVisible: true, 326 isVisible: true,
293 showInLegend: true 327 showInLegend: true
294 }, 328 },
295 { 329 {