Hello,
We are using the editor widget in ESRI for the crud operations of the symbols. I was able to succesfully render a webstyle symbol using the simple renderer.
const layer = new FeatureLayer({
source: graphics,
// renderer,
renderer:{
type: "simple",
symbol: {
type: "web-style", // autocasts as new SimpleFillSymbol()
styleName: "Esri2DPointSymbolsStyle",
name: "atm"
}
},
objectIdField: "ObjectID"
})
The use case which I currently have is to render more than one webstyle symbol in the editor. Since the simple renderer does not accept array of symbols , Is there any renderer which I can use to display the symbols on the editor.
I was trying it out with unique-renderer , but it does not seem to be working. Please find the screenshot attached
Thank you
The unique-value renderer should do what you want. If it didn't work for you, it's likely you have some sort of syntax error. Here is a code example.
const hwyRenderer = {
type: "unique-value",
legendOptions: {
title: "Freeway type"
},
field: "RTTYP",
uniqueValueInfos: [{
value: "S",
label: "State highway",
symbol: {
type: "simple-line",
color: "#e6d800",
width: "6px",
style: "solid"
}
}, {
value: "I",
label: "Interstate",
symbol: {
type: "simple-line",
color: "#e60049",
width: "6px",
style: "solid"
}
}, {
value: "U",
label: "US Highway",
symbol: {
type: "simple-line",
color: "#9b19f5",
width: "6px",
style: "solid"
}
}]
};