Merge pull request #2274 from yohanboniface/watch

Firefox has a Object.prototype.watch method
This commit is contained in:
Vladimir Agafonkin 2013-12-09 07:29:18 -08:00
commit 4fc4cadd11

View File

@ -27,7 +27,7 @@ L.Map.include({
var onResponse = L.bind(this._handleGeolocationResponse, this), var onResponse = L.bind(this._handleGeolocationResponse, this),
onError = L.bind(this._handleGeolocationError, this); onError = L.bind(this._handleGeolocationError, this);
if (options.watch) { if (options.hasOwnProperty('watch') && options.watch) {
this._locationWatchId = this._locationWatchId =
navigator.geolocation.watchPosition(onResponse, onError, options); navigator.geolocation.watchPosition(onResponse, onError, options);
} else { } else {