# HG changeset patch # User Markus Kottlaender # Date 1551882340 -3600 # Node ID 8416cf343f17f42014a8b59b69224bfdac10d802 # Parent f15ee4e84c0c54887ea253db68ffc8fba102ee08 client: critical bottlenecks: added red stroke color diff -r f15ee4e84c0c -r 8416cf343f17 client/src/store/map.js --- a/client/src/store/map.js Wed Mar 06 13:12:46 2019 +0100 +++ b/client/src/store/map.js Wed Mar 06 15:25:40 2019 +0100 @@ -340,33 +340,46 @@ strategy: bboxStrategy }), style: function(feature, resolution, isLegend) { + let styles = []; if ((feature.get("fa_critical") && resolution > 15) || isLegend) { let bnCenter = getCenter(feature.getGeometry().getExtent()); - return new Style({ - geometry: new Point(bnCenter), - image: new RegularShape({ - points: 3, - radius: isLegend ? 9 : 13, - fill: new Fill({ color: "white" }), - stroke: new Stroke({ - color: "rgba(255, 0, 0, 0.8)", - width: isLegend ? 2 : 3 + styles.push( + new Style({ + geometry: new Point(bnCenter), + image: new RegularShape({ + points: 3, + radius: isLegend ? 9 : 13, + fill: new Fill({ color: "white" }), + stroke: new Stroke({ + color: "rgba(255, 0, 0, 0.8)", + width: isLegend ? 2 : 3 + }) + }), + text: new Text({ + font: + "bold " + + (isLegend ? 8 : 12) + + 'px "Open Sans", "sans-serif"', + placement: "point", + fill: new Fill({ color: "black" }), + text: "!", + offsetY: isLegend ? 0 : 1, + offsetX: isLegend ? 1 : 0 }) - }), - text: new Text({ - font: - "bold " + - (isLegend ? 8 : 12) + - 'px "Open Sans", "sans-serif"', - placement: "point", - fill: new Fill({ color: "black" }), - text: "!", - offsetY: isLegend ? 0 : 1, - offsetX: isLegend ? 1 : 0 }) - }); + ); } - return []; + if (feature.get("fa_critical") && !isLegend) { + styles.push( + new Style({ + stroke: new Stroke({ + color: "rgba(255, 0, 0, 1)", + width: 4 + }) + }) + ); + } + return styles; } }), isVisible: true,