Merge pull request #7708 from osmandapp/Fix_7378

Fix #7378
This commit is contained in:
max-klaus 2019-10-21 10:40:26 +03:00 committed by GitHub
commit 94ad0d5b2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -128,7 +128,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc
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.0) {
mapView.setRotate(-val);
mapView.setRotate(-val, false);
}
} else if (showViewAngle && headingChanged) {
mapView.refreshMap();
@ -208,7 +208,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc
mapView.getAnimatedDraggingThread().startZooming(zoom.first, zoom.second, false);
}
if (rotation != null) {
mapView.setRotate(rotation);
mapView.setRotate(rotation, false);
}
mapView.setLatLon(location.getLatitude(), location.getLongitude());
}
@ -264,7 +264,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc
public void updateSettings(){
if (mapView != null) {
if (settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_NONE || routePlanningMode) {
mapView.setRotate(0);
mapView.setRotate(0, true);
}
mapView.setMapPosition(settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_BEARING
&& !routePlanningMode

View file

@ -399,10 +399,10 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
return getZoom() > LOWEST_ZOOM_TO_ROTATE;
}
public void setRotate(float rotate) {
public void setRotate(float rotate, boolean force) {
if (isMapRotateEnabled()) {
float diff = MapUtils.unifyRotationDiff(rotate, getRotate());
if (Math.abs(diff) > 5) { // check smallest rotation
if (Math.abs(diff) > 5 || force) { // check smallest rotation
animatedDraggingThread.startRotate(rotate);
}
}