<!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>