diff --git a/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java b/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java index 8a3471be2d..f99225907a 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java @@ -314,9 +314,7 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi @Override public void onDraw(Canvas canvas, RotatedTileBox tileBox, DrawSettings nightMode) { - Location myLoc = map.getMyApplication().getLocationProvider().getLastStaleKnownLocation(); - widgetsFactory.updateInfo(useFingerLocation ? fingerLocation : (myLoc == null - ? tileBox.getCenterLatLon() : new LatLon(myLoc.getLatitude(), myLoc.getLongitude())), tileBox.getZoom()); + widgetsFactory.updateInfo(useFingerLocation ? fingerLocation : null, tileBox.getZoom()); OsmandSettings settings = map.getMyApplication().getSettings(); if (tileBox.getZoom() < 3 || !settings.USE_MAP_MARKERS.get()) { diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java index 0477c8c1ca..f19434c14c 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java @@ -192,11 +192,11 @@ public class MapMarkersWidgetsFactory { if (customLocation != null) { loc = customLocation; } else { - Location l = map.getMapViewTrackingUtilities().getMyLocation(); + Location l = map.getMyApplication().getLocationProvider().getLastStaleKnownLocation(); if (l != null) { loc = new LatLon(l.getLatitude(), l.getLongitude()); } else { - loc = null; + loc = map.getMapLocation(); } } @@ -215,8 +215,8 @@ public class MapMarkersWidgetsFactory { return; } - Float heading = map.getMapViewTrackingUtilities().getHeading(); - + boolean mapLinkedToLoc = map.getMapViewTrackingUtilities().isMapLinkedToLocation(); + Float heading = !mapLinkedToLoc ? 0f : map.getMapViewTrackingUtilities().getHeading(); MapMarker marker = markers.get(0); updateUI(loc, heading, marker, arrowImg, distText, okButton, addressText, true, customLocation != null);