Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FSAs not displayed at CSD zoom levels (Probabilistic Loss Exceedance Curve) #125

Open
anthonyfok opened this issue Mar 10, 2024 · 1 comment
Assignees
Labels
Bug Something isn't working

Comments

@anthonyfok
Copy link
Member

Thanks to William Chow (@wkhchow) for reporting this issue on 2023-11-22 when we were examining #121:

In the map display associated with Probabilistic Loss Exceedance Curve, FSAs that are sparsely populated and thus very large (e.g. V0R), the red outline disappears when zoomed out to CSD levels, as shown in the following video. (Please unmute the video to hear my explanation.)

FSA.outline.disappears.example.2023-11-23.11-44-05.mp4

Note: this issue was fixed on www.riskprofiler.ca on 2023-11-23, but still pending source code commit to OpenDRR/h7-riskprofiler etc.

@anthonyfok anthonyfok added the Bug Something isn't working label Mar 10, 2024
@anthonyfok anthonyfok self-assigned this Mar 10, 2024
@anthonyfok anthonyfok added this to Backlog in RiskProfiler via automation Mar 10, 2024
@anthonyfok anthonyfok moved this from Backlog to In progress in RiskProfiler Mar 10, 2024
@anthonyfok
Copy link
Member Author

Video demo of the fix (please unmute video). (Sorry for using likely incorrect terminologies (CSD (zoom) level? Haha). FSA stays displayed even when zoomed way out; plus a bit of red shading:

FSA.outline.stays.even.if.zoomed.out.to.CSD.zoom.levels.2023-11-23.13-30-49.mp4

Code fix:

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 4eb9e62..795199a 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,11 @@ 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 */
+			// 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
 

My hypothesis: It seems Phil E. added the code back in July 2022 to display FSA only for "S" aggregation zoom levels, and hide it for CSD to be consistent, but most likely didn't test on Vancouver Island where the FSAs are such large areas! Haha!

RiskProfiler automation moved this from In progress to Done Mar 12, 2024
@anthonyfok anthonyfok reopened this Mar 12, 2024
RiskProfiler automation moved this from Done to In progress Mar 12, 2024
RiskProfiler automation moved this from In progress to Done Mar 12, 2024
@anthonyfok anthonyfok reopened this Mar 12, 2024
RiskProfiler automation moved this from Done to In progress Mar 12, 2024
RiskProfiler automation moved this from In progress to Done Mar 12, 2024
@anthonyfok anthonyfok reopened this Mar 12, 2024
RiskProfiler automation moved this from Done to In progress Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
RiskProfiler
In progress
Development

No branches or pull requests

1 participant