zoukankan      html  css  js  c++  java
  • ArcGIS Pro二次开发-插入文本,图例和指北针

    // Add text for title
                 Coordinate2D titleTxt_ll = new Coordinate2D(4.5, 9.5);
                 CIMTextSymbol arial36bold = SymbolFactory.Instance.ConstructTextSymbol(ColorFactory.Instance.BlueRGB, 80, "Arial", "Bold");
                 GraphicElement titleTxtElm = LayoutElementFactory.Instance.CreatePointTextGraphicElement(newLayout, titleTxt_ll, "Census Data", arial36bold);
                 titleTxtElm.SetName("Title");
    
                 // Add north arrow
                 // Reference a North Arrow in a style
                 StyleProjectItem stylePrjItm = Project.Current.GetItems<StyleProjectItem>().FirstOrDefault(item => item.Name == "ArcGIS 2D");
                 NorthArrowStyleItem naStyleItm = stylePrjItm.SearchNorthArrows("ArcGIS North 8")[0];
    
                 // Set the center coordinate and create the arrow on the layout
                 Coordinate2D center = new Coordinate2D(15, 7);
                 NorthArrow arrowElm = LayoutElementFactory.Instance.CreateNorthArrow(newLayout, center, newMapframe, naStyleItm);
                 arrowElm.SetName("New North Arrow");
                 arrowElm.SetHeight(2);
     // Add legend - first build 2D envelope geometry
                 Coordinate2D leg_ll = new Coordinate2D(13.5, 0.5);
                 Coordinate2D leg_ur = new Coordinate2D(16.5, 4.0);
                 Envelope leg_env = EnvelopeBuilder.CreateEnvelope(leg_ll, leg_ur);
    
                 // Create legend
                 Legend legendElm = LayoutElementFactory.Instance.CreateLegend(newLayout, leg_env, newMapframe);
                 legendElm.SetVisible(true);
                 legendElm.SetName("New Legend");
    
                 return newLayout;
              });
    
             var layoutPane = await ProApp.Panes.CreateLayoutPaneAsync(newLayout);
  • 相关阅读:
    你所不知道的 CSS 阴影技巧与细节
    %date~0,4%和 %time~0,2%等用法详解
    计算程序执行时间
    GDI
    IO
    字符串拼凑批量Insert SQL语句神BUG
    用逗号分隔的数据转换到数组
    MVC ViewBag传值
    接口和抽象类对比
    Partial 同一个命名空间下写两个类名一样的类
  • 原文地址:https://www.cnblogs.com/gisoracle/p/12504986.html
Copyright © 2011-2022 走看看