@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
51 lines (48 loc) • 2.65 kB
TypeScript
/**
* This object contains helper methods for generating a [UniqueValueRenderer](https://developers.arcgis.com/javascript/latest/references/core/renderers/UniqueValueRenderer/) for raster layers (i.e. [ImageryLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ImageryLayer/), [ImageryTileLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ImageryTileLayer/)).
*
* The [createRenderer()](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/raster/renderers/uniqueValue/#createRenderer) method in this module generates a renderer that may be applied directly to the input layer.
*
* @since 4.20
*/
import type UniqueValueRenderer from "../../../renderers/UniqueValueRenderer.js";
import type AlgorithmicColorRamp from "../../../rest/support/AlgorithmicColorRamp.js";
import type MultipartColorRamp from "../../../rest/support/MultipartColorRamp.js";
import type { Color as ColorJSON } from "../../../portal/jsonTypes.js";
import type { RasterRendererParameters } from "./types.js";
export interface RasterUniqueValuesParameters extends RasterRendererParameters {
/**
* A preferred class field name used for
* calculating unique values.
*/
classFieldName?: string;
/**
* 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`.
*/
colors?: ColorJSON[];
/** The color ramp to apply to the renderer. */
colorRamp?: MultipartColorRamp | AlgorithmicColorRamp;
}
/**
* The result object of the [createRenderer()](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/raster/renderers/uniqueValue/#createRenderer) method. See the table
* below for details of each property.
*/
export interface RasterUniqueValuesResult {
/**
* The UniqueValueRenderer renderer to apply
* to the input layer.
*/
renderer: UniqueValueRenderer;
/** The class field name from which the unique value infos were generated. */
classFieldName?: string | null;
}
/**
* Generates a [UniqueValueRenderer](https://developers.arcgis.com/javascript/latest/references/core/renderers/UniqueValueRenderer/) to render thematic imagery.
*
* @param parameters - Input parameters for generating a unique value visualization.
* @returns Resolves
* to an object containing a unique value renderer that can be set on the input layer.
*/
export function createRenderer(parameters: RasterUniqueValuesParameters): Promise<RasterUniqueValuesResult>;