首页 / 浏览问题 / 三维GIS / 问题详情
自定义的Action,鼠标点击无法触发
14EXP 2019年01月11日
function getInfo(){
                //设置控件的当前操作为自定义操作
                debugger;
                var myAction2 = new SuperMap.Web.UI.Action3Ds.MyAction2(sceneControl);
                sceneControl.set_sceneAction(myAction2);
            }
            SuperMap.Web.UI.Action3Ds.MyAction2 = function(sceneControl) {
                debugger;
                /* <param name="sceneControl" type="SuperMap.Web.UI.Controls.SceneControl"></param> */
                SuperMap.Web.UI.Action3Ds.MyAction2.initializeBase(this);
                this._name = "myAction2";
                this._sceneControl = sceneControl;
                //对应的场景操作类型为漫游
                this._type = SuperMap.Web.UI.Action3Ds.SceneActionType.POINTSELECT;
            };
            //扩展Action的属性和方法
            SuperMap.Web.UI.Action3Ds.MyAction2.prototype = {
                /*
                * 析构方法
                */
                dispose:function() {
                    ///<returns type="void"></returns>
                    this._sceneControl = null;
                },
                /*
                * 鼠标单击方法
                */
                onMouseDown:function(e) {
                    //这里无法触发

                    alert(e);
                    var x = e.get_clientX();
                    var y = e.get_clientY();
                       var point=new SuperMap.Pixel(x,y);
                      var select = scene.get_trackingLayer3D().hitTest(point);

鼠标点击无效.....

1个回答

SuperMap.Web.UI.Action3Ds.MyAction.registerClass('SuperMap.Web.UI.Action3Ds.MyAction',SuperMap.Web.UI.Action3Ds.SceneAction,Sys.IDisposable);

这一句写了没?
5,560EXP 2019年01月11日
这句话写了的,我不知道是不是和我项目里的js有冲突.单独写可以,但是加入到项目里就不行了,难受
...