diff --git a/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java b/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java index 7a1253595b..af41f07410 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java @@ -22,6 +22,7 @@ import net.osmand.plus.MapMarkersHelper; import net.osmand.plus.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmAndConstants; import net.osmand.plus.R; +import net.osmand.plus.TargetPointsHelper.TargetPoint; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.views.ContextMenuLayer.IContextMenuProvider; import net.osmand.plus.views.ContextMenuLayer.IContextMenuProviderSelection; @@ -250,7 +251,7 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi List activeMapMarkers = markersHelper.getActiveMapMarkers(); for (int i = 0; i < activeMapMarkers.size(); i++) { MapMarker marker = activeMapMarkers.get(i); - if (isLocationVisible(tb, marker)) { + if (isLocationVisible(tb, marker) && !overlappedByWaypoint(marker)) { Bitmap bmp = getMapMarkerBitmap(marker.colorIndex); int marginX = bmp.getWidth() / 6; int marginY = bmp.getHeight(); @@ -304,6 +305,16 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi return tx >= 0 && tx <= tb.getPixWidth() && ty >= widgetHeight && ty <= tb.getPixHeight(); } + public boolean overlappedByWaypoint(MapMarker marker) { + List targetPoints = map.getMyApplication().getTargetPointsHelper().getAllPoints(); + for (TargetPoint t : targetPoints) { + if (t.point.equals(marker.point)) { + return true; + } + } + return false; + } + @Override public void destroyLayer() { }