FRAMES | NO FRAMES |
This is supported from 10.1 onwards.
This document discusses the JSON classification definition objects. The classification definition optionally allows specifying symbology that would return a complete renderer object. It also includes an optional colorRamp object that is used to assign an unique color to each symbol.
The following classification definitions are discussed here:
Use class breaks classification scheme to group values in to classes.
Note about optional parameters:
normalizationType
and normalizationField
- use these properties to normalize class breaks.
baseSymbol
and colorRamp
- use these properties to include a symbol with varying color for each class. baseSymbol
is defined, then a default color ramp is used to assign a color for each class. colorRamp
is defined, then a default symbol would be created based on geometryType of the feature class and the colorRamp
would used to assign color to the symbol for each class. baseSymbol
and colorRamp
are missing then map server would assume default values for these properties and return the results with an appropriate symbol and color.
classificationMethod
is "esriClassifyStandardDeviation" use standardDeviationInterval
to specify the interval size. breakCount
is ignored in this case.
type
property for class breaks classification is classBreaksDef
.
{ "type": "classBreaksDef", "classificationField": "<field name>", "classificationMethod": "<esriClassifyNaturalBreaks | esriClassifyEqualInterval | esriClassifyQuantile | esriClassifyStandardDeviation | esriClassifyGeometricalInterval>", "breakCount": <count>, "standardDeviationInterval": < 1 | 0.5 | 0.33 | 0.25 >, //use when classificationMethod is esriClassifyStandardDeviation. //optional. use to normalize class breaks "normalizationType": "<esriNormalizeByField | esriNormalizeByLog | esriNormalizeByPercentOfTotal>", "normalizationField": "<field name>", //use when normalizationType is esriNormalizeByField //optional. use to define symbol for classes "baseSymbol": <symbol>, "colorRamp": <colorRamp> }
{ "type": "classBreaksDef", "classificationField": "POP2010", "classificationMethod": "esriClassifyNaturalBreaks", "breakCount": 5, "normalizationType": "esriNormalizeByField", "normalizationField": "Area" }
Use unique value classification scheme to group values based on a unique combination of one or more (up to 3) fields.
Note about optional parameters:
baseSymbol
and colorRamp
- use these properties to include a symbol with varying color for each class. baseSymbol
is defined, then a default color ramp is used to assign a color for each class. colorRamp
is defined, then a default symbol would be created based on geometryType of the feature class and the colorRamp
would used to assign color to the symbol for each class. baseSymbol
and colorRamp
are missing then map server would assume default values for these properties and return the results with an appropriate symbol and color.
type
property for unique value classification is uniqueValueDef
. { "type": "uniqueValueDef", "uniqueValueFields": ["<field name 1 >","<field name 2>","<field name 3>"], "fieldDelimiter": "field_delimiter_character", //optional. use to define symbol for unqiue values "baseSymbol": <symbol>, "colorRamp": <colorRamp> }
//uniqueValue classification definition with symbology
{
"type": "uniqueValueDef",
"uniqueValueFields": ["Type", "AdminClass"],
"fieldDelimiter": ",",
"baseSymbol":
{
"type": "esriSLS",
"style": "esriSLSSolid",
"width": 2
}
"colorRamp":
{
"type": "algorithmic",
"fromColor": [115,76,0,255],
"toColor": [255,25,86,255],
"algorithm": "esriHSVAlgorithm"
}
}