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
Properties
Methods
toJson() | Object | Returns an easily serializable object representation of the unique value definition. |
Constructor Details
Creates a new UniqueValueDefinition object.
Sample:
require([
"esri/tasks/UniqueValueDefinition", ...
], function(UniqueValueDefinition, ... ) {
var classificationDefinition = new UniqueValueDefinition();
...
});
Property Details
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";
The name of the field that contains unique values when combined with the values specified by attributeField
.
The name of the field that contains unique values when combined with the values specified by attributeField
and attributeField2
.
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.
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.
The type of classification definition.
Known values: uniqueValueDef | classBreaksDef
Method Details
Returns an easily serializable object representation of the unique value definition.