上面的方法是常用的方法,当然你可以在程序中建立MapLayer,然后把该MapLayer添加到MapControl中就可以了
例如:
TableInfoMemTable mytable = new TableInfoMemTable("Linetable")
TableInfoMemTable mybus = new TableInfoMemTable("bustable")
Table tableTemp = Session.Current.Catalog.GetTable("Linetable")
Table tableTem1 = Session.Current.Catalog.GetTable("bustable")
if (tableTemp != null)
{
tableTemp.Close()
}
if (tableTem1 != null)
{
tableTem1.Close()
}
mybus.Columns.Add(ColumnFactory.CreateFeatureGeometryColumn(mapControl1.Map.GetDisplayCoordSys()))
mybus.Columns.Add(ColumnFactory.CreateStyleColumn())
mybus.Columns.Add(ColumnFactory.CreateStringColumn("BusName", 30))
tableTem1 = Session.Current.Catalog.CreateTable(mybus)
FeatureLayer mybuslayer = new FeatureLayer(tableTem1)
mapControl1.Map.Layers.Insert(0,mybuslayer)
mytable.Columns.Add(ColumnFactory.CreateFeatureGeometryColumn(mapControl1.Map.GetDisplayCoordSys()))
mytable.Columns.Add(ColumnFactory.CreateStyleColumn())
mytable.Columns.Add(ColumnFactory.CreateStringColumn("GeometryName",30))
tableTemp = Session.Current.Catalog.CreateTable(mytable)
FeatureLayer mylayer = new FeatureLayer(tableTemp)
mapControl1.Map.Layers.Insert(1,mylayer)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)