# Class LayerPresetSetting

Layer preset settings for an individual layer or sublayer.

#### Hierarchy (view full)

- SerializableBase<LayerPresetSettingProperties>
  - LayerPresetSetting

#####
Index

### Constructors

constructor

### Properties

childrenIncludedInLayerList?
definitionExpression?
expanded?
includedInLayerList?
maxScale?
minScale?
opacity?
sublayers
visible?

### Methods

_getSerializableProperties
_toPropertyDef
assignProperties
assignPropertiesAsync
finishAssignProperties
getDefault
getDefaults
getSerializableProperties
toJSON

##
Constructors

### constructor

- new LayerPresetSetting(properties?): LayerPresetSetting

- #### Parameters

  - `Optional` properties: LayerPresetSettingProperties

  #### Returns LayerPresetSetting

  Overrides SerializableBase.constructor

##
Properties

### `Optional` childrenIncludedInLayerList

childrenIncludedInLayerList?: boolean

Controls whether sublayers are included or hidden in the layer list.

### `Optional` definitionExpression

definitionExpression?: string

DefinitionExpression of the layer.

### `Optional` expanded

expanded?: boolean

Whether the layer is expanded in the layer list.

### `Optional` includedInLayerList

includedInLayerList?: boolean

Controls whether this layer should be included in the layer list.

### `Optional` maxScale

maxScale?: number

If set, overrides the maximum scale of the layer or sublayer when the preset is applied. No effect if the type of layer or sublayer does not allow changing scale.

### `Optional` minScale

minScale?: number

If set, overrides the minimum scale of the layer or sublayer when the preset is applied. No effect if the type of layer or sublayer does not allow changing scale.

### `Optional` opacity

opacity?: number

If set, overrides the opacity of the layer or sublayer when the preset is applied. No effect if the type of layer or sublayer does not allow changing opacity.

### sublayers

sublayers: ObservableMap<string | number | SublayerReference, LayerPresetSetting>

LayerPresetSetting that can be applied to the sublayers of the layer this LayerPreset is applied to.

### `Optional` visible

visible?: boolean

Visibility of the layer.

##
Methods

### `Protected`_getSerializableProperties

- _getSerializableProperties(): PropertyDefs<LayerPresetSettingProperties>

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

  #### Returns PropertyDefs<LayerPresetSettingProperties>

  Overrides SerializableBase._getSerializableProperties

### `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 SerializableBase._toPropertyDef

### assignProperties

- assignProperties(properties): void

- Sets the properties for this item.

  #### Parameters

  - properties: Partial<LayerPresetSettingProperties>

    A plain object containing property values to set, keyed by property name.

  #### Returns void

  Inherited from SerializableBase.assignProperties

### assignPropertiesAsync

- assignPropertiesAsync(properties): Promise<void>

- Sets the properties for this item.

  This version will also await any asynchronous logic that is needed to set the properties.

  #### Parameters

  - properties: Partial<LayerPresetSettingProperties>

    A plain object containing property values to set, keyed by property name.

  #### Returns Promise<void>

  Inherited from SerializableBase.assignPropertiesAsync

### finishAssignProperties

- finishAssignProperties(): Promise<void>

- Waits for all deserialization logic initiated thus far to finish, whether invoked by passing properties into the constructor, or by invoking `assignProperties()` or `assignPropertiesAsync()`.

  #### Returns Promise<void>

  Inherited from SerializableBase.finishAssignProperties

### getDefault

- getDefault<K>(key): LayerPresetSettingProperties[K]

- Gets the default value of an object's property.

  #### Type Parameters

  - K extends keyof LayerPresetSettingProperties

  #### Parameters

  - key: K

    The property of the object for which to get the default value.

  #### Returns LayerPresetSettingProperties[K]

  Inherited from SerializableBase.getDefault

### getDefaults

- getDefaults(): LayerPresetSettingProperties

- Gets the object's default property values.

  #### Returns LayerPresetSettingProperties

  Inherited from SerializableBase.getDefaults

### getSerializableProperties

- getSerializableProperties(serializeMode?): PropertyDefs<LayerPresetSettingProperties>

- Returns the serializable properties.

  #### Parameters

  - serializeMode: SerializeMode = "all"

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

  #### Returns PropertyDefs<LayerPresetSettingProperties>

  Inherited from SerializableBase.getSerializableProperties

### toJSON

- toJSON(serializeMode?): LayerPresetSettingProperties

- Returns a serializable representation of the item.

  #### Parameters

  - serializeMode: SerializeMode = "all"

    If specified, only properties that are appropriate for the given mode are returned. Otherwise, all properties will be serialized.

  #### Returns LayerPresetSettingProperties

  Inherited from SerializableBase.toJSON