Only install animations if duration > 0

This commit is contained in:
Tom Payne
2013-10-07 15:47:16 +02:00
parent c6df48e424
commit b533cad031

View File

@@ -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,