<?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: Problem with UniqueValueRenderer when using field2 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-with-uniquevaluerenderer-when-using-field2/m-p/1264094#M80454</link>
    <description>&lt;P&gt;I would try using the new &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueGroups" target="_self"&gt;uniqueValueGroups&lt;/A&gt; for this purpose. The way you declare which value belongs to which field is more explicit, so you're less likely to run into issues. Try this...&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// This example groups categories under three headings:
// Commercial, Residential, and Other
layer.renderer = {
  type: "unique-value",
  field: "farmType",
  field2: "livestockType",
  fieldDelimiter: ", ",
  uniqueValueGroups: [{
    classes: [{
      label: "Pig",
      symbol: {
        type: "picture-marker",
        url: "https://cdn-icons-png.flaticon.com/512/776/776450.png",
        width: "25px",
        height: "25px",
        outline: {
            color: [255, 255, 255],
            width: 1,
        },
      },
      values: {
        value: 1,
        value2: null,
        value3: null
      }
    }, {
      label: "Cow",
      symbol: {
        type: "picture-marker",
        url: "https://cdn-icons-png.flaticon.com/512/6165/6165370.png",
        width: "25px",
        height: "25px",
        outline: {
          color: [255, 255, 255],
          width: 1
        }
      },
      values: {
        value: 2,
        value2: 1,
        value3: null
      }
    }, {
      label: "Goat",
      symbol: {
        type: "picture-marker",
        url: "https://cdn-icons-png.flaticon.com/512/8686/8686214.png",
        width: "25px",
        height: "25px",
        outline: {
          color: [255, 255, 255],
          width: 1
        }
      },
      values: {
        value: 2,
        value2: 2,
        value3: null
      }
    }, {
      label: "Slaughterhouse",
      symbol: {
        type: "picture-marker",
        url: "https://cdn-icons-png.flaticon.com/512/1995/1995607.png",
        width: "25px",
        height: "25px",
        outline: {
          color: [255, 255, 255],
          width: 1
        }
      },
      values: {
        value: 3,
        value2: null,
        value3: null
      }
    }, {
      label: "Chicken",
      symbol: {
        type: "picture-marker",
        url: "https://cdn-icons-png.flaticon.com/512/1449/1449791.png",
        width: "25px",
        height: "25px",
        outline: {
          color: [255, 255, 255],
          width: 1
        }
      },
      values: {
        value: 4,
        value2: null,
        value3: null
      }
    }]
  }]
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Mar 2023 18:00:04 GMT</pubDate>
    <dc:creator>KristianEkenes</dc:creator>
    <dc:date>2023-03-03T18:00:04Z</dc:date>
    <item>
      <title>Problem with UniqueValueRenderer when using field2</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-with-uniquevaluerenderer-when-using-field2/m-p/1263919#M80451</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I want to use UniqueValueRenderer to set symbols for features. This is my code:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; let rendererTest = {
        type: "unique-value",
        field: "farmType",
        field2: "livestockType",
        fieldDelimiter: ", ",
        uniqueValueInfos: [
            {
                value: "1",
                label: "Pig",
                symbol: {
                    type: "picture-marker",
                    url: "https://cdn-icons-png.flaticon.com/512/776/776450.png",
                    width: "25px",
                    height: "25px",
                    outline: {
                        color: [255, 255, 255],
                        width: 1,
                    },
                },
            },
            {
                value: "2, 1",
                label: "Cow",
                symbol: {
                    type: "picture-marker",
                    url: "https://cdn-icons-png.flaticon.com/512/6165/6165370.png",
                    width: "25px",
                    height: "25px",
                    outline: {
                        color: [255, 255, 255],
                        width: 1,
                    },
                },
            },
            {
                value: "2, 2",
                label: "Goat",
                symbol: {
                    type: "picture-marker",
                    url: "https://cdn-icons-png.flaticon.com/512/8686/8686214.png",
                    width: "25px",
                    height: "25px",
                    outline: {
                        color: [255, 255, 255],
                        width: 1,
                    },
                },
            },
            {
                value: "3",
                label: "Slaughterhouse",
                symbol: {
                    type: "picture-marker",
                    url: "https://cdn-icons-png.flaticon.com/512/1995/1995607.png",
                    width: "25px",
                    height: "25px",
                    outline: {
                        color: [255, 255, 255],
                        width: 1,
                    },
                },
            },
            {
                value: "4",
                label: "Chicken",
                symbol: {
                    type: "picture-marker",
                    url: "https://cdn-icons-png.flaticon.com/512/1449/1449791.png",
                    width: "25px",
                    height: "25px",
                    outline: {
                        color: [255, 255, 255],
                        width: 1,
                    },
                },
            }
        ],
    };&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;It works for the cases with value: "2, 1" and value: "2, 2". When I remove field2, fieldDelimiter and value: "2, 1", and value: "2, 2", the remaining values work normally. i'm working with FeatureLayer Client-Side.&lt;BR /&gt;I will be grateful for any help you can provide.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 09:11:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-with-uniquevaluerenderer-when-using-field2/m-p/1263919#M80451</guid>
      <dc:creator>LazyDogz</dc:creator>
      <dc:date>2023-03-03T09:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with UniqueValueRenderer when using field2</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-with-uniquevaluerenderer-when-using-field2/m-p/1264094#M80454</link>
      <description>&lt;P&gt;I would try using the new &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueGroups" target="_self"&gt;uniqueValueGroups&lt;/A&gt; for this purpose. The way you declare which value belongs to which field is more explicit, so you're less likely to run into issues. Try this...&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// This example groups categories under three headings:
