如何在ArcGlobe中实现zoomtolayer (How to zoom to layer in globe)
2008-01-14 16:01
573 查看
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.
在globe中聚焦到一个图层,就像以下代码实例所显示的那样得到该图层的句柄。通过传递图层的索引来得到一个具体图层的句柄。
[C#]
ESRI.ArcGIS.Analyst3D.IScene scene = (ESRI.ArcGIS.Analyst3D.IScene)globe; // Explicit cast. ESRI.ArcGIS.Carto.ILayer layer = scene.get_Layer(layerIndex); 当然,ILayer不一定要通过图层的索引来获得,也可以通过图层名称等来获取。 2.Now, get the extent of the layer using the following code example: 现在,使用下列代码实例来获得图层的范围。 [C#]
[code]
ESRI.ArcGIS.Geometry.IEnvelope envelope = layer.AreaOfInterest.Envelope;
3.After getting the extent, the IGlobeCamera.SetToZoomToExtents method can be used to zoom to the extent of the layer. See the following code example:
在得到图层的范围之后,IGlobeCamera.SetToZoomToExtents的方法可以用来聚焦到该图层的范围。看下列代码实例。
[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);
以上代码都经过测试完全可用(废话,易水的帮助还有错吗...)~嘿嘿~[/code]
相关文章推荐
- 如何在ArcGlobe中实现zoomtolayer (How to zoom to layer in globe)
- 在ArcGlobe中如何聚焦到选择的图元(How to zoom to selected features in globe)
- 【20091012-01】How to zoom to selected features in globe
- How to zoom to selected features in globe
- How to set globe layer cache properties(如何设置globe图层的缓存属性)
- How to hijack domain name in windows - 如何实现 Windows 本地域名劫持
- All-In-One Code Framework(AIO): 如何使用C#编写进程外的COM组件 (How to write an out-of-proc COM server in C#)
- 在iPhone应用中如何使用随机数(How to Use Random Numbers in Your iPhone App)
- Linq to Sql 如何实现 in 与 not in
- 如何Eclipse改变模板中${user}变量,How to change the variable ${user} used in the eclipse templates.
- 如何实现一个搜索引擎(1):构建索引 How to Implement a Search Engine Part 1: Create Index
- 如何用C++语言编程(How to program in C++)
- How to send mail by EMS - 如何实现邮件特快专递
- [备忘]how to use user-provided mentalray shader in Maya?(如何在maya里用自定义mentalray shader)
- How to get the size of file in C++ - 在C++中如何获取文件的大小
- 如何创建软链接 how to create a symbolic link in clearcase
- [原创] 如何留住优秀的测试人员(How to keep good testers in testing positions)
- How to add ComboBox control to the ToolBar control in VC - 如何在VC中向ToolBar控件加入ComboBox控件
- 如何使用th:each属性迭代模板-原标题:How To Use th:each For Iteration In Thymeleaf Template?
- How To Implement The Decision Tree Algorithm From Scratch In Python (从零开始在Python中实现决策树算法)