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

Show Subbasin Huc-12s On Map #2786

Merged
merged 7 commits into from
Apr 19, 2018
Merged

Conversation

arottersman
Copy link

@arottersman arottersman commented Apr 18, 2018

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. ]
3bn3ac1ejw

Testing Instructions

  • Pull this branch and ./scripts/bundle.sh
  • Proceed to subbasin modeling and confirm you see shapes appear on the map

Some things to try:

  • hover over the shapes
  • hover over the huc12 total table rows
  • click the shapes
  • click the huc12 total table rows
  • toggle the analyze/monitor/modeling view
  • navigate away from the model view while the shapes are on the map
  • exit subbasin mode and go back into it

Alice Rottersman added 4 commits April 18, 2018 13:49
* 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
Alice Rottersman added 3 commits April 19, 2018 12:17
* 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.
@arottersman arottersman changed the title wip Arr/subbasin show huc12s on map Show Subbasin Huc-12s On Map Apr 19, 2018
@rajadain
Copy link
Member

Taking a look now.

@rajadain
Copy link
Member

Are the HUC-12 boundaries supposed to be this color? It's hard to differentiate it from the water in the underlying basemap:

image

Copy link
Member

@rajadain rajadain left a 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!

@rajadain rajadain assigned arottersman and unassigned rajadain Apr 19, 2018
@rajadain
Copy link
Member

Made #2789 for the follow up.

@arottersman
Copy link
Author

Thanks for making that follow up, and for the review!

@arottersman arottersman merged commit 3902fb9 into develop Apr 19, 2018
@arottersman arottersman deleted the arr/subbasin-show-huc12s-on-map branch April 19, 2018 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants