New MouseWheelZoom behavior
See original GitHub issueDescribe the bug The old MouseWheelZoom behavior was, to only stop at the predefined resolutions. Now, when zooming multiple ticks at once, I end up at intermediate levels. Additionally it wont ever realign with the predefined resolutions.
To Reproduce Steps to reproduce the behavior:
- Go to ‘https://www.geoportal.ch/iggis/map/40?y=2738843.52&x=1249912.36&scale=100000’
- Zoom in a few ticks with the mousewheel. Notice the scale (bottom center of the page) will show not align with pre-defined levels in the dropdown.
Expected behavior
Zooming a few ticks should end at a predefined resolution, even without constrainResolution: true
. An acceptable solution would be, to at least realign with predefined resolutions when zooming one tick again.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
MouseWheelZoom (3D 1.5.2)
Creates a zoom behavior that uses AWT listeners and behavior posts rather than WakeupOnAWTEvent. MouseWheelZoom(java.awt.Component c, TransformGroup ...
Read more >d3.behavior.zoom dynamic offset of mousewheel zoom center
Does anyone know how to dynamically modify the center property of d3.behavior.zoom in order to mousewheel zoom to a point offset from mouse...
Read more >Make mouse wheel zoom in Inkscape (scroll wheel ... - YouTube
0:00 · New ! Watch ads now so you can enjoy fewer interruptions. Got it.
Read more >Disable Mousewheel Zoom Functionality in the Map - Public KB
If you need to disable scroll wheel zoom in the map or enable other specific behavior, you can use the functionality of HERE...
Read more >Leaflet mouse wheel zoom only after click on map
scrollWheelZoom.enable(); } });. May result in some unexpected behaviour once the user starts actually using the map. I would suggest something that ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Today I gave it a go to make MouseWheelZoom behave the way I want. It’s not thoroughly tested as of yet, but here’s what I ended up with. I copied a lot from
ol/interaction/MouseWheelZoom
, deleted what I didn’t understand 😉 and inlinedzoomByDelta
in order to round the current zoom level.I also saw the
constrainResolution
in in the latest development version, but I don’t think this would do the trick.Using the new constraints system, you should be able to write your own interaction that behaves exactly like you desire. When you use the latest
ol@dev
,constrainResolution: true
has a much improved behaviour over v6.2.1. See https://openlayers.org/en/master/examples/pinch-zoom.html.