Hide Table of Contents
esri
Map
toolbars
Class: UniqueValueDefinition
[ AMD Module Require | Legacy Module Require ]

Module Require

require(["esri/tasks/UniqueValueDefinition", ... ], function(UniqueValueDefinition, ... ){ ... });

Description

Class added 2.6
Define a unique value classification scheme used by the GenerateDataTask to generate 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.UniqueValueDefinition

Constructors

ConstructorDescription
new UniqueValueDefinition()Creates a new UniqueValueDefinition object.

Properties

PropertyTypeDescription
attributeFieldStringAttribute 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. 
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. If a baseSymbol is not defined then a default symbol is created based on the geometryType of the layer.
colorRampAlgorithmicColorRamp || MultiFieldColorRampDefine 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.

Methods

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

new UniqueValueDefinition()

Creates a new UniqueValueDefinition object.
Code Snippet:
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. 
Code Snippet:
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.

<AlgorithmicColorRamp || MultiFieldColorRamp> 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.
Method Details

toJson()

Returns an easily serializable object representation of the unique value definition.
Return Value: Object