首页 > 代码库 > wpf arcglobe +c# 三维缩放到图层
wpf arcglobe +c# 三维缩放到图层
/// <summary>
/// 地图缩放到图层
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button5_Click(object sender, RoutedEventArgs e)
{
ESRI.ArcGIS.Analyst3D.IScene _Scene = _GlobeControl.Globe as ESRI.ArcGIS.Analyst3D.IScene;
ESRI.ArcGIS.Carto.ILayer _ILayer = _Scene.get_Layer(0);//获取要缩放的图层
ESRI.ArcGIS.Geometry.IEnvelope _IEnvelope = _ILayer.AreaOfInterest.Envelope;
ICamera _ICamera = _GlobeControl.GlobeDisplay.ActiveViewer.Camera;
IGlobeCamera _IGlobeCamera = _ICamera as IGlobeCamera;
ISceneViewer _ISceneViewer = _GlobeControl.GlobeDisplay.ActiveViewer;
_IGlobeCamera.SetToZoomToExtents(_IEnvelope, _GlobeControl.Globe, _ISceneViewer);
}