<?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 ArcGIS Runtime SDK for .NET Printing Military Message Layers in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/arcgis-runtime-sdk-for-net-printing-military/m-p/664177#M8378</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have setup printing feature based on the &lt;A href="https://github.com/Esri/arcgis-runtime-samples-dotnet/blob/master/src/Desktop/ArcGISRuntimeSamplesDesktop/Samples/Printing/ClientPrinting.xaml" rel="nofollow noopener noreferrer" target="_blank"&gt;Client Print Sample&lt;/A&gt; provided on GitHub. Everything is working except for the Military Message Layers not being displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to get the most basic sample together with the print sample to display a 2525C symbol on the print preview, but I cannot get anything to work. If I try and programmatically add a message layer to the the print sample it throws an InvalidOperationException&lt;/P&gt;&lt;P&gt;"The Message could not be processed. MessageLayer must have been successfully loaded into a View (Map or Scene) before calling ProcessMessage."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hack to ClientPrinting.xaml.cs sample:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if (PrintMapView.Extent == null)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; PrintMapView.MaximumExtent = BaseMapView.MaximumExtent;
&amp;nbsp;&amp;nbsp;&amp;nbsp; PrintMapView.MaxScale = BaseMapView.MaxScale;
&amp;nbsp;&amp;nbsp;&amp;nbsp; PrintMapView.MinScale = BaseMapView.MinScale;
&amp;nbsp;&amp;nbsp;&amp;nbsp; PrintMapView.SetRotation(BaseMapView.Rotation);
&amp;nbsp;&amp;nbsp;&amp;nbsp; PrintMapView.WrapAround = BaseMapView.WrapAround;
&amp;nbsp;&amp;nbsp;&amp;nbsp; PrintMapView.Map = BaseMapView.Map;

&amp;nbsp;&amp;nbsp;&amp;nbsp; await PrintMapView.LayersLoadedAsync();
&amp;nbsp;&amp;nbsp;&amp;nbsp; // create a dictionary to hold message properties
&amp;nbsp;&amp;nbsp;&amp;nbsp; var messageProps = new Dictionary&amp;lt;string, string&amp;gt;();

&amp;nbsp;&amp;nbsp;&amp;nbsp; // define message properties (property name, value)
&amp;nbsp;&amp;nbsp;&amp;nbsp; messageProps.Add("_type", "position_report");
&amp;nbsp;&amp;nbsp;&amp;nbsp; messageProps.Add("_action", "update");
&amp;nbsp;&amp;nbsp;&amp;nbsp; messageProps.Add("_id", "e0ba16ac-cddd-4595-845e-32ca4177d080");
&amp;nbsp;&amp;nbsp;&amp;nbsp; messageProps.Add("_control_points", "-117.187,32.770;-117.191,32.725;-117.097,32.653;-116.944,32.610");
&amp;nbsp;&amp;nbsp;&amp;nbsp; messageProps.Add("_wkid", "4326");
&amp;nbsp;&amp;nbsp;&amp;nbsp; messageProps.Add("sic", "GFGPOAO-------X");
&amp;nbsp;&amp;nbsp;&amp;nbsp; messageProps.Add("uniquedesignation", "IGLOO");

&amp;nbsp;&amp;nbsp;&amp;nbsp; // create the message using the properties
&amp;nbsp;&amp;nbsp;&amp;nbsp; var message = new Esri.ArcGISRuntime.Symbology.Specialized.Message(messageProps);

&amp;nbsp;&amp;nbsp;&amp;nbsp; // get the message layer from the map
&amp;nbsp;&amp;nbsp;&amp;nbsp; var messageLayer = new MessageLayer(SymbolDictionaryType.Mil2525c)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID = "MyMessageLayer"
&amp;nbsp;&amp;nbsp;&amp;nbsp; };

