雙擊放大地圖開關

<< Click to Display Table of Contents >>

Navigation:  3D API 說明範例 > 功能 > 基本控制項 >

雙擊放大地圖開關

 

 

檢視範例

範例下載

 

 

<說明>

在本範例中,我們將示範如何雙擊放大地圖開關,說明如下:

 

 

 

<範例>

   var earth_ = null;

 

         function documentLoad()

         {

             document.body.style.overflow = "hidden";

             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), sHost + "/ServerGate/Skin1.jpg");

 

             var pNavi = pEarth.GetCurrentTool(); // 取得目前的 Navigation Tool

             pNavi.ExitTool(); // 關掉所有 Navigation Tool 的事件監聽

             pNavi.DoubleClickEnable = false; // 關閉滑鼠雙擊功能

             pNavi.InitTool(pEarth); // 重新啟動 Navigation Tool 的事件監聽

         }

       }

 

 

 

 

 


© 2017 Supergeo Technologies Inc.