zooming to a layer in globe
1.To Zoom to a layer into globe get a handle to the layer as shown code following. To get a handle to a specific layer, pass in the layer index.
Focus on a layer in the globe and get the handle to the layer as shown in the following code instance. A handle to a specific layer is obtained by passing the index of the layer.
[C #] ESRI. ArcGIS.Analyst3D.IScene scene = (ESRI. ArcGIS.Analyst3D.IScene) Globe; Explicit cast.
ESRI. ArcGIS.Carto.ILayer layer = Scene.get_layer (layerindex);
Of course, Ilayer does not have to be obtained by the index of the layer, or by the layer name.
2.Now, get the extent of the layer using the following code example:
Now use the following code instance to get the scope of the layer.
[C #] ESRI. ArcGIS.Geometry.IEnvelope envelope = layer. Areaofinterest.envelope;
3.After Getting the extent, the Iglobecamera.settozoomtoextents method can is used to zoom to the extent of the. See the following code example: after getting the layer's range, the Iglobecamera.settozoomtoextents method can be used to focus on the range of the layer. Look at the following code instance.
[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);
above code is tested and fully available (nonsense, Is the help of easy water still wrong? ) ~ hehe ~