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

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

Description

(Added at v2.6)
Define a unique value classification scheme used by the GenerateRendererTask to create a renderer that groups values based on a unique combination of one or more fields. Typically features are rendered based on the unique values of one attribute field. However up to three fields can be combined to generate a unique value.

Samples

Search for samples that use this class.

Class hierarchy

esri/tasks/ClassificationDefinition
|_esri/tasks/UniqueValueDefinition

Constructors

NameSummary
new UniqueValueDefinition()Creates a new UniqueValueDefinition object.

Properties

NameTypeSummary
attributeFieldStringAttribute field renderer uses to match values.
attributeField2StringThe name of the field that contains unique values when combined with the values specified by attributeField.
attributeField3StringThe name of the field that contains unique values when combined with the values specified by attributeField and attributeField2.
baseSymbolSymbolDefine a default symbol for the classification.
colorRampColorRampDefine a color ramp for the classification.
typeStringThe type of classification definition.

Methods

NameReturn typeSummary
toJson()ObjectReturns an easily serializable object representation of the unique value definition.
Constructor Details

new UniqueValueDefinition()

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

<String> attributeField

Attribute field renderer uses to match values. At version 3.0 the Unique Value renderer can be used to render feature layer tracks. Specify the layer's trackIdField as the attribute field. 
Sample:
classificationDefinition.attributeField = "SUB_REGION";

<String> attributeField2

The name of the field that contains unique values when combined with the values specified by attributeField.

<String> attributeField3

The name of the field that contains unique values when combined with the values specified by attributeField and attributeField2.

<Symbol> baseSymbol

Define a default symbol for the classification. If a baseSymbol is not defined then a default symbol is created based on the geometryType of the layer.

<ColorRamp> colorRamp

Define a color ramp for the classification. If a colorRamp is not defined then a default color ramp will be used to assign a color to each class.

<String> type

The type of classification definition.
Known values: uniqueValueDef | classBreaksDef
Method Details

toJson()

Returns an easily serializable object representation of the unique value definition.
Return type: Object
Show Modal