public interface CompassService
The CompassService provides a read-only heading property
that is updated at regular intervals by the underlying platform implementation. A user of the
CompassService can listen to changes of the heading, by registering a
ChangeListener to the
heading property.
Example
Services.get(CompassService.class).ifPresent(service -> {
double heading = service.getHeading();
System.out.printf("Current heading: %.2f", heading);
});
Android Configuration: none
iOS Configuration: none
| Modifier and Type | Method | Description |
|---|---|---|
double |
getHeading() |
Returns the compass heading, represented as a value between 0.0 and 359.99, where 0.0 is north.
|
javafx.beans.property.ReadOnlyDoubleProperty |
headingProperty() |
A frequently-updated heading of the compass.
|
double getHeading()
javafx.beans.property.ReadOnlyDoubleProperty headingProperty()