apache/incubator-cordova-ios — pull request #9 by becka11y (2012-04-03 20:18:25+00:00)
Title: Fixes cb-361 & use timeout to turn off compass sensor

Update for unified JS to remove headingRepeats parameter and
refactored to use timeout to turn off heading sensor (matches current implementation
of Android).
Updated to pass options.filter into getHeading to indicate a watch by Filter request

While we may refactor in a future release not to rely on a timeout, I had to make some change in order for the sensor to be turned off since previous to the unified JS, iOS was relying on a repeats parameter that no longer exists. I used a timeout option to be consistent with the current Android implementation.

As discussed on the list, I added suppor for watching the iOS compass via a filter value but hacking the options.filter parameter into the call to getHeading. If there is a filter param, call watchHeadingFilter to start monitoring compass changes based on the filter. This also requires a change to the UnifiedJS compass.js (see https://github.com/becka11y/incubator-cordova-js/tree/watchFilter) That branch needs work to fix the unit tests before committing.