WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: is there a way to make google maps accessible? Other recommended map software?

for

From: Bryan Garaventa
Date: Oct 29, 2012 2:33PM


Actually there is a much simpler way to do this.

The following jQuery script enables keyboard functionality for both keyboard
and screen reader users.

setTimeout(function(){
$(MapNode).find('div[title="Show street map"], div[title="Show street map
with terrain"], div[title="Show satellite imagery"], div[title="Zoom in to
show 45 degree view"], div[title="Show imagery with street names"],
div[title="Pan up"], div[title="Pan down"], div[title="Pan left"],
div[title="Pan right"], div[title="Return to the last result"],
div[title="Zoom in"], div[title="Zoom out"], img[title="Rotate map 90
degrees"]').each(function(i, o){
$(o).attr({
role: 'button',
tabindex: '0',
'aria-label': o.title
}).bind('keydown', function(ev){
if (ev.which == 13){
ev.preventDefault();
$(o).trigger('click');
}
});
});
}, 3000);

This is what I use on my own accessible Google Map at
http://whatsock.com/
(Located on the Live Demo tab.) which I've tested using IE8-9 and FF.

Since the Google Map API still doesn't appear to provide a callback for when
the rendering of controls completes loading, setTimeout is used instead. If
this callback has been added, please correct me.

Since these attribute changes don't actually have any impact on layout,
Google could add them to the API right now and then all Google maps
everywhere would automatically be accessible for both keyboard and screen
reader users.

----- Original Message -----
From: "Patrick H. Lauke" < <EMAIL REMOVED> >
To: < <EMAIL REMOVED> >
Sent: Monday, October 29, 2012 6:10 AM
Subject: Re: [WebAIM] is there a way to make google maps accessible? Other
recommended map software?


On 29/10/2012 12:55, Sandy wrote:
> hello all,
>
> I am working on a site that has an embedded google map, and it seems to
> be pretty hard to use without a mouse.
>
> Is there some kind of plugin that helps this work? Can anyone recommend
> a map that I can embed that will do better?

I wrote a little something back in 2008 about hacking the original maps
control to be kbd accessible.
http://dev.opera.com/articles/view/keyboard-accessible-google-maps/

Things have probably changed quite a bit behind the scenes, but it may
still be useful as a starting point.

P
--
Patrick H. Lauke
re·dux (adj.): brought back; returned. used postpositively
[latin : re-, re- + dux, leader; see duke.]

www.splintered.co.uk | www.photographia.co.uk
http://redux.deviantart.com | http://flickr.com/photos/redux/
twitter: @patrick_h_lauke | skype: patrick_h_lauke