<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Force map labels horizontal in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/force-map-labels-horizontal/m-p/1481035#M11600</link>
    <description>&lt;P&gt;Works!&lt;BR /&gt;&lt;BR /&gt;Will look into the viewer&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 30 May 2024 12:55:57 GMT</pubDate>
    <dc:creator>MariusN</dc:creator>
    <dc:date>2024-05-30T12:55:57Z</dc:date>
    <item>
      <title>Force map labels horizontal</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/force-map-labels-horizontal/m-p/1480894#M11598</link>
      <description>&lt;P&gt;Is there a way to force labels added to a map to appear horizontal?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; return QueuedTask.Run(() =&amp;gt;
 {
     var lyr = featureLayer;
     var lyrDefn = lyr.GetDefinition() as CIMFeatureLayer;
     CIMTextSymbol textSymbol = SymbolFactory.Instance.ConstructTextSymbol(ColorFactory.Instance.BlackRGB, 12, "Arial", "Bold");
     textSymbol.Callout = CreateCIMCallout();

     //Create the new label class and initialize props
     var newLabelClass = new CIMLabelClass
     {
         ExpressionEngine = LabelExpressionEngine.Arcade,
         Expression = "$feature.id",
         Visibility = true,
         TextSymbol = textSymbol.MakeSymbolReference(),
         Name = "XX",
     };

     var maplexLabelPlacementProps = new CIMMaplexLabelPlacementProperties
     {
         ThinDuplicateLabels = true,
         FeatureType = LabelFeatureType.Polygon,
     };

     var standardLabelPlacementProps = new CIMStandardLabelPlacementProperties
     {
         FeatureType = LabelFeatureType.Polygon,
     };

     newLabelClass.MaplexLabelPlacementProperties = maplexLabelPlacementProps;
     var lyrsLabelsClasses = lyrDefn.LabelClasses.ToList();

     lyrsLabelsClasses.Clear();
     lyrsLabelsClasses.Add(newLabelClass);

     lyrDefn.LabelClasses = lyrsLabelsClasses.ToArray(); //Set the labelClasses back
     lyr.SetDefinition(lyrDefn); //set the layer's definition;
     featureLayer.SetLabelVisibility(true);
 });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="rotation.png" style="width: 439px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/105748i34FE239E482575C6/image-size/large?v=v2&amp;amp;px=999" role="button" title="rotation.png" alt="rotation.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 09:14:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/force-map-labels-horizontal/m-p/1480894#M11598</guid>
      <dc:creator>MariusN</dc:creator>
      <dc:date>2024-05-30T09:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Force map labels horizontal</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/force-map-labels-horizontal/m-p/1481002#M11599</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Set additional property to&amp;nbsp;maplexLabelPlacementProps:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;                var maplexLabelPlacementProps = new CIMMaplexLabelPlacementProperties
                {
                    ThinDuplicateLabels = true,
                    FeatureType = LabelFeatureType.Polygon,
                    PolygonPlacementMethod = MaplexPolygonPlacementMethod.HorizontalInPolygon

                };&lt;/LI-CODE&gt;&lt;P&gt;I would recommend you use CIM Viewer for that kind of investigation&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 11:43:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/force-map-labels-horizontal/m-p/1481002#M11599</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2024-05-30T11:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Force map labels horizontal</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/force-map-labels-horizontal/m-p/1481035#M11600</link>
      <description>&lt;P&gt;Works!&lt;BR /&gt;&lt;BR /&gt;Will look into the viewer&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 12:55:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/force-map-labels-horizontal/m-p/1481035#M11600</guid>
      <dc:creator>MariusN</dc:creator>
      <dc:date>2024-05-30T12:55:57Z</dc:date>
    </item>
  </channel>
</rss>

