- 积分
- 1486
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-10-27
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2015-6-20 20:50:05
|
显示全部楼层
本帖最后由 ♂雨已~○ 于 2015-6-20 21:02 编辑
王老师,还有一个问题,就是如果在lambt投影下,不能用填值显示降水量呢?只要不用这种投影,就能正常填值显示降水量~~~下面是我降水量填值显示的代码:实现效果图
但只要用了投影就完全不能显示了!- string formName;
- string title;
- formName = Path.GetFileNameWithoutExtension(file);
- MeteoDataInfo aDataInfo = new MeteoDataInfo();
- string aFile = file;
- aDataInfo.OpenMICAPSData(aFile);
- StationData rainData = aDataInfo.GetStationData("Precipitation6h");
- LegendScheme aLS = new LegendScheme(ShapeTypes.Point);
- aLS.ImportFromXMLFile(Application.StartupPath+"\\Legend\\rain.lgs");
- VectorLayer aLayer = DrawMeteoData.CreateSTPointLayer(rainData, aLS, "Precipitation6h", "Precipitation6h");
- title = formName.Substring(0, 2) + "年" + formName.Substring(2, 2) + "月" + formName.Substring(4, 2) + "日" + formName.Substring(6, 2) + "时" + "自动观测6小时降水量数值填图";
- aLayer.LayerName = "Precipitation6h_fillValue";
- label3.Text = label3.Text + "\n" + title;
- VectorLayer cityLayer = (VectorLayer)aLayer;
- ((PointBreak)aLayer.LegendScheme.LegendBreaks[0]).EndValue = 100;
- cityLayer.LabelSet.FieldName = "Precipitation6h";
- cityLayer.LabelSet.AvoidCollision = true;
- cityLayer.LabelSet.LabelAlignType = MeteoInfoC.Legend.AlignType.Center;
- cityLayer.LabelSet.YOffset = 0;
- cityLayer.LabelSet.LabelFont = new Font("Arial", 8);
- cityLayer.LabelSet.LabelColor = Color.Black;
- cityLayer.LabelSet.DrawShadow = false;
- cityLayer.LabelSet.ShadowColor = Color.White;
- cityLayer.LabelSet.ColorByLegend = false;
- cityLayer.LabelSet.AutoDecimal = false;
- cityLayer.LabelSet.DecimalDigits = 1;
- cityLayer.AddLabels();
- for (int i = 0; i < aLS.BreakNum; i++)
- {
- ((PointBreak)aLayer.LegendScheme.LegendBreaks[i]).DrawFill = false;
- ((PointBreak)aLayer.LegendScheme.LegendBreaks[i]).DrawShape = false;
- }
- aLayer.IsMaskout = true;
- int aLayerHandle = layersLegend1.ActiveMapFrame.AddLayer(aLayer, 0);
- //根据标注值改变填色
- for (int i = 0; i < aLayer.LabelPoints.Count; i++)
- {
- if (double.Parse(((LabelBreak)aLayer.LabelPoints[i].Legend).Text) > 20.0)
- {
- ((LabelBreak)aLayer.LabelPoints[i].Legend).Color = Color.Red;
- }
- }
- layersLegend1.Refresh();
- layersLegend1.MapLayout.PaintGraphics();
复制代码
|
|