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

Change cursor to "not allowed" when hovering over nonclickable area #77

Merged
merged 4 commits into from
May 12, 2023

Conversation

cstephen
Copy link
Contributor

Closes #72.

This PR changes the mouse cursor to the "not allowed" cursor when it hovers outside of the clickable area.

To implement this, I also needed to generate a GeoJSON polygon of the selectable AOI perimeter to load into Leaflet so it would know what area was clickable. I've added the GeoJSON generating script to scripts/boundary.py and added instructions about how to run it to the main repo README, along with some documentation about how the shadow mask was generated since that had not yet been documented either, but is very related.

To test, load the app, verify that you see the "nope" sign when you hover outside of the clickable area, and make sure the app still works like before in other respects.

@cstephen cstephen requested a review from brucecrevensten May 11, 2023 23:24
@@ -11,7 +11,7 @@ Data for this project was provided in CSV format. This repo includes a preproces
- Omit blank and infinite values
- Optimize data by removing unused fields and rounding to sensible digits

To generate the needed JSON files, download the five CSV data files from [Google Drive](https://drive.google.com/drive/folders/1hrGuRmQtx-gTepN_H9BEfcGmnl5MCeAK?usp=sharing) and store them in `scripts/input`. Then run the following commands to convert them to JSON:
To generate the needed JSON files, download the five CSV data files from [Google Drive](https://drive.google.com/drive/folders/1hBjKEYzRPY7qQlbnqyMaYRMZSuMtIABB?usp=sharing) and store them in `scripts/input`. Then run the following commands to convert them to JSON:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this PR, but we probably will want to pull this reference out to a stand-along (non-Google) location after we launch to decouple changes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is #80


# Get the boundary (perimeter) of entire set of AOIs.
gdf = gpd.GeoDataFrame(
gpd.GeoSeries(unary_union(gdf.geometry.values)), columns=["geometry"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, and, I think we should merge this now but we need to update it after the polygon simplification is done (#73)

@brucecrevensten brucecrevensten merged commit 768894c into main May 12, 2023
@brucecrevensten brucecrevensten deleted the adaptive_map_cursor branch May 12, 2023 02: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.

Change hover icon to be "no click" when outside of AOI polygon on search map
2 participants