首页 / 浏览问题 / 组件GIS / 问题详情
跟踪图层TrackingLayer3D.HitTest需要point坐标
80EXP 2021年01月07日
跟踪图层TrackingLayer3D.HitTest需要point坐标 获取不到呀

1个回答

代码怎么写的,将代码贴出来看一下
4,620EXP 2021年01月08日
sceneControlSelect.Scene.TrackingLayer.HitTest(new Point());
在 ObjectSelected事件 中没办法获取到point坐标呀
public void Bind(){

 // 构造 GeoBox 对象
            GeoBox geoBox = new GeoBox();
            // 设置长方体的底面大小
            geoBox.BottomSize = new Size2D(200000, 100000);
            // 设置长方体的高度
            geoBox.Height = 10000;
            // 设置长方体所在的位置
            geoBox.Position = new Point3D(132, 32, 100000);
           

           GeoStyle3D geoStyle3D = new GeoStyle3D();
            geoStyle3D.FillBackColor = Color.Aqua;
            geoStyle3D.FillForeColor = Color.Aqua;
            geoStyle3D.AltitudeMode = AltitudeMode.ClampToGround;
            geoStyle3D.AltitudeMode = AltitudeMode.Absolute;
            geoStyle3D.ExtendedHeight = 50000;
            geoBox.Style3D = geoStyle3D;

            Point3Ds point3Ds = new Point3Ds();
            point3Ds.Add(new Point3D(103, 32, 0));
            point3Ds.Add(new Point3D(95, 24, 0));
            point3Ds.Add(new Point3D(96, 33, 0));
            point3Ds.Add(new Point3D(97, 50, 0));
            point3Ds.Add(new Point3D(103, 32, 0));
            GeoRegion3D geoRegion3D = new GeoRegion3D(point3Ds);
            
            geoRegion3D.Style3D = geoStyle3D;
            sceneLeft.Scene.TrackingLayer.Add(geoBox, "123");
            sceneLeft.Scene.TrackingLayer.Add(geoRegion3D, "123");

}

 public void sceneControl_ObjectSelected(object sender, ObjectSelectedEventArgs e)
        {
            SceneControl sceneControlSelect = (SceneControl)sender;
            sceneControlSelect.Scene.TrackingLayer.HitTest(new point());
            
        }
请问下  这个hitTest 中的point 要如何获取呢
MouseClick用的是这个事件,鼠标点击事件
...