Cancel snap to road after selecting default app mode
This commit is contained in:
parent
bb34542043
commit
833aebd171
1 changed files with 6 additions and 1 deletions
|
@ -408,9 +408,13 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
|
|||
@Override
|
||||
public void onApplicationModeItemClick(ApplicationMode mode) {
|
||||
if (planRouteContext.getSnappedMode() != mode) {
|
||||
boolean defaultMode = mode == ApplicationMode.DEFAULT;
|
||||
MapMarkersLayer layer = getMapMarkersLayer();
|
||||
if (layer != null) {
|
||||
layer.setDefaultAppMode(mode == ApplicationMode.DEFAULT);
|
||||
layer.setDefaultAppMode(defaultMode);
|
||||
}
|
||||
if (defaultMode) {
|
||||
planRouteContext.cancelSnapToRoad();
|
||||
}
|
||||
planRouteContext.getSnappedToRoadPoints().clear();
|
||||
planRouteContext.setSnappedMode(mode);
|
||||
|
@ -731,6 +735,7 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
|
|||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null) {
|
||||
mapActivity.getMapLayers().getMapMarkersLayer().setRoute(planRouteContext.getSnapTrkSegment());
|
||||
mapActivity.refreshMap();
|
||||
if (adjustMap) {
|
||||
showRouteOnMap(planRouteContext.getSnapTrkSegment().points);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue