I would like to know what the best way to alter a shapefiles feature is.
I've got my shapefile sitting on in a DynamicOverlay, I then have a DropDown list that lists all my editable shape files. when I select the layer in the dropdown list, it pushed the features of the layer to a HighlightOverlay.
I then have an edit button, that pushes the features onto the EditOverlay (I've noted that the features in the EditOverlay seem to lose all column data.) I can then edit the features however I want.
Once editing is complete, I then loop through all the EditOverlays features an either add them, or update them on the DynamicLayer. However, I have to do this by finding the dynamic layers feature by ID, then setting it to the editoverlayers feature, recreate the data that was originally there (as it gets cleared when setting it to the editoverlays feature) then updateing the dynamicoverlay.
The problem is this seems to be a very complicated was of performing what should be a simple task (I'm talking about the recreating of the data in the data columns) and on top of which, when I tell my DynamicOverlay to redraw at the end of the method, it seems to "Hide" my shapefile. I say "Hide" because my shapefile dissapears off the map. However if I stop the Web Site and restart it, my shapefile is there with all the features in the new places.
So once again my question is, what is the easiest way to update a feature (so the data is still there) and refresh the map to reflect the changes?
Please see my save method below:
ShapeFileFeatureLayer currentLayer = (ShapeFileFeatureLayer)mapMain.DynamicOverlay.Layers[cboEditLayer.SelectedItem.Text];
currentLayer.Open();
currentLayer.EditTools.BeginTransaction();
foreach (Feature feature in mapMain.EditOverlay.Features)
{
if (currentLayer.FeatureSource.GetFeatureById(feature.Id, ReturningColumnsType.AllColumns) == null)
{
currentLayer.FeatureSource.AddFeature(feature);
}
else
{
Feature f = currentLayer.FeatureSource.GetFeatureById(feature.Id, ReturningColumnsType.AllColumns);
Dictionary