VERIFIED SOLUTION i
X

How to ensure the default tab file style is used when adding new features in the Workspace Manager in MapXtreme.NET

UPDATED: July 19, 2017


When adding a new polygon to a tab file in the MapXtreme Workspace Manager, does not keep it default style implemented in MapInfo Pro.

To use the DefaultStyle from the tab file metadata, you will need to get an instance of the Default Style object and use it to set the style of each feature to be inserted.

The code for this can be found be below:

TableInfo srcTableInfo = srcTable.TableInfo;
GeometryColumn gc = srcTableInfo.Columns["obj"] as GeometryColumn; //Here obj is the name of the Geometry Column in the table. It can vary from table to table. There can be other ways to acquire this object.
Style defaultStyle = gc.DefaultStyle;
......................................
......................................
NewFeature.Geometry = F.mapFeature.Geometry;
NewFeature.Style= defaultStyle;

Downloads

  • No Downloads