res/middleware/cordova/3.4.0/android/plugins/org.apache.cordova.device-orientation/www/compass.js
function(successCallback, errorCallback, options) {
            argscheck.checkArgs('fFO', 'compass.watchHeading', arguments);
            // Default interval (100 msec)
            var frequency = (options !== undefined && options.frequency !== undefined) ? options.frequency : 100;
            var filter = (options !== undefined && options.filter !== undefined) ? options.filter : 0;

            var id = utils.createUUID();
            if (filter > 0) {
                // is an iOS request for watch by filter, no timer needed
                timers[id] = "iOS";
                compass.getCurrentHeading(successCallback, errorCallback, options);
            } else {
                // Start watch timer to get headings
                timers[id] = window.setInterval(function() {
                    compass.getCurrentHeading(successCallback, errorCallback);
                }, frequency);
            }

            return id;
        }
function(successCallback, errorCallback, options) {
            argscheck.checkArgs('fFO', 'compass.watchHeading', arguments);
            // Default interval (100 msec)
            var frequency = (options !== undefined && options.frequency !== undefined) ? options.frequency : 100;
            var filter = (options !== undefined && options.filter !== undefined) ? options.filter : 0;

            var id = utils.createUUID();
            if (filter > 0) {
                // is an iOS request for watch by filter, no timer needed
                timers[id] = "iOS";
                compass.getCurrentHeading(successCallback, errorCallback, options);
            } else {
                // Start watch timer to get headings
                timers[id] = window.setInterval(function() {
                    compass.getCurrentHeading(successCallback, errorCallback);
                }, frequency);
            }

            return id;
        }
function ( successCallback , errorCallback , options ) { argscheck . checkArgs ( 'fFO' , 'compass.watchHeading' , arguments ) ; // Default interval (100 msec) var frequency = ( options !== undefined && options . frequency !== undefined ) ? options . frequency : 100 ; var filter = ( options !== undefined && options . filter !== undefined ) ? options . filter : 0 ; var id = utils . createUUID ( ) ; if ( filter > 0 ) { // is an iOS request for watch by filter, no timer needed timers [ id ] = "iOS" ; compass . getCurrentHeading ( successCallback , errorCallback , options ) ; } else { // Start watch timer to get headings timers [ id ] = window . setInterval ( function ( ) { compass . getCurrentHeading ( successCallback , errorCallback ) ; } , frequency ) ; } return id ; }
Asynchronously acquires the heading repeatedly at a given interval.
@param {Function} successCallback The function to call each time the heading
data is available
@param {Function} errorCallback The function to call when there is an error
getting the heading data.
@param {HeadingOptions} options The options for getting the heading data
such as timeout and the frequency of the watch. For iOS, filter parameter
specifies to watch via a distance filter rather than time.
Asynchronously acquires the heading repeatedly at a given interval .