自定义的Action,鼠标点击无法触发

0 投票
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月 11 分类:  160次浏览 | 用户: 菜鸟新手 才疏学浅 (14 分)

1个回答

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

这一句写了没?
1月 11 用户: 张阳名 登峰造极 (5,294 分)
这句话写了的,我不知道是不是和我项目里的js有冲突.单独写可以,但是加入到项目里就不行了,难受
...