-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Allow choropleth to be toggled on and off #168
Conversation
nextjs/src/app/reports/[id]/(components)/MapLayers/PoliticalChoropleths.tsx
Outdated
Show resolved
Hide resolved
…wDataVisualisation property to dataVisualisation in ReportConfig
…edTypes state with the current checked value
…nent and show choropleth fill if it is true
{showChoropleth && ( | ||
<> | ||
<Layer | ||
beforeId="road-simple" | ||
id={`${tileset.mapboxSourceId}-fill`} | ||
source={tileset.mapboxSourceId} | ||
source-layer={tileset.sourceLayerId} | ||
type="fill" | ||
filter={getChoroplethFillFilter(dataByBoundary, tileset)} | ||
paint={getChoroplethFill( | ||
dataByBoundary, | ||
visibility === 'visible' | ||
)} | ||
/> | ||
</> | ||
)} |
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 will change the layer order in ways that might break the visualisation.
There is already a const visibility
statement further up. Let's just add an extra condition into that instead.
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.
done now I think
Description
This PR adds an option to select None in the Type dropdown in the Data Visualisation section to turn off the choropleth
Motivation and Context
Addresses issue MAP-711
How Can It Be Tested?
Download the branch and run locally
Create a map or navigate to an existing one
Go to configuration tab and select None under Type in Data Visualisation
Observe that selecting None turns off the choropleth (and reselecting Chropleth toggles it back on again)