<?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: PrintTask - Custom Legend in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtask-custom-legend/m-p/574372#M53658</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, I have a potential workaround on my end but it's less then ideal.&amp;nbsp; If there's no simple / non-hackish ways to pull this off then I see about editing my code.&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Sep 2020 22:29:57 GMT</pubDate>
    <dc:creator>AndrewMurdoch1</dc:creator>
    <dc:date>2020-09-17T22:29:57Z</dc:date>
    <item>
      <title>PrintTask - Custom Legend</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtask-custom-legend/m-p/574370#M53656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Day&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to build in a custom legend with the Print Task output?&amp;nbsp; Assuming I have the following output &lt;BR /&gt;&lt;IMG __jive_id="506996" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/506996_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;Can I have only one set of data per geometry shown in the legend, without restructuring how our data is broken down by feature layer?&amp;nbsp; Ideally I'd want to change the legend based on the condition at the time the printMap function is executed.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My Print Code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #ffc66d;"&gt;printMap&lt;/SPAN&gt;() {
  &lt;SPAN style="color: #cc7832;"&gt;const &lt;/SPAN&gt;printTask = &lt;SPAN style="color: #cc7832;"&gt;this&lt;/SPAN&gt;.&lt;SPAN style="color: #9876aa;"&gt;PrintTask&lt;/SPAN&gt;({
    &lt;SPAN style="color: #9876aa;"&gt;url&lt;/SPAN&gt;: &lt;SPAN style="color: #6a8759;"&gt;'https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task'
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;  &lt;/SPAN&gt;})&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;  const &lt;/SPAN&gt;template = &lt;SPAN style="color: #cc7832;"&gt;new this&lt;/SPAN&gt;.&lt;SPAN style="color: #9876aa;"&gt;PrintTemplate&lt;/SPAN&gt;({
    &lt;SPAN style="color: #9876aa;"&gt;format&lt;/SPAN&gt;: &lt;SPAN style="color: #6a8759;"&gt;'jpg'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;    &lt;/SPAN&gt;&lt;SPAN style="color: #9876aa;"&gt;layout&lt;/SPAN&gt;: &lt;SPAN style="color: #6a8759;"&gt;'a4-landscape'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;    &lt;/SPAN&gt;&lt;SPAN style="color: #9876aa;"&gt;layoutOptions&lt;/SPAN&gt;: {
      &lt;SPAN style="color: #9876aa;"&gt;titleText&lt;/SPAN&gt;: &lt;SPAN style="color: #6a8759;"&gt;''&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;      &lt;/SPAN&gt;&lt;SPAN style="color: #9876aa;"&gt;authorText&lt;/SPAN&gt;: &lt;SPAN style="color: #6a8759;"&gt;'Infrasol'
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;    &lt;/SPAN&gt;}
  })&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;  const &lt;/SPAN&gt;params = &lt;SPAN style="color: #cc7832;"&gt;new this&lt;/SPAN&gt;.&lt;SPAN style="color: #9876aa;"&gt;PrintParameters&lt;/SPAN&gt;({
    &lt;SPAN style="color: #9876aa;"&gt;view&lt;/SPAN&gt;: &lt;SPAN style="color: #cc7832;"&gt;this&lt;/SPAN&gt;.&lt;SPAN style="color: #9876aa;"&gt;_view&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;    &lt;/SPAN&gt;&lt;SPAN style="color: #9876aa;"&gt;template&lt;/SPAN&gt;: template
  })&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;  this&lt;/SPAN&gt;.&lt;SPAN style="color: #9876aa;"&gt;printProgress &lt;/SPAN&gt;= &lt;SPAN style="color: #cc7832;"&gt;true;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;  &lt;/SPAN&gt;printTask.&lt;SPAN style="color: #ffc66d;"&gt;execute&lt;/SPAN&gt;(params).&lt;SPAN style="color: #ffc66d;"&gt;then&lt;/SPAN&gt;( (result) =&amp;gt; {
    &lt;SPAN style="color: #cc7832;"&gt;this&lt;/SPAN&gt;.&lt;SPAN style="color: #9876aa;"&gt;printProgress &lt;/SPAN&gt;= &lt;SPAN style="color: #cc7832;"&gt;false;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;    &lt;/SPAN&gt;&lt;SPAN style="color: #9876aa; font-weight: bold; font-style: italic;"&gt;window&lt;/SPAN&gt;.&lt;SPAN style="color: #ffc66d;"&gt;open&lt;/SPAN&gt;(result.&lt;SPAN style="color: #9876aa;"&gt;url&lt;/SPAN&gt;)&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;  &lt;/SPAN&gt;}&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;(err) =&amp;gt; {
    &lt;SPAN style="color: #cc7832;"&gt;this&lt;/SPAN&gt;.&lt;SPAN style="color: #9876aa;"&gt;printProgress &lt;/SPAN&gt;= &lt;SPAN style="color: #cc7832;"&gt;false;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;    &lt;/SPAN&gt;&lt;SPAN style="color: #9876aa; font-weight: bold; font-style: italic;"&gt;console&lt;/SPAN&gt;.&lt;SPAN style="color: #ffc66d;"&gt;log&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;'ESRI Print Task Error: '&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;err)&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;  &lt;/SPAN&gt;})&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;}&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:43:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtask-custom-legend/m-p/574370#M53656</guid>
      <dc:creator>AndrewMurdoch1</dc:creator>
      <dc:date>2021-12-12T00:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: PrintTask - Custom Legend</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtask-custom-legend/m-p/574371#M53657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The printed legend is based on the ArcMap or ArcGIS Pro published template (hosted in ArcGIS Enterprise or ArcGIS Online), feature visibility, and the legend layer properties&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html"&gt;LegendLayer | ArcGIS API for JavaScript 4.16&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I don't think we have an OOTB method to achieve what you're looking for. Perhaps others in the community have a workaround for this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Sep 2020 22:14:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtask-custom-legend/m-p/574371#M53657</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2020-09-17T22:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: PrintTask - Custom Legend</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtask-custom-legend/m-p/574372#M53658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, I have a potential workaround on my end but it's less then ideal.&amp;nbsp; If there's no simple / non-hackish ways to pull this off then I see about editing my code.&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Sep 2020 22:29:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/printtask-custom-legend/m-p/574372#M53658</guid>
      <dc:creator>AndrewMurdoch1</dc:creator>
      <dc:date>2020-09-17T22:29:57Z</dc:date>
    </item>
  </channel>
</rss>

