-
Notifications
You must be signed in to change notification settings - Fork 31
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
Show Subbasin Huc-12s On Map #2786
Conversation
* Add a map feature group layer to show all the huc-12s in a subbasin modeled shape. * Each layer in the feature group is a HUC-12 geometry that highlights on hover. On click an 'active' attribute is set on the corresponding SubbasinDetail; this is not used yet.
* Instead of reading the active huc12 in the huc12-level view from an option, read it from state on the `subbasins` collection's models ('active'). This way clicking on the map and clicking a row on the table both navigate you to huc12-level view. * Hovering on the map should highlight the row on the table
Keep the highlighting in sync between the table and the map shapes.
* When a subbasin huc12 is selected, make it gold and fit the map bounds to it. * Don't apply hover styling to it when it is selected * Still apply hover styling to the other huc12s, but make sure they get sent back to the back of the layer stack so the active layer appears on top
* If the subbasin details are available before the model results have finished, do not allow the user to select a shape on the map. * If the subbasin results finish before the subbasin details are available, listen to the details collection for changes, so that set up can be completed when the details are ready. While waiting, display the huc12 name as a placeholder '--' and don't do any map behavior related to hovering over the table.
Fix a bug whereby we were overwriting the `gis_data` attribute on a project with the subbasin mapshed results. The subbasin mapshed results are not proper GMS files, and should not be available for download.
* When toggling between analyze, monitor and model, clear the subbasin map state where appropriate and set it back when returning. Make sure layers stay in their appropriate order (ie active subbasin should always be on top of everything) * When exiting the modeling view, clear the subbasin results from the map.
Taking a look now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good and works very well. The only crash I see is when changing scenarios from within Sub-basin mode. I think that's complex enough to be its own follow up card, so we'll tackle that separately.
Nice work!
Made #2789 for the follow up. |
Thanks for making that follow up, and for the review! |
Overview
Add the huc-12 subbasin shapes to the map. They have two-way interactivity: you can active their hover state by hovering over them on the map or on the huc-12 totals table. You can select one via clicking the map or clicking their row in the huc12 totals table.
Connects #2651
Demo
[ ignore the error on the analyze page in this gif. It isn't related. ]
Testing Instructions
./scripts/bundle.sh
Some things to try: