Use start location when sort waypoints (if possible)

This commit is contained in:
Victor Shcherb 2015-03-28 15:39:47 +01:00
parent d7188ba4b5
commit 91efb7041e
2 changed files with 5 additions and 1 deletions

View file

@ -155,6 +155,7 @@
android:layout_gravity="top|center" android:layout_gravity="top|center"
android:layout_marginTop="@dimen/map_button_margin" android:layout_marginTop="@dimen/map_button_margin"
android:background="@drawable/btn_round" android:background="@drawable/btn_round"
android:visibility="gone"
android:orientation="vertical" > android:orientation="vertical" >
<ImageView <ImageView

View file

@ -19,7 +19,6 @@ import net.osmand.util.MapUtils;
import android.app.Activity; import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.AlertDialog.Builder; import android.app.AlertDialog.Builder;
import android.app.Application;
import android.app.Dialog; import android.app.Dialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.DialogInterface.OnShowListener; import android.content.DialogInterface.OnShowListener;
@ -149,6 +148,10 @@ public class IntermediatePointsDialog {
if(cll != null) { if(cll != null) {
LatLon ll = new LatLon(cll.getLatitude(), cll.getLongitude()); LatLon ll = new LatLon(cll.getLatitude(), cll.getLongitude());
start = TargetPoint.create(ll, null); start = TargetPoint.create(ll, null);
} else if(app.getTargetPointsHelper().getPointToStart() != null) {
TargetPoint ps = app.getTargetPointsHelper().getPointToStart();
LatLon ll = new LatLon(ps.getLatitude(), ps.getLongitude());
start = TargetPoint.create(ll, null);
// } else if(activity instanceof MapActivity) { // } else if(activity instanceof MapActivity) {
// LatLon ll = new LatLon(((MapActivity) activity).getMapView().getLatitude(), ((MapActivity) activity).getMapView().getLongitude()); // LatLon ll = new LatLon(((MapActivity) activity).getMapView().getLatitude(), ((MapActivity) activity).getMapView().getLongitude());
// start = TargetPoint.create(ll, null); // start = TargetPoint.create(ll, null);