<?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 custom render after a Geoprocess in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-render-after-a-geoprocess/m-p/75131#M6804</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have tried to use the class break renderer with the result of a geoprocess but have had not luck so instead I wrote my own.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It renders the resulting counties according to the percent. However if I pan/zoom the map the colors revert to a default.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas on why this would happen?&amp;nbsp; Also if anyone has a simple example of a class render working on the resulting features of a geoprocess I would like to see it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the function that receives the output and draws it to screen. This works fine until I pan or zoom&amp;nbsp; - then the polygons loose their symbology.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;function drawMap(results, messages) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; console.log("geocodeCountGP is running");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; var polySymbol = new esri.symbol.SimpleFillSymbol();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; polySymbol.setOutline(new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0,0,0,1]), 1));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; polySymbol.setColor(new dojo.Color([56, 150, 0,0.9]));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; var features = results[0].value.features;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; var infoTemplate = new esri.InfoTemplate("${COUNTY}","Count: ${Join_Count}");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; for (var f=0, fl=features.length; f&amp;lt;fl; f++) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; var feature = features&lt;F&gt;;&lt;/F&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; percent = features&lt;F&gt;.attributes.Percent;&lt;/F&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; if (percent &amp;lt; 5) {polySymbol.setColor(new dojo.Color([255,255,51,.5]))};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; if (percent &amp;gt;= 5 &amp;amp;&amp;amp; percent &amp;lt; 10) {polySymbol.setColor(new dojo.Color([56, 168, 0,0.25]))};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; if (percent &amp;gt;= 10 &amp;amp;&amp;amp; percent &amp;lt; 20) {polySymbol.setColor(new dojo.Color([56, 168, 0,0.5]))};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; if (percent &amp;gt;= 20) {polySymbol.setColor(new dojo.Color([56, 168, 0,0.75]))}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; feature.setSymbol(polySymbol);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; map.graphics.add(feature);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; map.graphics.add(feature.setInfoTemplate(infoTemplate));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Oct 2013 19:22:11 GMT</pubDate>
    <dc:creator>ChrisSeeger</dc:creator>
    <dc:date>2013-10-02T19:22:11Z</dc:date>
    <item>
      <title>custom render after a Geoprocess</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-render-after-a-geoprocess/m-p/75131#M6804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have tried to use the class break renderer with the result of a geoprocess but have had not luck so instead I wrote my own.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It renders the resulting counties according to the percent. However if I pan/zoom the map the colors revert to a default.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas on why this would happen?&amp;nbsp; Also if anyone has a simple example of a class render working on the resulting features of a geoprocess I would like to see it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the function that receives the output and draws it to screen. This works fine until I pan or zoom&amp;nbsp; - then the polygons loose their symbology.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;function drawMap(results, messages) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; console.log("geocodeCountGP is running");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; var polySymbol = new esri.symbol.SimpleFillSymbol();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; polySymbol.setOutline(new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0,0,0,1]), 1));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; polySymbol.setColor(new dojo.Color([56, 150, 0,0.9]));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; var features = results[0].value.features;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; var infoTemplate = new esri.InfoTemplate("${COUNTY}","Count: ${Join_Count}");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; for (var f=0, fl=features.length; f&amp;lt;fl; f++) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; var feature = features&lt;F&gt;;&lt;/F&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; percent = features&lt;F&gt;.attributes.Percent;&lt;/F&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; if (percent &amp;lt; 5) {polySymbol.setColor(new dojo.Color([255,255,51,.5]))};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; if (percent &amp;gt;= 5 &amp;amp;&amp;amp; percent &amp;lt; 10) {polySymbol.setColor(new dojo.Color([56, 168, 0,0.25]))};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; if (percent &amp;gt;= 10 &amp;amp;&amp;amp; percent &amp;lt; 20) {polySymbol.setColor(new dojo.Color([56, 168, 0,0.5]))};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; if (percent &amp;gt;= 20) {polySymbol.setColor(new dojo.Color([56, 168, 0,0.75]))}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; feature.setSymbol(polySymbol);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; map.graphics.add(feature);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; map.graphics.add(feature.setInfoTemplate(infoTemplate));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 19:22:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-render-after-a-geoprocess/m-p/75131#M6804</guid>
      <dc:creator>ChrisSeeger</dc:creator>
      <dc:date>2013-10-02T19:22:11Z</dc:date>
    </item>
  </channel>
</rss>

