Use no browser globals at all

This commit is contained in:
ahocevar
2013-04-10 16:53:45 +02:00
parent dc1d7a1aba
commit a437bea61f
4 changed files with 7 additions and 6 deletions

View File

@@ -95,12 +95,12 @@ ol.Geolocation.prototype.handleTrackingChanged_ = function() {
if (ol.Geolocation.SUPPORTED) {
var tracking = this.getTracking();
if (tracking && !goog.isDef(this.watchId_)) {
this.watchId_ = navigator.geolocation.watchPosition(
this.watchId_ = goog.global.navigator.geolocation.watchPosition(
goog.bind(this.positionChange_, this),
goog.bind(this.positionError_, this),
this.getTrackingOptions());
} else if (!tracking && goog.isDef(this.watchId_)) {
navigator.geolocation.clearWatch(this.watchId_);
goog.global.navigator.geolocation.clearWatch(this.watchId_);
this.watchId_ = undefined;
}
}