From a5b7caf716c144ca9cd7172d4c1396fb178b97c9 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 17 Jul 2020 17:02:30 +0300 Subject: [PATCH] Show start and finish icons for every track segment --- OsmAnd/src/net/osmand/plus/views/GPXLayer.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/GPXLayer.java b/OsmAnd/src/net/osmand/plus/views/GPXLayer.java index c1c1ede0c6..8ad60d98a5 100644 --- a/OsmAnd/src/net/osmand/plus/views/GPXLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/GPXLayer.java @@ -402,7 +402,7 @@ public class GPXLayer extends OsmandMapLayer implements IContextMenuProvider, IM } private void drawDirectionArrows(Canvas canvas, RotatedTileBox tileBox, List selectedGPXFiles) { - if (!tileBox.isZoomAnimated()) { + if (tileBox.getZoom() >= START_ZOOM && !tileBox.isZoomAnimated()) { for (SelectedGpxFile selectedGpxFile : selectedGPXFiles) { boolean showArrows = selectedGpxFile.getGpxFile().isShowArrows(); if (hasTrackDrawInfoForSelectedGpx(selectedGpxFile)) { @@ -548,13 +548,15 @@ public class GPXLayer extends OsmandMapLayer implements IContextMenuProvider, IM } if (showStartFinish) { List segments = selectedGpxFile.getPointsToDisplay(); - TrkSegment endSegment = segments.get(segments.size() - 1); + for (TrkSegment segment : segments) { + if (segment.points.size() >= 2) { + WptPt start = segment.points.get(0); + WptPt end = segment.points.get(segment.points.size() - 1); - WptPt start = segments.get(0).points.get(0); - WptPt end = endSegment.points.get(endSegment.points.size() - 1); - - drawPoint(canvas, tileBox, start, startPointIcon); - drawPoint(canvas, tileBox, end, finishPointIcon); + drawPoint(canvas, tileBox, start, startPointIcon); + drawPoint(canvas, tileBox, end, finishPointIcon); + } + } } } }