I want to use UniqueValueRenderer to set symbols for features. This is my code:
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,
},
},
}
],
};
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.
I will be grateful for any help you can provide.