<?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: How to filter layers in a legend: understanding PrintTemplate.layoutOptions.legendLayers in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6810#M630</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Piterson,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;That should make it easy as&amp;nbsp;you know where the templates are located on the file system and to make sure the mxd has the option checked to limit the legend then.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Nov 2016 23:09:03 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2016-11-30T23:09:03Z</dc:date>
    <item>
      <title>How to filter layers in a legend: understanding PrintTemplate.layoutOptions.legendLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6805#M625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I try to define the list of layers to be included in a legend in print task. It (marked with red color) has no impact on output printed image. It always only one layer - "address_points" (I tried&amp;nbsp;&lt;SPAN style="color: #ff0000;"&gt;["address_points,streets,lakes"] &lt;SPAN style="color: #000000;"&gt;or&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;["streets,"] &lt;SPAN style="color: #000000;"&gt;or&lt;/SPAN&gt; ["lakes"]). &lt;SPAN style="color: #000000;"&gt;I see in debug mode that "map" object contains&amp;nbsp;layerIds ("address_points,streets,lakes").&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to use&amp;nbsp;PrintTemplate.layoutOptions.legendLayers&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;template2.layoutOptions = {&lt;BR /&gt; "titleText": title,&lt;BR /&gt; "authorText": author,&lt;BR /&gt; "copyrightText": "&amp;lt;Copyright info here&amp;gt;",&lt;BR /&gt; &lt;SPAN style="color: #ff0000;"&gt;"legendLayers": ["address_points,streets,lakes"],&lt;/SPAN&gt;&lt;BR /&gt; "scalebarUnit": "Miles",&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;Please explain how to make it working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also noticed the question (see the link below), but cannot understand it.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/117321"&gt;Javascript API print task legend with dynamically rendered layer&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Nov 2016 22:34:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6805#M625</guid>
      <dc:creator>PitersonPaulgek</dc:creator>
      <dc:date>2016-11-29T22:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter layers in a legend: understanding PrintTemplate.layoutOptions.legendLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6806#M626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Piterson,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;The printTemplates.layoutOptions.legendLayers is expecting an array of&amp;nbsp;&lt;/P&gt;&lt;PRE class="" style="color: #4d4d4d; background: #fafafa; border: 2px solid #dddddd; padding: 0.5em 0px 0.5em 0.5em;"&gt;&lt;SPAN class="" style="color: #dd1144;"&gt;esri/tasks/LegendLayer&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;objects not just strings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/3/jsapi/legendlayer-amd.html" title="https://developers.arcgis.com/javascript/3/jsapi/legendlayer-amd.html"&gt;LegendLayer | API Reference | ArcGIS API for JavaScript 3.18&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2016 01:03:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6806#M626</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-11-30T01:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter layers in a legend: understanding PrintTemplate.layoutOptions.legendLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6807#M627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;Thank you for the response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works, thank you. &amp;nbsp;&lt;/P&gt;&lt;P style="direction: ltr;"&gt;But it shows now number of layers I define plus one layer (&lt;SPAN style="background-color: #ffffff;"&gt;"address_points" - that was before). &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="direction: ltr;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Example: I ask to include 3 layers "address_points,streets,lakes" - it includes 4 layers - &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;address_points,streets,lakes" + "address_points".&lt;/SPAN&gt;&amp;nbsp;How to remove it?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="direction: ltr;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Additional question: How to include in a legend only symbols that actually on current extent?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="direction: ltr;"&gt;&lt;/P&gt;&lt;P style="direction: ltr;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="direction: ltr;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2016 04:00:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6807#M627</guid>
      <dc:creator>PitersonPaulgek</dc:creator>
      <dc:date>2016-11-30T04:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter layers in a legend: understanding PrintTemplate.layoutOptions.legendLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6808#M628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Piterson,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp; &amp;nbsp;Why not just not add the address_points then? In ArcMap there is an option to limit the legend for a mxd but the only way (untested) that I can think of to have this happen in the print layout is to edit the ArcGIS Server default print layouts to enable that option (I don't have much more advice on this though as I have never attempted).&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2016 14:12:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6808#M628</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-11-30T14:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter layers in a legend: understanding PrintTemplate.layoutOptions.legendLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6809#M629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just for information -&amp;nbsp;&lt;/P&gt;&lt;P&gt;we use&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;custom map layouts/templates.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2016 22:44:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6809#M629</guid>
      <dc:creator>PitersonPaulgek</dc:creator>
      <dc:date>2016-11-30T22:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter layers in a legend: understanding PrintTemplate.layoutOptions.legendLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6810#M630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Piterson,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;That should make it easy as&amp;nbsp;you know where the templates are located on the file system and to make sure the mxd has the option checked to limit the legend then.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2016 23:09:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6810#M630</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-11-30T23:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter layers in a legend: understanding PrintTemplate.layoutOptions.legendLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6811#M631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Currently, it works partly:&lt;/P&gt;&lt;P&gt;1) We created mxd with all layers&amp;nbsp;&lt;/P&gt;&lt;P&gt;and set "Legend properties"-&amp;gt;"General" check box on "Only display layers that are checked on in Table Of Contents" -&amp;nbsp;&lt;/P&gt;&lt;P&gt;and set "Items" Only show classes visible in current extent&lt;/P&gt;&lt;P&gt;2) the code is now&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;template2.layoutOptions = {&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;"titleText": title,&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;"authorText": author,&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;"copyrightText": "Any copyright",&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="color: #ff0000; background-color: #ffffff; border: 0px;"&gt;"legendLayers": [],&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;"scalebarUnit": "Miles",&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;it works partly:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;1) OK - when change "&lt;SPAN&gt;display layers that are checked on in Table Of Contents" - it changes legend layers accordingly.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;2) OK - it shows only visible (current extent) features symbology in the legend&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;3) NOT OK - &amp;nbsp;it does not change visible sublayers: example:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;"address_points" has 3 sublayers (the same source but different symbology):&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;- "show by population"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;- "show by year"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;- "show by update_time"&lt;BR /&gt;We expect when user change sublayer it will show in the legend (printed map) accordingly.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;But it only takes first every time.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2016 06:09:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6811#M631</guid>
      <dc:creator>PitersonPaulgek</dc:creator>
      <dc:date>2016-12-01T06:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter layers in a legend: understanding PrintTemplate.layoutOptions.legendLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6812#M632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Piterson,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;If you want to change visible sub layer then you need to follow the documentation on LegendLayer and set the subLayerIds property of the&amp;nbsp;&lt;SPAN&gt;LegendLayer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Don't forget to mark this question as answered by clicking on the "Correct Answer" link on the reply that answered your question.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2016 14:05:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6812#M632</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-12-01T14:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter layers in a legend: understanding PrintTemplate.layoutOptions.legendLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6813#M633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see that we do not use LegendLayer object in the current code&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;template2.layoutOptions = {&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;"titleText": title,&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;"authorText": author,&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;"copyrightText": "Any copyright",&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="color: #ff0000; background-color: #ffffff; border: 0px;"&gt;"legendLayers": [],&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;"scalebarUnit": "Miles",&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2016 22:13:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6813#M633</guid>
      <dc:creator>PitersonPaulgek</dc:creator>
      <dc:date>2016-12-01T22:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter layers in a legend: understanding PrintTemplate.layoutOptions.legendLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6814#M634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Piterson,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Here is the quote from the docs:&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;legendLayers: an array of LegendLayer containing the id's of the layers that will be included in the legend. If legendLayers is not specified, all operational layers (non-tiled layers) will be present in the legend. To specify that no layers will be included in the legend set legendLayer to an empty array.&lt;/BLOCKQUOTE&gt;&lt;P&gt;So I am not sure what you are trying to do but you are confined to what API allows.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2016 14:05:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6814#M634</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-12-02T14:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter layers in a legend: understanding PrintTemplate.layoutOptions.legendLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6815#M635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;I will do more testing. And publish the result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2016 03:26:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-layers-in-a-legend-understanding/m-p/6815#M635</guid>
      <dc:creator>PitersonPaulgek</dc:creator>
      <dc:date>2016-12-05T03:26:24Z</dc:date>
    </item>
  </channel>
</rss>

