<?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 Renderer on a Feature Layer Selection Set in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/renderer-on-a-feature-layer-selection-set/m-p/488201#M45407</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;On a feature layer, applying an unique value renderer is providing the necessary symbology - based on an attribute field, the renderer is applied to all features in the feature layer. Now, the renderer needs to be applied only to the "selected features" of the feature layer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;featureLayer.selectFeatures(selectQueryTask, esri.layers.FeatureLayer.SELECTION_NEW);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On these selected features (using getSelectedFeatures() or other property), how can I apply the renderer? Any suggestions will be helpful. Thanks in advance!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Raghu&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Aug 2013 18:12:40 GMT</pubDate>
    <dc:creator>RaghuVamshi</dc:creator>
    <dc:date>2013-08-19T18:12:40Z</dc:date>
    <item>
      <title>Renderer on a Feature Layer Selection Set</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/renderer-on-a-feature-layer-selection-set/m-p/488201#M45407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;On a feature layer, applying an unique value renderer is providing the necessary symbology - based on an attribute field, the renderer is applied to all features in the feature layer. Now, the renderer needs to be applied only to the "selected features" of the feature layer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;featureLayer.selectFeatures(selectQueryTask, esri.layers.FeatureLayer.SELECTION_NEW);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On these selected features (using getSelectedFeatures() or other property), how can I apply the renderer? Any suggestions will be helpful. Thanks in advance!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Raghu&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Aug 2013 18:12:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/renderer-on-a-feature-layer-selection-set/m-p/488201#M45407</guid>
      <dc:creator>RaghuVamshi</dc:creator>
      <dc:date>2013-08-19T18:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Renderer on a Feature Layer Selection Set</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/renderer-on-a-feature-layer-selection-set/m-p/488202#M45408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For those with a similar question, here is a working solution. I could not get the unique renderer to work on the selection set. Instead, assigned a graphic (and unique color) to each feature. There should be a better way to do this, am open to any suggestions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Raghu&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function colorSelFeatures(featureset)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; for (var i = 0; i &amp;lt; featureset.length; i++)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //add each feature from featureset to graphic
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var graphic = features&lt;I&gt;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic.setSymbol(new esri.symbol.SimpleFillSymbol().setColor(getRandomColor())); //calls a function to assign color to each graphic

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.add(graphic);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/I&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:28:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/renderer-on-a-feature-layer-selection-set/m-p/488202#M45408</guid>
      <dc:creator>RaghuVamshi</dc:creator>
      <dc:date>2021-12-11T21:28:44Z</dc:date>
    </item>
  </channel>
</rss>

