diff --git a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java index e12626f139..6d9db21c34 100644 --- a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java +++ b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java @@ -107,9 +107,6 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc } } - public Location getMyLocation() { - return myLocation; - } public Float getHeading() { return heading; @@ -124,7 +121,8 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc heading = val; if (mapView != null) { float speedForDirectionOfMovement = settings.SWITCH_MAP_DIRECTION_TO_COMPASS.get(); - boolean smallSpeedForDirectionOfMovement = speedForDirectionOfMovement != 0 && getMyLocation() != null && isSmallSpeedForDirectionOfMovement(getMyLocation(), speedForDirectionOfMovement); + boolean smallSpeedForDirectionOfMovement = speedForDirectionOfMovement != 0 && + myLocation != null && isSmallSpeedForDirectionOfMovement(myLocation, speedForDirectionOfMovement); if ((settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_COMPASS || (settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_BEARING && smallSpeedForDirectionOfMovement)) && !routePlanningMode) { if (Math.abs(MapUtils.degreesDiff(mapView.getRotate(), -val)) > 1) { mapView.setRotate(-val); diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkerSelectionFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkerSelectionFragment.java index 71f1f4d8d6..bd036e77e5 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkerSelectionFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkerSelectionFragment.java @@ -70,11 +70,9 @@ public class MapMarkerSelectionFragment extends BaseOsmAndDialogFragment { Float head = trackingUtils.getHeading(); float mapRotation = mapActivity.getMapRotate(); LatLon mw = mapActivity.getMapLocation(); - Location l = trackingUtils.getMyLocation(); - boolean mapLinked = trackingUtils.isMapLinkedToLocation() && l != null; - LatLon myLoc = l == null ? null : new LatLon(l.getLatitude(), l.getLongitude()); + boolean mapLinked = trackingUtils.isMapLinkedToLocation(); useCenter = !mapLinked; - loc = (useCenter ? mw : myLoc); + loc = mw; if (useCenter) { heading = -mapRotation; } else {