"Map center" jumps to previous point location after route calculation
This commit is contained in:
parent
ba19772b58
commit
0919e44ce2
4 changed files with 14 additions and 8 deletions
|
@ -473,6 +473,10 @@ public class TrackDetailsMenu {
|
|||
}
|
||||
|
||||
public void refreshChart(LineChart chart, boolean forceFit) {
|
||||
refreshChart(chart, true, forceFit);
|
||||
}
|
||||
|
||||
public void refreshChart(LineChart chart, boolean fitTrackOnMap, boolean forceFit) {
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
GpxDisplayItem gpxItem = getGpxItem();
|
||||
if (mapActivity == null || gpxItem == null) {
|
||||
|
@ -529,8 +533,10 @@ public class TrackDetailsMenu {
|
|||
if (location != null) {
|
||||
mapActivity.refreshMap();
|
||||
}
|
||||
if (fitTrackOnMap) {
|
||||
fitTrackOnMap(chart, location, forceFit);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean shouldShowXAxisPoints () {
|
||||
return true;
|
||||
|
|
|
@ -311,7 +311,7 @@ public class GraphsCard extends BaseCard implements OnUpdateInfoListener {
|
|||
private void updateChartOnMap() {
|
||||
if (hasVisibleGraph()) {
|
||||
trackDetailsMenu.reset();
|
||||
refreshMapCallback.refreshMap(false);
|
||||
refreshMapCallback.refreshMap(false, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -105,11 +105,11 @@ public class GraphAdapterHelper {
|
|||
@NonNull final TrackDetailsMenu detailsMenu) {
|
||||
final RefreshMapCallback refreshMapCallback = new RefreshMapCallback() {
|
||||
@Override
|
||||
public void refreshMap(boolean forceFit) {
|
||||
public void refreshMap(boolean fitTrackOnMap, boolean forceFit) {
|
||||
LineChart chart = graphAdapter.getChart();
|
||||
OsmandApplication app = mapActivity.getMyApplication();
|
||||
if (!app.getRoutingHelper().isFollowingMode()) {
|
||||
detailsMenu.refreshChart(chart, forceFit);
|
||||
detailsMenu.refreshChart(chart, fitTrackOnMap, forceFit);
|
||||
mapActivity.refreshMap();
|
||||
}
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ public class GraphAdapterHelper {
|
|||
|
||||
@Override
|
||||
public void onValueSelected(Entry e, Highlight h) {
|
||||
refreshMapCallback.refreshMap(false);
|
||||
refreshMapCallback.refreshMap(true, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -141,7 +141,7 @@ public class GraphAdapterHelper {
|
|||
lastPerformedGesture == ChartTouchListener.ChartGesture.PINCH_ZOOM ||
|
||||
lastPerformedGesture == ChartTouchListener.ChartGesture.DOUBLE_TAP ||
|
||||
lastPerformedGesture == ChartTouchListener.ChartGesture.ROTATE) {
|
||||
refreshMapCallback.refreshMap(true);
|
||||
refreshMapCallback.refreshMap(true, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -150,6 +150,6 @@ public class GraphAdapterHelper {
|
|||
}
|
||||
|
||||
public interface RefreshMapCallback {
|
||||
void refreshMap(boolean forceFit);
|
||||
void refreshMap(boolean fitTrackOnMap, boolean forceFit);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -369,7 +369,7 @@ public class RouteDetailsFragment extends ContextMenuFragment
|
|||
super.calculateLayout(view, initLayout);
|
||||
if (!initLayout && getCurrentMenuState() != MenuState.FULL_SCREEN) {
|
||||
if (refreshMapCallback != null) {
|
||||
refreshMapCallback.refreshMap(false);
|
||||
refreshMapCallback.refreshMap(false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue