Open ukiz opened 10 years ago
Wouldn't this change break the maxDelta functionality? (trigger a zoom for a large mousewheel movement even if the scroll timeout interval is still active).
The only change in the functionality is that - for a large mousewheel movement - instead of an immediate wheelZoom, another timeout interval is issued (so it will never break from the timeout interval). This behaviour seems ok to me, as long as it limits the maximum delta returned from the handler, which I see as the most important purpose of maxDelta.
Set up MouseWheel with {cumulative: true, interval: 50, maxDelta: 4}. When zooming with mouse wheel with a delta=5, the map eventually zooms with a delta=1 (while it should zoom with delta=maxDelta). Actually, zoomTo is called twice, first with delta=4 (as it should), then with delta=1 (from initial zoom level).
This can be observed in http://openlayers.org/dev/examples/mousewheel-interval.html - make sure to uncheck and then check again the cumulative option, as cumulative=false by default (so the example page shows wrong state initially) and then try to zoom with mouse wheel with a delta=7 - the map zooms in correctly first, but then back out.
Here is a solution that works for me: Handler.MouseWheel.js, line 190:
replace with: