Ok I follow what you are saying about having to spoof the map-click. I have added two functions for enabling and disabling the handler.
I make a call to my enableKeyboardNavigationHandler function at the end of the showPoints function but the navigation doesnt work when the markers get added to the map. Also, with regards to your comment that closing the infoWindow causes a map click to occur, this isn't the case if you close the infoWindow by simply clicking the map again and not clicking the little 'x' button in the top right of the infoWindow. Refresh the page, add the markers, open a marker infoWindow then click anywhere on the map, not the little 'x' button and you will see what I mean! Sorry to be pain with this one, its been a nuisance to me for some time and I am very eager to resolve it. Cheers, Rob On Apr 27, 2:14 pm, Andrew Leach <[email protected]> wrote: > On Apr 27, 1:51 pm, parky128 <[email protected]> wrote: > > > Was there supposed to be a link to your example in your most reply? > > No: same link.http://www.acleach.me.uk/gmaps/keyboardhandler.htm > > > Weirdly though, if I hover over a marker to open the info window and > > then close that window, the keyboard navigation comes back! > > You click in the map when you close the infoWindow. > > > This is baffling me now. > > Spoof the map-click event to enable the handler; a click outside the > map (which my example also spoofs) disables the handler. So when you > click a button, you disable the handler. Clicking in the map enables > the handler. > > Because clicking the button to add the markers (or remove them) > disables the handler, you need to spoof the map-click which re-enables > it. That worked for me: entering > javascript:GEvent.trigger(document,"click", > {srcElement:document.getElementById("myMap"),target:document.getElementById("myMap"),nodeType: > 1}) > in the address bar re-enabled the handler. You could do that in your > code when you need it. > > It would probably be a good idea to have two functions, say > enableHandler() and disableHandler() which you can call when you need > them. > > -- > You received this message because you are subscribed to the Google Groups > "Google Maps API" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group > athttp://groups.google.com/group/google-maps-api?hl=en. -- You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
