A11y fixes from #3210 (#5092)

This commit is contained in:
Patrick Arlt 2016-11-11 17:17:49 -08:00 committed by Vladimir Agafonkin
parent 88d107ca96
commit ab31976c75
2 changed files with 12 additions and 0 deletions

View File

@ -79,6 +79,12 @@ L.Control.Zoom = L.Control.extend({
link.href = '#';
link.title = title;
/*
* Will force screen readers like VoiceOver to read this as "Zoom in - button"
*/
link.setAttribute('role', 'button');
link.setAttribute('aria-label', title);
L.DomEvent
.on(link, 'mousedown dblclick', L.DomEvent.stopPropagation)
.on(link, 'click', L.DomEvent.stop)

View File

@ -140,6 +140,12 @@ L.TileLayer = L.GridLayer.extend({
*/
tile.alt = '';
/*
Set role="presentation" to force screen readers to ignore this
https://www.w3.org/TR/wai-aria/roles#textalternativecomputation
*/
tile.setAttribute('role', 'presentation');
tile.src = this.getTileUrl(coords);
return tile;