2 lines
1.0 KiB
JavaScript
2 lines
1.0 KiB
JavaScript
|
/* 2020-9-24 14:48:24 | 版权所有 军懋国兴 */
|
||
|
mars3d.widget.bindClass(mars3d.widget.BaseWidget.extend({options:{view:{type:"divwindow",url:"view.html",windowOptions:{width:700,height:110}}},winCreateOK:function(){this.updateUrl()},activate:function(){this.viewer.scene.camera.moveEnd.addEventListener(this.camera_moveEndHandler,this)},disable:function(){this.viewWindow=null,this.viewer.scene.camera.moveEnd.removeEventListener(this.camera_moveEndHandler,this)},updateUrl:function(){$("#txtUrl").val(this.getUrl()),$("#txtUrl").focus(),$("#txtUrl").select()},camera_moveEndHandler:function(){this.updateUrl()},getUrl:function(){var e=mars3d.point.getCameraView(this.viewer,!0),t=window.location.href;-1!=t.lastIndexOf("#")&&(t=t.replace(window.location.hash,"").replace("#",""));var i=t.lastIndexOf("?");-1!=i&&(t=t.substring(0,i));var n,a=t+"?x="+e.x+"&y="+e.y+"&z="+e.z+"&heading="+e.heading+"&pitch="+e.pitch+"&roll="+e.roll,r=haoutil.system.getRequest();for(n in r)"x"!=n&&"y"!=n&&"z"!=n&&"heading"!=n&&"pitch"!=n&&"roll"!=n&&(a+="&"+n+"="+r[n]);return a}}));
|