Home > @magiclane/maps-sdk > Compass

Compass class

Compass sensor data providing directional heading.

Gives the device's heading relative to magnetic or true north using magnetometer data.

Sensor Data Source

Signature:

export declare class Compass extends GemAutoreleaseObject implements SenseData 

Extends: GemAutoreleaseObject

Implements: SenseData

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Compass class.

Properties

Property

Modifiers

Type

Description

accuracy

readonly

CompassAccuracy

The accuracy of the compass measurement.

acquisitionTime

readonly

Date

Acquisition time

heading

readonly

number

The compass heading in degrees.

type

readonly

DataType

Get data type

Methods

Method

Modifiers

Description

toJson()

Serialize to JSON