require(["esri/smartMapping/raster/renderers/uniqueValue"], (rasterUniqueValueCreator) => { /* code goes here */ });
import * as rasterUniqueValueCreator from "@arcgis/core/smartMapping/raster/renderers/uniqueValue.js";
esri/smartMapping/raster/renderers/uniqueValue
This object contains helper methods for generating a UniqueValueRenderer for raster layers (i.e. ImageryLayer, ImageryTileLayer).
The createRenderer method in this module generates a renderer that may be applied directly to the input layer.
Method Overview
Name | Return Type | Summary | Object |
---|---|---|---|
Promise<RasterUniqueValuesResult> | Generates a UniqueValueRenderer to render thematic imagery. | uniqueValue |
Method Details
-
createRenderer
createRenderer(params){Promise<RasterUniqueValuesResult>}
-
Generates a UniqueValueRenderer to render thematic imagery.
ParametersSpecificationparams ObjectInput parameters for generating a unique value visualization. See the table below for details of each parameter.
Specificationlayer ImageryLayer|ImageryTileLayerThe input layer for which the renderer is generated.
renderingRule RasterFunctionoptionalDeprecated since 4.27. Use
rasterFunction
instead.rasterFunction RasterFunctionoptionalSpecifies the function for how the requested image should be processed. When
rasterFunction
is applied, the server returns updated service information that reflects custom processing as defined by the raster function. If not provided, the output renderer is created using the layer'srasterFunction
.classFieldName StringoptionalA preferred class field name used for calculating unique values.
optional The colors to apply to each unique value. This must be a two-dimensional array where each item of the first dimension is an array of 3-4 numbers representing RGB or RGBA values of each unique value. This overrides
colorRamp
.colorRamp AlgorithmicColorRamp|MultipartColorRampoptionalThe color ramp to apply to the renderer.
signal AbortSignaloptionalAllows for cancelable requests. If canceled, the promise will be rejected with an error named
AbortError
. See also AbortController.ReturnsType Description Promise<RasterUniqueValuesResult> Resolves to an object containing a unique value renderer that can be set on the input layer.
Type Definitions
-
The result object of the createRenderer() method. See the table below for details of each property.
- Properties
-
renderer UniqueValueRenderer
The UniqueValueRenderer renderer to apply to the input layer.
classFieldName StringThe class field name from which the unique value infos were generated.