diff --git a/src/objectliterals.jsdoc b/src/objectliterals.jsdoc index 47630acd77..f5be363af5 100644 --- a/src/objectliterals.jsdoc +++ b/src/objectliterals.jsdoc @@ -1,3 +1,8 @@ +/** + * @typedef {Object} ol.DeviceOrientationOptions + * @property {boolean|undefined} tracking Tracking. + */ + /** * @typedef {Object} ol.GeolocationOptions * @property {boolean|undefined} tracking Tracking. diff --git a/src/ol/deviceorientation.exports b/src/ol/deviceorientation.exports index 4496aa24b9..6988135399 100644 --- a/src/ol/deviceorientation.exports +++ b/src/ol/deviceorientation.exports @@ -1 +1 @@ -@exportSymbol ol.DeviceOrientation +@exportClass ol.DeviceOrientation ol.DeviceOrientationOptions diff --git a/src/ol/deviceorientation.js b/src/ol/deviceorientation.js index 4d27e163f4..99d405a50e 100644 --- a/src/ol/deviceorientation.js +++ b/src/ol/deviceorientation.js @@ -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);