Merge remote-tracking branch 'origin/plan_route_options' into plan_route_options

This commit is contained in:
Dima-1 2020-08-04 12:10:44 +03:00
commit d1d3129996

View file

@ -1465,6 +1465,8 @@ public class MeasurementToolFragment extends BaseOsmAndFragment {
private ProgressDialog progressDialog;
private File toSave;
private boolean exportRouteAsGpx = false;
@Override
protected void onPreExecute() {
cancelModes();
@ -1505,6 +1507,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment {
gpx.tracks.add(track);
} else if (saveType == SaveType.ROUTE_POINT) {
if (editingCtx.isInSnapToRoadMode()) {
exportRouteAsGpx = true;
editingCtx.exportRouteAsGpx(trackName, new ExportAsGpxListener() {
@Override
public void onExportAsGpxFinished(GPXFile gpx) {
@ -1589,8 +1592,10 @@ public class MeasurementToolFragment extends BaseOsmAndFragment {
@Override
protected void onPostExecute(Exception warning) {
if (!exportRouteAsGpx) {
onGpxSaved(warning);
}
}
private void onGpxSaved(Exception warning) {
final MapActivity mapActivity = getMapActivity();