Appearance
Accessibility
The European Accessibility Act asks for WCAG 2.2 level AA for most web shops and services. A store locator is part of that: a visitor has to be able to find a store without a mouse, without seeing the map and without loading it.
The locator tag
The locator tag is made for WCAG 2.2 AA, see its accessibility. With your own layout or template in the locator tag, check the list below for the parts you changed.
Your own templates
With the search_form and search_result tags (or the radius and query tags) you write the HTML yourself, so it is as accessible as your template. The tags help where they can:
- The
search_formtag outputs the form withrole="search", so a screen reader can jump to it. - The variables are HTML-escaped, so they are safe in your HTML and in the params of the map tag.
- The map tag of Maps has a skip link, a name for screen readers (
aria:label) and a list of the markers as text (list="yes"), see the map tag.
The store locator example follows the list below.
Checklist
| WCAG | Check |
|---|---|
| 1.1.1 | An image in your template has an alt text, an icon only for decoration has alt="" |
| 1.3.1 | Every field has a <label> (a placeholder is not a label), a group of checkboxes is in a <fieldset> with a <legend>, the results are a list (<ol> or <ul>) and the headings fit in the headings of the page |
| 1.3.2, 2.4.3 | The list comes before the map in the HTML, or the map has a skip link: a visitor with the keyboard reaches the results without going through the map |
| 1.4.1 | Open now, closed or a featured store is a text, not only a colour |
| 1.4.3 | Text has a contrast of 4.5:1 to its background (3:1 for large text) |
| 1.4.10 | The form, the list and the map fit below each other on a small screen (320 pixels wide), without scrolling sideways |
| 1.4.11 | The borders of the fields, the checkboxes and the focus outline have a contrast of 3:1 |
| 2.1.1 | Everything works with the keyboard: use <button> and <a href>, not a <div> with a click event |
| 2.4.4 | A link says where it goes (e.g. Directions to Bike Center Utrecht, or Directions in the item of that store) |
| 2.4.6 | The results have a heading with the number of results, e.g. 6 stores within 25 km of Utrecht |
| 2.4.7 | Your CSS doesn't hide the focus outline (outline: none without another focus style) |
| 2.5.8 | Buttons, links and checkboxes are at least 24 by 24 pixels, or have enough space around them |
| 3.2.2 | Checking a checkbox doesn't search by itself, the visitor searches with the button (or tell the visitor that it does) |
| 3.3.1 | A location that can't be found gives a text that says so, e.g. with {if no_results} |
| 3.3.2 | The search field says what to type, e.g. City, postal code or address |
| 4.1.3 | A result that changes without a page load (your own Javascript, e.g. with the JSON endpoint) is in a live region (role="status") |
And for links to other sites, e.g. Get directions with target="_blank": tell the visitor that it opens a new tab, e.g. with a text that is only for screen readers.
Paging
With a page load per page of results, add the id of the results heading to the paging links ({pagination_url}#results). The browser then goes to the results on the new page and a screen reader starts there, instead of at the top of the page.
Consent
When the map waits for consent, the list has to work without it: keep the results out of the map tag's consent placeholder and don't make the list depend on the map. In the store locator example the list is in the map tag, but it is output by the search_result tag on the server, so it is there before the map is loaded.