&amp;nbsp;&amp;nbsp;&amp;nbsp; PrintMapView.Map.Layers.Add(messageLayer);
&amp;nbsp;&amp;nbsp;&amp;nbsp; // make sure it's loaded before using it
&amp;nbsp;&amp;nbsp;&amp;nbsp; await PrintMapView.LayersLoadedAsync(new[] {messageLayer});
&amp;nbsp;&amp;nbsp;&amp;nbsp; // call ProcessMessage on the layer
&amp;nbsp;&amp;nbsp;&amp;nbsp; bool success = messageLayer.ProcessMessage(message);
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!success)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Trace.WriteLine("Failed to process message.");
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone managed to print a map with military symbols on it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that I am testing this against version 10.2.6&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 04:04:51 GMT</pubDate>
    <dc:creator>PeterDavis3</dc:creator>
    <dc:date>2021-12-12T04:04:51Z</dc:date>
    <item>
      <title>ArcGIS Runtime SDK for .NET Printing Military Message Layers</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/arcgis-runtime-sdk-for-net-printing-military/m-p/664177#M8378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have setup printing feature based on the &lt;A href="https://github.com/Esri/arcgis-runtime-samples-dotnet/blob/master/src/Desktop/ArcGISRuntimeSamplesDesktop/Samples/Printing/ClientPrinting.xaml" rel="nofollow noopener noreferrer" target="_blank"&gt;Client Print Sample&lt;/A&gt; provided on GitHub. Everything is working except for the Military Message Layers not being displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to get the most basic sample together with the print sample to display a 2525C symbol on the print preview, but I cannot get anything to work. If I try and programmatically add a message layer to the the print sample it throws an InvalidOperationException&lt;/P&gt;&lt;P&gt;"The Message could not be processed. MessageLayer must have been successfully loaded into a View (Map or Scene) before calling ProcessMessage."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hack to ClientPrinting.xaml.cs sample:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if (PrintMapView.Extent == null)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; PrintMapView.MaximumExtent = BaseMapView.MaximumExtent;
&amp;nbsp;&amp;nbsp;&amp;nbsp; PrintMapView.MaxScale = BaseMapView.MaxScale;
&amp;nbsp;&amp;nbsp;&amp;nbsp; PrintMapView.MinScale = BaseMapView.MinScale;
&amp;nbsp;&amp;nbsp;&amp;nbsp; PrintMapView.SetRotation(BaseMapView.Rotation);
&amp;nbsp;&amp;nbsp;&amp;nbsp; PrintMapView.WrapAround = BaseMapView.WrapAround;
&amp;nbsp;&amp;nbsp;&amp;nbsp; PrintMapView.Map = BaseMapView.Map;

&amp;nbsp;&amp;nbsp;&amp;nbsp; await PrintMapView.LayersLoadedAsync();
&amp;nbsp;&amp;nbsp;&amp;nbsp; // create a dictionary to hold message properties
&amp;nbsp;&amp;nbsp;&amp;nbsp; var messageProps = new Dictionary&amp;lt;string, string&amp;gt;();

&amp;nbsp;&amp;nbsp;&amp;nbsp; // define message properties (property name, value)
&amp;nbsp;&amp;nbsp;&amp;nbsp; messageProps.Add("_type", "position_report");
&amp;nbsp;&amp;nbsp;&amp;nbsp; messageProps.Add("_action", "update");
&amp;nbsp;&amp;nbsp;&amp;nbsp; messageProps.Add("_id", "e0ba16ac-cddd-4595-845e-32ca4177d080");
&amp;nbsp;&amp;nbsp;&amp;nbsp; messageProps.Add("_control_points", "-117.187,32.770;-117.191,32.725;-117.097,32.653;-116.944,32.610");
&amp;nbsp;&amp;nbsp;&amp;nbsp; messageProps.Add("_wkid", "4326");
&amp;nbsp;&amp;nbsp;&amp;nbsp; messageProps.Add("sic", "GFGPOAO-------X");
&amp;nbsp;&amp;nbsp;&amp;nbsp; messageProps.Add("uniquedesignation", "IGLOO");

&amp;nbsp;&amp;nbsp;&amp;nbsp; // create the message using the properties
&amp;nbsp;&amp;nbsp;&amp;nbsp; var message = new Esri.ArcGISRuntime.Symbology.Specialized.Message(messageProps);

&amp;nbsp;&amp;nbsp;&amp;nbsp; // get the message layer from the map
&amp;nbsp;&amp;nbsp;&amp;nbsp; var messageLayer = new MessageLayer(SymbolDictionaryType.Mil2525c)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID = "MyMessageLayer"
&amp;nbsp;&amp;nbsp;&amp;nbsp; };

&amp;nbsp;&amp;nbsp;&amp;nbsp; PrintMapView.Map.Layers.Add(messageLayer);
&amp;nbsp;&amp;nbsp;&amp;nbsp; // make sure it's loaded before using it
&amp;nbsp;&amp;nbsp;&amp;nbsp; await PrintMapView.LayersLoadedAsync(new[] {messageLayer});
&amp;nbsp;&amp;nbsp;&amp;nbsp; // call ProcessMessage on the layer
&amp;nbsp;&amp;nbsp;&amp;nbsp; bool success = messageLayer.ProcessMessage(message);
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!success)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Trace.WriteLine("Failed to process message.");
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone managed to print a map with military symbols on it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that I am testing this against version 10.2.6&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:04:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/arcgis-runtime-sdk-for-net-printing-military/m-p/664177#M8378</guid>
      <dc:creator>PeterDavis3</dc:creator>
      <dc:date>2021-12-12T04:04:51Z</dc:date>
    </item>
  </channel>
</rss>

