From 8ac031b483d4e3aa82124d0a1483fc3364bf429f Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 24 Jul 2020 19:08:39 +0300 Subject: [PATCH] Draw start finish as single icon if point is the same --- OsmAnd/src/net/osmand/plus/views/GPXLayer.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/GPXLayer.java b/OsmAnd/src/net/osmand/plus/views/GPXLayer.java index 1f77a5e52f..922fbba961 100644 --- a/OsmAnd/src/net/osmand/plus/views/GPXLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/GPXLayer.java @@ -94,6 +94,7 @@ public class GPXLayer extends OsmandMapLayer implements IContextMenuProvider, IM private Drawable startPointIcon; private Drawable finishPointIcon; + private Drawable startAndFinishIcon; private LayerDrawable selectedPoint; private TrackDrawInfo trackDrawInfo; private TrackChartPoints trackChartPoints; @@ -190,6 +191,7 @@ public class GPXLayer extends OsmandMapLayer implements IContextMenuProvider, IM UiUtilities iconsCache = view.getApplication().getUIUtilities(); startPointIcon = iconsCache.getIcon(R.drawable.map_track_point_start); finishPointIcon = iconsCache.getIcon(R.drawable.map_track_point_finish); + startAndFinishIcon = iconsCache.getIcon(R.drawable.map_track_point_start_finish); contextMenuLayer = view.getLayerByClass(ContextMenuLayer.class); @@ -545,8 +547,12 @@ public class GPXLayer extends OsmandMapLayer implements IContextMenuProvider, IM WptPt start = segment.points.get(0); WptPt end = segment.points.get(segment.points.size() - 1); - drawPoint(canvas, tileBox, start, startPointIcon); - drawPoint(canvas, tileBox, end, finishPointIcon); + if (start.equals(end)) { + drawPoint(canvas, tileBox, start, startAndFinishIcon); + } else { + drawPoint(canvas, tileBox, start, startPointIcon); + drawPoint(canvas, tileBox, end, finishPointIcon); + } } } }