Hello,
I want to symbolize my data on behalf of two fields. One is status field and other is category field. I try to used arcade expression for uniqueValueInfos to render the layer but unfortunately it is not working. Please help me to figure out my mistake.
Here is source code.
Thanks
const name = "$feature.alarmstate"
const cat = "$feature.category"
const valueExpression = `When( ${name} == '0' AND ${cat} == 'VIP', 0, ${name} == '1' AND ${cat} == 'VIP', 0,
${name} == '2' AND ${cat} == 'VIP', 0, ${name} == '3' AND ${cat} == 'VIP', 0,
${name} == '4' AND ${cat} == 'VIP', 0,
${name} == '0' AND ${cat} == 'Ordinary', 1, ${name} == '1' AND ${cat} == 'Ordinary', 2,
${name} == '2' AND ${cat} == 'Ordinary', 3, ${name} == '3' AND ${cat} == 'Ordinary', 4,
${name} == '4' AND ${cat} == 'Ordinary', 5)`
var rendererCheck = {
type: "unique-value",
//field: "alarminfo",
valueExpression:valueExpression,
uniqueValueInfos: [
{
value: "0",
symbol: {
type: "picture-marker",
url: "images/vip.png",
width: "30px",
height: "15px"
}
}, {
value: "1",
symbol: {
type: "simple-marker",
style: "diamond",
color: "green",
size: "10px",
outline: {
color: [ 255, 255, 255, 1 ],
width: 0.4
}
}
}, {
value: "2",
symbol: {
type: "simple-marker",
style: "diamond",
color: "blue",
size: "10px",
outline: {
color: [ 255, 255, 255, 1 ],
width: 0.4
}
}
}, {
value: "3",
symbol: {
type: "simple-marker",
style: "diamond",
color: "red",
size: "10px",
outline: {
color: [ 255, 255, 255, 1 ],
width: 0.4
}
}
}, {
value: "4",
symbol: {
type: "simple-marker",
style: "diamond",
color: "black",
size: "10px",
outline: {
color: [ 255, 255, 255, 1 ],
width: 0.4
}
}
}, {
value: "5",
symbol: {
type: "simple-marker",
style: "diamond",
color: "Yellow",
size: "10px",
outline: {
color: [ 255, 255, 255, 1 ],
width: 0.4
}
}
}
]
};
customerLayer.renderer =rendererCheck