# Class FeatureLayerReadOnlySchema

An implementation of Schema that directly mirrors the equivalent properties on FeatureLayer for reading, and disallows updating.

#### Hierarchy (view full)

- FeatureLayerSchema
  - FeatureLayerReadOnlySchema

#####
Index

### Constructors

constructor

### Properties

_handles
_layerBindings
_layerExtension
_primaryKeyField
_watchHandles
@eventTypes
fieldExtensions
fields

### Accessors

displayField
geometryType
hasGeometry
parent
primaryKeyField
spatialReference
timeZone
typeIdField
types

### Methods

_createFieldCollection
_createTypeCollection
_getCollectionSetting
_getNestedSettings
_getPropertyBindings
_getSerializableProperties
_getSetting
_hasSettingIncludingAncestor
_setParent
_setSetting
_toPropertyDef
assignProperties
assignPropertiesAsync
createAllFieldInfos
createPopupTemplate
destroy
findFieldByName
finishAssignProperties
getDefault
getDefaults
getSerializableProperties
isModified
reset
toJSON
createFieldInfoFromField

##
Constructors

### constructor

- new FeatureLayerReadOnlySchema(layerExtension): FeatureLayerReadOnlySchema

- #### Parameters

  - layerExtension: LayerExtension<LayerExtensionProperties>

  #### Returns FeatureLayerReadOnlySchema

  Inherited from FeatureLayerSchema.constructor

##
Properties

### `Protected` `Readonly`_handles

_handles: Handles<unknown, ResourceHandle>

Inherited from FeatureLayerSchema._handles

### `Protected` `Readonly`_layerBindings

_layerBindings: Map<keyof FeatureLayerReadOnlySchema, LayerExtensionSchemaPropertyBinding> = ...

Maps schema properties to properties on Layer.

Inherited from FeatureLayerSchema._layerBindings

### `Protected` `Readonly`_layerExtension

_layerExtension: LayerExtension<LayerExtensionProperties>

The parent layer extension.

Inherited from FeatureLayerSchema._layerExtension

### `Protected`_primaryKeyField

_primaryKeyField: string

A cache of the primary key field name used to speed up lookup.

Inherited from FeatureLayerSchema._primaryKeyField

### `Protected` `Readonly`_watchHandles

_watchHandles: ResourceHandle[] = []

A set of watch handles that get cleaned up when the class instance is destroyed.

Inherited from FeatureLayerSchema._watchHandles

### @eventTypes

@eventTypes: SchemaEvents

#### Deprecated

Do not directly reference this property. Use EventNames and EventTypes helpers from @arcgis/core/Evented.

Inherited from FeatureLayerSchema.@eventTypes

### `Readonly` fieldExtensions

fieldExtensions: FieldExtensionCollection

The field extensions associated with each field of the schema.

Inherited from FeatureLayerSchema.fieldExtensions

### `Readonly` fields

fields: FieldCollection

A collection of Field objects describing each field in the schema.

Inherited from FeatureLayerSchema.fields

##
Accessors

### displayField

- get displayField(): string

- The name of the field containing the display name of the feature.

  #### Returns string

  Inherited from FeatureLayerSchema.displayField

- set displayField(value): void

- #### Parameters

  - value: string

  #### Returns void

  Inherited from FeatureLayerSchema.displayField

### geometryType

- get geometryType(): GeometryType

- The type of geometry. This property will be undefined if the data is not spatial.

  #### Returns GeometryType

  Inherited from FeatureLayerSchema.geometryType

- set geometryType(value): void

- #### Parameters

  - value: GeometryType

  #### Returns void

  Inherited from FeatureLayerSchema.geometryType

### hasGeometry

- get hasGeometry(): boolean

- Whether the schema has spatial data.

  #### Returns boolean

  Inherited from FeatureLayerSchema.hasGeometry

### parent

- get parent(): this

- The parent settings that these settings will inherit from.

  #### Returns this

  Inherited from FeatureLayerSchema.parent

- set parent(value): void

- #### Parameters

  - value: this

  #### Returns void

  Inherited from FeatureLayerSchema.parent

### primaryKeyField

- get primaryKeyField(): string

- The name of the field containing the feature's primary key (value that uniquely identifies a feature).

  #### Returns string

  Inherited from FeatureLayerSchema.primaryKeyField

- set primaryKeyField(value): void

- #### Parameters

  - value: string

  #### Returns void

  Inherited from FeatureLayerSchema.primaryKeyField

### spatialReference

- get spatialReference(): SpatialReference

