首页 / 浏览问题 / 组件GIS / 问题详情
winfrom Dataset 无法设置单个对象的样式
80EXP 2021年07月15日
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

希望可以帮助到您!
10,758EXP 2021年07月16日
...