Hi,
To draw a hole in a polygon, I select a polygon and then draw a polygon over it and click a button which executes the following code:
ShapeFileLayer1.Open();
ShapeFileLayer1.EditTools.BeginTransaction();
AreaBaseShape areaBaseShape1 = (AreaBaseShape)(ShapeFileLayer1.FeatureSource.GetFeatureById(selectedFeatureId,
new
string
[0])).GetShape();
AreaBaseShape areaShape2 = (AreaBaseShape)wpfMap1.TrackOverlay.TrackShapeLayer.InternalFeatures[0].GetShape();
MultipolygonShape resultMultiPolygonShape = areaBaseShape1.GetDifference(areaShape2);
ShapeFileLayer1.EditTools.Delete(selectedFeatureId);
ShapeFileLayer1.EditTools.Add(resultMultiPolygonShape);
ShapeFileLayer1.EditTools.CommitTransaction();
ShapeFileLayer1.Close();
This draws the polygon with the hole, but instead of deleting and adding the feature, I wish to use the ShapeFileLayer1.EditTools.Update method. I am unable to get the desired result when I use the Update method.
1. How can I use the Update method in the above scenario?
2. Is the GetDifference method recommended for drawing polygons with holes?
Thanks,
Jacob