Reputation: 1685
I built an OpenLayers 3 map. I love it, but I feel that the zooming is too fast. I can't find a way to slow it down. A longer animation duration and/or a fractional-zoom approach (zooming by less than 1 for each event) would help. How can I implement these changes?
Upvotes: 2
Views: 857
Reputation: 14150
You can customize the duration
property on ol.control.Zoom
, ol.interaction.MouseWheelZoom
, ol.interaction.DoubleClickZoom
and ol.interaction.KeyboardZoom
:
var duration = 1000; // 1 second
map.addControl(new ol.control.Zoom({
duration: duration
}));
map.addInteraction(new ol.interaction.MouseWheelZoom({
duration: duration
}));
map.addInteraction(new ol.interaction.DoubleClickZoom({
duration: duration
}));
map.addInteraction(new ol.interaction.KeyboardZoom({
duration: duration
}));
Upvotes: 3