David,
Thanks for your post. This is some advanced topic to create and have your own EditOverlay.
Hope my following answers and codes can give you some help to move forward.
We will create new features without copy there tag information, so it would be taken off which seems can be enhanced somehow. But we leave the ColumnValues of the control point feature to record any information of the corresponding vertex, in which you can add as many information as you want.
Following contains some sample codes which I will record the original vertex coordinates information. We only deal with the PolygonShape without pay any attention to other type of feature. Just take a reference.
protected override IEnumerable<Feature> CalculateVertexControlPointsCore(Feature feature)
{
WellKnownType wellKnowType = feature.GetWellKnownType();
IEnumerable<Feature> returnValues = new Collection<Feature>();
returnValues = CaculateVertexControlPointsForPolygonTypeFeature(feature);
return returnValues;
}
private static IEnumerable<Feature> CaculateVertexControlPointsForPolygonTypeFeature(Feature polygonFeature)
{
Collection<Feature> returnValues = new Collection<Feature>();
PolygonShape polygonShape = polygonFeature.GetShape() as PolygonShape;
RectangleShape boundingBox = polygonShape.GetBoundingBox();
RingShape outRing = polygonShape.OuterRing;
for (int k = 0; k < outRing.Vertices.Count; k++)
{
Feature reshapeFeature = new Feature(outRing.Vertices[k].X + 10.0, outRing.Vertices[k].Y);
reshapeFeature.ColumnValues.Add("OriginalX", outRing.Vertices[k].X.ToString());
reshapeFeature.ColumnValues.Add("OriginalY", outRing.Vertices[k].Y.ToString());
returnValues.Add(reshapeFeature);
}
for (int j = 0; j < polygonShape.InnerRings.Count; j++)
{
RingShape innerRing = polygonShape.InnerRings[j];
for (int k = 0; k < innerRing.Vertices.Count; k++)
{
Feature reshapeFeature = new Feature(innerRing.Vertices[k].X + 10.0, innerRing.Vertices[k].Y);
reshapeFeature.ColumnValues.Add("OriginalX", innerRing.Vertices[k].X.ToString());
reshapeFeature.ColumnValues.Add("OriginalY", innerRing.Vertices[k].Y.ToString());
returnValues.Add(reshapeFeature);
}
}
return returnValues;
}
Any more questions just let me know.
Thanks.
Yale.