Set default 'tracking' property to false

This commit is contained in:
Frederic Junod
2013-06-21 09:21:48 +02:00
parent c4ce85c847
commit 9cac8a92df
2 changed files with 10 additions and 6 deletions

View File

@@ -27,6 +27,10 @@ ol.DeviceOrientationProperty = {
*/
ol.DeviceOrientation = function(opt_options) {
goog.base(this);
var options = goog.isDef(opt_options) ? opt_options : {};
/**
* @private
* @type {?number}
@@ -37,7 +41,7 @@ ol.DeviceOrientation = function(opt_options) {
ol.Object.getChangeEventType(ol.DeviceOrientationProperty.TRACKING),
this.handleTrackingChanged_, false, this);
goog.base(this, goog.isDef(opt_options) ? opt_options : {});
this.setTracking(goog.isDef(options.tracking) ? options.tracking : false);
};
goog.inherits(ol.DeviceOrientation, ol.Object);
@@ -139,7 +143,8 @@ goog.exportProperty(
/**
* @return {boolean|undefined} tracking.
* Are we tracking the device's orientation?
* @return {boolean} tracking.
*/
ol.DeviceOrientation.prototype.getTracking = function() {
return /** @type {boolean} */ (