layerDefinition
An object that defines the attribute schema and drawing information for a layer drawn using client-side graphics.
Referenced by: CSV Layer (CSV), Feature Layer (ArcGISFeatureLayer), Image Service Layer (ArcGISImageServiceLayer), Image Service Vector Layer (ArcGISImageServiceVectorLayer), layer, ArcGISStreamLayer, table, Web Feature Service Layer (WFS)
Properties
Property | Details |
---|---|
allowGeometryUpdates | Boolean value indicating whether the geometry of the features in the layer can be edited. |
capabilities | A comma separated list of supported capabilities, e.g. Query,Editing . |
copyrightText | String value for the copyright text information for the layer. |
currentVersion | Numeric value indicating the server version of the layer. |
defaultVisibility | Boolean value indicating whether the layer's visibility is turned on. |
definitionEditor | Stores interactive filters. |
definitionExpression | SQL-based definition expression string that narrows the data to be displayed in the layer. |
description | String value of the layer as defined in the map service. |
displayField | A string value that summarizes the feature. |
drawingInfo | Contains the drawing and labeling information. |
extent | An object defining the rectangular area. Must be one of the following values:
|
featureReduction | Feature reductions declutter the screen by hiding features that would otherwise intersect with other features on screen. |
fields | An array of field objects containing information about the attribute fields for the feature collection or layer. |
geometryType | A string defining the type of geometry. Possible geometry types are: esriGeometryPoint , esriGeometryMultipoint , esriGeometryPolyline , esriGeometryPolygon , and esriGeometryEnvelope . |
globalIdField | The unique identifier for a feature or table row within a geodatabase. |
hasAttachments | Indicates whether attachments should be loaded for the layer. |
hasM | Boolean value indicating whether layer has M values. |
hasStaticData | Boolean value indicating whether data changes. True if it does not. |
hasZ | Boolean value indicating whether layer has Z values. |
htmlPopupType | String value indicating the HTML popup type. If property is present, must be one of the following values:
|
id | The identifier assigned to the layer. |
isDataVersioned | Boolean value indicating whether the data is versioned. |
maxRecordCount | Numeric value indicating tbe maximum number of records that will be returned at once for a query. |
maxScale | Integer property used to determine the maximum scale at which the layer is displayed. |
minScale | Integer property used to determine the minimum scale at which the layer is displayed. |
name | Contains a unique name for the layer that can be displayed in a legend. |
objectIdField | Indicates the name of the object ID field in the dataset. |
overrideSymbols | Dictates whether a client can support having an end user modify symbols on individual features. |
rangeInfos | Indicates range information |
source | An object indicating the layerDefinition's layer source. |
spatialReference | An object containing the WKID or WKT identifying the spatial reference of the layer's geometry. |
supportedQueryFormats | String value indicating the output formats that are supported in a query. |
supportsAdvancedQueries | Boolean value indicating whether the layer supports orderByFields in a query operation. |
supportsAttachmentsByUploadId | Boolean value indicating whether the layer supports uploading attachments with the Uploads operation. This can then be used in the Add Attachment and Update Attachment operations. |
supportsCalculate | Boolean value indicating whether the layer supports the Calculate REST operation when updating features. |
supportsRollbackOnFailureParameter | Boolean value indicating whether the layer supports rolling back edits made on a feature layer if some of the edits fail. |
supportsStatistics | Boolean value indicating whether feature layer query operations support statistical functions. |
supportsValidateSql | Boolean value indicating whether the validateSQL operation is supported across a feature service layer. |
templates | A property of the layer definition when there are no types defined; otherwise, templates are defined as properties of the types. |
timeInfo | The time info metadata of the layer. May be set for feature layers inside a feature collection item. |
type | Indicates whether the layerDefinition applies to a Feature Layer or a Table. If property is present, must be one of the following values:
|
typeIdField | Contains the name of the field holding the type ID for the features. |
types | Contains information about an attribute field. |
visibilityField | String value indicating the attribute field that is used to control the visibility of a feature. If applicable, when rendering a feature the client should use this field to control visibility. The field's values are 0 = do not display, 1 = display. |
Example
{
"layerDefinition": {
"drawingInfo": {
"renderer": {
"rotationType": "geographic",
"rotationExpression": "[AZIMUTH]",
"visualVariables": [
{
"type": "rotationInfo",
"rotationType": "geographic",
"field": "AZIMUTH"
}
],
"type": "simple",
"label": "renderer label",
"description": "renderer description",
"symbol": {
"angle": 0,
"xoffset": 0,
"yoffset": 0,
"type": "esriPMS",
"url": "9c4163ed7e32b5b36721bd9b34190ae4",
"imageData": "...",
"contentType": "image/png",
"width": 60,
"height": 60
}
},
"labelingInfo": [
{
"labelExpression": "[AZIMUTH]",
"useCodedValues": true,
"maxScale": 0,
"minScale": 0,
"labelPlacement": "esriServerPointLabelPlacementAboveRight",
"symbol": {
"color": [
0,
0,
0,
255
],
"type": "esriTS",
"horizontalAlignment": "center",
"angle": 0,
"xoffset": 0,
"yoffset": 0,
"text": "",
"rotated": false,
"kerning": true,
"font": {
"size": 13.333333333333332,
"style": "normal",
"weight": "normal",
"family": "serif"
}
}
}
]
}
}
}
Feedback on this topic?