Do not draw lines without my location

This commit is contained in:
Alexander Sytnyk 2017-09-20 14:00:17 +03:00
parent a893fbe6cd
commit accb0c7b93

View file

@ -226,12 +226,12 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
List<MapMarker> activeMapMarkers = markersHelper.getMapMarkers(); List<MapMarker> activeMapMarkers = markersHelper.getMapMarkers();
if (settings.SHOW_LINES_TO_FIRST_MARKERS.get()) { if (settings.SHOW_LINES_TO_FIRST_MARKERS.get() && myLoc != null) {
linePath.reset(); linePath.reset();
tx.clear(); tx.clear();
ty.clear(); ty.clear();
int locX = myLoc == null ? tileBox.getCenterPixelX() : tileBox.getPixXFromLonNoRot(myLoc.getLongitude()); int locX = tileBox.getPixXFromLonNoRot(myLoc.getLongitude());
int locY = myLoc == null ? tileBox.getCenterPixelY() : tileBox.getPixYFromLatNoRot(myLoc.getLatitude()); int locY = tileBox.getPixYFromLatNoRot(myLoc.getLatitude());
for (int i = 0; i < activeMapMarkers.size() && i < 2; i++) { for (int i = 0; i < activeMapMarkers.size() && i < 2; i++) {
int markerX = tileBox.getPixXFromLonNoRot(activeMapMarkers.get(i).getLongitude()); int markerX = tileBox.getPixXFromLonNoRot(activeMapMarkers.get(i).getLongitude());
int markerY = tileBox.getPixYFromLatNoRot(activeMapMarkers.get(i).getLatitude()); int markerY = tileBox.getPixYFromLatNoRot(activeMapMarkers.get(i).getLatitude());