Conversation
Add the ability to tweak the PositionOptions used for Geolocation, for instance to use low-accuracy position to save battery on mobile devices. The options parameter is reactive. Add a `pause` feature to temporarily halt position updates, again to allow better power management on mobile devices. The paused status is also reactive. Stop position watcher when there are no dependencies of the location, so that we automatically save power if (for example) a reactive map view is not visible.
10a0d36 to
2ca4428
Compare
|
Hey, sorry I'm behind on reviewing this. I'll try to get to it this week. |
|
@cscott: this is definitely something I've been looking for. going to try your branch out while waiting for this PR to land. 👍 |
There was a problem hiding this comment.
What does "The options can be reactive." mean in this context?
There was a problem hiding this comment.
See the simple-map example above. You can call:
var loc = Geolocation.latLng({ enableHighAccuracy: !!Session.get("highAccuracy") });
and the reactive-dependency magic will work to ensure that loc is properly updated if the Session variable changes (or if the location changes, naturally). The watcher that is created behind the scenes will be properly torn down/rebuilt iff it is necessary when this statement is recomputed.
|
|
|
This will need to be re-done and updated. Currently as is is not mergable, also because of CLA not signed. |
Add the ability to tweak the PositionOptions used for Geolocation, for
instance to use low-accuracy position to save battery on mobile devices.
The options parameter is reactive.
Add a
pausefeature to temporarily halt position updates, again toallow better power management on mobile devices. The paused status
is also reactive.
Stop position watcher when there are no dependencies of the location,
so that we automatically save power if (for example) a reactive map
view is not visible.