This commit is contained in:
Alexey Kulish 2017-10-14 17:40:35 +03:00
parent f19c2e51c0
commit 37b67363ce

View file

@ -366,12 +366,14 @@ public class MapActivityActions implements DialogProvider {
mapActivity.getRoutingHelper().setGpxParams(params); mapActivity.getRoutingHelper().setGpxParams(params);
settings.FOLLOW_THE_GPX_ROUTE.set(result.path); settings.FOLLOW_THE_GPX_ROUTE.set(result.path);
if (!ps.isEmpty()) { if (!ps.isEmpty()) {
Location loc = ps.get(ps.size() - 1); Location startLoc = ps.get(0);
Location finishLoc = ps.get(ps.size() - 1);
TargetPointsHelper tg = mapActivity.getMyApplication().getTargetPointsHelper(); TargetPointsHelper tg = mapActivity.getMyApplication().getTargetPointsHelper();
tg.navigateToPoint(new LatLon(loc.getLatitude(), loc.getLongitude()), false, -1); tg.navigateToPoint(new LatLon(finishLoc.getLatitude(), finishLoc.getLongitude()), false, -1);
if (tg.getPointToStart() == null) { if (startLoc != finishLoc) {
loc = ps.get(0); tg.setStartPoint(new LatLon(startLoc.getLatitude(), startLoc.getLongitude()), false, null);
tg.setStartPoint(new LatLon(loc.getLatitude(), loc.getLongitude()), false, null); } else {
tg.clearStartPoint(false);
} }
} }
} }