<?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: Altering LayerInfo for Items in a Custom Legend Widget in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/altering-layerinfo-for-items-in-a-custom-legend/m-p/728438#M318</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kytt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; This code will work to change the name of the layer in the legend:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this.map.getLayer('Layer Id')._titleForLegend = "Test Name";&lt;/P&gt;&lt;P&gt;You will have to force a redraw of the legend using a map zoom or getting a reference to the legend widget and calling this.legend.refresh();&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Jan 2016 18:07:34 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2016-01-26T18:07:34Z</dc:date>
    <item>
      <title>Altering LayerInfo for Items in a Custom Legend Widget</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/altering-layerinfo-for-items-in-a-custom-legend/m-p/728435#M315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should be a simple question...I am developing a custom Legend Widget in WAB 1.2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to alter the title of some set of layers which will be displayed in the widget without changing the layer title in the service itself.&amp;nbsp; Is this possible, or is LayerInfo immutable?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is in fact immutable, what workflow would you recommend?&amp;nbsp; Is there any way around altering the layer titles directly in the map services?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2016 16:24:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/altering-layerinfo-for-items-in-a-custom-legend/m-p/728435#M315</guid>
      <dc:creator>KyttMacManus</dc:creator>
      <dc:date>2016-01-26T16:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Altering LayerInfo for Items in a Custom Legend Widget</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/altering-layerinfo-for-items-in-a-custom-legend/m-p/728436#M316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kytt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Sure you can manitpulate the layers layer info ._titleForLegend property. I don't have any code sample for this but I do this in some of my widgets.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2016 16:39:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/altering-layerinfo-for-items-in-a-custom-legend/m-p/728436#M316</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-01-26T16:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Altering LayerInfo for Items in a Custom Legend Widget</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/altering-layerinfo-for-items-in-a-custom-legend/m-p/728437#M317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response Robert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am still having a bit of trouble which I guess is based on distinguishing between the LayerInfos and LayerInfo classes in WAB (see &lt;A href="https://developers.arcgis.com/web-appbuilder/api-reference/layerinfo.htm" title="https://developers.arcgis.com/web-appbuilder/api-reference/layerinfo.htm"&gt;LayerInfo class—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers&lt;/A&gt;&amp;nbsp; ) and the LayerInfo class in the regular JS API (see &lt;A href="https://developers.arcgis.com/javascript/jsapi/layerinfo-amd.html" title="https://developers.arcgis.com/javascript/jsapi/layerinfo-amd.html"&gt;LayerInfo | API Reference | ArcGIS API for JavaScript&lt;/A&gt;​ )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unless I am doing something wrong, it seems like the WAB class is either immutable, or not fully documented.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any more advice?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2016 16:56:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/altering-layerinfo-for-items-in-a-custom-legend/m-p/728437#M317</guid>
      <dc:creator>KyttMacManus</dc:creator>
      <dc:date>2016-01-26T16:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Altering LayerInfo for Items in a Custom Legend Widget</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/altering-layerinfo-for-items-in-a-custom-legend/m-p/728438#M318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kytt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; This code will work to change the name of the layer in the legend:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this.map.getLayer('Layer Id')._titleForLegend = "Test Name";&lt;/P&gt;&lt;P&gt;You will have to force a redraw of the legend using a map zoom or getting a reference to the legend widget and calling this.legend.refresh();&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2016 18:07:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/altering-layerinfo-for-items-in-a-custom-legend/m-p/728438#M318</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-01-26T18:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Altering LayerInfo for Items in a Custom Legend Widget</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/altering-layerinfo-for-items-in-a-custom-legend/m-p/728439#M319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again Robert.&amp;nbsp; This works great for me to grab and manipulate the Legend Title of the map service name that is the top level title of a layer in the Legend.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am wanting to get at one of the services sublayers as my service architecture is many layers to one service.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the advice you have given so far which has been very useful.&amp;nbsp; If you have an idea of how to get at the service sublayers that would be great, but I am already indebted by your helpfulness!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2016 18:35:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/altering-layerinfo-for-items-in-a-custom-legend/m-p/728439#M319</guid>
      <dc:creator>KyttMacManus</dc:creator>
      <dc:date>2016-01-26T18:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: Altering LayerInfo for Items in a Custom Legend Widget</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/altering-layerinfo-for-items-in-a-custom-legend/m-p/728440#M320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kytt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I have never tried that before so it will require some digging. I will let you know if I figure anything out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2016 19:55:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/altering-layerinfo-for-items-in-a-custom-legend/m-p/728440#M320</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-01-26T19:55:37Z</dc:date>
    </item>
  </channel>
</rss>

