// MapInfo.Data.Table table
=MapInfo.Engine.Session.Current.Catalog.CreateTable(tableInfo);
MapInfo.Mapping.FeatureLayer featureLayer =
newMapInfo.Mapping.FeatureLayer(table);
this.mapControl1.Map.Layers.Add(featureLayer);
return table;
}
private void AddFeaturesAndSave()
{
MapInfo.Styles.SimpleLineStyle LineStyle =
newMapInfo.Styles.SimpleLineStyle(new
MapInfo.Styles.LineWidth(1,MapInfo.Styles.LineWidthUnit.Point));
MapInfo.Styles.CompositeStyle compositeStyle =
newMapInfo.Styles.CompositeStyle(null,LineStyle, null, null);
MapInfo.Geometry.CoordSys coordSys =mapControl1.Map.GetDisplayCoordSys();
MapInfo.Data.Table table = CreateNewMapDataTable("NewTable");
MapInfo.Data.TableInfo tableInfo = table.TableInfo;
while(……)
{
MapInfo.Data.Feature feature = newMapInfo.Data.Feature(tableInfo.Columns);
feature.Geometry = ……
feature.Style = ……
feature["ID"] = ……
table.InsertFeature(feature);
}
tableInfo.WriteTabFile(); //保存为.tab文件
mapControl1.Refresh();
}
10 计算缩放比例
/**//// <summary>
/// 重画控件时计算缩放比例
/// </summary>
/// <param></param>
/// <param></param>
protected void mapControl1_Paint(object sender,PaintEventArgs e)
{
MapInfo.Geometry.Distance zoomDistance=this.mapControl1.Map.Zoom;
double zoom=Convert.ToDouble(Convert.ToInt32(zoomDistance.Value*16.09))/10;
this.statusBar1.Text="缩放比例:"+zoom.ToString()+" 千米";
}
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/tongxinshuyu/article-28065-5.html
唉
请教授下课吧
同时也说明12海里主权我们已经坐实了