程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> .NET網頁編程 >> .NET實例教程 >> 如何在ArcGlobe中實現zoomtolayer (How to zoom to layer in globe)

如何在ArcGlobe中實現zoomtolayer (How to zoom to layer in globe)

編輯:.NET實例教程

Zooming to a layer in globe

  1. To zoom to a layer in globe get a handle to the layer as shown in the following code example. To get a handle to a specific layer, pass in the layer index.

[C#]
ESRI.ArcGIS.Analyst3D.IScene scene = (ESRI.ArcGIS.Analyst3D.IScene)globe; // Explicit cast.ESRI.ArCGIS.Carto.ILayer layer = scene.get_Layer(layerIndex);
  1. Now, get the extent of the layer using the following code example:

[C#]
ESRI.ArCGIS.Geometry.IEnvelope envelope = layer.AreaOfInterest.Envelope;
  1. After getting the extent, the IGlobeCamera.SetToZoomToExtents method can be used to zoom to the extent of the layer. See the following code example:

[C#]
ESRI.ArcGIS.Analyst3D.ICamera camera = globeDisplay.ActiveVIEwer.Camera;ESRI.ArcGIS.GlobeCore.IGlobeCamera globeCamera = (ESRI.ArcGIS.GlobeCore.IGlobeCamera)camera; // Explicit cast.ESRI.ArCGIS.Analyst3D.ISceneViewer sceneViewer = globeDisplay.ActiveViewer;globeCamera.SetToZoomToExtents(envelope, globe, sceneVIEwer); 

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved