VoxelLayer with discrete variable

This sample shows how to visualize and change the properties of a discrete variable using uniqueValues 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 uniqueValues. The uniqueValues describe how to render both discrete variable volumes and sections. Use the method getVariableStyle of VoxelLayer to get the selected variable's VoxelVariableStyle

Use dark colors for code blocksCopy
1
2
3
4
5
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";

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.