The LayerDefinition object defines the attribute schema and drawing information for a layer drawn using client-side graphics. This could include a feature collection, a CSV file referenced through the web, or a single layer in an ArcGIS map service. Also used for dynamic layers.

See https://developers.arcgis.com/web-map-specification/objects/layerDefinition/ https://developers.arcgis.com/web-scene-specification/objects/layerDefinition/.

interface LayerDefinitionJson {
    allowGeometryUpdates?: boolean;
    capabilities?: string;
    copyrightText?: string;
    currentVersion?: number;
    defaultVisibility?: boolean;
    definitionEditor?: DefinitionEditorJson;
    definitionExpression?: string;
    description?: string;
    displayField?: string;
    drawingInfo?: DrawingInfoJson;
    elevationInfo?: ElevationInfoJson;
    extent?: ExtentJson;
    featureReduction?: FeatureReductionJson;
    fieldOverrides?: FieldOverrideJson[];
    fields?: FieldJson[];
    floorInfo?: {
        floorField: string;
    };
    geometryType?: string;
    globalIdField?: string;
    hasAttachments?: boolean;
    hasM?: boolean;
    hasStaticData?: boolean;
    hasZ?: boolean;
    htmlPopupType?: "esriServerHTMLPopupTypeAsHTMLText" | "esriServerHTMLPopupTypeAsURL" | "esriServerHTMLPopupTypeNone";
    id?: string | number;
    isDataVersioned?: boolean;
    maxRecordCount?: number;
    maxScale?: number;
    minScale?: number;
    name?: string;
    objectIdField?: string;
    orderBy?: OrderByClauseJson[];
    overrideSymbols?: boolean;
    rangeInfos?: RangeInfoJson[];
    source?: DynamicDataLayerJson | DynamicMapLayerJson;
    spatialReference?: SpatialReferenceJson;
    supportedQueryFormats?: string;
    supportsAdvancedQueries?: boolean;
    supportsAttachmentsByUploadId?: boolean;
    supportsCalculate?: boolean;
    supportsRollbackOnFailureParameter?: boolean;
    supportsStatistics?: boolean;
    supportsValidateSql?: boolean;
    templates?: TemplateJson[];
    timeInfo?: LayerTimeInfoJson;
    type?: string;
    typeIdField?: string;
    types?: TypeJson[];
    visibilityField?: string;
}

Properties

allowGeometryUpdates?: boolean

Boolean value indicating whether the geometry of the features in the layer can be edited.

capabilities?: string

A comma-separated string listing which editing operations are allowed on an editable feature service. Available operations include: Create | Delete | Query | Update | Editing.

copyrightText?: string

String value for the copyright text information for the layer.

currentVersion?: number

Numeric value indicating the server version of the layer.

defaultVisibility?: boolean

Boolean value indicating whether the layer's visibility is turned on.

definitionEditor?: DefinitionEditorJson

Stores interactive filters.

definitionExpression?: string

An optional SQL-based definition expression that narrows down the data to be displayed in the layer. Used with ArcGIS Server map services.

description?: string

String value of the layer as defined in the map service.

displayField?: string

The name of the field that best summarizes the feature. Values from this field are used by default as the titles for pop-up windows.

drawingInfo?: DrawingInfoJson

A drawingInfo object containing drawing, labeling, and transparency information for the layer.

elevationInfo?: ElevationInfoJson

Specifies how graphics are placed on the vertical axis (z). This property may only be used in a SceneView.

extent?: ExtentJson

The rectangular map extent that should be requested from the service, given in the format [[xmin, ymin],[xmax,ymax]].

featureReduction?: FeatureReductionJson

Feature reductions declutter the screen by hiding features that would otherwise intersect with other features on screen.

fieldOverrides?: FieldOverrideJson[]

The layer-specific overrides of field properties. Used by SubtypeGroupLayer to modify field information for each subtype. Any field missing from this array should be hidden.

fields?: FieldJson[]

