您好, 以下代码示范了如何将二维面矢量数据集添加到三维场景中,同时对面矢量数据集中的面对象进行拉伸和风格设置。
假设下面函数中的 targetDataset 参数是一个面矢量数据集,该数据集中包含字段 BottomAltitude、ExtendedHight、SideTexture、TopTexture,分别为:底部高程字段、拉伸高度字段、侧面纹理字段和顶部纹理字段。
public void TestLayer3DSettingDatasetVector(DatasetVector targetDataset,Scene sceneObject)
{
//矢量数据集三维图层扩展设置
Layer3DSettingVector layer3DSettingVector = new Layer3DSettingVector();
GeoStyle3D geoStyle3D = new GeoStyle3D();
geoStyle3D.AltitudeMode = AltitudeMode.RelativeToGround;
geoStyle3D.FillMode = FillMode3D.LineAndFill;
geoStyle3D.LineColor = Color.Red;
geoStyle3D.LineWidth = 1;
layer3DSettingVector.Style = geoStyle3D;
layer3DSettingVector.BottomAltitudeField = "BottomAltitude";
layer3DSettingVector.ExtendedHeightField = "ExtendedHeight";
layer3DSettingVector.SideTextureField = "SideTexture";
layer3DSettingVector.TopTextureField = "TopTexture";
//将矢量数据集显示在三维地图场景中
Layer3DDataset layer3DDataset=sceneObject.Layers.Add(targetDataset, layer3DSettingVector, true);
layer3DDataset.UpdateData();
sceneObject.Refresh();
}
希望能够帮助到您