疊加WMS

<< Click to Display Table of Contents >>

Navigation:  3D API 說明範例 > 圖層套疊 > 介接OGC服務 >

疊加WMS

 

 

檢視範例1

檢視範例2

範例下載

 

 

今日已有相當多圖資皆以網路地圖服務(Web Map Service, WMS)型態發布於網路上,提供廣泛介接使用。SuperGIS 3D API亦支援將WMS檔案疊加於地圖平台上,以呈現更多元的資訊。其方法如下:

 

 

<範例1>

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

             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(getDataServicePath() + 'TC_fly/SimpleWMTS.aspx',

               //                                pEarth, { layer: 'TC' }, null);

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

 

             pEarth.SetViewpoint(120.789, 24.160, 3000, 0, 50, true);

         }

       }

 

 

 

<範例2>

         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(false, s_WGS84); // false: 使用 Cube 模式; true: 使用 Planet 模式

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

 

             pEarth.SetViewpoint(121.25, 24.5, 12000, 0, 65, true);

         }

       }

 

 

 


© 2017 Supergeo Technologies Inc.