选择集放大居中显示

  /// <summary>
  •         /// 选择集放大居中显示
  •         /// </summary>
  •         /// <param name="pSelectionSet">选择集</param>
  •         /// <param name="pMapControl">地图控件</param>
  •         private void SetSelectionSetFullVisible(ISelectionSet pSelectionSet,AxMapControl pMapControl)
  •         {
  •             try
  •             {
  •                 if (pSelectionSet != null)
  •                 {
  •                     IFeatureLayerDefinition pFDefinition = pSelectionSet as IFeatureLayerDefinition;
  •                     pFDefinition.CreateSelectionLayer("newlayerName", true, null, null);
  •                     IFeatureLayer pFeatureLayer=pFDefinition as IFeatureLayer;
  •                     IEnvelope pEnvelope = pFeatureLayer.AreaOfInterest;
  •                     pMapControl.Extent = pEnvelope;                    
  •                 }
  •             }
  •             catch (Exception Err)
  •             {
  •                 MessageBox.Show(Err.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  •             }
  •         }
  • 来自:http://bbs.esrichina-bj.cn/ESRI/thread-35180-1-1.html

    posted @ 2009-03-12 15:20  闫磊博客  阅读(291)  评论(0编辑  收藏  举报