diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java index 2b97479f6b..0a0b2dce90 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java @@ -57,7 +57,6 @@ import net.osmand.router.RouteResultPreparation; import net.osmand.router.TurnType; import net.osmand.util.Algorithms; -import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -642,9 +641,9 @@ public class RouteInfoWidgetsFactory { private int cachedDegrees; private float MIN_SPEED_FOR_HEADING = 1f; - public LatLon getPointToNavigate() { - TargetPoint p = map.getPointToNavigate(); - return p == null ? null : p.point; + private LatLon getNextTargetPoint() { + List points = getOsmandApplication().getTargetPointsHelper().getIntermediatePointsWithTarget(); + return points.isEmpty() ? null : points.get(0).point; } @Override @@ -668,7 +667,7 @@ public class RouteInfoWidgetsFactory { public int getBearing(boolean relative) { int d = -1000; Location myLocation = getOsmandApplication().getLocationProvider().getLastKnownLocation(); - LatLon l = getPointToNavigate(); + LatLon l = getNextTargetPoint(); if (l == null) { List markers = getOsmandApplication().getMapMarkersHelper().getMapMarkers(); if (markers.size() > 0) {