[OpenLayers-Users] openlayers 2.12rc5 & KeyboardDefaults

Eric Lemoine eric.lemoine at camptocamp.com
Tue Jun 5 02:20:40 PDT 2012


On Tue, Jun 5, 2012 at 11:09 AM, Eric Lemoine
<eric.lemoine at camptocamp.com> wrote:
> On Tue, Jun 5, 2012 at 10:30 AM, Marcelo Bianchi
> <mbianchi at gfz-potsdam.de> wrote:
>> Dear List,
>>
>> There looks like to be a issue with the release 2.12/rc5 when using the
>> KeyboardDefaults control on the map.
>>
>> When I added this control to the map, I am unable to type any "-" or "+" on
>> any form element of my page.
>>
>> Maybe this was triggered by the commits related to this improvement.
>>
>> https://github.com/openlayers/openlayers/pull/222
>>
>> but the side effects are quite bad.
>>
>> The code I am using to trigger the problem is attached.
>> I tested the code with opera/firefox/google-chrome and the result is the
>> same.
>>
>> regards,
>
>
> Is the problem new with 2.12?

I just did some tests. With 2.11 pressing the plus key when the text
field has the focus both zooms the map and adds "+" to the field. With
2.12 the map zooms but "+" is not added to the field.

With 2.12 you can reach a behavior that is better than with 2.11. Use
the following:

new OpenLayers.Control.KeyboardDefaults({observeElement: 'map'})]}

and

<div id="map" tabindex="0" style="margin: 0px; width: 100%; height:
250px; border: 1px Solid black;"></div>

(note the tabindex attribute)

With this the map will zoom/dezoom only when the map has the focus.
See the accessible.html example for more information.

I hope this addresses your problems.




-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com


More information about the Users mailing list