首页 / 浏览问题 / 组件GIS / 问题详情
KML图层添加三维圆要素会报错
23EXP 2022年06月22日

使用产品:iserver 10i  操作系统:win10 x64
问题详细描述:所用代码如下

GeoCircle3D circle3D = new GeoCircle3D();
                    Feature3D feature3D = new Feature3D();
                    feature3D.Geometry = circle3D;
                    GlobalInstance._layerNoFlyZoneKml.Features.Add(circle3D);

在kml图层中添加三维圆要素时会报以下错误

同样的代码段,在kml图层中添加多边形要素时就不会报错

GeoRegion3D geoRegion3D = CreateGeoRegion(point3Ds, AltitudeMode.ClampToGround);
                    Feature3D feature3D = new Feature3D();
                    
                    feature3D.Geometry = geoRegion3D;
                    GlobalInstance._layerNoFlyZoneKml.Features.Add(feature3D);


问题重现步骤:1.打开三维场景

2.添加kml图层

3.添加三维圆要素或者多边形要素。圆要素出现报错问题

1个回答

您好,三维圆面几何对象(GeoCircle3D)在添加到 KML 图层之前,需要调用 GetGeoModel() 方法,使其按 GeoModel 的方式重新构建,得到对应的 GeoModel 对象后,再将其添加到 KML 图层。可参考以下代码:

GeoCircle3D circle3D = new GeoCircle3D(new Point3D(0, 0, 0), 10);
var geoModel = circle3D.GetGeoModel(36, 36);
Feature3D feature3D = new Feature3D();
feature3D.Geometry = geoModel;
layer3DKML.Features.Add(feature3D);

希望可以帮到您。

2,158EXP 2022年06月22日
好的,可以了,感谢
...