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>
<script language="javascript">
var SGWorld = initSGWorld();
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.SGWorld81"); // IE
} catch (e) {
if (SGWorld == undefined) {
SGWorld = __sgworld__.SetParamEx(9970, 81); // EDGE
}
}
return SGWorld;
}
</script>
</body>
</html>