ArcGIS Pro-SetCustomFullExtent

LayoutProjectItem layoutItem = Project.Current.GetItems().FirstOrDefault(item => item.Name.Equals("Standard"));
Layout layout = layoutItem.GetLayout();
MapFrame mapFrame = layout.FindElement("FrameName") as MapFrame;
//Get map 
var mapFrameMap = mapFrame.Map;
//Get the specific layer you want from the map
var lyrOfInterest = mapFrameMap.GetLayersAsFlattenedList().OfType().FirstOrDefault();

using (RowCursor jCursor1 = ExtentFeatureClass.Search(queryFilter, true))
{
while (jCursor1.MoveNext())
{

var RTSNUM = "RTSNumber";
using (Feature feature = (Feature)jCursor1.Current)
{
// Process the feature. For example...
var pin = feature[RTSNUM].ToString();
Geometry geo2 = feature.GetShape().Clone();
var selectionEnvelope2 = geo2.Extent;
mapFrameMap.SetCustomFullExtent(selectionEnvelope2);
mapFrame.SetCamera(selectionEnvelope2);

 

你可能感兴趣的:(ArcGIS Pro-SetCustomFullExtent)