ThinkGeo.com    |     Documentation    |     Premium Support

ShapeFileFeatureLayer.FeatureSource.UpdateFeature(feature);


ShapeFileFeatureLayer


 shapeFileLayer = (ShapeFileFeatureLayer)Map1.StaticOverlay.Layers["CitiesLayer"];

shapeFileLayer.Open();



shapeFileLayer.FeatureSource.BeginTransaction();



shapeFileLayer.FeatureSource.UpdateFeature(feature);



shapeFileLayer.FeatureSource.CommitTransaction();



Get Exaption:


File access error, you should open the shape file with ReadWrite mode.


How to open it?


 



Artem, 
  
 when you first create that layer, you should add the ReadWrite mode, the code should be like this 
 
ShapeFileFeatureLayer shapeFileLayer = new ShapeFileFeatureLayer("path", ShapeFileReadWriteMode.ReadWrite);
 
 Also, I noticed you are trying to edit the static overlay. Nothing is wrong here technically, but usually static overlay is supposed to be stable and we do changes on dynamic overlay, which is on top of the static one and we have a method map.RefreshDynamic to  redraw it only. 
  
 Thanks, 
  
 Ben