首页 / 浏览问题 / 组件 / 问题详情
winfrom Dataset 无法设置单个对象的样式
回首那一...  (74分)  初出茅庐
7月15日, 2021
winfrom Dataset 无法设置单个对象的样式 设置了对象的颜色为红色  但是显示的还是默认色 代码如下

DatasetVector datasetVector = CreateDataset("Region", DatasetType.Region);
            GeoRegion geoRegion = new GeoRegion();
            Point2Ds point2Ds = new Point2Ds();
            point2Ds.Add(new Point2D(114.10438438672989, 22.785617393491204));
            point2Ds.Add(new Point2D(114.10491067623667, 22.78493524212784));
            point2Ds.Add(new Point2D(114.10597390166231, 22.785825527135959));
            point2Ds.Add(new Point2D(114.10706940744896, 22.78641921785977));
            point2Ds.Add(new Point2D(114.10675789675562, 22.786745420986655));
            point2Ds.Add(new Point2D(114.10438438672989, 22.785617393491204));
            geoRegion.AddPart(point2Ds);
            geoRegion.Style = new GeoStyle();
            geoRegion.Style.FillBackColor = Color.Red;
            geoRegion.Style.FillForeColor = Color.Red;
            geoRegion.Style.LineColor = Color.Red;

            recordset = datasetVector.GetRecordset(false, CursorType.Dynamic);
            Dictionary<string, object> dic = new Dictionary<string, object>();
            dic.Add("id", "test");
            recordset.AddNew(geoRegion, dic);
            recordset.Update();

1个回答

您好,如果您需要让数据集中的不同对象在地图图层中显示不同的颜色风格样式,应该使用自定义专题图功能的对应颜色属性实现。

接口:ThemeCustom

希望可以帮助到您!
执笔画月  (3,644分)  名扬四海
7月16日, 2021
...