jawj / OverlappingMarkerSpiderfier-Leaflet

Deals with overlapping markers in the Leaflet maps API, Google Earth-style
253 stars 68 forks source link

spiderify markers ADA accessibility #27

Open MuellerMatthew opened 8 years ago

MuellerMatthew commented 8 years ago

I have been working on making my maps more accessible to users with screen readers and users who navigate via keyboards, and one issue I have noticed is that when I am using OMS, some of the functionality is not not very accessible.

When I 'tab' to a marker which is overlapping with other markers, and press 'enter' the overlapping markers spiderify, and my focus remains on the original marker which is great, but when I start tabbing again, the focus shifts off of the spiderified markers to other markers on the screen. Additionally, there is currently no way to unspiderify the markers when they are spiderified(pressing 'enter' spiderifies, but we need another key option to unspiderify).

I think 2 improvements which we could make to this plugin which would make it more accessible is to:

  1. Add a default event handler to the 'esc' key when markers are spiderified which unspiderifies markers.
  2. When markers are spiderified maintain the focus to the spiderified markers by preventing the other markers on the map from being getting focus from tabbing. Tabbing can be used to navigate between the spiderified markers in a clockwise order until the markers are unspiderified when the focus can again shift to the other markers on the map. Additionally if a spiderified marker has the focus the 'left' and 'right' arrow keys should also be usable to allow users to switch between spiderified markers, while the up and down keys should be able to spiderify and unspiderify.