ThinkGeo.com    |     Documentation    |     Premium Support

The FeatureSource is not editable

<a>WfsFeatureSource</a> is not editable? 

 WfsFeatureLayer wfl = new WfsFeatureLayer(url, typename);
            wfl.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = new AreaStyle(new GeoSolidBrush(GeoColor.StandardColors.LightGreen));
            wfl.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            try {

                RectangleShape rs = new RectangleShape(45, 50, 70, 35);
                PolygonShape ps = rs.ToPolygon();
                Feature feature_ps = new Feature(ps);
                feature_ps.ColumnValues.Add("MAX_ROW_NUM", "0");
                feature_ps.ColumnValues.Add("GRIDNAME", "特殊堆场");
                feature_ps.ColumnValues.Add("AREA_NUM", "0");
                feature_ps.ColumnValues.Add("BAY_NUM", "0");
                feature_ps.ColumnValues.Add("ROW_NUM", "0");
                feature_ps.ColumnValues.Add("MAX_TIER_NUM", "0");
                wfl.Open();
                wfl.FeatureSource.BeginTransaction();
                wfl.FeatureSource.AddFeature(feature_ps);
                TransactionResult tr = wfl.FeatureSource.CommitTransaction();
                wfl.Close();
            
            }
            catch (Exception ex) {
                Console.WriteLine(ex.Message);//throw Exception  The FeatureSource is not editable.
            
            }


Hi Zhang, 
  
 The WfsFeatureLayer is not supported in our core like the exception says as they are just some service layers which provides the map image on the fly. 
  
 Regards, 
 Johnny

Thanks Johnny 









I Konw OracleFeatureLayer  can delete a feature from OracleDB ,but can  OracleFeatureLayer  add a Feature to OracleDB?   Can you  give me an Example?

Zhang, 
  
 You are welcome. For the oracle sample, I guess there is a duplicate thread, please refer to thinkgeo.com/forums/MapSuite/tabid/143/aft/11687/Default.aspx 
  
 Regards, 
 Johnny