AddOverlay
public MapTool1()
{
IsSketchTool = true;
SketchType = SketchGeometryType.Line;
SketchOutputMode = SketchOutputMode.Map;
}
protected override Task OnToolActivateAsync(bool active)
{
return base.OnToolActivateAsync(active);
}
protected async override Task<bool> OnSketchCompleteAsync(Geometry geometry)
{
var polyline = geometry as Polyline;
if (polyline != null)
{
var sR = polyline.SpatialReference;
// make more vertices ... using tolerance to cover projected / non-projected coord systems
var denseDistance = sR.XYTolerance * 1000;
var denseLine = GeometryEngine.Instance.DensifyByLength(polyline, denseDistance) as Polyline;
await QueuedTask.Run(() =>
{
//var movedZup = GeometryEngine.Instance.Move(result.Geometry, 0, 0, 1) as Polyline;
ActiveMapView.AddOverlay(polyline);
});
}
return true;
}
}