[OpenLayers-Users] mousewheel jumps two zoom levels

Vidal, Antoni antoni.vidal at icc.cat
Fri Jan 27 08:28:16 EST 2012


Hi,

Yes Andreas, using console as you said, I get two navigation controls, one added to map as a control, and a seccond added as a geoext action to get a pan button in the toolbar.

I've dropped the seccond because is not necesary.

Anyway, I've configured control with: mouseWheelOptions: {interval: 20, cumulative: false}

Best regards,

Antoni Vidal
Unitat d'Aplicacions SIG-WEB
Institut Cartogràfic de Catalunya
Parc de Montjuïc, E-08038 Barcelona
Tel. (+34) 93 567 15 00 (ext. 3228)
www.icc.cat



-----Missatge original-----
De: andreas.hocevar at gmail.com [mailto:andreas.hocevar at gmail.com] En nom de Andreas Hocevar
Enviat: jueves, 26 de enero de 2012 16:25
Per a: Vidal, Antoni
A/c: openlayers-users at lists.osgeo.org
Tema: Re: [OpenLayers-Users] mousewheel jumps two zoom levels

My guess is that you have two Navigation controls. One that is added to the map by default unless you configure it with your custom array of controls, and the navControl you added.

You can check in the javascript console by trying

map.getControlsByClass("OpenLayers.Control.Navigation");

and see if it returns an array of length 1 or 2.

The obvious fix is to configure the map with your own default set of controls.

Andreas.

On Thu, Jan 26, 2012 at 3:29 PM, Vidal, Antoni <antoni.vidal at icc.cat> wrote:
> Hi list,
>
>
>
> I've an OpenLayers.control.Navigation with following config options:
>
>
>
>         var navControl = new OpenLayers.Control.Navigation({
>
>             type: OpenLayers.Control.TYPE_TOGGLE,
>
>             zoomWheelEnabled: true,
>
>             mouseWheelOptions: {interval: 1}
>
>         });
>
>
>
> But when user changes map zoom level using mousewheel, map zoomlevel 
> jumps from 0 to 2 and then to 4, etc.
>
>
>
> Is possible to change this behaviour and force change zoomlevel one by one ?
>
>
>
> Thanks in advance.
>
>
>
> Antoni Vidal
>
> Unitat d'Aplicacions SIG-WEB
> Institut Cartogràfic de Catalunya
> Parc de Montjuïc, E-08038 Barcelona
> Tel. (+34) 93 567 15 00 (ext. 3228)
> www.icc.cat
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>



--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.


More information about the Users mailing list