ThinkGeo.com    |     Documentation    |     Premium Support

WCF example for persisting map data

Hi Yale,


   Suppose we have a two tier map application. The frontend resides the application GUI where a polygon zone is created,

have you got some sample code which shows how to send the polygon data back to the backend through certain WCF service agent , and the WCF service performs the data saving with MapSuite 4.0 API? Thanks very much.


Franklin


 


 


 



Franklin,


Thanks for your post and questions.
Following is the basic API to save a polygon into shape file, hope it helps. We have some WCF service sample in our Service Edition, did you get a chance to have a look?

 

ShapeFileFeatureLayer shapeFileFeatureLayer = new ShapeFileFeatureLayer(@"", ShapeFileReadWriteMode.ReadWrite);
shapeFileFeatureLayer.Open();
try
{
      shapeFileFeatureLayer.EditTools.BeginTransaction();
      shapeFileFeatureLayer.EditTools.Add(polygon);
      TransactionResult result = shapeFileFeatureLayer.EditTools.CommitTransaction();
}
finally
{
      shapeFileFeatureLayer.Close();
}


Thanks.
Yale