From ecb58268c998950f4ddf792b9d666ade15f17420 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 23 Nov 2015 10:22:54 +0100 Subject: [PATCH] Change destination red cursor to 1st intermediate --- .../src/net/osmand/plus/views/PointNavigationLayer.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/PointNavigationLayer.java b/OsmAnd/src/net/osmand/plus/views/PointNavigationLayer.java index 060c1330ea..505c59476d 100644 --- a/OsmAnd/src/net/osmand/plus/views/PointNavigationLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/PointNavigationLayer.java @@ -8,7 +8,6 @@ import android.graphics.Paint; import android.graphics.Paint.Align; import android.graphics.Paint.Style; import android.graphics.PointF; - import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.data.QuadPoint; @@ -19,6 +18,7 @@ import net.osmand.plus.TargetPointsHelper.TargetPoint; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.views.ContextMenuLayer.IContextMenuProvider; +import java.util.Iterator; import java.util.List; public class PointNavigationLayer extends OsmandMapLayer implements IContextMenuProvider { @@ -103,7 +103,12 @@ public class PointNavigationLayer extends OsmandMapLayer implements IContextMenu int locationY = tb.getPixYFromLatNoRot(pointToNavigate.getLatitude()); canvas.rotate(-tb.getRotate(), locationX, locationY); canvas.drawBitmap(targetPoint, locationX - marginX, locationY - marginY, bitmapPaint); - } else if (pointToNavigate != null) { + } + Iterator it = targetPoints.getIntermediatePoints().iterator(); + if(it.hasNext()) { + pointToNavigate = it.next(); + } + if (pointToNavigate != null && !isLocationVisible(tb, pointToNavigate)) { boolean show = !view.getApplication().getRoutingHelper().isRouteCalculated(); if(view.getSettings().SHOW_DESTINATION_ARROW.isSet()) { show = view.getSettings().SHOW_DESTINATION_ARROW.get();