- 积分
- 55960
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-21
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2014-5-28 11:47:15
|
显示全部楼层
参考新的代码:
private void TSMI_StationModel_Click(object sender, EventArgs e)
{
//Create a MeteoDataInfo object
MeteoDataInfo aDataInfo = new MeteoDataInfo();
//Open SYNOP data file
string aFile = Application.StartupPath + "\\Sample\\12010615.syn";
string stFile = Application.StartupPath + "\\Sample\\SYNOP_Stations.csv";
aDataInfo.OpenSYNOPData(aFile, stFile);
//Create a legend scheme
LegendScheme aLS = LegendManage.CreateSingleSymbolLegendScheme(ShapeTypes.Point, Color.Blue, 12);
//Get station model data
StationModelData stationModelData = aDataInfo.GetStationModelData();
VectorLayer aLayer = new VectorLayer(ShapeTypes.Point);
aLayer = DrawMeteoData.CreateStationModelLayer(stationModelData,
aDataInfo.MissingValue, aLS, "StationModel", true);
//Add layer
layersLegend1.ActiveMapFrame.AddLayer(aLayer);
layersLegend1.Refresh();
//Change title of the layout
LayoutGraphic aTitle = mapLayout1.GetTexts()[0];
aTitle.SetLabelText("MeteoInfo Class Library Demo - Station Model Layer");
} |
|