Commit Graph

8 Commits

Author SHA1 Message Date
Tom Byers
23f0bb096e Add accessible name and description to map
The map is already in the tabbing order, so can be
moved to by tabbing and by programs like screen
readers or speech recognition, but it doesn't have
an accessible name so when assistive tech' that
requires this for identification gets the contents
read out instead, which is confusing.

This adds an accessible name, via aria-label, made
out of the areas the alert targets.

This also adds some help text, explaining how to
use the map via aria-describedby. This is a pretty
common pattern and is used in native UI like
selectboxes where a range of commands are
available to control the UI 'widget'. Using
aria-describedby means the help text is not used
every time the widget is focused but is available
if the user gets stuck. For example, Voiceover
announces it if the widget is focused but
not interacted with for a period of time, or when
a shortcut key is pressed.

Finally, I also added a role of 'region' because
when I tested with the NVDA screen reader, the
accessible name wasn't announced but this fixed
that. I think it's because the div isn't being
recognised as having a role without it being set
explicitly and is therefore ignored.
2021-08-27 13:49:49 +01:00
Chris Hill-Scott
738ac1d818 Vary bleed amount based on population density
There are basically two kinds of 4G masts:

Frequency | Range       | Bandwidth
----------|-------------|----------------------------------
800MHz    | Long (500m) | Low (can handle a bit of traffic)
1800Mhz   | Short (5km) | High (can handle lots of traffic)

The 1800Mhz masts are better in terms of how much traffic they can
handle and how fast a connection they provide. But because they have
quite short range, it’s only economical to install them in very built up
areas†.

In more rural areas the 800MHz masts are better because they cover a
wider area, and have enough bandwidth for the lower population density.

The net effect of this is that cell broadcasts in rural areas are likely
to bleed further, because the masts they are being broadcast from are
less precise.

We can use population density as a proxy for how likely it is to be
covered by 1800Mhz masts, and therefore how much bleed we should expect.
So this commit varies the amount of bleed shown based on the population
density.

I came up with the formula based on 3 fixed points:
- The most remote areas (for example the Scottish Highlands) should have
  the highest average bleed, estimated at 5km
- An town, like Crewe, should have about the same bleed as we were
  estimating before (1.5km) – Pete D thinks this is about right based on
  his knowledge of the area around his office in Crewe
- The most built up areas, like London boroughs, could have as little as
  500m of bleed

Based on these three figures I came up with the following formula, which
roughly gives the right bleed distance (`b`) for each of their population
densities (`d`):
```
b = 5900 - (log10(d) × 1_250)
```

Plotted on a curve it looks like this:

This is based on averages – remember that the UI shows where is _likely_
to receive the alert, based on bleed, not where it’s _possible_ to
receive the alert.

Here’s what it looks like on the map:

---

†There are some additional subtleties which make this not strictly true:
- The 800Mhz masts are also used in built up areas to fill in the gaps
  between the areas covered by the 1800Mhz masts
- Switching between masts is inefficient, so if you’re moving fast
  through a built up area (for example on a train) your phone will only
  use the 800MHz masts so that you have to handoff from one mast to
  another less often
2021-03-18 09:37:23 +00:00
Chris Hill-Scott
3f338d45ca Rename CSS classes for consistency
This prefixes everything to do with areas/the map with `area-list`, so
from looking at one element you know which `.scss` file will contain the
relevant code.
2020-10-12 15:53:09 +01:00
Chris Hill-Scott
3c7364408b Make selected areas more tag-like
I’ve never liked the style of the selected areas on the preview of a
broadcast message. They were a compromise, taking what’s on the map page
and giving it a shaded background so it looks less like a text box.

The trouble is all these stroked elements jumbled together made the page
look very busy. I think it can be a bit calmer if they look more like
the ‘tag’ component[1] from the Design System, which only uses shading.

Going for black text not blue, because it’s one less piece of visual
differentiation – again, trying to keep the busyness level down.

1. https://design-system.service.gov.uk/components/tag/
2020-10-12 15:53:09 +01:00
Chris Hill-Scott
f79a5ca020 Style ‘likely’ area with a dashed line
We’ve had some feedback that relying only on luminosity and position to
differentiate between the ‘will get alert’ and ‘likely to get alert’
areas on the map might not be enough.

We don’t want to introduce another colour because:
- it will make the map look very busy
- not many other colours contrast with the map tiles as well as blue
- relying on colour only to communicate information is also bad for
  accessibility

Instead we can make one of the lines a different style. I’ve gone for
dashed on the ‘likely’ line because it looks nice, and gives some
suggestion of a porous boundary.

Implementing this means using CSS border image, because a `dashed`
border (which we still have as a fallback) doesn’t render with
consistent dash sizes from browser to browser. We need consistency to
match the dashes that the map will be drawing (which use SVG not CSS
so don’t have the same problem).
2020-09-24 16:15:31 +01:00
Chris Hill-Scott
0369472a76 Add a key to the map
To help people understand that broadcasting is not a precise technology,
we have shown the estimate bleed area on the map.

Because people aren’t familiar with the technology a visual only clue is
not enough. So this commit adds a key to the map, which explains what
the different outlines mean.

It also removes the sticky footer from this page to:
- make the key visible on the page
- make people scroll and review the map before they get to the big green
  button
- not reduce the size of the map any further
2020-09-08 16:44:49 +01:00
David McDonald
be563e73c6 Add map in details to broadcast view
Avoided using `closest` as not supported by IE8-11
https://caniuse.com/#search=closest

Used `parentElement` supported by IE9+
https://caniuse.com/#search=parentElement

Used `className` as supported by IE9+
https://caniuse.com/#search=className

Also rearranged the javascript for maps such that figuring out the
polygon array is done first and then the time when we need to have the
details component open before closing it again is kept to minimum
2020-09-04 10:20:54 +01:00
David McDonald
32a794aacd Move styling into separate files for reuse 2020-09-03 10:50:58 +01:00