// Add text for title Coordinate2D titleTxt_ll = new Coordinate2D4.5, 9.5); CIMTextSymbol arial36bold = SymbolFactory.Instance.ConstructTextSymbolColorFactory.Instance.BlueRGB, 80, "Arial", "Bold"); GraphicElement titleTxtElm = LayoutElementFactory.Instance.CreatePointTextGraphicElementnewLayout, titleTxt_ll, "Census Data", arial36bold); titleTxtElm.SetName"Title"); // Add north arrow // Reference a North Arrow in a style StyleProjectItem stylePrjItm = Project.Current.GetItems<StyleProjectItem>).FirstOrDefaultitem => 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 Coordinate2D15, 7); NorthArrow arrowElm = LayoutElementFactory.Instance.CreateNorthArrownewLayout, center, newMapframe, naStyleItm); arrowElm.SetName"New North Arrow"); arrowElm.SetHeight2);
// Add legend - first build 2D envelope geometry Coordinate2D leg_ll = new Coordinate2D13.5, 0.5); Coordinate2D leg_ur = new Coordinate2D16.5, 4.0); Envelope leg_env = EnvelopeBuilder.CreateEnvelopeleg_ll, leg_ur); // Create legend Legend legendElm = LayoutElementFactory.Instance.CreateLegendnewLayout, leg_env, newMapframe); legendElm.SetVisibletrue); legendElm.SetName"New Legend"); return newLayout; }); var layoutPane = await ProApp.Panes.CreateLayoutPaneAsyncnewLayout);