選択フィーチャにズーム

投稿日:2016/9/1 (木) 更新日:

ISelectionSet pSelectionSet = pFeatureSelection.SelectionSet;
IEnumGeometry pEnumGeometry = new EnumFeatureGeometryClass();
IEnumGeometryBind pEnumGeometryBind = (IEnumGeometryBind)pEnumGeometry;
pEnumGeometryBind.BindGeometrySource(null,pSelectionSet);
 
System.Type t =  System.Type.GetTypeFromProgID("esriGeometry.GeometryEnvironment");
IGeometryFactory pGeometryFactory = (IGeometryFactory)System.Activator.CreateInstance(t);
 
IGeometry pGeometry = pGeometryFactory.CreateGeometryFromEnumerator(pEnumGeometry);
 
axMapControl1.ActiveView.Extent = pGeometry.Envelope;
 
axMapControl1.Refresh();

関連記事

-プログラミング, ArcGIS
-, ,

Copyright© WINGFIELD since1981 , 2018 All Rights Reserved.