Use ol.isDef when checking booleans

This commit is contained in:
Marc Jansen
2015-09-22 10:55:46 +02:00
committed by Tim Schaub
parent 0e4c73072f
commit 68442578ba
6 changed files with 26 additions and 19 deletions
+4 -3
View File
@@ -3,6 +3,7 @@
goog.provide('ol.interaction.Interaction');
goog.provide('ol.interaction.InteractionProperty');
goog.require('ol');
goog.require('ol.MapBrowserEvent');
goog.require('ol.Object');
goog.require('ol.animation');
@@ -149,7 +150,7 @@ ol.interaction.Interaction.rotateWithoutConstraints =
if (goog.isDefAndNotNull(rotation)) {
var currentRotation = view.getRotation();
var currentCenter = view.getCenter();
if (currentRotation !== undefined && currentCenter &&
if (ol.isDef(currentRotation) && currentCenter &&
opt_duration && opt_duration > 0) {
map.beforeRender(ol.animation.rotate({
rotation: currentRotation,
@@ -220,10 +221,10 @@ ol.interaction.Interaction.zoomWithoutConstraints =
if (goog.isDefAndNotNull(resolution)) {
var currentResolution = view.getResolution();
var currentCenter = view.getCenter();
if (currentResolution !== undefined && currentCenter &&
if (ol.isDef(currentResolution) && currentCenter &&
opt_duration && opt_duration > 0) {
map.beforeRender(ol.animation.zoom({
resolution: currentResolution,
resolution: /** @type {number} */ (currentResolution),
duration: opt_duration,
easing: ol.easing.easeOut
}));