Skip to content
import { createRenderer } from "@arcgis/core/smartMapping/raster/renderers/uniqueValue.js";
Since
ArcGIS Maps SDK 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.

Type definitions

RasterUniqueValuesParameters

Type definition

classFieldName

Property
Type
string | undefined

A preferred class field name used for calculating unique values.

colors

Property
Type
ColorJSON[] | undefined

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

Property
Type
MultipartColorRamp | AlgorithmicColorRamp | undefined

The color ramp to apply to the renderer.

RasterUniqueValuesResult

Type definition

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

renderer

Property
Type
UniqueValueRenderer

The UniqueValueRenderer renderer to apply to the input layer.

classFieldName

Property
Type
string | null | undefined

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

Functions

createRenderer

Function

Generates a UniqueValueRenderer to render thematic imagery.

Signature
createRenderer (parameters: RasterUniqueValuesParameters): Promise<RasterUniqueValuesResult>
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for generating a unique value visualization.

Returns
Promise<RasterUniqueValuesResult>

Resolves to an object containing a unique value renderer that can be set on the input layer.