首先导入
using MapInfo.Data;
using MapInfo.Engine;
using MapInfo.Mapping;
1 private void CreateTempTable()
2 {
3 MapInfo.Mapping.Map map = Session.Current.MapFactory[0];
4 IMapLayer lyr = map.Layers["Animation"];
5 if (lyr == null)
6 {
7 TableInfoMemTable ti = new TableInfoMemTable("Animation");
8 ti.Columns.Add(ColumnFactory.CreateFeatureGeometryColumn(map.GetDisplayCoordSys()));
9 ti.Columns.Add(ColumnFactory.CreateStyleColumn());
10 Table table = MapInfo.Engine.Session.Current.Catalog.CreateTable(ti);
11 map.Layers.Insert(0, new FeatureLayer(table, "Animation", "Animation"));
12 }
13 }
2 {
3 MapInfo.Mapping.Map map = Session.Current.MapFactory[0];
4 IMapLayer lyr = map.Layers["Animation"];
5 if (lyr == null)
6 {
7 TableInfoMemTable ti = new TableInfoMemTable("Animation");
8 ti.Columns.Add(ColumnFactory.CreateFeatureGeometryColumn(map.GetDisplayCoordSys()));
9 ti.Columns.Add(ColumnFactory.CreateStyleColumn());
10 Table table = MapInfo.Engine.Session.Current.Catalog.CreateTable(ti);
11 map.Layers.Insert(0, new FeatureLayer(table, "Animation", "Animation"));
12 }
13 }