Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/support
esri/workers
Class: GenerateRendererParameters

require(["esri/tasks/GenerateRendererParameters"], function(GenerateRendererParameters) { /* code goes here */ });

Description

(Added at v2.6)
Define the classification definition and optional where clause for the GenerateRendererTask operation.

Samples

Search for samples that use this class.

Constructors

NameSummary
new GenerateRendererParameters()Creates a new GenerateRendererParameters object.

Properties

NameTypeSummary
classificationDefinitionClassificationDefinitionA ClassBreaksDefinition or UniqueValueDefinition classification definition used to generate the data classes.
formatLabelBooleanIndicate if the label should be formatted.
precisionNumberRound values for the renderer.
prefixStringThe label in the legend will have this prefix.
unitLabelStringThe label in the legend will have this at the end of each label.
whereStringA where clause used to generate the data classes.
Constructor Details

new GenerateRendererParameters()

Creates a new GenerateRendererParameters object.
Sample:
require([
  "esri/tasks/GenerateRendererParameters", ... 
], function(GenerateRendererParameters, ... ) {
  var params = new GenerateRendererParameters();
  params.classificationDefinition = classDef;
  params.where = layerDef; 
  ...
});
Property Details

<ClassificationDefinition> classificationDefinition

A ClassBreaksDefinition or UniqueValueDefinition classification definition used to generate the data classes.
Sample:
require([
  "esri/tasks/ClassBreaksDefinition", "esri/tasks/AlgorithmicColorRamp", "esri/Color",
  "esri/tasks/GenerateRendererParameters", ... 
], function(ClassBreaksDefinition, AlgorithmicColorRamp, Color, GenerateRendererParameters, ... ) {
  var classDef = new ClassBreaksDefinition();
  classDef.classificationField = currentAttribute;
  classDef.classificationMethod = "quantile";
  classDef.breakCount = 5;
  classDef.baseSymbol = sfs;

  var colorRamp = new AlgorithmicColorRamp();
  colorRamp.fromColor = Color.fromHex("#998ec3");
  colorRamp.toColor = Color.fromHex("#f1a340");
  colorRamp.algorithm = "hsv";
  classDef.colorRamp = colorRamp;

  var params = new GenerateRendererParameters();
  params.classificationDefinition = classDef;
  ...
});

<Boolean> formatLabel

Indicate if the label should be formatted (Added at v3.7)
Known values: true | false

<Number> precision

Round values for the renderer. It should only work with classBreaksRenderer (Added at v3.7)

<String> prefix

The label in the legend will have this prefix (Added at v3.7)

<String> unitLabel

The label in the legend will have this at the end of each label (Added at v3.7)

<String> where

A where clause used to generate the data classes. Any legal SQL where clause operating on the fields in the layer/table is allowed.
Sample:

 params.where =  "STATE_NAME = 'Washington'"; 

Show Modal