experiment: shade excluded Bezirke on map (faint yellow overlay)
Tints districts the user's Bezirk filter has EXCLUDED in light yellow
(#fde68a, fillOpacity 0.35) so the active selection is obvious from
the map alone — and you can see at a glance whether a "rausgefiltert"
flat fell in a no-go district. When no district filter is set the
overlay stays off entirely (nothing is excluded).
Wiring:
- Berlin Bezirke GeoJSON checked in at web/static/berlin-districts.geojson
(12 features, name property matches our DISTRICTS list 1:1, props
stripped down to {name} and minified — 312KB raw, ~80KB gzipped).
- Route exposes the user's selected_districts_csv to the template.
- The flats-map-data <script> carries it on data-selected-districts so
it flows in alongside csrf and the marker payload.
- map.js fetches the GeoJSON once (cache normally), keeps the layer in
a module-level reference, and re-styles it via setStyle() on every
swap (cheap). Marker layer is kicked to the front so pins always
paint above the shaded polygons. fingerprintOf now also folds in
the selected-districts CSV so a Bezirk-only filter change still
triggers a re-render.
Branch only — kept off main while we see if this reads well.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
85f5f364ed
commit
2ebbf76a80
4 changed files with 92 additions and 12 deletions
|
|
@ -128,12 +128,20 @@ def _wohnungen_context(user) -> dict:
|
|||
"can_apply": allowed and not already_applied,
|
||||
"is_running": is_running,
|
||||
})
|
||||
# Bezirke the user has narrowed to (CSV). Empty = no district filter, in
|
||||
# which case the map's "excluded districts" overlay stays off entirely.
|
||||
try:
|
||||
selected_districts_csv = (filters_row["districts"] if filters_row else "") or ""
|
||||
except (KeyError, IndexError, TypeError):
|
||||
selected_districts_csv = ""
|
||||
|
||||
return {
|
||||
"flats": flats_view,
|
||||
"rejected_flats": rejected_view,
|
||||
"filtered_out_flats": filtered_out_view,
|
||||
"partner": partner_info,
|
||||
"map_points": map_points,
|
||||
"selected_districts_csv": selected_districts_csv,
|
||||
"has_filters": _has_filters(filters_row),
|
||||
"alert_label": alert_label,
|
||||
"alert_chip": alert_chip,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue