SkylineGlobe TerraExplorer Pro 7.0 Web 控件版 第一行示例代码

SkylineGlobe TerraExplorer Pro 7.0 是原生的64位应用程序,在Web端用插件方式开发的第一行示例代码如下:

常规代码,需要IE64位:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<meta http-equiv="X-UA-Compatible" content="IE=9" />
<script type="text/javascript" >
function Init3D() {
try {
var projecttree = window.document.getElementById("projecttree");
var obj2 = CProjectTree();
projecttree.appendChild(obj2); var dmap = window.document.getElementById("3dmap");
var obj = C3DWindow();
dmap.appendChild(obj); setTimeout(function () { LoadFly(); }, 1000); //setTimeout(function () { SetProjectTree(); }, 500);
}
catch (e) {
alert(e);
}
} function LoadFly() {
alert(0);
var sg = CSGWorld();
var flyurl = "C:\\Users\\Administrator\\Desktop\\a.FLY";
sg.Open(flyurl);
alert(1);
} function SetProjectTree() {
TerraExplorerInformationWindow.AttachTo3dWindow(TerraExplorer3DWindow); // attach project tree to 3D
} // SGWorld70
function CSGWorld() {
try {
var obj = window.document.getElementById("SGWorld");
if (obj == null) {
//obj = TerraExplorer3DWindow.CreateInstance("{3a4f919a-65a8-11d5-85c1-0001023952c1}"); obj = document.createElement('object');
document.body.appendChild(obj);
obj.name = "SGWorld";
obj.id = "SGWorld";
obj.classid = "CLSID:3A4F919A-65A8-11D5-85C1-0001023952C1";
}
return obj;
}
catch (e) {
alert(e);
}
} 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 = "100%";
obj.style.height = "100%";
obj.classid = "CLSID:3a4f9192-65a8-11d5-85c1-0001023952c1";
}
return obj;
}
catch (e) {
alert(e);
}
} function CProjectTree() {
try {
var obj = window.document.getElementById("TerraExplorerInformationWindow");
if (obj == null) {
obj = document.createElement('object');
obj.name = "TerraExplorerInformationWindow";
obj.id = "TerraExplorerInformationWindow";
obj.style.width = "100%";
obj.style.height = "100%";
obj.classid = "clsid:3a4f9193-65a8-11d5-85c1-0001023952c1";
}
return obj;
}
catch (e) {
alert(e);
}
}
</script>
</head>
<body style="overflow: hidden;margin:0px;padding:0px;" onload="Init3D();">
<input id="Button1" type="button" value="button" onclick="LoadFly()" />
<div id="3dmap" style="z-index:0;background-image:url('images/bg.jpg');width:75%;height:100%;margin-top:38px;position:fixed;"></div>
<div id="projecttree"style="z-index:0;width:25%;height:100%;margin-top:0px;position:fixed;left:75%;background-color:yellowgreen;z-index:1000;"></div>
</body>
</html>

扩展控件 IE32位和IE64位都可以支持:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script type="text/javascript" >
function Init3D() {
try {
alert("OS:" + window.navigator.platform);
var projecttree = window.document.getElementById("projecttree");
var obj2 = CProjectTree();
projecttree.appendChild(obj2); var dmap = window.document.getElementById("3dmap");
var obj = C3DWindow();
dmap.appendChild(obj); setTimeout(function () { LoadFly(); }, 500); setTimeout(function () { SetProjectTree(); }, 500);
}
catch (e) {
alert(e);
}
} function LoadFly() {
var sg = CSGWorld();
var flyurl = "http://192.168.9.73/SG/projects/tg7.401998";
sg.Open(flyurl);
} function SetProjectTree() {
TerraExplorerInformationWindow.AttachTo3dWindow(TerraExplorer3DWindow); // attach project tree to 3D
} // SGWorld70
function CSGWorld() {
try {
var obj = window.document.getElementById("SGWorld");
if (obj == null) {
obj = TerraExplorer3DWindow.CreateInstance("{3a4f919a-65a8-11d5-85c1-0001023952c1}");
}
return obj;
}
catch (e) {
alert(e);
}
} 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 = "100%";
obj.style.height = "100%";
obj.classid = "CLSID:3a4f9196-65a8-11d5-85c1-0001023952c1";
obj.style.zIndex = -10000;
}
return obj;
}
catch (e) {
alert(e);
}
} function CProjectTree() {
try {
var obj = window.document.getElementById("TerraExplorerInformationWindow");
if (obj == null) {
obj = document.createElement('object');
obj.name = "TerraExplorerInformationWindow";
obj.id = "TerraExplorerInformationWindow";
obj.style.width = "100%";
obj.style.height = "100%";
obj.classid = "clsid:3a4f919b-65a8-11d5-85c1-0001023952c1";
}
return obj;
}
catch (e) {
alert(e);
}
}
</script>
</head>
<body style="overflow: hidden;margin:0px;padding:0px;" onload="Init3D();">
<div id="3dmap" style="z-index:0;background-image:url('images/bg.jpg');width:75%;height:100%;margin-top:38px;position:fixed;"></div>
<div id="projecttree"style="z-index:0;width:25%;height:100%;margin-top:0px;position:fixed;left:75%;background-color:yellowgreen;z-index:1000;"></div>
</body>
</html>
上一篇:LLBL Gen Pro 5.0


下一篇:opengl 笔记(2)