<?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 Cluster icon based on condition logic from 3 features properties in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-cluster-icon-based-on-condition-logic-from/m-p/1378084#M83550</link>
    <description>&lt;P&gt;You are right ! Thank you so much!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Feb 2024 10:01:20 GMT</pubDate>
    <dc:creator>DanielMoga</dc:creator>
    <dc:date>2024-02-05T10:01:20Z</dc:date>
    <item>
      <title>Custom Cluster icon based on condition logic from 3 features properties</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-cluster-icon-based-on-condition-logic-from/m-p/1376983#M83513</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello community!&lt;/P&gt;&lt;P&gt;I'm new to GIS technology and terminology, and I hope I can explain my issue correctly.&lt;/P&gt;&lt;P&gt;I'm working with a FeatureLayer, and for each item in the features, there's a specific logic for its symbol. Now, I need to implement a logic where clusters have different icons based on three feature properties.&lt;/P&gt;&lt;P&gt;For example, consider the following structure:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;featureLayer =&amp;gt; features: any[] =&amp;gt; just for example = [ &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;{ status: 'U', alert: '', priority: 'high' }, &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;{ status: 'C', alert: '1', priority: 'high' },&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;{ status: 'U', alert: '1', priority: 'low'},&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;......................... &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;During feature reduction, I need the cluster to have a specific symbol if it contains items with status 'U' and no alerts, another symbol if there are items with status 'C', and so on, covering all combinations of statuses, alerts, and priorities.&lt;/P&gt;&lt;P&gt;From what I've observed, the cluster.featureReduction.renderer seems to overwrite the individual renderer.&lt;/P&gt;&lt;P&gt;Is there a way to achieve this functionality?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 12:56:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-cluster-icon-based-on-condition-logic-from/m-p/1376983#M83513</guid>
      <dc:creator>DanielMoga</dc:creator>
      <dc:date>2024-02-01T12:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Cluster icon based on condition logic from 3 features properties</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-cluster-icon-based-on-condition-logic-from/m-p/1377018#M83514</link>
      <description>&lt;P&gt;You can define the featureReduction renderer with visual variables as in this example.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/featurereduction-cluster-visualvariables/" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/featurereduction-cluster-visualvariables/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Visual variable can also be used with an UniqueVauleRenderer, so you can make your most important variable change what kind of icon is used and the other variables adjust the color or size.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 14:21:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-cluster-icon-based-on-condition-logic-from/m-p/1377018#M83514</guid>
      <dc:creator>JeffreyThompson2</dc:creator>
      <dc:date>2024-02-01T14:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Cluster icon based on condition logic from 3 features properties</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-cluster-icon-based-on-condition-logic-from/m-p/1377186#M83518</link>
      <description>&lt;P&gt;Yes you would need to set layer.featureReduction.renderer. to incorporate the three field values, you can either use a UniqueValueRenderer (if all the values are categorical) OR write an Arcade expression to combine them into a composite score. Something like the example below. Note that since this is a cluster renderer the attributes in $feature come from featureReduction.fields NOT layer.fields. So you'll need to account for that.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const clusterRenderer = new SimpleRenderer({
  symbol: {
    type: "simple-marker",
    size: 8,
    outline: {
      width: 0.5,
      color: "rgba(255,255,255,0.5)"
    }
  },
  visualVariables: [{
    type: "size",
    field: "cluster_count",
    minSize: 12,
    maxSize: 60,
    minDataValue: 1,
    maxDataValue: 1000
  }, {
    type: "color",
    valueExpression: `
      // $feature gives you access to feature attributes.
      var status = Decode($feature.status,
        "U", 10,
        "C", 5,
        0
      );  
      var alert = Number($feature.alert);
      var priority = Decode($feature.priority,
        "High", 10,
        "Medium", 5,
        "Low", 3,
        0
      );

      var score = (status + alert + priority) / 3;
      return score;
    `,
    stops: [
      { value: 0, color: "white" },
      { value: 3, color: "beige" },
      { value: 5, color: "yellow" },
      { value: 7, color: "orange" },
      { value: 10, color: "red" }
    ]
  }]
});

layer.featureReduction.renderer = clusterRenderer;&lt;/LI-CODE&gt;&lt;P&gt;mposite score or level.&lt;/P&gt;&lt;P&gt;for example...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 18:36:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-cluster-icon-based-on-condition-logic-from/m-p/1377186#M83518</guid>
      <dc:creator>KristianEkenes</dc:creator>
      <dc:date>2024-02-01T18:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Cluster icon based on condition logic from 3 features properties</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-cluster-icon-based-on-condition-logic-from/m-p/1377513#M83531</link>
      <description>&lt;P&gt;thank you for your responses but I`m facing to a new question: How can I access individual properties? After I Console($feature) I have this:&amp;nbsp;{"attributes":{"cluster_count":6},"geometry":{"x":267,"y":-14}}. What I`m missing in my configs to be able to have those features properties available in $feature context ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 13:18:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-cluster-icon-based-on-condition-logic-from/m-p/1377513#M83531</guid>
      <dc:creator>DanielMoga</dc:creator>
      <dc:date>2024-02-02T13:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Cluster icon based on condition logic from 3 features properties</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-cluster-icon-based-on-condition-logic-from/m-p/1377637#M83533</link>
      <description>&lt;P&gt;You need to define aggregate fields for them to come through in $feature. That's what I meant by featureReduction.fields. This sample demonstrates how to do that.&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/featurereduction-cluster-aggregate-fields/" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/featurereduction-cluster-aggregate-fields/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 16:29:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-cluster-icon-based-on-condition-logic-from/m-p/1377637#M83533</guid>
      <dc:creator>KristianEkenes</dc:creator>
      <dc:date>2024-02-02T16:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Cluster icon based on condition logic from 3 features properties</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-cluster-icon-based-on-condition-logic-from/m-p/1378084#M83550</link>
      <description>&lt;P&gt;You are right ! Thank you so much!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 10:01:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-cluster-icon-based-on-condition-logic-from/m-p/1378084#M83550</guid>
      <dc:creator>DanielMoga</dc:creator>
      <dc:date>2024-02-05T10:01:20Z</dc:date>
    </item>
  </channel>
</rss>

