<?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: Custom SimpleRenderer JS 4.3 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-simplerenderer-js-4-3/m-p/715095#M66453</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Figured it out.&lt;/P&gt;&lt;P&gt;I needed to actually change the symbol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this.set("symbol",sym.clone());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in context:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var CustomSymbolRenderer = &lt;BR /&gt; SimpleRenderer.createSubclass(SimpleRenderer,&lt;BR /&gt; {&lt;BR /&gt; getSymbol: function (prm1,prm2) {&lt;BR /&gt; var sym = this.inherited(arguments);&lt;BR /&gt; console.log(Math.floor(Math.random() * 255) + 1);&lt;BR /&gt; sym.color = new Color([&lt;BR /&gt; Math.floor(Math.random() * 255) + 1, &lt;BR /&gt; Math.floor(Math.random() * 255) + 1, &lt;BR /&gt; Math.floor(Math.random() * 255) + 1, &lt;BR /&gt; .5]);&lt;BR /&gt; this.set("symbol",sym.clone());&lt;BR /&gt; return sym;&lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Mar 2017 07:35:21 GMT</pubDate>
    <dc:creator>JordanBaumgardner</dc:creator>
    <dc:date>2017-03-31T07:35:21Z</dc:date>
    <item>
      <title>Custom SimpleRenderer JS 4.3</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-simplerenderer-js-4-3/m-p/715094#M66452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to create a custom renderer to handle unique symbology for each feature. In 3.x I did this by intercepting the&amp;nbsp;graphic-add event. I thought I had it but it always returns the 1st symbol. I assume I'm not overriding the proper method.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I successfully subclassed the SimpleRenderer, but overriding the GetSymbol method only seems to alter the 1st one, although it get called for each feature.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone know what I'm doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Working/Not working code&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;A class="link-titled" href="https://jsbin.com/doticip/4/edit?html,output" title="https://jsbin.com/doticip/4/edit?html,output"&gt;JS Bin - Collaborative JavaScript Debugging&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;//Key parts:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;var CustomSymbolRenderer = &lt;BR /&gt;SimpleRenderer.createSubclass(SimpleRenderer,&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp;getSymbol: function (prm1,prm2) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;var sym = this.inherited(arguments);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;console.log(Math.floor(Math.random() * 255) + 1);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;sym.color = new Color([&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Math.floor(Math.random() * 255) + 1, &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Math.floor(Math.random() * 255) + 1, &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Math.floor(Math.random() * 255) + 1, &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; .5]);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;return sym;&lt;BR /&gt;}&lt;BR /&gt;}); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var featureLayer = new FeatureLayer({&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;url: "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fservices.arcgis.com%2FV6ZHFr6zdgNZuVG0%2FArcGIS%2Frest%2Fservices%2FNYCDemographics1%2FFeatureServer%2F0" rel="nofollow" target="_blank"&gt;https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/NYCDemographics1/FeatureServer/0&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;, renderer: new CustomSymbolRenderer({ symbol: new SimpleFillSymbol({ color: "red", outline: {color: [128, 128, 128, 0.5],width: "0.5px"} })&lt;/P&gt;&lt;P&gt;})&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;map.add(featureLayer);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2017 07:27:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-simplerenderer-js-4-3/m-p/715094#M66452</guid>
      <dc:creator>JordanBaumgardner</dc:creator>
      <dc:date>2017-03-31T07:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: Custom SimpleRenderer JS 4.3</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-simplerenderer-js-4-3/m-p/715095#M66453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Figured it out.&lt;/P&gt;&lt;P&gt;I needed to actually change the symbol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this.set("symbol",sym.clone());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in context:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var CustomSymbolRenderer = &lt;BR /&gt; SimpleRenderer.createSubclass(SimpleRenderer,&lt;BR /&gt; {&lt;BR /&gt; getSymbol: function (prm1,prm2) {&lt;BR /&gt; var sym = this.inherited(arguments);&lt;BR /&gt; console.log(Math.floor(Math.random() * 255) + 1);&lt;BR /&gt; sym.color = new Color([&lt;BR /&gt; Math.floor(Math.random() * 255) + 1, &lt;BR /&gt; Math.floor(Math.random() * 255) + 1, &lt;BR /&gt; Math.floor(Math.random() * 255) + 1, &lt;BR /&gt; .5]);&lt;BR /&gt; this.set("symbol",sym.clone());&lt;BR /&gt; return sym;&lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2017 07:35:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-simplerenderer-js-4-3/m-p/715095#M66453</guid>
      <dc:creator>JordanBaumgardner</dc:creator>
      <dc:date>2017-03-31T07:35:21Z</dc:date>
    </item>
  </channel>
</rss>

