Skyline - it's your world

Developer

Product Overview
Why should you choose SkylineGlobe products? Click here...

Contact Us

Developer - Web (JavaScript/HTML)


Getting started

  1. Download and install TerraExplorer Plus.
  2. Create a new HTML page.
  3. Define an object element that will allow you access to TerraExplorer v6 API.
    <object id="SGWorld" classid="CLSID:3a4f91b0-65a8-11d5-85c1-0001023952c1" style="visibility: hidden;height: 0"></object>
  4. Define a div element that will hold a TerraExplorer ActiveX object
    <object id="TE" classid="clsid:3a4f9192-65a8-11d5-85c1-0001023952c1" style="width: 600px;height: 600px"></object>
  5. Now you can use the SGWorld object to control the TerraExplorer ActiveX component. The following code loads a .fly project and flies to a specific location.
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>HTML Example</title>
        <script type="text/javascript">
            function Init() {
                try {
                    var flyPath = "http://www.skylineglobe.com/SkylineGlobe/WebClient/PresentationLayer/WebClient/SkyglobeLB.fly";
                    // attach callback to the load finished event
                    SGWorld.AttachEvent("OnLoadFinished", OnProjectLoadFinished);
                    // Load default developer fly file from www.skylineglobe.com web site.
                    // default load is in async mode
                    SGWorld.Project.Open(flyPath);
                    alert("Opening project " + flyPath + " in async mode");
                }
                catch (e) {
                    alert("Error: " + e.description);
                }
     
            }
     
            function OnProjectLoadFinished() {
                alert("Received project loaded event. Click OK to fly to Washington DC.");
                var Washington = SGWorld.Creator.CreatePosition(-77.036667, 38.895111, 1500);
                SGWorld.Navigate.FlyTo(Washington);
            }
        </script>
    </head>
    <body onload="Init()">
        <object id="TE" classid="clsid:3a4f9192-65a8-11d5-85c1-0001023952c1" style="width: 600px;height: 600px"></object>
        <object id="SGWorld" classid="CLSID:3a4f91b0-65a8-11d5-85c1-0001023952c1" style="visibility: hidden;height: 0"></object>
    </body>
    </html>
  6. View the above sample in your browser (IE only). Explore SkylineGlobe's (Any browser) interactive tutorial for more code samples and examples of TerraExplorer’s capabilities.

Related Links & Files

© 2011 Skyline Software Systems Inc. All rights reserved.  contact us  |  support  |  legal notice  |  privacy

Content

Close