Hi Howard,
I guess what you did in the sample is to save the altered rectangle shape into polygondemo.shp with the help of editOverlay_EditEnded, right?
To show the effect of such an event handling, I added a Dislay button click event handler as follows:
private void DisplayBtn_Click(object sender, RoutedEventArgs e)
{
Map1.MapUnit = GeographyUnit.DecimalDegree;
ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(@"data\polygondemo.shp");
worldLayer.Open();
Collection<Feature> allFeatures = worldLayer.QueryTools.GetAllFeatures(ReturningColumnsType.NoColumns);
Map1.TrackOverlay.TrackMode = TrackMode.None;
foreach (Feature feature in allFeatures)
{
Map1.EditOverlay.EditShapesLayer.InternalFeatures.Add(feature);
}
Map1.EditOverlay.CalculateAllControlPoints();
Map1.TrackOverlay.TrackShapeLayer.InternalFeatures.Clear();
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.SimpleColors.Transparent, GeoColor.FromArgb(100, GeoColor.SimpleColors.Black));
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
LayerOverlay layerOverlay = new LayerOverlay();
// Add the shapefile layer to the layer overlay
layerOverlay.Layers.Add(worldLayer);
Map1.Overlays.Add(layerOverlay);
Map1.Refresh();
}
}
However, when i click the button, the samle application hangs up at worldLayer.Open(), with an error message complaining that the shp file is used by another process and is not accessable. Do you know how to resolve this issue?
Thanks. I think your approach is quite innovative.
Franklin