<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>并列对比</title>
    <script type = "text/javascript" language = "javascript">
        var idleMode = null;
        var globe1;
        var globe2;
        var TerrainDatabaseToOpen = "D:\\Storage\\a.fly";
       // var TerrainDatabaseToOpen = "http://www.skylineglobe.com/SkylineGlobeLayers/SG_ExternalFlys/skylineglobe.fly";
               
        function g2SetAsLeader() {           
            globe2.Application.Multiple3DWindows.SetAsLeader();
        }
        function g2OnFrame() {
            if (idleMode == 2) {
                var pos = globe2.Navigate.GetPosition(3);
                globe1.Navigate.SetPosition(pos);
            }
        }
        function g2OnLButtonDown(Flags, X, Y, pbHandled) {
            idleMode = 2;
        }

        function g1SetAsLeader() {
            globe1.Application.Multiple3DWindows.SetAsLeader();
        }
        function g1OnFrame() {
            if (idleMode == 1) {
                var pos = globe1.Navigate.GetPosition(3);
                globe2.Navigate.SetPosition(pos);
            }
        }
        function g1OnLButtonDown(Flags, X, Y, pbHandled) {
            idleMode = 1;
        }

        function Init() {
            globe1 = TEX.CreateInstance("TerraExplorerX.SGWorld61");
            globe1.Open(TerrainDatabaseToOpen);
            globe1.AttachEvent("OnFrame", g1OnFrame);
            globe1.AttachEvent("OnLButtonDown", g1OnLButtonDown);
            globe2 = TEX2.CreateInstance("TerraExplorerX.SGWorld61");
            globe2.AttachEvent("OnFrame", g2OnFrame);
            globe2.AttachEvent("OnLButtonDown", g2OnLButtonDown);
            globe2.Open(TerrainDatabaseToOpen);
            idleMode = 1;
        }               
    </script>
</head>
<body onload="Init()">
    <table>
        <tr>
            <td>
                <object id="TEX" classid="clsid:3a4f9196-65a8-11d5-85c1-0001023952c1"
                    width="600" height="600">
                </object>
                <object id="TEX2" classid="clsid:3a4f9196-65a8-11d5-85c1-0001023952c1"
                     width="600" height="600">
                </object>            
            </td>          
        </tr>
    </table>
</body>
</html>