Data-driven extrusion
This sample demonstrates how to apply a size visual variable to extrude features thematically based on a numeric field value. The same basic principles of working with size visual variables reviewed in the Visualize features thematically with a continuous size ramp sample also apply to 3D thematic visualizations.
However, when working with volumetric symbol layers such as ExtrudeSymbol3DLayer, PathSymbol3DLayer, and ObjectSymbol3DLayer size values are always expressed in real-world units (meters).
var renderer = new SimpleRenderer({
symbol: new PolygonSymbol3D({
symbolLayers: [new ExtrudeSymbol3DLayer()]
}),
label: "% population in poverty by county",
visualVariables: [{
type: "size",
field: "POP_POVERTY",
normalizationField: "TOTPOP_CY",
stops: [
{
value: 0.10,
size: 10000
},
{
value: 0.50,
size: 500000
}]
}, {
type: "color",
field: "POP_POVERTY",
normalizationField: "TOTPOP_CY",
stops: [
{
value: 0.10,
color: "#FFFCD4"
},
{
value: 0.35,
color: [153, 83, 41]
}]
}]
});
In 3D, attempting to distinguish features of varying sizes from various distances can be problematic. Because of perspective, it is difficult to perceive spatial size differences between features. For that reason it is a good idea to add a color visual variable for the same field when extruding features thematically.
Additional visualization samples and resources