<< Click to Display Table of Contents >>

指定圖台初始位置

 

 

檢視範例

範例下載

 

 

<說明>

根據不同的使用情境,全台灣範圍的地圖顯示可能不會符合使用者的需求,而必需另指定特定的初始圖台位置及範圍。在指定圖台位置API可做一系列之地圖位置的設置動作,包含設定及取得地圖邊框範圍、設定地圖的中心點坐標、將地圖進行平移等功能,詳細說明如下所示:

 

 

<範例>

         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");

 

             // 設定目前 Camera 位置, 參數為: 經度, 緯度, 高程(公尺), 方位角, 傾角, 是否動畫展示

             pEarth.SetViewpoint(121.25, 24.82, 500000, 0, 0, true);

         }

       }

 

 

 

 

 


© 2017 Supergeo Technologies Inc.