Skip to content

Commit

Permalink
Merge pull request #133 from empowerplan/fix/distilled_popups
Browse files Browse the repository at this point in the history
Fix popups for distilled layers
  • Loading branch information
henhuy authored May 6, 2024
2 parents 27ecabd + f28f034 commit afb3039
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ and this project tries to adhere to [Semantic Versioning](https://semver.org/spe
- top wizard layout
- municipality borders and labels
- show potential layers if detail panel is open when revisiting settings menu
- popups for distilled layers

## [0.1.0] - 2024-03-19
### Added
Expand Down
7 changes: 4 additions & 3 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ def __getitem__(self, item): # noqa: D105, ANN001, ANN204
MAP_ENGINE_X_OFFSET = 1 # Defines how many tiles to the right are added at first level
MAP_ENGINE_Y_OFFSET = 1 # Defines how many tiles to the bottom are added at first level
MAP_ENGINE_MAX_DISTILLED_ZOOM = 13
DISTILL = env.bool("MAP_ENGINE_USE_DISTILLED_MVTS", False)

MAP_ENGINE_IMAGES = [
setup.MapImage("wind", "images/icons/map_wind.png"),
Expand Down Expand Up @@ -541,15 +542,15 @@ def __getitem__(self, item): # noqa: D105, ANN001, ANN204
popup_at_default_layer=True,
),
setup.Popup(
"rpg_ols_pv_ground_operating",
f"rpg_ols_pv_ground_operating{'_distilled' if DISTILL else ''}",
popup_at_default_layer=True,
),
setup.Popup(
"rpg_ols_pv_ground_approved",
f"rpg_ols_pv_ground_approved{'_distilled' if DISTILL else ''}",
popup_at_default_layer=True,
),
setup.Popup(
"rpg_ols_pv_ground_planned",
f"rpg_ols_pv_ground_planned{'_distilled' if DISTILL else ''}",
popup_at_default_layer=True,
),
setup.Popup(
Expand Down
1 change: 1 addition & 0 deletions digiplan/map/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def get_popup(request: HttpRequest, lookup: str, region: int) -> response.JsonRe
containing HTML to render popup and chart options to be used in E-Chart.
"""
map_state = request.GET.dict()
lookup = lookup.removesuffix("_distilled")
popup = popups.POPUPS[lookup](lookup, region, map_state=map_state)
return popup.render()

Expand Down

0 comments on commit afb3039

Please sign in to comment.