<< Click to Display Table of Contents >>

疊加KML/KMZ

 

 

檢視範例

範例下載

 

 

<說明>

KML為OGC(Open Geospatial Consortium, Inc.,開放地理資訊系統協會)宣布之開放地理資訊編碼標準。目前網際網路上有許多大量的地理資訊採用KML資料格式儲存並公開使用。SuperGIS 3D API支援將KML檔案引用疊加於地圖平台上,讓更多元的資訊可以呈現。其方法如下:

 

 

<範例>

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

 

             pEarth.SetViewpoint(120.658, 24.160, 200, 0, 45, true);

 

             var kmlDoc = pEarth.CreateKMLDocument('test', 'http://60.251.183.9/model3D/台電變電所A.kmz', "");

             pEarth.PlacemarkObjects.Add(kmlDoc);

         }

       }

 

 

 

 

另外也可以利用方法取得KML圖層的詮釋資料,包括製作者資訊、圖層說明、圖層名稱、摘要等。

 


© 2017 Supergeo Technologies Inc.