uniqueValue

AMD: require(["esri/smartMapping/raster/renderers/uniqueValue"], (rasterUniqueValueCreator) => { /* code goes here */ });
ESM: import * as rasterUniqueValueCreator from "@arcgis/core/smartMapping/raster/renderers/uniqueValue";
Object: esri/smartMapping/raster/renderers/uniqueValue
Since: ArcGIS API for JavaScript 4.20

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>more details

Generates a UniqueValueRenderer to render thematic imagery.

more detailsuniqueValue

Method Details

createRenderer(params){Promise<RasterUniqueValuesResult>}

Generates a UniqueValueRenderer to render thematic imagery.

Parameters:
Specification:
params Object

Input parameters for generating a unique value visualization. See the table below for details of each parameter.

Specification:

The input layer for which the renderer is generated.

renderingRule RasterFunction
optional

Specifies the rule for how the requested image should be rendered. When renderingRule is applied, the server returns updated service information that reflects custom processing as defined by the rendering rule. If not provided, the output renderer is created using the layer's renderingRule.

classFieldName String
optional

A preferred class field name used for calculating unique values.

colors Number[][]
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.

optional

The color ramp to apply to the renderer.

signal AbortSignal
optional

Allows for cancelable requests. If canceled, the promise will be rejected with an error named AbortError. See also AbortController.

Returns:
Type Description
Promise<RasterUniqueValuesResult> Resolves to an object containing a unique value renderer that can be set on the input layer.

Type Definitions

RasterUniqueValuesResult

The result object of the createRenderer() method. See the table below for details of each property.

Properties:

The UniqueValueRenderer renderer to apply to the input layer.

classFieldName String

The class field name from which the unique value infos were generated.

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