UNVERIFIED SOLUTION i
X

MapXtreme: Polygon(s) covering smaller polygons when the smaller polygons should appear on top in MapXtreme 7.2

Issue

A polygon(s) which should appear underneath other polygons, appear on top of the other polygons.

Cause

The is a know issue in MapXtreme and has been raised has a feature request by our engineering

Resolution

UPDATED: March 30, 2017


Please use the following workaround in your code:

In MapXtreme ResultSet tables (IResultSetFeatureCollection) can get the correct drawing order.

For example:

1. After creating the TableInfoMemTable object, insert the geomerties into the MemTable and open the MemTable using Catlog.OpenTable(). Do Not add the table as feature layer.
2. Try to get ResultSet table (IResultSetFeatureCollection) from opened MemTable something like:
private IResultSetFeatureCollection ReadAllFeatureUsingIRFC(string tableAlias)
{
MIConnection conn = new MIConnection();
conn.Open();
MICommand cmd = conn.CreateCommand();
IResultSetFeatureCollection irfc = null;
try
{ cmd.CommandText = "select * from " + tableAlias; irfc = cmd.ExecuteFeatureCollection(); }
finally
{ cmd.Dispose(); conn.Close(); }
return irfc;
}
And add the featureLayer like below to get the correct object drawing order.
IResultSetFeatureCollection irfc = ReadAllFeatureUsingIRFC("MemTable");
MapCtrl.Map.Layers.Add(new FeatureLayer(irfc.Table));

Using the above may stop the ability to save tab files. Please also use the following code:
You can have TableInfoNative object and insert the feature in it. Also TableInfoNative object can be saved on to the disc as well.
The following code will work:

TableInfoNative ti = new TableInfoNative("NativeTable");
ti.TablePath = @"e:\MXT-7638.Tab";
ti.DataPath = @"e:\MXT-7638.Dat";
ti.Columns.Add(ColumnFactory.CreateIndexedIntColumn("ID"));
ti.Columns.Add(ColumnFactory.CreateStyleColumn());
ti.Columns.Add(ColumnFactory.CreateFeatureGeometryColumn(MapCtrl.Map.GetDisplayCoordSys()));
Table t = Session.Current.Catalog.CreateTable(ti);
ti.WriteTabFile();
// Add features
// Draw features using IRFC


 

Environment Details


 

Downloads

  • No Downloads