<< Click to Display Table of Contents >>

初始化球面模式

 

檢視範例

範例下載

 

 

<說明>

使用3D API來初始化三維圖台。宣告一個3D API物件,指定要放置圖台的網頁容器,即可完成地圖的初始化。以下範例中,宣告了一個網頁容器pBody,準備容納地圖;接著宣告3D API物件,指定放置於已宣告的網頁容器pBody,即可完成圖台初始化的設定。

 

 

<範例>

 function documentLoad()

       {

             SuperGIS.Initialize("/ServerGate/", function () {

                 SuperGIS.ServerEarth.Initialize(InitEarth);

             });

         }

 

     function InitEarth()

     {

         var pBody = new SuperGIS.Windows.HTMLContainer(document.body);

 

         var sHost = location.href;

         var idx = sHost.indexOf("/", 8);

         if (idx >= 0) sHost = sHost.substring(0, idx);

         CreateHTML5Earth(pBody, function (pEarth) { EarthLoaded(pEarth); });

 

         function EarthLoaded(pEarth)

         {

             pEarth.Scene.BackgroundColor = pEarth.CreateColor(0, 0, 0, 1);

             pEarth.SetupSystem(true, s_WGS84);

             pEarth.SetupSkin(pEarth.CreateEnvelope(-180, 180, -90, 90, s_WGS84), sHost + "/ServerGate/Skin1.jpg");

         }

       }

 

 

 

 

 


© 2017 Supergeo Technologies Inc.