Change default zoom delta and animate mousewheel zoom #261

merged 15 commits into from Mar 5, 2013


None yet
3 participants

elemoine commented Mar 4, 2013

This PR basically suggests three changes:

  • Change the default resolution constraint to snap to the OSM resolutions instead of having intermediate zoom steps between the OSM resolutions. See #219.
  • Animate zooms and pans triggered by the mousewheel interaction.
  • Debounce mousewheel events for better performance and preventing very fast zooms when using the mousewheel and the trackpad.

These changes can be tested on

Please test and review.


twpayne commented Mar 4, 2013

This works really nicely with both the trackpad and the mousewheel on Mac OS X.


elemoine commented Mar 4, 2013

Thanks @twpayne.

I just added a few commits (from @fredj and me):

  • fa63a01 renames View2D functions for consistency reasons
  • 39f60d7 and 0602a47 introduce a rotationNoConstraint function and make the TouchRotate interaction use that function
  • 42ffb12 adds a snapToZero rotation constraint and uses it by default has the latest code.


fredj commented Mar 4, 2013

on mobile device, the double tap zooms too much


elemoine commented Mar 4, 2013

Thanks @fredj. I also found other issues. Needs more work then.


elemoine commented Mar 4, 2013

Just added more commits:

  • febadbf makes the DragRotate interaction use rotateNoConstraint not to apply the rotation constraint while rotating, which is consistent with wat the TouchRotate interaction does.
  • f64749b and 6c65aea animate the rotation when the mouse or fingers are released.
  • 3ab36d3 and f3c808e animate the final zoom after pinching.

This PR now includes lots of improvements to our interactions. This can all be tested on

Tomorrow, @fredj and I will look into fixing the nasty pans that sometimes (often!) occur after pinching. This will be done with a separate PR.


elemoine commented Mar 5, 2013

Just added animated double click/tap zooming. Refs #132.

@fredj, could you please take another look at this PR before merging? Thanks.


fredj commented Mar 5, 2013

We probably don't want to change examples/wms-custom-proj.js but it's good to merge.


elemoine commented Mar 5, 2013

The change to wms-custom-proj.js makes sense since we now use the OSM resolutions by default.

As discussed with Tom I'll change from the zoomNoConstraint to zoomWithoutConstraints before merging.

elemoine pushed a commit that referenced this pull request Mar 5, 2013

Merge pull request #261 from elemoine/zoomfactor
Change default zoom delta and animate mousewheel zoom

@elemoine elemoine merged commit 98f9f44 into openlayers:master Mar 5, 2013

@elemoine elemoine deleted the elemoine:zoomfactor branch Mar 5, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment