zoukankan      html  css  js  c++  java
  • ArcGIS Pro-SetCustomFullExtent

    LayoutProjectItem layoutItem = Project.Current.GetItems<LayoutProjectItem>().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<FeatureLayer>().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);
  • 相关阅读:
    人月神话阅读笔记03
    学习进度十六
    计算最长英语链
    学习进度十五
    人月神话阅读笔记02
    找“水王”
    学习进度十四
    用户体验评价
    学习进度十三
    学习进度十二
  • 原文地址:https://www.cnblogs.com/gisoracle/p/12629157.html
Copyright © 2011-2022 走看看