rasterRenderers

AMD: require(["esri/rasterRenderers"], (rasterRenderers) => { /* code goes here */ });
ESM: import * as rasterRenderers from "@arcgis/core/rasterRenderers.js";
Object: esri/rasterRenderers
Since: ArcGIS Maps SDK 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 FlowRenderer from "esri/renderers/FlowRenderer";
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 { FlowRenderer, 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

Type Definition
ClassBreaksRenderer ClassBreaksRenderer

ClassBreaksRenderer.

FlowRenderer

Type Definition
FlowRenderer FlowRenderer

FlowRenderer.

RasterColormapRenderer

Type Definition
RasterColormapRenderer RasterColormapRenderer

RasterColormapRenderer.

RasterShadedReliefRenderer

Type Definition
RasterShadedReliefRenderer RasterShadedReliefRenderer

RasterShadedReliefRenderer.

RasterStretchRenderer

Type Definition
RasterStretchRenderer RasterStretchRenderer

RasterStretchRenderer.

UniqueValueRenderer

Type Definition
UniqueValueRenderer UniqueValueRenderer

UniqueValueRenderer.

VectorFieldRenderer

Type Definition
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.