Skip to content

Commit

Permalink
Merge pull request #161 from empowerplan/fix/choropleth_revisit
Browse files Browse the repository at this point in the history
Choropleth is reactivated when revisiting status quo
  • Loading branch information
nesnoj authored Oct 8, 2024
2 parents 84e30f2 + aae4636 commit 7d1c814
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project tries to adhere to [Semantic Versioning](https://semver.org/spe
### Fixed
- 404 errors for missing MVTs
- truncated tooltips
- choropleth is reactivated when revisiting status quo

### Changed
- improve accessibility
Expand Down
11 changes: 10 additions & 1 deletion digiplan/static/js/menu.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { resultsTabs, futureDropdown } from "./elements.js";
import { resultsTabs, statusquoDropdown, futureDropdown } from "./elements.js";
import { terminateSimulation } from "./results.js";
import { hidePotentialLayers, showPotentialLayers } from "./sliders.js";

Expand Down Expand Up @@ -57,6 +57,7 @@ PubSub.subscribe(
);
PubSub.subscribe(eventTopics.MENU_STATUS_QUO_SELECTED, hidePotentialLayers);
PubSub.subscribe(eventTopics.MENU_STATUS_QUO_SELECTED, hideEmpowerplanContent);
PubSub.subscribe(eventTopics.MENU_STATUS_QUO_SELECTED, reactivateChoropleth);
PubSub.subscribe(eventTopics.MENU_SETTINGS_SELECTED, setMapChartViewVisibility);
PubSub.subscribe(eventTopics.MENU_SETTINGS_SELECTED, deactivateChoropleth);
PubSub.subscribe(eventTopics.MENU_SETTINGS_SELECTED, terminateSimulation);
Expand Down Expand Up @@ -188,3 +189,11 @@ function hideEmpowerplanContent(msg) {
map.resize();
return logMessage(msg);
}

function reactivateChoropleth(msg) {
const choropleth = statusquoDropdown.value;
if (choropleth !== "") {
PubSub.publish(mapEvent.CHOROPLETH_SELECTED, statusquoDropdown.value);
}
return logMessage(msg);
}

0 comments on commit 7d1c814

Please sign in to comment.