Add ol.BrowserFeature.HAS_GEOLOCATION
This commit is contained in:
@@ -2,4 +2,5 @@
|
||||
@exportProperty ol.BrowserFeature.DEVICE_PIXEL_RATIO
|
||||
@exportProperty ol.BrowserFeature.HAS_TOUCH
|
||||
@exportProperty ol.BrowserFeature.HAS_DEVICE_ORIENTATION
|
||||
@exportProperty ol.BrowserFeature.HAS_GEOLOCATION
|
||||
@exportProperty ol.BrowserFeature.HAS_WEBGL
|
||||
|
||||
@@ -31,6 +31,15 @@ ol.BrowserFeature.HAS_DEVICE_ORIENTATION =
|
||||
'DeviceOrientationEvent' in goog.global;
|
||||
|
||||
|
||||
/**
|
||||
* Is HTML5 geolocation supported in the current browser?
|
||||
* @const
|
||||
* @type {boolean}
|
||||
* @todo stability experimental
|
||||
*/
|
||||
ol.BrowserFeature.HAS_GEOLOCATION = 'geolocation' in goog.global.navigator;
|
||||
|
||||
|
||||
/**
|
||||
* True if browser supports touch events.
|
||||
* @const
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
@exportSymbol ol.Geolocation
|
||||
@exportSymbol ol.Geolocation.SUPPORTED ol.Geolocation.SUPPORTED
|
||||
|
||||
@@ -6,6 +6,7 @@ goog.provide('ol.GeolocationProperty');
|
||||
goog.require('goog.events');
|
||||
goog.require('goog.events.EventType');
|
||||
goog.require('goog.math');
|
||||
goog.require('ol.BrowserFeature');
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Object');
|
||||
goog.require('ol.proj');
|
||||
@@ -140,7 +141,7 @@ ol.Geolocation.prototype.handleProjectionChanged_ = function() {
|
||||
* @private
|
||||
*/
|
||||
ol.Geolocation.prototype.handleTrackingChanged_ = function() {
|
||||
if (ol.Geolocation.SUPPORTED) {
|
||||
if (ol.BrowserFeature.HAS_GEOLOCATION) {
|
||||
var tracking = this.getTracking();
|
||||
if (tracking && !goog.isDef(this.watchId_)) {
|
||||
this.watchId_ = goog.global.navigator.geolocation.watchPosition(
|
||||
@@ -155,15 +156,6 @@ ol.Geolocation.prototype.handleTrackingChanged_ = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Is HTML5 geolocation supported in the current browser?
|
||||
* @const
|
||||
* @type {boolean}
|
||||
* @todo stability experimental
|
||||
*/
|
||||
ol.Geolocation.SUPPORTED = 'geolocation' in goog.global.navigator;
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {GeolocationPosition} position position event.
|
||||
|
||||
Reference in New Issue
Block a user