From 6e5fdcfdc956ff1f957a7cdea0038eeb28a9dad7 Mon Sep 17 00:00:00 2001 From: Anthony Fok Date: Tue, 12 Mar 2024 05:51:49 -0600 Subject: [PATCH] Do not hide zoomed-out FSAs in Probabilistic Loss Exceedance Curve Also add a translucent red shade to the enclosed FSA to make it clear which areas are inside or outside of the FSA. Fixes OpenDRR/riskprofiler#125 --- .../themes/fw-child/resources/js/rp_risks.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/site/assets/themes/fw-child/resources/js/rp_risks.js b/site/assets/themes/fw-child/resources/js/rp_risks.js index f93569f9..606a1270 100644 --- a/site/assets/themes/fw-child/resources/js/rp_risks.js +++ b/site/assets/themes/fw-child/resources/js/rp_risks.js @@ -1023,10 +1023,12 @@ var color_ramp = [ } - if (map.hasLayer(plugin_settings.map.layers.fsa)) { - plugin_settings.map.panes.fsa.style.display = 'none' - // map.removeLayer(plugin_settings.map.layers.fsa) - } + /* 2023-11-23: Commented out to keep huge FSA (e.g. "V0R") visible even if zoomed out to CSD aggregation; + * see https://github.com/OpenDRR/riskprofiler/issues/125 */ + // if (map.hasLayer(plugin_settings.map.layers.fsa)) { + // plugin_settings.map.panes.fsa.style.display = 'none' + // // map.removeLayer(plugin_settings.map.layers.fsa) + // } var indicator_key = plugin_settings.indicator.key + '_' + plugin_settings.api.retrofit @@ -1854,7 +1856,9 @@ var color_ramp = [ plugin_settings.map.layers.fsa = new L.GeoJSON(source, { style: { - fill: false, + fill: true, + fillColor: '#FF0000', + fillOpacity: 0.15, color: '#FF0000', weight: 4, opacity: 0.6