// Commercial, Residential, and Other
layer.renderer = {
  type: "unique-value",
  field: "farmType",
  field2: "livestockType",
  fieldDelimiter: ", ",
  uniqueValueGroups: [{
    classes: [{
      label: "Pig",
      symbol: {
        type: "picture-marker",
        url: "https://cdn-icons-png.flaticon.com/512/776/776450.png",
        width: "25px",
        height: "25px",
        outline: {
            color: [255, 255, 255],
            width: 1,
        },
      },
      values: {
        value: 1,
        value2: null,
        value3: null
      }
    }, {
      label: "Cow",
      symbol: {
        type: "picture-marker",
        url: "https://cdn-icons-png.flaticon.com/512/6165/6165370.png",
        width: "25px",
        height: "25px",
        outline: {
          color: [255, 255, 255],
          width: 1
        }
      },
      values: {
        value: 2,
        value2: 1,
        value3: null
      }
    }, {
      label: "Goat",
      symbol: {
        type: "picture-marker",
        url: "https://cdn-icons-png.flaticon.com/512/8686/8686214.png",
        width: "25px",
        height: "25px",
        outline: {
          color: [255, 255, 255],
          width: 1
        }
      },
      values: {
        value: 2,
        value2: 2,
        value3: null
      }
    }, {
      label: "Slaughterhouse",
      symbol: {
        type: "picture-marker",
        url: "https://cdn-icons-png.flaticon.com/512/1995/1995607.png",
        width: "25px",
        height: "25px",
        outline: {
          color: [255, 255, 255],
          width: 1
        }
      },
      values: {
        value: 3,
        value2: null,
        value3: null
      }
    }, {
      label: "Chicken",
      symbol: {
        type: "picture-marker",
        url: "https://cdn-icons-png.flaticon.com/512/1449/1449791.png",
        width: "25px",
        height: "25px",
        outline: {
          color: [255, 255, 255],
          width: 1
        }
      },
      values: {
        value: 4,
        value2: null,
        value3: null
      }
    }]
  }]
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 18:00:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-with-uniquevaluerenderer-when-using-field2/m-p/1264094#M80454</guid>
      <dc:creator>KristianEkenes</dc:creator>
      <dc:date>2023-03-03T18:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with UniqueValueRenderer when using field2</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-with-uniquevaluerenderer-when-using-field2/m-p/1264390#M80463</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Sorry for the late response. But I'm using version 4.24, so it has some errors as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;[esri.core.Accessor] Accessor#set Invalid property value, value needs to be one of 'esri.renderers.HeatmapRenderer', 'esri.renderers.SimpleRenderer', 'esri.renderers.UniqueValueRenderer', 'esri.renderers.ClassBreaksRenderer', 'esri.renderers.DotDensityRenderer', 'esri.renderers.DictionaryRenderer', 'esri.renderers.PieChartRenderer', or a plain object that can autocast (having .type = 'heatmap', 'simple', 'unique-value', 'class-breaks', 'dot-density', 'dictionary', 'pie-chart')&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;When I try to update to version 4.26, some dijits like dijit/MenuItem cannot work. Is there any way to use UniqueValueRenderer in my case? Thank you in advance.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 04:23:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-with-uniquevaluerenderer-when-using-field2/m-p/1264390#M80463</guid>
      <dc:creator>LazyDogz</dc:creator>
      <dc:date>2023-03-06T04:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with UniqueValueRenderer when using field2</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-with-uniquevaluerenderer-when-using-field2/m-p/1273698#M80700</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/620660"&gt;@LazyDogz&lt;/a&gt;&amp;nbsp;:).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Are you still experiencing your issue? If so, why don't you try the following:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; let rendererTest = {
        type: "unique-value",
        field: "farmType",
        field2: "livestockType",
        fieldDelimiter: ", ",
        uniqueValueInfos: [
            {
                value: "1, &amp;lt;Null&amp;gt;",
                label: "Pig",
                symbol: {
                    type: "picture-marker",
                    url: "https://cdn-icons-png.flaticon.com/512/776/776450.png",
                    width: "25px",
                    height: "25px",
                    outline: {
                        color: [255, 255, 255],
                        width: 1,
                    },
                },
            },
            {
                value: "2, 1",
                label: "Cow",
                symbol: {
                    type: "picture-marker",
                    url: "https://cdn-icons-png.flaticon.com/512/6165/6165370.png",
                    width: "25px",
                    height: "25px",
                    outline: {
                        color: [255, 255, 255],
                        width: 1,
                    },
                },
            },
            {
                value: "2, 2",
                label: "Goat",
                symbol: {
                    type: "picture-marker",
                    url: "https://cdn-icons-png.flaticon.com/512/8686/8686214.png",
                    width: "25px",
                    height: "25px",
                    outline: {
                        color: [255, 255, 255],
                        width: 1,
                    },
                },
            },
            {
                value: "3, &amp;lt;Null&amp;gt;",
                label: "Slaughterhouse",
                symbol: {
                    type: "picture-marker",
                    url: "https://cdn-icons-png.flaticon.com/512/1995/1995607.png",
                    width: "25px",
                    height: "25px",
                    outline: {
                        color: [255, 255, 255],
                        width: 1,
                    },
                },
            },
            {
                value: "4, &amp;lt;Null&amp;gt;",
                label: "Chicken",
                symbol: {
                    type: "picture-marker",
                    url: "https://cdn-icons-png.flaticon.com/512/1449/1449791.png",
                    width: "25px",
                    height: "25px",
                    outline: {
                        color: [255, 255, 255],
                        width: 1,
                    },
                },
            }
        ],
    };&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The main edits are to&lt;BR /&gt;&lt;BR /&gt;Line 8:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;value: "1, &amp;lt;Null&amp;gt;",&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Line 50 :&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;value: "3, &amp;lt;Null&amp;gt;",&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;And line 64:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;value: "4, &amp;lt;Null&amp;gt;",&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 17:46:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-with-uniquevaluerenderer-when-using-field2/m-p/1273698#M80700</guid>
      <dc:creator>KELLY-ILE</dc:creator>
      <dc:date>2023-03-30T17:46:37Z</dc:date>
    </item>
  </channel>
</rss>

