- Accelerometer
- Camera
- Capture
- Compass
- Connection
- Contacts
- Device
- Events
- File
- Geolocation
- Globalization
- InAppBrowser
- Media
- Notification
- Splashscreen
- Storage
- Getting Started Guides
- Command-Line Usage
- Privacy Guide
- Upgrading Guides
- Project Settings
- Plugin Development Guide
- Domain Whitelist Guide
- Embedding WebView
This version of the documentation is outdated!
Click here for the latest released version.
Compass
Obtains the direction that the device is pointing.
Methods
- compass.getCurrentHeading
- compass.watchHeading
- compass.clearWatch
- compass.watchHeadingFilter (obsolete)
- compass.clearWatchFilter (obsolete)
Arguments
Permissions
Android
app/res/xml/config.xml
<plugin name="Compass" value="org.apache.cordova.CompassListener" />
Bada
No permissions are required.
BlackBerry WebWorks
No permissions are required.
iOS
config.xml
<plugin name="Compass" value="CDVLocation" />
webOS
No permissions are required.
Windows Phone
Properties/WPAppManifest.xml
<Capabilities>
<Capability Name="ID_CAP_SENSORS" />
</Capabilities>
Reference: Application Manifest for Windows Phone
Tizen
No permissions are required.