diff --git a/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java b/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java index 858bde22f5..b213d31a17 100644 --- a/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java +++ b/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java @@ -190,8 +190,10 @@ public class TargetPointsHelper { } - public void setSingleDestination(double lat, double lon, String historyName) { - clearPointToNavigate(false); + public void setDestination(double lat, double lon, String historyName) { + //clearPointToNavigate(false); + // Do not delete waypoints here + settings.clearPointToNavigate(); settings.setPointToNavigate(lat, lon, true, historyName); updatePointsFromSettings(); diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index ad5e3dcb7e..e82d222d6b 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -1256,7 +1256,7 @@ public class MapActivityActions implements DialogProvider { if(onShow != null) { onShow.onClick(v); } - targetPointsHelper.setSingleDestination(location.getLatitude(), location.getLongitude(), name); + targetPointsHelper.setDestination(location.getLatitude(), location.getLongitude(), name); MapActivity.launchMapActivityMoveToTop(activity); qa.dismiss(); } diff --git a/OsmAnd/src/net/osmand/plus/activities/NavigatePointFragment.java b/OsmAnd/src/net/osmand/plus/activities/NavigatePointFragment.java index e0eee101e1..88de9092f6 100644 --- a/OsmAnd/src/net/osmand/plus/activities/NavigatePointFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/NavigatePointFragment.java @@ -256,8 +256,7 @@ public class NavigatePointFragment extends SherlockFragment implements SearchAct double lon = convert(((TextView) view.findViewById(R.id.LongitudeEdit)).getText().toString()); TargetPointsHelper targetPointsHelper = ((OsmandApplication) getActivity().getApplication()).getTargetPointsHelper(); if (mode == NAVIGATE_TO) { - //TODO: Do not delete waypoints here! - targetPointsHelper.setSingleDestination(lat, lon, getString(R.string.point_on_map, lat, lon)); + targetPointsHelper.setDestination(lat, lon, getString(R.string.point_on_map, lat, lon)); MapActivity.launchMapActivityMoveToTop(getActivity()); } else if (mode == ADD_WAYPOINT) { MapActivityActions.navigatePointDialogAndLaunchMap(getActivity(), lat, lon, getString(R.string.point_on_map, lat, lon)); diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressFragment.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressFragment.java index a8a94cdfd8..388afcfcab 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressFragment.java @@ -294,8 +294,7 @@ public class SearchAddressFragment extends SherlockFragment { OsmandApplication ctx = (OsmandApplication) getActivity().getApplication(); final TargetPointsHelper targetPointsHelper = ctx.getTargetPointsHelper(); if (mode == NAVIGATE_TO) { - //TODO: Do not delete waypoints here! - targetPointsHelper.setSingleDestination(searchPoint.getLatitude(), searchPoint.getLongitude(), historyName); + targetPointsHelper.setDestination(searchPoint.getLatitude(), searchPoint.getLongitude(), historyName); MapActivity.launchMapActivityMoveToTop(getActivity()); } else if (mode == ADD_WAYPOINT) { MapActivityActions.navigatePointDialogAndLaunchMap(getActivity(), searchPoint.getLatitude(), searchPoint.getLongitude(), historyName);