- The spatial reference of the schema. Can be defined using a well-known ID (WKID) or well-known text (WKT).

  #### Returns SpatialReference

  Inherited from FeatureLayerSchema.spatialReference

- set spatialReference(value): void

- #### Parameters

  - value: SpatialReference

  #### Returns void

  Inherited from FeatureLayerSchema.spatialReference

### timeZone

- get timeZone(): string

- The time zone that the data is stored in. The default is UTC.

  #### Returns string

  Inherited from FeatureLayerSchema.timeZone

- set timeZone(value): void

- #### Parameters

  - value: string

  #### Returns void

  Inherited from FeatureLayerSchema.timeZone

### typeIdField

- get typeIdField(): string

- The name of the field holding the type ID or subtypes for the features.

  #### Returns string

  Inherited from FeatureLayerSchema.typeIdField

- set typeIdField(value): void

- #### Parameters

  - value: string

  #### Returns void

  Inherited from FeatureLayerSchema.typeIdField

### types

- get types(): Collection<FeatureType>

- A collection of types or subtypes for the features.

  #### Returns Collection<FeatureType>

  Inherited from FeatureLayerSchema.types

##
Methods

### `Protected`_createFieldCollection

- _createFieldCollection(): Collection<Field>

- Creates the backing collection for fields.

  #### Returns Collection<Field>

  Overrides FeatureLayerSchema._createFieldCollection

### `Protected`_createTypeCollection

- _createTypeCollection(): Collection<FeatureType>

- Creates the backing collection for types.

  #### Returns Collection<FeatureType>

  Overrides FeatureLayerSchema._createTypeCollection

### `Protected`_getCollectionSetting

- _getCollectionSetting<T>(setting): Collection<T>

- Gets the value for a setting that represents a collection.

  #### Type Parameters

  - T

  #### Parameters

  - setting: keyof FeatureLayerReadOnlySchema

    The setting name.

  #### Returns Collection<T>

  Inherited from FeatureLayerSchema._getCollectionSetting

### `Protected`_getNestedSettings

- _getNestedSettings<T>(setting, factory): T

- Gets a property which is itself an instance of Settings.

  #### Type Parameters

  - T extends Settings<unknown>

  #### Parameters

  - setting: keyof FeatureLayerReadOnlySchema

    The setting name.

  - factory: (() => T)

    A factory for creating the nested settings.

    - - (): T

      - #### Returns T

  Inherited from FeatureLayerSchema._getNestedSettings

### `Protected`_getPropertyBindings

- _getPropertyBindings(): Partial<Record<keyof FeatureLayerReadOnlySchema, LayerExtensionSchemaPropertyBinding>>

- Returns the property bindings.

  #### Returns Partial<Record<keyof FeatureLayerReadOnlySchema, LayerExtensionSchemaPropertyBinding>>

  Inherited from FeatureLayerSchema._getPropertyBindings

### `Protected`_getSerializableProperties

- _getSerializableProperties(): PropertyDefs<SchemaProperties>

- The property keys and their metadata that are used to implement serializing and deserializing the class instance.

  #### Returns PropertyDefs<SchemaProperties>

  Inherited from FeatureLayerSchema._getSerializableProperties

### `Protected`_getSetting

- _getSetting<K>(setting, defaultValue?): FeatureLayerReadOnlySchema[K]

- Gets the value for a setting.

  #### Type Parameters

  - K extends keyof FeatureLayerReadOnlySchema

  #### Parameters

  - setting: K

    The setting name.

  - `Optional` defaultValue: FeatureLayerReadOnlySchema[K]

    The default value if the setting is not explicitly set.

  #### Returns FeatureLayerReadOnlySchema[K]

  Inherited from FeatureLayerSchema._getSetting

### `Protected`_hasSettingIncludingAncestor

- _hasSettingIncludingAncestor<K>(setting): boolean

- Determines whether the specified setting has been modified locally or by any parent of the current settings instance.

  #### Type Parameters

  - K extends keyof FeatureLayerReadOnlySchema

  #### Parameters

  - setting: K

    The setting to check.

  #### Returns boolean

  Inherited from FeatureLayerSchema._hasSettingIncludingAncestor

### `Protected`_setParent

- _setParent(parent): void

- Sets the parent settings that these settings will inherit from.

  #### Parameters

  - parent: FeatureLayerReadOnlySchema

    The parent settings to inherit from.

  #### Returns void

  Inherited from FeatureLayerSchema._setParent

### `Protected`_setSetting

- _setSetting<K>(setting, value): void

