首页 / 浏览问题 / 组件GIS / 问题详情
iObjects .net 11i 根据已有的值无法更新元素
19EXP 2025年08月06日

问题描述:根据list中已有的值,将对应的地图上的面进行高亮起来,目前不知道怎么设置几何元素或者可以用什么方法能够实现

if (this.selectedProvinces.Count != 0)
                {
                    Recordset recordset = this.importResult.GetRecordset(true, CursorType.Static);
                    SuperMap.Data.Geometry geo = recordset.GetGeometry();  // 获取几何对象
                    SuperMap.Data.Geometry geometry = geo;  // 复制几何对象
                    GeoStyle geostyle = new GeoStyle();  // 创建几何样式对象
                    foreach (var element in this.selectedProvinces)
                    {
                        geostyle.FillForeColor = System.Drawing.Color.Blue;  // 填充颜色为蓝色
                        geostyle.FillOpaqueRate = 100;  // 设置填充不透明度为100
                        geometry.Style = geostyle;  // 应用样式到几何对象
                        this.mapControl.Map.TrackingLayer.Add(geometry, element);
                    }
                }

高亮,

问题关闭原因: 已解决

1个回答

您好,看你的代码  style是没有赋值的

可以考虑把style设置个明显的颜色试试

希望能帮助到您
1,430EXP 2025年08月06日
...