From d5d32b7674c7197f6c88dc36478e258e0be89ec8 Mon Sep 17 00:00:00 2001 From: nazar-kutz Date: Mon, 18 Jan 2021 13:18:51 +0200 Subject: [PATCH 1/2] Fix "exit confirmation dialog is displayed every time after screen was flipped" --- .../plus/onlinerouting/ui/OnlineRoutingEngineFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/onlinerouting/ui/OnlineRoutingEngineFragment.java b/OsmAnd/src/net/osmand/plus/onlinerouting/ui/OnlineRoutingEngineFragment.java index d362898275..433fda973c 100644 --- a/OsmAnd/src/net/osmand/plus/onlinerouting/ui/OnlineRoutingEngineFragment.java +++ b/OsmAnd/src/net/osmand/plus/onlinerouting/ui/OnlineRoutingEngineFragment.java @@ -658,6 +658,7 @@ public class OnlineRoutingEngineFragment extends BaseOsmAndFragment { } private void restoreState(@NonNull Bundle savedState) { + editedEngineKey = savedState.getString(EngineParameter.KEY.name()); initEngine = createInitStateEngine(); String typeKey = savedState.getString(ENGINE_TYPE_KEY); EngineType type = EngineType.getTypeByName(typeKey); @@ -671,7 +672,6 @@ public class OnlineRoutingEngineFragment extends BaseOsmAndFragment { customVehicleKey = savedState.getString(ENGINE_CUSTOM_VEHICLE_KEY); selectedLocation = ExampleLocation.valueOf(savedState.getString(EXAMPLE_LOCATION_KEY)); appMode = ApplicationMode.valueOfStringKey(savedState.getString(APP_MODE_KEY), null); - editedEngineKey = savedState.getString(EngineParameter.KEY.name()); } private void initState() { From c7dcc9b0cef2da3436219f403d3bd95234bf6515 Mon Sep 17 00:00:00 2001 From: nazar-kutz Date: Mon, 18 Jan 2021 13:48:05 +0200 Subject: [PATCH 2/2] Fix OpenRouteService parsing --- .../net/osmand/plus/onlinerouting/engine/OrsEngine.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/onlinerouting/engine/OrsEngine.java b/OsmAnd/src/net/osmand/plus/onlinerouting/engine/OrsEngine.java index 594e7e1b36..7c57737d46 100644 --- a/OsmAnd/src/net/osmand/plus/onlinerouting/engine/OrsEngine.java +++ b/OsmAnd/src/net/osmand/plus/onlinerouting/engine/OrsEngine.java @@ -69,9 +69,9 @@ public class OrsEngine extends OnlineRoutingEngine { LatLon start = path.get(0); LatLon end = path.get(path.size() - 1); sb.append('&').append("start=") - .append(start.getLatitude()).append(',').append(start.getLongitude()); + .append(start.getLongitude()).append(',').append(start.getLatitude()); 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 track = new ArrayList<>(); for (int i = 0; i < array.length(); i++) { JSONArray point = array.getJSONArray(i); - double lat = Double.parseDouble(point.getString(0)); - double lon = Double.parseDouble(point.getString(1)); + double lon = Double.parseDouble(point.getString(0)); + double lat = Double.parseDouble(point.getString(1)); track.add(new LatLon(lat, lon)); } return track;