Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix distanceFilter caching for LocationObserver
Summary: Allow changing distanceFilter after _locationManager has been initialized. There is 2 reasons for this PR: - When calling `getCurrentPosition`, `_observerOptions` is possibly not set properly ( as it is set only in `startObserving`), in this case it would have default values so `distanceFilter` will be 0 in this case ( which can be the right value but we should be more explicit about it, `kCLDistanceFilterNone` or `RCT_DEFAULT_LOCATION_ACCURACY`): <img width="961" alt="screen shot 2016-04-14 at 8 44 09 pm" src="https://cloud.githubusercontent.com/assets/159813/14551465/6aa8791a-0288-11e6-9c98-1687357f8c2a.png"> - Another issue is that `distanceFilter` is cached so it can't be changed afterwards: ```javascript let options; options = { enableHighAccuracy: true, distanceFilter: 20, }; this.watchId = this.geolocation.watchPosition( () => { }, () => { }, options, ); // => sets distanceFilter to 20 this.geolocation.clearWatch(this.watchId); options = { enableHighAccuracy: Closes #6987 Differential Revision: D3258956 fb-gh-sync-id: 00a1d1b29d732a54cdc30e20a7a9a2de3dd9b725 fbshipit-source-id: 00a1d1b29d732a54cdc30e20a7a9a2de3dd9b725
- Loading branch information