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
Type | Property and Description |
---|---|
javafx.beans.property.ReadOnlyDoubleProperty |
heading
A frequently-updated heading of the compass.
|
Modifier and Type | Method and 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.
|
javafx.beans.property.ReadOnlyDoubleProperty headingProperty
getHeading()
double getHeading()
javafx.beans.property.ReadOnlyDoubleProperty headingProperty()
getHeading()