Don't use window and document
With this change, our JavaScript can also be executed by non-brower engines.
This commit is contained in:
@@ -16,6 +16,6 @@ ol.BrowserFeature = {
|
||||
* @type {boolean}
|
||||
*/
|
||||
HAS_TOUCH: ol.ASSUME_TOUCH ||
|
||||
(document && 'ontouchstart' in document.documentElement) ||
|
||||
!!(window.navigator.msPointerEnabled)
|
||||
(goog.global.document && 'ontouchstart' in document.documentElement) ||
|
||||
!!(goog.global.navigator.msPointerEnabled)
|
||||
};
|
||||
|
||||
@@ -112,7 +112,7 @@ ol.Geolocation.prototype.handleTrackingChanged_ = function() {
|
||||
* @const
|
||||
* @type {boolean}
|
||||
*/
|
||||
ol.Geolocation.SUPPORTED = 'geolocation' in navigator;
|
||||
ol.Geolocation.SUPPORTED = 'geolocation' in goog.global.navigator;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user