rasterRenderers

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

A convenience module for importing renderer classes that can be used to render ImageryLayer when developing with TypeScript. For example, rather than importing renderers one at a time like this:

import ClassBreaksRenderer from "esri/renderers/ClassBreaksRenderer";
import UniqueValueRenderer from "esri/renderers/UniqueValueRenderer";
import RasterStretchRenderer from "esri/renderers/RasterStretchRenderer";
import RasterColormapRenderer from "esri/renderers/RasterColormapRenderer";
import RasterShadedReliefRenderer from "esri/renderers/RasterShadedReliefRenderer";
import VectorFieldRenderer from "esri/renderers/VectorFieldRenderer";

You can use this module to import them on a single line:

import { ClassBreaksRenderer, UniqueValueRenderer, RasterColormapRenderer, RasterStretchRenderer, RasterShadedReliefRenderer, VectorFieldRenderer } from "esri/rasterRenderers";

This module also allows you to implement type guards on renderers, making your code smarter.

import { Renderer } from "esri/rasterRenderers";

function logRenderer(renderer: RasterStretchRenderer): void {
 if (renderer.type == "raster-stretch") {
   // the compiler knows the renderer must be a RasterStretchRenderer
   console.log("renderer color ramp: ", renderer.colorRamp);
 }
}

Type Definitions

ClassBreaksRenderer ClassBreaksRenderer

ClassBreaksRenderer.

RasterColormapRenderer RasterColormapRenderer

RasterColormapRenderer.

RasterShadedReliefRenderer RasterShadedReliefRenderer

RasterShadedReliefRenderer.

RasterStretchRenderer RasterStretchRenderer

RasterStretchRenderer.

UniqueValueRenderer UniqueValueRenderer

UniqueValueRenderer.

VectorFieldRenderer VectorFieldRenderer

VectorFieldRenderer.

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