Add options to ol.DeviceOrientation constructor

This commit is contained in:
Frederic Junod
2013-04-22 09:08:31 +02:00
parent 15e5242611
commit b66b0be8b4
3 changed files with 11 additions and 6 deletions

View File

@@ -1,3 +1,8 @@
/**
* @typedef {Object} ol.DeviceOrientationOptions
* @property {boolean|undefined} tracking Tracking.
*/
/**
* @typedef {Object} ol.GeolocationOptions
* @property {boolean|undefined} tracking Tracking.

View File

@@ -1 +1 @@
@exportSymbol ol.DeviceOrientation
@exportClass ol.DeviceOrientation ol.DeviceOrientationOptions

View File

@@ -22,10 +22,9 @@ ol.DeviceOrientationProperty = {
/**
* @constructor
* @extends {ol.Object}
* @param {ol.DeviceOrientationOptions=} opt_options Options.
*/
ol.DeviceOrientation = function() {
goog.base(this);
ol.DeviceOrientation = function(opt_options) {
/**
* @private
@@ -33,11 +32,12 @@ ol.DeviceOrientation = function() {
*/
this.listenerKey_ = null;
this.setTracking(false);
goog.events.listen(this,
ol.Object.getChangedEventType(ol.DeviceOrientationProperty.TRACKING),
this.handleTrackingChanged_, false, this);
goog.base(this, goog.isDef(opt_options) ? opt_options : {});
};
goog.inherits(ol.DeviceOrientation, ol.Object);