forked from apache/cordova-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed over CompassConstants -> CompassError, added a proper Compass…
…Error obj, tweaking CompassHeading constructor, added fail wrappers to compass, set a default quality level for camera.getPicture.
- Loading branch information
Showing
7 changed files
with
45 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* CompassError. | ||
* An error code assigned by an implementation when an error has occured | ||
* @constructor | ||
*/ | ||
var CompassError = function(err) { | ||
this.code = (typeof err != 'undefined' ? err : null); | ||
}; | ||
|
||
/** | ||
* Error codes | ||
*/ | ||
CompassError.COMPASS_INTERNAL_ERR = 0; | ||
CompassError.COMPASS_NOT_SUPPORTED = 20; | ||
|
||
module.exports = CompassError; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
var CompassHeading = function() { | ||
this.magneticHeading = null; | ||
this.trueHeading = null; | ||
this.headingAccuracy = null; | ||
this.timestamp = new Date(); | ||
var CompassHeading = function(magneticHeading, trueHeading, headingAccuracy, timestamp) { | ||
this.magneticHeading = magneticHeading || null; | ||
this.trueHeading = trueHeading || null; | ||
this.headingAccuracy = headingAccuracy || null; | ||
this.timestamp = (timestamp ? new Date(timestamp) : new Date()); | ||
}; | ||
|
||
module.exports = CompassHeading; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters