Only animate when resolution is about to be changed

This commit is contained in:
Andreas Hocevar
2015-09-26 10:50:50 +02:00
parent 5cac9d61cc
commit 4e48170fac

View File

@@ -222,6 +222,7 @@ ol.interaction.Interaction.zoomWithoutConstraints =
var currentResolution = view.getResolution();
var currentCenter = view.getCenter();
if (currentResolution !== undefined && currentCenter &&
resolution !== currentResolution &&
opt_duration && opt_duration > 0) {
map.beforeRender(ol.animation.zoom({
resolution: /** @type {number} */ (currentResolution),