From accb0c7b9320927ab11850d4d88c05eb3a49286d Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Wed, 20 Sep 2017 14:00:17 +0300 Subject: [PATCH] Do not draw lines without my location --- OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java b/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java index e906d9feed..ec93c52755 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java @@ -226,12 +226,12 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi List activeMapMarkers = markersHelper.getMapMarkers(); - if (settings.SHOW_LINES_TO_FIRST_MARKERS.get()) { + if (settings.SHOW_LINES_TO_FIRST_MARKERS.get() && myLoc != null) { linePath.reset(); tx.clear(); ty.clear(); - int locX = myLoc == null ? tileBox.getCenterPixelX() : tileBox.getPixXFromLonNoRot(myLoc.getLongitude()); - int locY = myLoc == null ? tileBox.getCenterPixelY() : tileBox.getPixYFromLatNoRot(myLoc.getLatitude()); + int locX = tileBox.getPixXFromLonNoRot(myLoc.getLongitude()); + int locY = tileBox.getPixYFromLatNoRot(myLoc.getLatitude()); for (int i = 0; i < activeMapMarkers.size() && i < 2; i++) { int markerX = tileBox.getPixXFromLonNoRot(activeMapMarkers.get(i).getLongitude()); int markerY = tileBox.getPixYFromLatNoRot(activeMapMarkers.get(i).getLatitude());