An array of Field objects containing information about the attribute fields for the feature collection or layer.

floorInfo?: {
    floorField: string;
}

Contains floor-awareness information for the layer. See https://developers.arcgis.com/web-map-specification/objects/layerFloorInfo/.

Type declaration

  • floorField: string

    The name of the attribute field that contains a floor's level ID used for floor filtering.

geometryType?: string

The type of geometry used in the layer definition. One of the GeometryType constants.

globalIdField?: string

The unique identifier for a feature or table row within a geodatabase.

hasAttachments?: boolean

Indicates whether attachments should be loaded for the layer.

hasM?: boolean

Boolean value indicating whether layer has M values.

hasStaticData?: boolean

Boolean value indicating whether data changes. True if it does not.

hasZ?: boolean

Boolean value indicating whether layer has Z values.

htmlPopupType?: "esriServerHTMLPopupTypeAsHTMLText" | "esriServerHTMLPopupTypeAsURL" | "esriServerHTMLPopupTypeNone"

String value indicating the HTML popup type. Possible values are listed in the htmlPopupType table below.

id?: string | number

The identifier assigned to the layer.

isDataVersioned?: boolean

Boolean value indicating whether the data is versioned.

maxRecordCount?: number

Numeric value indicating the maximum number of records that will be returned at once for a query.

maxScale?: number

A number representing the maximum scale at which the layer definition will be applied. The number is the scale's denominator; thus, a value of 2400 represents a scale of 1/2,400. A value of 0 indicates that the layer definition will be applied no matter how far you zoom in.

minScale?: number

A number representing the minimum scale at which the layer definition will be applied. The number is the scale's denominator; thus, a value of 2400 represents a scale of 1/2,400.

name?: string

A string containing a unique name for the layer that could be displayed in a legend.

objectIdField?: string

Indicates the name of the object ID field in the dataset.

orderBy?: OrderByClauseJson[]

Determines the display order of features on the map.

overrideSymbols?: boolean

Dictates whether a client can support having an end user modify symbols on individual features.

rangeInfos?: RangeInfoJson[]

Indicates range information.

spatialReference?: SpatialReferenceJson

An object containing the WKID or WKT identifying the spatial reference of the layer's geometry.

supportedQueryFormats?: string

String value indicating the output formats that are supported in a query.

supportsAdvancedQueries?: boolean

Boolean value indicating whether the layer supports orderByFields in a query operation.

supportsAttachmentsByUploadId?: boolean

Boolean value indicating whether the layer supports uploading attachments with the Uploads operation. This can be then used in the Add Attachment and Update Attachment operations.

supportsCalculate?: boolean

Boolean value indicating whether the layer supports the Calculate REST operation when updating features.

supportsRollbackOnFailureParameter?: boolean

Boolean value indicating whether the layer supports rolling back edits made on a feature layer if some of the edits fail.

supportsStatistics?: boolean

Boolean value indicating whether feature layer query operations support statistical functions.

supportsValidateSql?: boolean

Boolean value indicating whether the validateSQL operation is supported across a feature service layer.

templates?: TemplateJson[]

An array of template objects describing features that can be created in this layer. Templates are used with map notes, other feature collections, and editable web-based CSV layers. They are not used with ArcGIS feature services, which already have feature templates defined in the service.

Templates are defined as a property of the layer definition when there are no types defined; otherwise, templates are defined as properties of the types.

The time info metadata of the layer. May be set for feature layers inside a feature collection item.

type?: string

Indicates whether the layerDefinition applies to a "Feature Layer" or a "Table".

typeIdField?: string

The name of the field holding the type ID for the features, if types exist for the dataset. Each available type has an ID, and each feature's typeIdField can be read to determine the type for each feature.

types?: TypeJson[]

An array of Type objects available for the dataset. This is used when the typeIdField is populated.

Types contain information about the combinations of attributes that are allowed for features in the dataset. Each feature in the dataset can have a type, indicated in its typeIdField.

visibilityField?: string

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.