Skip to content

This sample shows how to visualize and change the properties of a discrete variable using VoxelUniqueValue on a VoxelLayer.

If the variable of the voxel layer contains qualitative data, for example, the soil types defined in discrete classes, the data is visualized using VoxelUniqueValue. The VoxelUniqueValue describe how to render both discrete variable volumes and sections. Use the method getVariableStyle() of VoxelLayer to get the selected variable’s VoxelVariableStyle

const currentVariableStyle = vxlLayer.getVariableStyle(null);
const uniqueValue = currentVariableStyle.uniqueValues.getItemAt(i);
uniqueValue.color = new Color("#00FF00");
uniqueValue.enabled = true; //whether or not to render the data
uniqueValue.label = "Gravel";