指定地圖坐標系統

<< Click to Display Table of Contents >>

Navigation:  3D API 說明範例 > 建立圖台 >

指定地圖坐標系統

 

 

檢視範例

範例下載

 

 

<說明>

在設定初始化Cube模式後,Cube 環境提供不只一種坐標系統, 開發者可依使用者需求指定坐標,SuperGIS 3D API提供適用臺灣地區的TWD97 (EPSG:3826),以及適用於外島地區的119分帶TWD97(EPSG:3825)坐標系統,如欲與OpenStreetMap, Google底圖同時套用,亦有Google坐標系統(EPSG:3857)的選項。

 

 

<範例>

   // 定義 Pseudo-Mercator 的坐標系統 WKT 內容

       var s_PseudoM = "PROJCS[\"WGS 84 / Pseudo-Mercator\", GEOGCS[\"GCS_WGS_1984\", DATUM[\"D_WGS_1984\", SPHEROID[\"WGS_1984\", 6378137, 298.257223563]], PRIMEM[\"Greenwich\", 0.0], UNIT[\"Degree\", 0.017453292519943295]], PROJECTION[\"Mercator_1SP\"], PARAMETER[\"Central_Meridian\", 0], PARAMETER[\"Scale_Factor\", 1], PARAMETER[\"False_Easting\", 0], PARAMETER[\"False_Northing\", 0], UNIT[\"Meter\", 1.0], AUTHORITY[\"EPSG\", 3857]]";

       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_PseudoM); // 指定 3D 環境坐標系統為 Pseudo-Mercator

             pEarth.SetupSkin(pEarth.CreateEnvelope(13430000, 13433000, 2773500, 2775000, s_PseudoM), sHost + "/ServerGate/white.jpg");

             pEarth.MajorGraticule.Visible = false;

             pEarth.MinorGraticule.Visible = false;

 

             pEarth.SetViewpoint(120.6559, 24.16, 1000, 0, 45, true); // SetViewpoint 指定輸入 WGS84 經緯度

         }

       }

 

 

 

 

 


© 2017 Supergeo Technologies Inc.