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}
|
* @type {boolean}
|
||||||
*/
|
*/
|
||||||
HAS_TOUCH: ol.ASSUME_TOUCH ||
|
HAS_TOUCH: ol.ASSUME_TOUCH ||
|
||||||
(document && 'ontouchstart' in document.documentElement) ||
|
(goog.global.document && 'ontouchstart' in document.documentElement) ||
|
||||||
!!(window.navigator.msPointerEnabled)
|
!!(goog.global.navigator.msPointerEnabled)
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ ol.Geolocation.prototype.handleTrackingChanged_ = function() {
|
|||||||
* @const
|
* @const
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
*/
|
*/
|
||||||
ol.Geolocation.SUPPORTED = 'geolocation' in navigator;
|
ol.Geolocation.SUPPORTED = 'geolocation' in goog.global.navigator;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user