FRAMES | NO FRAMES | Description | Parameters | Examples | Response |
URL | http://<layer-url>/generateRenderer |
Parent Resource | Layer / Table |
---|---|
Required Capability | Query |
This operation is supported from 10.1 onwards.
The generateRenderer
operation is performed on a layer / table resource. This operation groups data using the supplied classificationDef
(classification definition) and an optional where
clause. The result is a renderer object. Use baseSymbol
and colorRamp
to define the symbols assigned to each class. If the operation is performned on a table, the result is a renderer object containing the data classes and no symbols.
You can provide arguments to the generateRenderer operation as query parameters defined in the parameters table below.
Parameter | Details |
---|---|
f |
Description: The
response format. The default response format is html. Values: html | json |
classificationDef | Description:
The definition using which the renderer is generated. Note: Use either one of ClassBreaks or UniqueValue classifcation definition. Syntax: classificationDef = classification definition //classBreaks classification definition classificationDef = { "type": "classBreaksDef", "classificationField": "POP2010", "classificationMethod": "esriClassifyNaturalBreaks", "breakCount": 5, "normalizationType": "esriNormalizeByField", "normalizationField": "Area" } |
where | Description: A where clause for which the data needs to be classified. Any legal SQL where clause operating on the fields in the layer / table is allowed. Example: where = POP2000 > 350000 |
gdbVersion |
Description: Switch map layer to point to an alternate geodatabase version. This parameter applies only if isDataVersioned property of the layer is true . If this is not specified, the renderer will be generated from the published map’s version. Syntax: gdbVersion=<geodatabase version> Example: gdbVersion=sde.version1 |
Example 1: Generate Renderer using a unique value classification definition:
symbol
is included in classication definition){ "type": "uniqueValue", "field1": "EVENTID", "field2": "", "field3": "", "fieldDelimiter": ",", "defaultSymbol": { "type": "esriSLS", "style": "esriSLSSolid", "width": 2 }, "defaultLabel": "", "uniqueValueInfos": [ { "value": " ", "label": " ", "description": "", "symbol": { "type": "esriSLS", "style": "esriSLSSolid", "width": 2, "color": [ 115,77,0,255 ] } }, { "value": "Alberto", "label": "Alberto", "description": "", "symbol": { "type": "esriSLS", "style": "esriSLSSolid", "width": 2, "color": [ 120,122,1,255 ] } }, { "value": "Beryl", "label": "Beryl", "description": "", "symbol": { "type": "esriSLS", "style": "esriSLSSolid", "width": 2, "color": [ 83,133,3,255 ] } }, { "value": "Chris", "label": "Chris", "description": "", "symbol": { "type": "esriSLS", "style": "esriSLSSolid", "width": 2, "color": [ 39,143,4,255 ] } }, { "value": "Debby", "label": "Debby", "description": "", "symbol": { "type": "esriSLS", "style": "esriSLSSolid", "width": 2, "color": [ 255,25,86,255 ] } } ] }