Opened 13 years ago

Closed 13 years ago

#380 closed defect (fixed)

Wheelmouse Zoom function doing it twice

Reported by: belug Owned by: adube
Priority: major Milestone: 1.2.0
Component: widgets Version: trunk
Keywords: zoom double wheel weelmouse Cc:

Description

In some examples the wheelmouse zoom is zooming twice.

Double zoom : http://geoprisma.org/samples/tms/index.php (without zoomSlider) http://geoprisma.org/samples/zoomslider/index.php (with zoomSlider)

Single zoom : http://geoprisma.org/samples/mapfishlayertree/index.php (without zoomSlider)

First I thought of a bug with zoomslider, but I've found a example without it.

For now I cannot find why.

Attachments (1)

mouseWheelOffForPan.diff (618 bytes ) - added by belug 13 years ago.
Turn off the zoomWheel on the pan action of the toolbar

Download all attachments as: .zip

Change History (4)

comment:1 by adube, 13 years ago

Component: sampleswidgets

Where

The issue comes from the MapPanel widget and only appears when the "pan" button is activated.

How

The issue is caused by 2 OpenLayers.Control.Navigation controls activated at the same time, one for the "pan" button, the other for the one created by the MapPanel widget itself and added to the Map.

Why

With the legacy Map widget, map navigation was not possible unless you clicked the "pan" button, which was pretty annoying. So, in the MapPanel widget, in order to solve this issue, a Navigation control was added by default. Now, since these two can be activated at the same time, it causes the "double zoom" issue when using the mouse scroll.

Solution

This could be quickly fixed by removing the "pan" button scroll zooming by setting its Navigation control "zoomWheelEnabled" property to false.

What do you think ?

comment:2 by belug, 13 years ago

Tested it with the fix proposed and it resolve the bug. But this fix make it not optionnal. This could be set as an optionnal parameter of the toolbar and by default false (To turn of the zoomWheelEnabled.

by belug, 13 years ago

Attachment: mouseWheelOffForPan.diff added

Turn off the zoomWheel on the pan action of the toolbar

comment:3 by adube, 13 years ago

Resolution: fixed
Status: newclosed

The fix disables zoom using the wheel when using the Map widget, but since it's deprecated it's okay to do so.

Fixed in r1247.

Note: See TracTickets for help on using tickets.