Point 絕對高

<< Click to Display Table of Contents >>

Navigation:  3D API 說明範例 > 功能 > 圖層位置 >

Point 絕對高

 

 

檢視範例

範例下載

 

 

<說明>

在本範例中,我們將示範如何執行Point 絕對高,說明如下:

 

 

<範例>

      var earth_ = null;

 

         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)

         {

             earth_ = 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), "");

             pEarth.MajorGraticule.Visible = false;

             pEarth.MinorGraticule.Visible = false;

 

             Dtm = new SuperGIS.DTMLayer("http://203.66.168.227/TGOS3D_WMTS/World/SimpleWMTS_GLOBE_W_D.aspx?apikey=mcXodoZFWJaUJRFS5H3gCec83a570/QupBX5ROqlSmu9vZW61YOYMe86Om9zQ2g2pVSGtjfLi5gex++mKHMFNK95UFUwZD3TtpSdH73WhL5KMv0WZVPMe5rB4KiLpaRrReusEFx+W10=&appid=BHvpiOJ5Wp41CsxemFMNWQ==",

                                               pEarth, { layer: 'Map' }, null);

 

             // 指定圖磚服務的 WMTS 網址, 欲加入的圖層名稱及 callback function 名稱

             Tile = new SuperGIS.TileLayer("http://203.66.168.227/TGOS3D_WMTS/World/SimpleWMTS_GLOBE_W.aspx?apikey=mcXodoZFWJaUJRFS5H3gCec83a570/QupBX5ROqlSmu9vZW61YOYMe86Om9zQ2g2pVSGtjfLi5gex++mKHMFNK95UFUwZD3TtpSdH73WhL5KMv0WZVPMe5rB4KiLpaRrReusEFx+W10=&appid=BHvpiOJ5Wp41CsxemFMNWQ==",

                                               pEarth, { layer: 'Map' }, null);

 

             // 指定向量磚服務的 WMTS 網址, 欲加入的圖層名稱, 及 callback function 名稱

             VLayer = new SuperGIS.VectorLayer(getDataServicePath() + '3dtest_PointRN/SimpleWMTS.aspx',

                                               pEarth, { layer: 'Point_RN' }, PointFinish);

 

             pEarth.SetViewpoint(120.288, 22.617, 500, 0, 50, true);

         }

 

         // 在 callback 中設定每個 feature 的符號樣式

         function PointFinish(array) {

             var rv = 255, gv = 0, bv = 0;

             for (var i = 0; i < array.length; i++) {

                 var mark = array[i];

                 var fc = earth_.CreateColor(rv / 255.0, gv / 255.0, bv / 255.0, 1);

                 mark.ReplaceZ = 100; // 設定高程 (公尺)

 

                 // 基本上在 3D 環境中, 無法以點 (Pixel) 的方式呈現物件, 故 CreateSimpleDDDPointSymbol 的結果是看不到東西,

                 // 但可以搭配 ExtrudeSymbol 的設定來展示拉線的效果

                 mark.DDDSymbol = earth_.CreateSimpleDDDPointSymbol(earth_.CreateModelMaterial(0, fc));

 

                 mark.ExtrudeSymbol = earth_.CreateSimpleDDDLineSymbol(earth_.CreateModelMaterial(0, fc));

                 mark.AltitudeMode = SuperGIS.DDDEarth.AltitudeMode.Absolute;

             }

         }

       }

 

 

 

 

 

 


© 2017 Supergeo Technologies Inc.