Minor Fix
I doubt anyone noticed but the panel icons occasionally didn’t match the map icons in terms of the severity colour. Instead of trying to track the source of the error I rewrote the icon selection code using the Python dict() data structure. The upshot is that instead of having many lines of IF..THEN..ELSE statements I have reduced it to
iconMap = ICON_MAP[message.filter][severity]
Where the message.filter values is the type of event e.g roadworks etc.
The map is built like so:
ICON_MAP = dict()
ICON_MAP[ROADWORKS] = dict()
ICON_MAP[ROADWORKS][TEXT_SEVERE]=URL_MAP_SEVERE_ROADWORKS
ICON_MAP[ROADWORKS][TEXT_MEDIUM]=URL_MAP_MEDIUM_ROADWORKS
ICON_MAP[ROADWORKS][TEXT_SLIGHT]=URL_MAP_SLIGHT_ROADWORKS
Remaining todos:
- Fix the formatting of the region elements in the panel under Firefox. I havn’t a clue why this weird shift to the left has started but it is a bit of a pain.
- Fix format of page under IE.
Comments
Leave a Reply