From 5acf9023d02f06e7900861d89dbf87a0dc338457 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Tue, 29 Sep 2015 09:39:19 -0600 Subject: [PATCH] Remove goog.isDefAndNotNull() from deviceorientation.js --- src/ol/deviceorientation.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ol/deviceorientation.js b/src/ol/deviceorientation.js index 8707fb2073..4c1397f7d1 100644 --- a/src/ol/deviceorientation.js +++ b/src/ol/deviceorientation.js @@ -114,24 +114,23 @@ ol.DeviceOrientation.prototype.disposeInternal = function() { ol.DeviceOrientation.prototype.orientationChange_ = function(browserEvent) { var event = /** @type {DeviceOrientationEvent} */ (browserEvent.getBrowserEvent()); - if (goog.isDefAndNotNull(event.alpha)) { + if (event.alpha !== null) { var alpha = goog.math.toRadians(event.alpha); this.set(ol.DeviceOrientationProperty.ALPHA, alpha); // event.absolute is undefined in iOS. if (goog.isBoolean(event.absolute) && event.absolute) { this.set(ol.DeviceOrientationProperty.HEADING, alpha); - } else if (goog.isDefAndNotNull(event.webkitCompassHeading) && - goog.isDefAndNotNull(event.webkitCompassAccuracy) && + } else if (goog.isNumber(event.webkitCompassHeading) && event.webkitCompassAccuracy != -1) { var heading = goog.math.toRadians(event.webkitCompassHeading); this.set(ol.DeviceOrientationProperty.HEADING, heading); } } - if (goog.isDefAndNotNull(event.beta)) { + if (event.beta !== null) { this.set(ol.DeviceOrientationProperty.BETA, goog.math.toRadians(event.beta)); } - if (goog.isDefAndNotNull(event.gamma)) { + if (event.gamma !== null) { this.set(ol.DeviceOrientationProperty.GAMMA, goog.math.toRadians(event.gamma)); }