選択フィーチャにズーム

      2017/12/09

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 , ,