Merge pull request #6101 from tschaub/wheel-zoom
Avoid starting new zoom animation while already animating
This commit is contained in:
@@ -133,13 +133,14 @@ ol.interaction.MouseWheelZoom.handleEvent = function(mapBrowserEvent) {
|
|||||||
* @param {ol.Map} map Map.
|
* @param {ol.Map} map Map.
|
||||||
*/
|
*/
|
||||||
ol.interaction.MouseWheelZoom.prototype.doZoom_ = function(map) {
|
ol.interaction.MouseWheelZoom.prototype.doZoom_ = function(map) {
|
||||||
var maxDelta = ol.MOUSEWHEELZOOM_MAXDELTA;
|
|
||||||
var delta = ol.math.clamp(this.delta_, -maxDelta, maxDelta);
|
|
||||||
|
|
||||||
var view = map.getView();
|
var view = map.getView();
|
||||||
|
|
||||||
ol.interaction.Interaction.zoomByDelta(map, view, -delta, this.lastAnchor_,
|
if (!view.getAnimating()) {
|
||||||
this.duration_);
|
var maxDelta = ol.MOUSEWHEELZOOM_MAXDELTA;
|
||||||
|
var delta = ol.math.clamp(this.delta_, -maxDelta, maxDelta);
|
||||||
|
ol.interaction.Interaction.zoomByDelta(map, view, -delta, this.lastAnchor_,
|
||||||
|
this.duration_);
|
||||||
|
}
|
||||||
|
|
||||||
this.delta_ = 0;
|
this.delta_ = 0;
|
||||||
this.lastAnchor_ = null;
|
this.lastAnchor_ = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user