Fix magnetic bearing
This commit is contained in:
parent
764baf8c44
commit
601be5d22e
1 changed files with 2 additions and 2 deletions
|
@ -695,7 +695,7 @@ public class RouteInfoWidgetsFactory {
|
|||
dest.setBearing(myLocation.bearingTo(dest));
|
||||
GeomagneticField destGf = new GeomagneticField((float) dest.getLatitude(), (float) dest.getLongitude(), (float) dest.getAltitude(),
|
||||
System.currentTimeMillis());
|
||||
float bearingToDest = dest.getBearing() + destGf.getDeclination();
|
||||
float bearingToDest = dest.getBearing() - destGf.getDeclination();
|
||||
if (relative) {
|
||||
float b = -1000;
|
||||
Float heading = getOsmandApplication().getLocationProvider().getHeading();
|
||||
|
@ -705,7 +705,7 @@ public class RouteInfoWidgetsFactory {
|
|||
} else if (myLocation.hasBearing()) {
|
||||
GeomagneticField myLocGf = new GeomagneticField((float) myLocation.getLatitude(), (float) myLocation.getLongitude(), (float) myLocation.getAltitude(),
|
||||
System.currentTimeMillis());
|
||||
b = (myLocation.getBearing() + myLocGf.getDeclination());
|
||||
b = myLocation.getBearing() - myLocGf.getDeclination();
|
||||
}
|
||||
if (b > -1000) {
|
||||
bearingToDest -= b;
|
||||
|
|
Loading…
Reference in a new issue