I create a simple renderer with an extrusion and assign it to a feature layer:
var symbol = new PolygonSymbol3D({
symbolLayers: [new ExtrudeSymbol3DLayer({
size: 50000, // meters in height extruded
})]
});
var renderer = new SimpleRenderer({
symbol: symbol,
label: "Tract by ROW Acquisition Status",
visualVariables: [{
type: "color",
field: "Acquisition_Status",
stops: [
{
value: 'Not Acquired',
color: "green", // DISPLAYS AS ***RED*** IN THE WEB SCENE
label: "Not Acquired"
},{
value: 'Acquired',
color: "red", // DISPLAYS AS ***GREEN*** IN THE WEB SCENE
label: "Acquired"
}
]}
]
});
Then when I view the results in a scene the colors are reversed; i.e., "Acquired" is green and "Not Acquired" is red, even though the code told the renderer to have "Acquired" to be red and "Not Acquired" to be green. WUWT?
Hi Dirk,
Don't use SimpleRenderer with visualVariables in this case. Visual variables are meant to map continuous numeric data. Instead what you need is a UniqueValueRenderer. This works well when you have categories.
Here is a sample that is quite similar to your case: Extrude building footprints based on real world heights | ArcGIS API for JavaScript 4.2