I'm trying to override it 'cause it's so dang sensitive. Bonus points if you can also demonstrate a elegant way to override, but, well, I can probably figure that out.
[GIS] How to disable mouse scroll zoom in OpenLayers 3
openlayersopenlayers-2
openlayersopenlayers-2
I'm trying to override it 'cause it's so dang sensitive. Bonus points if you can also demonstrate a elegant way to override, but, well, I can probably figure that out.
Best Answer
Simplest way I've found is to set the interaction defaults to false when you instantiate your map like so:
Then once it is disabled you will need to provide your own functions to zoom on mouse scroll. Something like this should do the trick:
This is what I use to prevent the scroll wheel from zooming all the way in or out too rapidly. However it relies on you creating a function _panAndZoom(map,zoom_in, coordinates) and setting the lastScrollZoom and scrollDelta settings in your app.
This is my _panAndZoom function: