Skyline 7 1. 通过Object创建SGWorld

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
	<meta charset="utf-8" />
    <style>
        *{            margin:0;            padding:0;        }
       html,body{           width:100%;height:100%;overflow:hidden;      background-color:#000000; }

    </style>

</head>
<body onload="Init3D();">
    <div id="id3DEarth"></div>

    <script>
        var flyUrl = "D:\\data\\fly\\test.FLY";

        var SGWorld_Theme;

        function Init3D() {
            var dmap = window.document.getElementById("id3DEarth");
            var obj = C3DWindow();
            if (obj) {
                dmap.appendChild(obj);

                //去掉3D地球控件白色边框
                obj.BorderStyle = "0";

                setTimeout(function () { LoadFly(); }, 500);
            }
        }

        function LoadFly() {
            SGWorld_Theme = CSGWorld("SGWorld_Theme");

            SGWorld_Theme.AttachEvent("OnLoadFinished", OnProjectLoadFinished);

            SGWorld_Theme.Open(flyUrl);
        }

        function C3DWindow() {
            try {
                var obj = window.document.getElementById("TerraExplorer3DWindow");
                if (obj == null) {
                    obj = document.createElement('object');
                    obj.name = "TerraExplorer3DWindow";
                    obj.id = "TerraExplorer3DWindow";
                    obj.style.width = "80%";
                    obj.style.height = "80%";

                    obj.style.position = "absolute";

                    obj.classid = "CLSID:3a4f9192-65a8-11d5-85c1-0001023952c1";
                    obj.style.zIndex = -10000;

                    obj.innerHTML = "<param value= 'transparent' name='wmode'>";

                }
                return obj;
            }
            catch (e) {
                alert(e.message);
            }
        }

        function OnProjectLoadFinished() {


        }

        function CSGWorld(SGWorld_Theme) {
            try {
                var obj = document.getElementById(SGWorld_Theme);
                if (obj == null) {
                    obj = document.createElement('object');
                    obj.setAttribute("name", SGWorld_Theme);
                    obj.setAttribute("id", SGWorld_Theme);
                    obj.style.height = "1px";
                    obj.style.width = "1px";
                    obj.setAttribute("classid", "CLSID:3A4F919A-65A8-11D5-85C1-0001023952C1");
                    document.body.appendChild(obj);
                }
                return obj;
            }
            catch (e) {   alert(e.message);        }
        }



    </script>


</body>
</html>

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值