Merge remote-tracking branch 'origin/master' into fix_online_routing_ui

This commit is contained in:
Skalii 2021-01-18 15:59:37 +02:00
commit becb780a7f
2 changed files with 5 additions and 5 deletions

View file

@ -69,9 +69,9 @@ public class OrsEngine extends OnlineRoutingEngine {
LatLon start = path.get(0); LatLon start = path.get(0);
LatLon end = path.get(path.size() - 1); LatLon end = path.get(path.size() - 1);
sb.append('&').append("start=") sb.append('&').append("start=")
.append(start.getLatitude()).append(',').append(start.getLongitude()); .append(start.getLongitude()).append(',').append(start.getLatitude());
sb.append('&').append("end=") sb.append('&').append("end=")
.append(end.getLatitude()).append(',').append(end.getLongitude()); .append(end.getLongitude()).append(',').append(end.getLatitude());
} }
} }
@ -84,8 +84,8 @@ public class OrsEngine extends OnlineRoutingEngine {
List<LatLon> track = new ArrayList<>(); List<LatLon> track = new ArrayList<>();
for (int i = 0; i < array.length(); i++) { for (int i = 0; i < array.length(); i++) {
JSONArray point = array.getJSONArray(i); JSONArray point = array.getJSONArray(i);
double lat = Double.parseDouble(point.getString(0)); double lon = Double.parseDouble(point.getString(0));
double lon = Double.parseDouble(point.getString(1)); double lat = Double.parseDouble(point.getString(1));
track.add(new LatLon(lat, lon)); track.add(new LatLon(lat, lon));
} }
return track; return track;

View file

@ -662,6 +662,7 @@ public class OnlineRoutingEngineFragment extends BaseOsmAndFragment {
} }
private void restoreState(@NonNull Bundle savedState) { private void restoreState(@NonNull Bundle savedState) {
editedEngineKey = savedState.getString(EngineParameter.KEY.name());
initEngine = createInitStateEngine(); initEngine = createInitStateEngine();
String typeKey = savedState.getString(ENGINE_TYPE_KEY); String typeKey = savedState.getString(ENGINE_TYPE_KEY);
EngineType type = EngineType.getTypeByName(typeKey); EngineType type = EngineType.getTypeByName(typeKey);
@ -675,7 +676,6 @@ public class OnlineRoutingEngineFragment extends BaseOsmAndFragment {
customVehicleKey = savedState.getString(ENGINE_CUSTOM_VEHICLE_KEY); customVehicleKey = savedState.getString(ENGINE_CUSTOM_VEHICLE_KEY);
selectedLocation = ExampleLocation.valueOf(savedState.getString(EXAMPLE_LOCATION_KEY)); selectedLocation = ExampleLocation.valueOf(savedState.getString(EXAMPLE_LOCATION_KEY));
appMode = ApplicationMode.valueOfStringKey(savedState.getString(APP_MODE_KEY), null); appMode = ApplicationMode.valueOfStringKey(savedState.getString(APP_MODE_KEY), null);
editedEngineKey = savedState.getString(EngineParameter.KEY.name());
} }
private void initState() { private void initState() {