Zooming to a layer in globe
- 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);
- Now, get the extent of the layer using the following code example:
[C#]
ESRI.ArCGIS.Geometry.IEnvelope envelope = layer.AreaOfInterest.Envelope;
- 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);