[OpenLayers-Users] OpenLayers accessibility
William Martin
williammartin at mail.und.nodak.edu
Fri Aug 20 16:40:36 EDT 2010
All,
Is there any way, short of rolling a custom variant, to make OpenLayers add ALT text to its images?
Currently the tile images I'm getting are added something like this:
<img
style="width: 256px; height: 256px; position: relative;"
src="{URL snipped}"
class="olTileImage"
id="OpenLayersDiv2089">
When my screen reader encounters that, it reads the URL for the image, which is:
http://opencache.statkart.no/gatekeeper/gk/gk.open?LAYERS=topo2&FORMAT=image%2Fjpeg&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=0,56.25,11.25,67.5&WIDTH=256&HEIGHT=256
Keep in mind that it's reading this aloud, so somethin like "1.25" comes out as "one point two five". Multiply that pain by 34 for the initially loaded tiles.
Then the map controls have HTML like this:
<img
id="OpenLayers.Control.PanZoomBar_2159_panup_innerImage"
style="position: relative; width: 18px; height: 18px;"
src="http://openlayers.org/api/img/north-mini.png">
Again, a screen reader reads the contents of the SRC attribute because there's no ALT text.
Maps are inherently visual/spatial, and therefore of little use to a blind visitor. I'd like to set blank ALT text on all the images, thus:
<img
style="width: 256px; height: 256px; position: relative;"
src="{URL snipped}"
class="olTileImage"
id="OpenLayersDiv2089"
alt="">
... which will cause screen readers to silently skip over the image. Then I'd add ALT text for the entire map:
<div id="access-note">Image: Map of Norway.</div>
<div id="map">{OpenLayers would fill in the map here}</div>
That way, any blind visitors would be told that there's a map of Norway there, but not troubled with endless, mindless recitations of image SRC attributes for a map they can't use. All of my site's content is actually available without the maps -- the maps are a useful navigational interface, but all the actual site content can be read without them.
So, can I make it add blank ALT text to the tile and control images?
Will Martin
More information about the Users
mailing list