Fix magnetic bearing

This commit is contained in:
Alexey Kulish 2016-05-16 10:20:47 +03:00
parent 764baf8c44
commit 601be5d22e

View file

@ -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;