From b533cad031919a0731c2ea519443317ef0d92055 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Mon, 7 Oct 2013 15:47:16 +0200 Subject: [PATCH] Only install animations if duration > 0 --- src/ol/interaction/interaction.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ol/interaction/interaction.js b/src/ol/interaction/interaction.js index 99978dc5a7..ffb2e7bf70 100644 --- a/src/ol/interaction/interaction.js +++ b/src/ol/interaction/interaction.js @@ -35,7 +35,7 @@ ol.interaction.Interaction.pan = function( map, view, delta, opt_duration) { var currentCenter = view.getCenter(); if (goog.isDef(currentCenter)) { - if (goog.isDef(opt_duration)) { + if (goog.isDef(opt_duration) && opt_duration > 0) { map.beforeRender(ol.animation.pan({ source: currentCenter, duration: opt_duration, @@ -77,7 +77,7 @@ ol.interaction.Interaction.rotateWithoutConstraints = var currentRotation = view.getRotation(); var currentCenter = view.getCenter(); if (goog.isDef(currentRotation) && goog.isDef(currentCenter) && - goog.isDef(opt_duration)) { + goog.isDef(opt_duration) && opt_duration > 0) { map.beforeRender(ol.animation.rotate({ rotation: currentRotation, duration: opt_duration, @@ -156,7 +156,7 @@ ol.interaction.Interaction.zoomWithoutConstraints = var currentResolution = view.getResolution(); var currentCenter = view.getCenter(); if (goog.isDef(currentResolution) && goog.isDef(currentCenter) && - goog.isDef(opt_duration)) { + goog.isDef(opt_duration) && opt_duration > 0) { map.beforeRender(ol.animation.zoom({ resolution: currentResolution, duration: opt_duration,