Remove snappedToRoadPoints from layer
This commit is contained in:
parent
2871edbb55
commit
9a3cafc431
3 changed files with 6 additions and 23 deletions
|
@ -20,7 +20,6 @@ import net.osmand.plus.views.OsmandMapLayer;
|
|||
import net.osmand.plus.views.OsmandMapTileView;
|
||||
import net.osmand.util.MapUtils;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import gnu.trove.list.array.TIntArrayList;
|
||||
|
@ -29,7 +28,6 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL
|
|||
|
||||
private OsmandMapTileView view;
|
||||
private boolean inMeasurementMode;
|
||||
private List<WptPt> snappedToRoadPoints = new LinkedList<>();
|
||||
private Bitmap centerIconDay;
|
||||
private Bitmap centerIconNight;
|
||||
private Bitmap pointIcon;
|
||||
|
@ -118,10 +116,6 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL
|
|||
this.inMeasurementMode = inMeasurementMode;
|
||||
}
|
||||
|
||||
public List<WptPt> getSnappedToRoadPoints() {
|
||||
return snappedToRoadPoints;
|
||||
}
|
||||
|
||||
String getDistanceSt() {
|
||||
float dist = 0;
|
||||
List<WptPt> measurementPoints = editingCtx.getPoints();
|
||||
|
@ -255,12 +249,7 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL
|
|||
}
|
||||
}
|
||||
|
||||
List<WptPt> drawPoints;
|
||||
if (snappedToRoadPoints.size() > 0) {
|
||||
drawPoints = snappedToRoadPoints;
|
||||
} else {
|
||||
drawPoints = editingCtx.getPoints();
|
||||
}
|
||||
List<WptPt> drawPoints = editingCtx.getPoints();
|
||||
|
||||
if (drawPoints.size() > 0) {
|
||||
path.reset();
|
||||
|
|
|
@ -9,7 +9,6 @@ import java.util.List;
|
|||
public class ClearPointsCommand extends MeasurementModeCommand {
|
||||
|
||||
private List<WptPt> points;
|
||||
private List<WptPt> snappedToRoadPoints;
|
||||
|
||||
public ClearPointsCommand(MeasurementToolLayer measurementLayer) {
|
||||
this.measurementLayer = measurementLayer;
|
||||
|
@ -18,11 +17,8 @@ public class ClearPointsCommand extends MeasurementModeCommand {
|
|||
@Override
|
||||
public boolean execute() {
|
||||
List<WptPt> pts = measurementLayer.getEditingCtx().getPoints();
|
||||
List<WptPt> snappedPts = measurementLayer.getSnappedToRoadPoints();
|
||||
points = new LinkedList<>(pts);
|
||||
snappedToRoadPoints = new LinkedList<>(snappedPts);
|
||||
pts.clear();
|
||||
snappedPts.clear();
|
||||
measurementLayer.refreshMap();
|
||||
return true;
|
||||
}
|
||||
|
@ -30,14 +26,12 @@ public class ClearPointsCommand extends MeasurementModeCommand {
|
|||
@Override
|
||||
public void undo() {
|
||||
measurementLayer.getEditingCtx().getPoints().addAll(points);
|
||||
measurementLayer.getSnappedToRoadPoints().addAll(snappedToRoadPoints);
|
||||
measurementLayer.refreshMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void redo() {
|
||||
measurementLayer.getEditingCtx().getPoints().clear();
|
||||
measurementLayer.getSnappedToRoadPoints().clear();
|
||||
measurementLayer.refreshMap();
|
||||
}
|
||||
|
||||
|
|
|
@ -16,21 +16,21 @@ public class SnapToRoadCommand extends MeasurementModeCommand {
|
|||
|
||||
@Override
|
||||
public boolean execute() {
|
||||
measurementLayer.getSnappedToRoadPoints().clear();
|
||||
measurementLayer.getSnappedToRoadPoints().addAll(snappedPoints);
|
||||
measurementLayer.refreshMap();
|
||||
// measurementLayer.getSnappedToRoadPoints().clear();
|
||||
// measurementLayer.getSnappedToRoadPoints().addAll(snappedPoints);
|
||||
// measurementLayer.refreshMap();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
measurementLayer.getSnappedToRoadPoints().clear();
|
||||
// measurementLayer.getSnappedToRoadPoints().clear();
|
||||
measurementLayer.refreshMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void redo() {
|
||||
measurementLayer.getSnappedToRoadPoints().addAll(snappedPoints);
|
||||
// measurementLayer.getSnappedToRoadPoints().addAll(snappedPoints);
|
||||
measurementLayer.refreshMap();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue