Fix fit route on map after calc on tablet landscape

This commit is contained in:
crimean 2019-03-28 14:53:44 +03:00
parent a17274c372
commit 87a2740e6f
2 changed files with 7 additions and 5 deletions

View file

@ -1818,7 +1818,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
WeakReference<MapRouteInfoMenuFragment> fragmentRef = mapRouteInfoMenu.findMenuFragment();
if (fragmentRef != null) {
MapRouteInfoMenuFragment f = fragmentRef.get();
if (landscapeLayout) {
if (!f.isPortrait()) {
tileBoxWidthPx = tb.getPixWidth() - f.getWidth();
} else {
tileBoxHeightPx = tb.getPixHeight() - f.getHeight();

View file

@ -1684,10 +1684,12 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
WeakReference<MapRouteInfoMenuFragment> fragmentRef = routeInfoMenu.findMenuFragment();
if (fragmentRef != null) {
MapRouteInfoMenuFragment f = fragmentRef.get();
if (mapActivity.isLandscapeLayout()) {
tileBoxWidthPx = tb.getPixWidth() - f.getWidth();
} else {
tileBoxHeightPx = tb.getPixHeight() - f.getHeight();
if (f != null) {
if (!f.isPortrait()) {
tileBoxWidthPx = tb.getPixWidth() - f.getWidth();
} else {
tileBoxHeightPx = tb.getPixHeight() - f.getHeight();
}
}
}
mapActivity.getMapView().fitLocationToMap(latitude, longitude, mapActivity.getMapView().getZoom(),