Do not adjust the map after snap to road

This commit is contained in:
Alexander Sytnyk 2017-10-04 18:51:34 +03:00
parent 26c8e6c185
commit 7c362fd4f1

View file

@ -604,13 +604,15 @@ public class PlanRouteFragment extends Fragment {
}
}
private void showMarkersRouteOnMap() {
private void showMarkersRouteOnMap(boolean adjustMap) {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
mapActivity.getMapLayers().getMapMarkersLayer().setRoute(snapTrkSegment);
if (adjustMap) {
showRouteOnMap(snapTrkSegment.points);
}
}
}
private void showRouteOnMap(List<WptPt> points) {
MapActivity mapActivity = getMapActivity();
@ -786,6 +788,10 @@ public class PlanRouteFragment extends Fragment {
}
private void recreateSnapTrkSegment() {
recreateSnapTrkSegment(true);
}
private void recreateSnapTrkSegment(boolean adjustMap) {
snapTrkSegment.points.clear();
List<WptPt> points = getPointsToCalculate();
if (appMode.getStringKey().equals(ApplicationMode.DEFAULT.getStringKey())) {
@ -802,7 +808,7 @@ public class PlanRouteFragment extends Fragment {
}
}
}
showMarkersRouteOnMap();
showMarkersRouteOnMap(adjustMap);
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
mapActivity.getMyApplication().runInUIThread(new Runnable() {
@ -914,7 +920,7 @@ public class PlanRouteFragment extends Fragment {
}
calculatedPairs++;
snappedToRoadPoints.put(currentPair, pts);
recreateSnapTrkSegment();
recreateSnapTrkSegment(false);
app.runInUIThread(new Runnable() {
@Override
public void run() {