iObject .net 11.1.1 vs2022 win11 x64
问题详细描述:通过上一步获得的二维点的坐标,将x,y赋值给三维点,z值设为2。将这个三维点通过添加到TrackingLayer展现在当前的Scene中,但是,我无法在当前的Scene看到我添加的TrackingLayer,或者TrackingLayer上的三维点和 geoText
if (rs.GetGeometry().Type == GeometryType.GeoPoint)//点类型
{
GeoPoint pt=rs.GetGeometry() as GeoPoint;
GeoStyle geoStyle_P = new GeoStyle();
geoStyle_P.FillBackColor = Color.Red;
geoStyle_P.FillForeColor = Color.Red;
geoStyle_P.MarkerSize = (new Size2D(20, 20));
pt.Style= geoStyle_P;
_map.TrackingLayer.Add(pt,"");
//_map.ViewBounds = pt.Bounds;
_map.RefreshTrackingLayer();
_map.Refresh();
//Layer3DDataset layer3DDataset=_scene
GeoPoint3D geoPoint3D =new GeoPoint3D();
geoPoint3D.X = pt.X;
geoPoint3D.Y = pt.Y;
geoPoint3D.Z = 2;
GeoStyle3D geoStyle3D = new GeoStyle3D();
geoStyle3D.AltitudeMode = AltitudeMode.RelativeToGround;
geoStyle3D.BottomAltitude = 0;
geoStyle3D.ExtendedHeight = 20;
geoPoint3D.Style3D= geoStyle3D;
_scene.TrackingLayer.Add(geoPoint3D , "");
string text = "Test";
TextPart textpart = new TextPart(text, geoPoint3D.X, geoPoint3D.Y, 3);
GeoText geoText = new GeoText(textpart);
geoText.TextStyle.ForeColor = System.Drawing.Color.Red;
geoText.TextStyle.BackColor = System.Drawing.Color.AliceBlue;
geoText.TextStyle.Shadow = true;
geoText.TextStyle.ShadowColor = System.Drawing.Color.AliceBlue;
geoText.TextStyle.Bold = true;
_scene.TrackingLayer.Add(geoText, text);
_scene.Refresh();
}