选择集放大居中显示
/// <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