Use ol.coordinate.equals

This commit is contained in:
Tim Schaub
2017-08-14 09:25:41 -04:00
parent 48178f0e31
commit 7f0c8fe899

View File

@@ -1173,11 +1173,8 @@ ol.View.createRotationConstraint_ = function(options) {
* @return {boolean} The animation involves no view change. * @return {boolean} The animation involves no view change.
*/ */
ol.View.isNoopAnimation = function(animation) { ol.View.isNoopAnimation = function(animation) {
if (animation.sourceCenter) { if (animation.sourceCenter && animation.targetCenter) {
if (animation.sourceCenter[0] !== animation.targetCenter[0]) { if (!ol.coordinate.equals(animation.sourceCenter, animation.targetCenter)) {
return false;
}
if (animation.sourceCenter[1] !== animation.targetCenter[1]) {
return false; return false;
} }
} }