Add ol.BrowserFeature.HAS_DEVICE_ORIENTATION

This commit is contained in:
Éric Lemoine
2013-12-18 08:20:52 +01:00
parent 79718151b7
commit 62e8803287
4 changed files with 13 additions and 11 deletions
+2 -10
View File
@@ -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',