Update route from current location
This commit is contained in:
parent
fb87f9093c
commit
e6580e8829
4 changed files with 5 additions and 17 deletions
|
@ -4,15 +4,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
|
||||
<!-- <LinearLayout
|
||||
android:id="@+id/TopBar"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal" /> -->
|
||||
|
||||
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="fill_parent"
|
||||
|
|
|
@ -143,9 +143,8 @@ public class TargetPointsHelper {
|
|||
|
||||
public void updateRoutingHelper() {
|
||||
LatLon start = settings.getPointToStart();
|
||||
if((routingHelper.isFollowingMode() && routingHelper.getLastProjection() != null) || start == null) {
|
||||
Location lastKnownLocation = ctx.getLocationProvider().getLastKnownLocation();
|
||||
//Location lastKnownLocation = routingHelper.getLastProjection();
|
||||
Location lastKnownLocation = ctx.getLocationProvider().getLastKnownLocation();
|
||||
if((routingHelper.isFollowingMode() && lastKnownLocation != null) || start == null) {
|
||||
routingHelper.setFinalAndCurrentLocation(settings.getPointToNavigate(),
|
||||
settings.getIntermediatePoints(), lastKnownLocation, routingHelper.getCurrentGPXRoute());
|
||||
} else {
|
||||
|
|
|
@ -468,9 +468,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
loc = ps.get(0);
|
||||
tg.setStartPoint(new LatLon(loc.getLatitude(), loc.getLongitude()), false, null);
|
||||
}
|
||||
tg.updateRoutingHelper();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -515,9 +513,8 @@ public class MapActivityActions implements DialogProvider {
|
|||
targets.setStartPoint(from, false, fromName);
|
||||
// then set gpx
|
||||
setGPXRouteParams(gpxFile);
|
||||
if(from != null) {
|
||||
targets.updateRoutingHelper();
|
||||
}
|
||||
// then update start and destination point
|
||||
targets.updateRoutingHelper();
|
||||
|
||||
mapActivity.getMapViewTrackingUtilities().switchToRoutePlanningMode();
|
||||
mapActivity.getMapView().refreshMap(true);
|
||||
|
|
|
@ -306,6 +306,7 @@ public class MapRoutePreferencesControl extends MapControls {
|
|||
@Override
|
||||
public boolean processResult(GPXFile result) {
|
||||
mapActivity.getMapActions().setGPXRouteParams(result);
|
||||
mapActivity.getMyApplication().getTargetPointsHelper().updateRoutingHelper();
|
||||
updateSpinnerItems(gpxSpinner);
|
||||
updateParameters();
|
||||
mapActivity.getRoutingHelper().recalculateRouteDueToSettingsChange();
|
||||
|
|
Loading…
Reference in a new issue