From 67eb2d1ac9121a43ebe2161b9ff365d0d38699dc Mon Sep 17 00:00:00 2001 From: Alex Sytnyk Date: Fri, 11 May 2018 16:45:15 +0300 Subject: [PATCH] Fix #5354 --- .../plus/views/mapwidgets/RouteInfoWidgetsFactory.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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) {