- Sets the value for a setting. This will override any inherited value for the setting.

  #### Type Parameters

  - K extends keyof FeatureLayerReadOnlySchema

  #### Parameters

  - setting: K

    The setting name.

  - value: FeatureLayerReadOnlySchema[K]

    The setting value.

  #### Returns void

  Overrides FeatureLayerSchema._setSetting

### `Protected`_toPropertyDef

- _toPropertyDef<T>(def): PropertyDef<T>

- Converts the value to a PropertyDef object.

  #### Type Parameters

  - T

  #### Parameters

  - def: PropertyDefSerializeMode | PropertyDefSerializeMode[] | PropertyDef<T>

    The value to convert.

  #### Returns PropertyDef<T>

  Inherited from FeatureLayerSchema._toPropertyDef

### assignProperties

- assignProperties(properties): void

- #### Parameters

  - properties: Partial<unknown>

  #### Returns void

  #### Inherit Doc

  Inherited from FeatureLayerSchema.assignProperties

### assignPropertiesAsync

- assignPropertiesAsync(properties): Promise<void>

- #### Parameters

  - properties: Partial<unknown>

  #### Returns Promise<void>

  #### Inherit Doc

  Inherited from FeatureLayerSchema.assignPropertiesAsync

### createAllFieldInfos

- createAllFieldInfos(): FieldInfo[]

- Creates an array of FieldInfos that includes all fields within the Schema.

  #### Returns FieldInfo[]

  Inherited from FeatureLayerSchema.createAllFieldInfos

### createPopupTemplate

- createPopupTemplate(): PopupTemplate

- Generates an esri PopupTemplate from the fields in this schema.

  #### Returns PopupTemplate

  Inherited from FeatureLayerSchema.createPopupTemplate

### destroy

- destroy(): void

- Cleans up resources used by the schema.

  #### Returns void

  Inherited from FeatureLayerSchema.destroy

### findFieldByName

- findFieldByName(name): Field

- Finds a field by field name.

  #### Parameters

  - name: string

    The name of the field to search for.

  #### Returns Field

  The matching field, or `undefined` if there is no match.

  Inherited from FeatureLayerSchema.findFieldByName

### finishAssignProperties

- finishAssignProperties(): Promise<void>

- #### Returns Promise<void>

  #### Inherit Doc

  Inherited from FeatureLayerSchema.finishAssignProperties

### getDefault

- getDefault<K>(key): unknown

- #### Type Parameters

  - K extends never

  #### Parameters

  - key: K

  #### Returns unknown

  #### Inherit Doc

  Inherited from FeatureLayerSchema.getDefault

### getDefaults

- getDefaults(): SchemaProperties

- #### Returns SchemaProperties

  #### Inherit Doc

  Inherited from FeatureLayerSchema.getDefaults

### getSerializableProperties

- getSerializableProperties(serializeMode?): PropertyDefs<unknown>

- Returns the serializable properties.

  #### Parameters

  - serializeMode: SerializeMode = "all"

    Optional. If specified, only properties that support the given serialization mode will be returned.

  #### Returns PropertyDefs<unknown>

  Inherited from FeatureLayerSchema.getSerializableProperties

### isModified

- isModified(): boolean

- Determines whether the settings have been locally modified in any way.

  #### Returns boolean

  Inherited from FeatureLayerSchema.isModified

- isModified(setting): boolean

- Determines whether the specified setting has been locally modified, and is thus overriding any inherited value.

  #### Parameters

  - setting: keyof FeatureLayerReadOnlySchema

    The setting to check.

  #### Returns boolean

  Inherited from FeatureLayerSchema.isModified

### reset

- reset(): void

- Removes all local overrides, resetting all settings to their inherited values, if any.

  #### Returns void

  Inherited from FeatureLayerSchema.reset

- reset(setting): void

- Removes a local override for a setting and resets it to its inherited value, if any.

  #### Parameters

  - setting: keyof FeatureLayerReadOnlySchema

    The setting to reset.

  #### Returns void

  Inherited from FeatureLayerSchema.reset

### toJSON

- toJSON(serializeMode?): SchemaProperties

- #### Parameters

  - serializeMode: SerializeMode = "all"

  #### Returns SchemaProperties

  #### Inherit Doc

  Inherited from FeatureLayerSchema.toJSON

### `Static` createFieldInfoFromField

- createFieldInfoFromField(field): FieldInfo

- Generates a popup template field info object from an esri field.

  #### Parameters

  - field: Field

    The field to generate the field info object from.

  #### Returns FieldInfo

  Inherited from FeatureLayerSchema.createFieldInfoFromField