Map Page Enhancements - December 18, 2025¶
Updates to /maps page to support cbdistricts API changes and improve user experience.
Changes¶
1. Data Freshness Display¶
- Shows "Districts: YYYY-MM-DD" in the map header when data loads
- Uses new
versionandupdatedfields from/api/v1/layersendpoint
2. Cache Invalidation¶
- Tracks
updatedtimestamp in localStorage - Automatically clears layer cache when district data is updated on the server
- Prevents stale data from persisting across sessions
3. Michigan District Names¶
- Updated
getDisplayName()to prefernamelsadproperty - Supports MICRC (Michigan Independent Citizens Redistricting Commission) data format
- Falls back to
nameproperty ifnamelsadnot available
4. Party Color Fill Fix¶
- Changed fill-color expression from
casetomatchsyntax - Matches pattern used by cbdistricts for consistency
- Colors: Republican (#E91D0E), Democrat (#232066), default (#9ca3af)
Technical Details¶
Fill color expression (before):
['case',
['==', ['get', 'party'], 'Republican'], '#E91D0E',
['==', ['get', 'party'], 'Democrat'], '#232066',
'#9ca3af']
Fill color expression (after):
Related¶
- cbdistricts API changes:
cbdistricts/docs/API-CHANGES-20251218.md - New layers:
michigan-congressional, updated Michigan state layers with MICRC source