<?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: Setting Graphic symbol color after graphics layer is drawn on the map in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-graphic-symbol-color-after-graphics-layer/m-p/643128#M60000</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Suggestions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 1) Best solution is to add a renderer to the layer based on the conditions so you don't have to worry about changing symbol colors directly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 2) To change the symbol directly, here are the general steps (not tested):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;var layer = map.getLayer('layerid'); // get the symbol var symbol = layer.graphics[0].symbol; // change color symbol.setColor(new dojo.Color("red")); // assign symbol back to graphic layer.graphics[0].setSymbol(symbol);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 May 2014 14:33:26 GMT</pubDate>
    <dc:creator>JohnGrayson</dc:creator>
    <dc:date>2014-05-02T14:33:26Z</dc:date>
    <item>
      <title>Setting Graphic symbol color after graphics layer is drawn on the map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-graphic-symbol-color-after-graphics-layer/m-p/643127#M59999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a graphics layer drawn on the map with several other layers. I want to set a different color for the symbol based on a condition. So, I have used symbol.SetColor method which does not work. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;var layer = map.getLayer('layerid'); layer.graphics[0].symbol.setColor(new dojo.Color("red"));&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Santhosh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 14:10:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-graphic-symbol-color-after-graphics-layer/m-p/643127#M59999</guid>
      <dc:creator>SanthoshKumar3</dc:creator>
      <dc:date>2014-05-02T14:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Graphic symbol color after graphics layer is drawn on the map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-graphic-symbol-color-after-graphics-layer/m-p/643128#M60000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Suggestions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 1) Best solution is to add a renderer to the layer based on the conditions so you don't have to worry about changing symbol colors directly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 2) To change the symbol directly, here are the general steps (not tested):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;var layer = map.getLayer('layerid'); // get the symbol var symbol = layer.graphics[0].symbol; // change color symbol.setColor(new dojo.Color("red")); // assign symbol back to graphic layer.graphics[0].setSymbol(symbol);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 14:33:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-graphic-symbol-color-after-graphics-layer/m-p/643128#M60000</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2014-05-02T14:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Graphic symbol color after graphics layer is drawn on the map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-graphic-symbol-color-after-graphics-layer/m-p/643129#M60001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks John. Setting the symbol for the graphic worked. I thought setting the color will refresh the graphic automatically.&amp;nbsp; I will look up renderer examples in the API documentation. It sounds like that is a clean solution.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 14:41:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-graphic-symbol-color-after-graphics-layer/m-p/643129#M60001</guid>
      <dc:creator>SanthoshKumar3</dc:creator>
      <dc:date>2014-05-02T14:41:09Z</dc:date>
    </item>
  </channel>
</rss>

