Show original track line
This commit is contained in:
parent
f232395a71
commit
9c1ffd6c13
2 changed files with 17 additions and 1 deletions
|
@ -61,6 +61,7 @@ public class MeasurementEditingContext {
|
||||||
|
|
||||||
private boolean inAddPointMode;
|
private boolean inAddPointMode;
|
||||||
private boolean inApproximationMode;
|
private boolean inApproximationMode;
|
||||||
|
List<WptPt> originalTrackPointList = new ArrayList<>();
|
||||||
private int calculatedPairs;
|
private int calculatedPairs;
|
||||||
private int pointsToCalculateSize;
|
private int pointsToCalculateSize;
|
||||||
private CalculationMode lastCalculationMode = WHOLE_TRACK;
|
private CalculationMode lastCalculationMode = WHOLE_TRACK;
|
||||||
|
@ -69,6 +70,7 @@ public class MeasurementEditingContext {
|
||||||
private RouteCalculationProgress calculationProgress;
|
private RouteCalculationProgress calculationProgress;
|
||||||
private Map<Pair<WptPt, WptPt>, RoadSegmentData> roadSegmentData = new ConcurrentHashMap<>();
|
private Map<Pair<WptPt, WptPt>, RoadSegmentData> roadSegmentData = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
|
||||||
public enum CalculationMode {
|
public enum CalculationMode {
|
||||||
NEXT_SEGMENT,
|
NEXT_SEGMENT,
|
||||||
WHOLE_TRACK
|
WHOLE_TRACK
|
||||||
|
@ -182,8 +184,14 @@ public class MeasurementEditingContext {
|
||||||
|
|
||||||
public void setInApproximationMode(boolean inApproximationMode) {
|
public void setInApproximationMode(boolean inApproximationMode) {
|
||||||
this.inApproximationMode = inApproximationMode;
|
this.inApproximationMode = inApproximationMode;
|
||||||
|
if (inApproximationMode) {
|
||||||
|
originalTrackPointList = new ArrayList<>(before.points);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<WptPt> getOriginalTrackPointList() {
|
||||||
|
return originalTrackPointList;
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
GpxData getGpxData() {
|
GpxData getGpxData() {
|
||||||
|
|
|
@ -7,6 +7,8 @@ import android.graphics.Paint;
|
||||||
import android.graphics.Path;
|
import android.graphics.Path;
|
||||||
import android.graphics.PointF;
|
import android.graphics.PointF;
|
||||||
|
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
import net.osmand.GPXUtilities.TrkSegment;
|
import net.osmand.GPXUtilities.TrkSegment;
|
||||||
import net.osmand.GPXUtilities.WptPt;
|
import net.osmand.GPXUtilities.WptPt;
|
||||||
import net.osmand.Location;
|
import net.osmand.Location;
|
||||||
|
@ -178,7 +180,13 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL
|
||||||
TrkSegment after = editingCtx.getAfterTrkSegmentLine();
|
TrkSegment after = editingCtx.getAfterTrkSegmentLine();
|
||||||
new Renderable.StandardTrack(new ArrayList<>(after.points), 17.2).
|
new Renderable.StandardTrack(new ArrayList<>(after.points), 17.2).
|
||||||
drawSegment(view.getZoom(), lineAttrs.paint, canvas, tb);
|
drawSegment(view.getZoom(), lineAttrs.paint, canvas, tb);
|
||||||
|
if (editingCtx.isInApproximationMode()) {
|
||||||
|
List<WptPt> current = editingCtx.getOriginalTrackPointList();
|
||||||
|
lineAttrs.customColorPaint.setColor(ContextCompat.getColor(view.getContext(),
|
||||||
|
R.color.activity_background_transparent_color_dark));
|
||||||
|
new Renderable.StandardTrack(new ArrayList<>(current), 17.2).
|
||||||
|
drawSegment(view.getZoom(), lineAttrs.customColorPaint, canvas, tb);
|
||||||
|
}
|
||||||
drawPoints(canvas, tb);
|
drawPoints(canvas, tb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue