<?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: ClassBreaksRenderer Not Refreshing in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/classbreaksrenderer-not-refreshing/m-p/1024132#M71673</link>
    <description>&lt;P&gt;I decided to make a codepen and explore this a little more and turns out that removing and adding in the manner I suggested above didn't work.&amp;nbsp; I took it one step further and tried getting the layer from the layers array, but that didn't do anything except add more code.&amp;nbsp; I created a second renderer with the new values, and just assigned the layer's renderer to the new one and it worked.&amp;nbsp; Maybe there is something broken in the remove and add methods because they do add and remove as the console indicates, but nothing happens in the map or legend.&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/static_K/pen/wvoGzyq?editors=0011" target="_blank" rel="noopener"&gt;Update Classbreaks | Renderer&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 06 Feb 2021 15:45:45 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-02-06T15:45:45Z</dc:date>
    <item>
      <title>ClassBreaksRenderer Not Refreshing</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/classbreaksrenderer-not-refreshing/m-p/1024063#M71671</link>
      <description>&lt;P&gt;Is it possible to modify the symbolization of a class breaks renderer?&amp;nbsp; My map has a feature layer with a class breaks render.&amp;nbsp; I'd like to change the class breaks renderer based on user input when a user changes a dropdown selection.&amp;nbsp; When I remove break info and add new break info, and do a refresh on the feature layer, nothing happens on the map.&amp;nbsp; If I zoom or pan I can see the legend change, but the map still looks the same.&amp;nbsp; &amp;nbsp;Do I need to redraw the map or do a different sort of refresh?&lt;/P&gt;&lt;P&gt;Code example is below"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var myFeatureLayer = new FeatureLayer(myurl, {
     definitionExpression: "ID = 0",
     listMode: "hide",
     outFields: ["*"],
     opacity: 1.0,
     popupTemplate: myPopupTemplate,
     renderer: myClassBreaksRenderer,
     title: "Locations"
});

var myClassBreaksRenderer = new ClassBreaksRenderer({
     type: "class-breaks",
     field: "myField"
});

myClassBreaksRenderer.addClassBreakInfo({
     minValue: 0,
     maxValue: 21.0,
     symbol: {
          type: "simple-marker",
          color: [255, 255, 255, 1],
          size: 16,
          outline: {
               color: "yellow",
               width: 4
            }
        }
});
myClassBreaksRenderer.addClassBreakInfo({
     minValue: 22.0,
     maxValue: 27.0,
     symbol: {
          type: "simple-marker",
          color: [255, 255, 255, 1],
          size: 16,
          outline: {
               color: "orange",
               width: 4
            }
        }
});
myClassBreaksRenderer.addClassBreakInfo({
     minValue: 28.0,
     maxValue: 29.0,
     symbol: {
          type: "simple-marker",
          color: [255, 255, 255, 1],
          size: 16,
          outline: {
               color: "darkred",
               width: 4
            }
        }
});

map.add(myFeatureLayer);

// code below is to remove the original 0-21 yellow marker and add a green
// marker to replace it.
$("#mySelect").change(function () {
     myClassBreaksRenderer.removeClassBreakInfo(0, 21.0);

     myClassBreaksRenderer.addClassBreakInfo({
          minValue: 0,
          maxValue: 21.0,
          symbol: {
               type: "simple-marker",
               color: [255, 255, 255, 1],
               size: 16,
               outline: {
                    color: "green",
                    width: 4
                }
          }
     });
     // expect to see the symbol change but there is not visible difference
     myFeatureLayer.refresh();

});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 21:47:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/classbreaksrenderer-not-refreshing/m-p/1024063#M71671</guid>
      <dc:creator>chuckfrank</dc:creator>
      <dc:date>2021-02-05T21:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: ClassBreaksRenderer Not Refreshing</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/classbreaksrenderer-not-refreshing/m-p/1024103#M71672</link>
      <description>&lt;P&gt;Try referencing your FeatureLayers.renderer property like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;myFeatureLayer.renderer.removeClassBreakInfo(0, 21.0);

myFeatureLayer.renderer.addClassBreakInfo({
          minValue: 0,
          maxValue: 21.0,
          symbol: {
               type: "simple-marker",
               color: [255, 255, 255, 1],
               size: 16,
               outline: {
                    color: "green",
                    width: 4
                }
          }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Feb 2021 03:57:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/classbreaksrenderer-not-refreshing/m-p/1024103#M71672</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-02-06T03:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: ClassBreaksRenderer Not Refreshing</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/classbreaksrenderer-not-refreshing/m-p/1024132#M71673</link>
      <description>&lt;P&gt;I decided to make a codepen and explore this a little more and turns out that removing and adding in the manner I suggested above didn't work.&amp;nbsp; I took it one step further and tried getting the layer from the layers array, but that didn't do anything except add more code.&amp;nbsp; I created a second renderer with the new values, and just assigned the layer's renderer to the new one and it worked.&amp;nbsp; Maybe there is something broken in the remove and add methods because they do add and remove as the console indicates, but nothing happens in the map or legend.&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/static_K/pen/wvoGzyq?editors=0011" target="_blank" rel="noopener"&gt;Update Classbreaks | Renderer&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Feb 2021 15:45:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/classbreaksrenderer-not-refreshing/m-p/1024132#M71673</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-02-06T15:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: ClassBreaksRenderer Not Refreshing</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/classbreaksrenderer-not-refreshing/m-p/1024927#M71705</link>
      <description>&lt;P&gt;Thank you Jeff!&amp;nbsp; It appears that creating a new class breaks renderer and setting in the feature layer followed by a refresh is working.&amp;nbsp; I've written a function that builds a renderer and class breaks info based on user selections and it seems to work reliably.&amp;nbsp; &amp;nbsp;I never had luck with the "removeClassBreakInfo", but defining an entirely new set of classBreaksInfo is more clear.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 16:30:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/classbreaksrenderer-not-refreshing/m-p/1024927#M71705</guid>
      <dc:creator>chuckfrank</dc:creator>
      <dc:date>2021-02-09T16:30:33Z</dc:date>
    </item>
  </channel>
</rss>

