Creating an HTML Client Application
This sample demonstrates how to incorporate TerraExplorer COM capabilities into a web page using the SGWorld object that gives you access to all of its main interfaces.
<html>
<body onload="Init();">
<script language="javascript">
function initSGWorld() {
if(SGWorld != null)
return SGWorld;
//Fusion -> use parent's instance (parent of IFrame)
if (parent && parent.SGWorld) {
SGWorld = parent.SGWorld;
return SGWorld;
}
//Desktop -> create an instance
try{
SGWorld = new ActiveXObject("TerraExplorerX.SGWorld80"); //IE
}
catch(e){
if(SGWorld == undefined)
{
SGWorld = __sgworld__.SetParamEx(9970, 80); //EDGE
}
};
return SGWorld;
}
</script>
</body>
</html>