diff --git a/src/ol/browserfeature.exports b/src/ol/browserfeature.exports index 46f7db1350..b1ff1760c6 100644 --- a/src/ol/browserfeature.exports +++ b/src/ol/browserfeature.exports @@ -1,4 +1,5 @@ @exportSymbol ol.BrowserFeature @exportProperty ol.BrowserFeature.DEVICE_PIXEL_RATIO @exportProperty ol.BrowserFeature.HAS_TOUCH +@exportProperty ol.BrowserFeature.HAS_DEVICE_ORIENTATION @exportProperty ol.BrowserFeature.HAS_WEBGL diff --git a/src/ol/browserfeature.js b/src/ol/browserfeature.js index 7b5d3c2fe7..c145ebbb37 100644 --- a/src/ol/browserfeature.js +++ b/src/ol/browserfeature.js @@ -21,6 +21,16 @@ ol.ASSUME_TOUCH = false; ol.BrowserFeature.DEVICE_PIXEL_RATIO = goog.global.devicePixelRatio || 1; +/** + * Indicates if DeviceOrientation is supported in the user's browser. + * @const + * @type {boolean} + * @todo stability experimental + */ +ol.BrowserFeature.HAS_DEVICE_ORIENTATION = + 'DeviceOrientationEvent' in goog.global; + + /** * True if browser supports touch events. * @const diff --git a/src/ol/deviceorientation.exports b/src/ol/deviceorientation.exports index b0a0b9eaf2..4496aa24b9 100644 --- a/src/ol/deviceorientation.exports +++ b/src/ol/deviceorientation.exports @@ -1,2 +1 @@ @exportSymbol ol.DeviceOrientation -@exportSymbol ol.DeviceOrientation.SUPPORTED ol.DeviceOrientation.SUPPORTED diff --git a/src/ol/deviceorientation.js b/src/ol/deviceorientation.js index 000494963b..aab556ebef 100644 --- a/src/ol/deviceorientation.js +++ b/src/ol/deviceorientation.js @@ -3,6 +3,7 @@ goog.provide('ol.DeviceOrientationProperty'); goog.require('goog.events'); goog.require('goog.math'); +goog.require('ol.BrowserFeature'); goog.require('ol.Object'); @@ -111,15 +112,6 @@ ol.DeviceOrientation.prototype.disposeInternal = function() { }; -/** - * Indicates if DeviceOrientation is supported in the user's browser. - * @const - * @type {boolean} - * @todo stability experimental - */ -ol.DeviceOrientation.SUPPORTED = 'DeviceOrientationEvent' in goog.global; - - /** * @private * @param {goog.events.BrowserEvent} browserEvent Event. @@ -230,7 +222,7 @@ goog.exportProperty( * @private */ ol.DeviceOrientation.prototype.handleTrackingChanged_ = function() { - if (ol.DeviceOrientation.SUPPORTED) { + if (ol.BrowserFeature.HAS_DEVICE_ORIENTATION) { var tracking = this.getTracking(); if (tracking && goog.isNull(this.listenerKey_)) { this.listenerKey_ = goog.events.listen(goog.global, 'deviceorientation',