爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 2633|回复: 0

求助! 关于14类数据 图例填充

[复制链接]

新浪微博达人勋

发表于 2015-5-13 18:30:04 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
  哪位老师能给我指点一下:   meteoinfo不支持14类  所以就用数据流读文本文档里的点坐标 然后在地图上画出来形成一个圆圈  但是在设置图例时遇到问题  如何才能让14类数据画出的圆圈所代表的范围跟图例里面的范围对应起来 然后用图例所对应的颜色填充圆圈  
           ArrayList LINESlinesnum = chafen(list[ListCount++]);
            int LINESlines = Convert.ToInt32(LINESlinesnum[0]);
            if (LINESlines > 0)
            {
                for (int n = 1; n <= LINESlines; n++)
                {
                    PolygonShape pls1 = new PolygonShape();
                    List<PointD> list2 = new List<PointD>();
                    ArrayList PLnum = chafen(list[ListCount++]);
                    int points1 = Convert.ToInt32(PLnum[1]);
                    int LineSize = Convert.ToInt32(PLnum[0]);
                    int i = ListCount;
                    for (; i <= ListCount + points1 - 1; i++)
                    {
                        ArrayList StratPoint1 = chafen(list[i]);
                        list2.Add(new PointD(Convert.ToDouble(StratPoint1[0]), Convert.ToDouble(StratPoint1[1])));
                    }
                    ListCount = i;
                    ArrayList GNnum = chafen(list[ListCount++]);
                    int grade = Convert.ToInt32(GNnum[0]);
                    int number = Convert.ToInt32(GNnum[1])
                    ArrayList OverPoint = chafen(list[ListCount++]);
                    list2.Add(new PointD(Convert.ToDouble(OverPoint[0]), Convert.ToDouble(OverPoint[1])));
                    pls1.Points = list2;
                    PolygonBreak plb1 = new PolygonBreak();
                    plb1.Color = Color.FromArgb(80, Color.LightBlue);
                    Graphic g2 = new Graphic(pls1, plb1);
                    addLayer(lgsTxt, g2, n);
                }

  public void addLayer( string lgs, Graphic g, int j)
        {
            VectorLayer pLayer = new VectorLayer(ShapeTypes.Polygon);
            pLayer.LayerName = "Rain";
            pLayer.Visible = true;
            pLayer.EditAddField("ID", typeof(double));
            pLayer.EditAddField("Rain_Low", typeof(string));
            Graphic pGraphic = null;
            aLS.ImportFromXMLFile(lgs);
            pGraphic = g;
            Shape pShape = pGraphic.Shape;
            int shapNum = layersLegend1.ActiveMapFrame.GetLayerNodes().Count;
            int shapeNum = pLayer.ShapeNum;
            int i = 1;
            if (pLayer.EditInsertShape(pShape, shapeNum))
            {
                pLayer.EditCellValue("ID", shapeNum, i);
            }
            i += 1;
            pLayer.UpdateLegendScheme(LegendType.SingleSymbol, "ID");   
            //PolygonBreak aPGB = (PolygonBreak)pLayer.LegendScheme.LegendBreaks[0];        
            //aPGB.Color = aLS.LegendBreaks[j].Color;      
            layersLegend1.ActiveMapFrame.AddLayer(pLayer);
            pLayer.IsMaskout = true;
            layersLegend1.ActiveMapFrame.MapView.PaintLayers();
        }

密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表