Mercurial > gemma
changeset 2525:8416cf343f17
client: critical bottlenecks: added red stroke color
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Wed, 06 Mar 2019 15:25:40 +0100 |
parents | f15ee4e84c0c |
children | 6498267096ae |
files | client/src/store/map.js |
diffstat | 1 files changed, 35 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- 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,