fix bug where setting destination killed waypoints in some cases
This commit is contained in:
parent
120f8dca3a
commit
67b252a129
4 changed files with 7 additions and 7 deletions
|
@ -190,8 +190,10 @@ public class TargetPointsHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setSingleDestination(double lat, double lon, String historyName) {
|
public void setDestination(double lat, double lon, String historyName) {
|
||||||
clearPointToNavigate(false);
|
//clearPointToNavigate(false);
|
||||||
|
// Do not delete waypoints here
|
||||||
|
settings.clearPointToNavigate();
|
||||||
settings.setPointToNavigate(lat, lon, true, historyName);
|
settings.setPointToNavigate(lat, lon, true, historyName);
|
||||||
updatePointsFromSettings();
|
updatePointsFromSettings();
|
||||||
|
|
||||||
|
|
|
@ -1256,7 +1256,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
if(onShow != null) {
|
if(onShow != null) {
|
||||||
onShow.onClick(v);
|
onShow.onClick(v);
|
||||||
}
|
}
|
||||||
targetPointsHelper.setSingleDestination(location.getLatitude(), location.getLongitude(), name);
|
targetPointsHelper.setDestination(location.getLatitude(), location.getLongitude(), name);
|
||||||
MapActivity.launchMapActivityMoveToTop(activity);
|
MapActivity.launchMapActivityMoveToTop(activity);
|
||||||
qa.dismiss();
|
qa.dismiss();
|
||||||
}
|
}
|
||||||
|
|
|
@ -256,8 +256,7 @@ public class NavigatePointFragment extends SherlockFragment implements SearchAct
|
||||||
double lon = convert(((TextView) view.findViewById(R.id.LongitudeEdit)).getText().toString());
|
double lon = convert(((TextView) view.findViewById(R.id.LongitudeEdit)).getText().toString());
|
||||||
TargetPointsHelper targetPointsHelper = ((OsmandApplication) getActivity().getApplication()).getTargetPointsHelper();
|
TargetPointsHelper targetPointsHelper = ((OsmandApplication) getActivity().getApplication()).getTargetPointsHelper();
|
||||||
if (mode == NAVIGATE_TO) {
|
if (mode == NAVIGATE_TO) {
|
||||||
//TODO: Do not delete waypoints here!
|
targetPointsHelper.setDestination(lat, lon, getString(R.string.point_on_map, lat, lon));
|
||||||
targetPointsHelper.setSingleDestination(lat, lon, getString(R.string.point_on_map, lat, lon));
|
|
||||||
MapActivity.launchMapActivityMoveToTop(getActivity());
|
MapActivity.launchMapActivityMoveToTop(getActivity());
|
||||||
} else if (mode == ADD_WAYPOINT) {
|
} else if (mode == ADD_WAYPOINT) {
|
||||||
MapActivityActions.navigatePointDialogAndLaunchMap(getActivity(), lat, lon, getString(R.string.point_on_map, lat, lon));
|
MapActivityActions.navigatePointDialogAndLaunchMap(getActivity(), lat, lon, getString(R.string.point_on_map, lat, lon));
|
||||||
|
|
|
@ -294,8 +294,7 @@ public class SearchAddressFragment extends SherlockFragment {
|
||||||
OsmandApplication ctx = (OsmandApplication) getActivity().getApplication();
|
OsmandApplication ctx = (OsmandApplication) getActivity().getApplication();
|
||||||
final TargetPointsHelper targetPointsHelper = ctx.getTargetPointsHelper();
|
final TargetPointsHelper targetPointsHelper = ctx.getTargetPointsHelper();
|
||||||
if (mode == NAVIGATE_TO) {
|
if (mode == NAVIGATE_TO) {
|
||||||
//TODO: Do not delete waypoints here!
|
targetPointsHelper.setDestination(searchPoint.getLatitude(), searchPoint.getLongitude(), historyName);
|
||||||
targetPointsHelper.setSingleDestination(searchPoint.getLatitude(), searchPoint.getLongitude(), historyName);
|
|
||||||
MapActivity.launchMapActivityMoveToTop(getActivity());
|
MapActivity.launchMapActivityMoveToTop(getActivity());
|
||||||
} else if (mode == ADD_WAYPOINT) {
|
} else if (mode == ADD_WAYPOINT) {
|
||||||
MapActivityActions.navigatePointDialogAndLaunchMap(getActivity(), searchPoint.getLatitude(), searchPoint.getLongitude(), historyName);
|
MapActivityActions.navigatePointDialogAndLaunchMap(getActivity(), searchPoint.getLatitude(), searchPoint.getLongitude(), historyName);
|
||||||
|
|
Loading…
Reference in a new issue