Remove unnecessary method

This commit is contained in:
Victor Shcherb 2018-05-23 23:10:41 +02:00
parent d1de3a8dd1
commit 75edb73989
2 changed files with 4 additions and 8 deletions

View file

@ -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);

View file

@ -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 {