[GIS] How to make zooming for OpenStreetMap in OpenLayers more sensitive to mouse wheel scrolling

openlayers-2openstreetmap

I have been testing OpenLayers for a while and I notice that the scrolling on OpenStreetMap layer does not make the map zoom in or out as much as I would like it to be. On most occasions, I am only able to zoom in or out by only one level at a time, regardless of the scroll clicks. However, when the base layer is switched to Google Maps, I am able to zoom in and out more with more scroll clicks. You can see the difference with this example.

At first, I thought this could be due to some inherent problem with OpenStreetMaps, but after testing its own map on the main site, there seem to be no problem with zooming through multiple levels with a mouse scroll. Am I missing something in the OpenLayers control setting to enable such responsive scrolling behaviour?

Best Answer

The documentation doesn't say much about this, but if you examine the script, there is a mousewheel interval option:

/**
 * Property: interval
 * {Integer} In order to increase server performance, an interval (in 
 *     milliseconds) can be set to reduce the number of up/down events 
 *     called. If set, a new up/down event will not be set until the 
 *     interval has passed. 
 *     Defaults to 0, meaning no interval. 
 */
interval: 0,

This value can be changed by setting the following when declaring map controls:

new OpenLayers.Control.Navigation(
 {mouseWheelOptions: {interval: 500}}
);
Related Question