# Class BasemapExtension<T>

Extends the capabilities of an Esri Basemap object.

#### Type Parameters

- T extends BasemapExtensionProperties = BasemapExtensionProperties

#### Hierarchy (view full)

- EntityBase<T>
  - BasemapExtension

#####
Index

### Constructors

constructor

### Properties

_id
_itemType
_watchHandles
@eventTypes
description?
included
isSeries?
onClick?
taskSettings
factory

### Accessors

baseLayerExtensions
basemap
failureMode
iconUrl
id
isDestroyed
isInitialized
itemType
mapExtension
referenceLayerExtensions

### Methods

_createTaskSettings
_getSerializableProperties
_initializableChildCollections
_initializeChildren
_onBaseLayerAddedPostInitialize
_onDestroy
_onInitialize
_onReferenceLayerAddedPostInitialize
_postInitialize
_toPropertyDef
assignProperties
assignPropertiesAsync
destroy
finishAssignProperties
getDefault
getDefaults
getSerializableProperties
initialize
toItemUri
toJSON
create

##
Constructors

### constructor

- new BasemapExtension<T>(properties?): BasemapExtension<T>

- Creates a new instance of mapping/BasemapExtension!BasemapExtension.

  #### Type Parameters

  - T extends BasemapExtensionProperties = BasemapExtensionProperties

  #### Parameters

  - `Optional` properties: T

    An object containing initial property values to set.

  #### Returns BasemapExtension<T>

  Overrides EntityBase.constructor

##
Properties

### `Protected`_id

_id: string

The unique ID for this entity. Once set, this should never change.

Inherited from EntityBase._id

### `Protected` `Readonly`_itemType

_itemType: string = ItemType.BASEMAP_EXTENSION

The item type for this entity when it participates in an App.

Overrides EntityBase._itemType

### `Protected` `Readonly`_watchHandles

_watchHandles: Map<string, ResourceHandle[]> = ...

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

### @eventTypes

@eventTypes: InitializableBaseEvents

#### Deprecated

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

Inherited from EntityBase.@eventTypes

### `Optional` description

description?: string

A user defined description.

### included

included: boolean = true

Whether this basemap should be included in a basemap picker.

### `Optional` isSeries

isSeries?: boolean

If true, the layers in this basemap will be presented one at a time, rather that all at once.

### `Optional` onClick

onClick?: Action

An action that will be performed when the user clicks on the basemap in the basemap picker.

### `Readonly` taskSettings

taskSettings: TaskSettings

#### Inherit Doc

### `Static` factory

factory: BasemapExtensionFactory = defaultBasemapExtensionFactory

The factory that will be used whenever a BasemapExtension needs to be created. Applications can supply their own factory to customize BasemapExtension creation.

##
Accessors

### baseLayerExtensions

- get baseLayerExtensions(): LayerExtensionCollection<LayerExtensionProperties>

- The layer extensions associated with each base layer of the basemap.

  #### Returns LayerExtensionCollection<LayerExtensionProperties>

### basemap

- get basemap(): Basemap

- The Esri Basemap object being extended.

  #### Returns Basemap

### failureMode

- get failureMode(): FailureMode

- Determines how a parent object should handle initialization failure in this object. The default is "warn".

  - `"error"`: support/InitializeError!InitializeError is thrown.
  - `"warn"`: Message is logged and support/InitializableBase!InitializeWarningEvent is raised.
  - `"ignore"`: support/InitializableBase!InitializeWarningEvent is raised.

  #### Returns FailureMode

  Inherited from EntityBase.failureMode

- set failureMode(value): void

- #### Parameters

  - value: FailureMode

  #### Returns void

  Inherited from EntityBase.failureMode

### iconUrl

- get iconUrl(): string

- The URL pointing to an image that represents the basemap.

  #### Returns string

- set iconUrl(value): void

- #### Parameters

  - value: string

  #### Returns void

### id

- get id(): string

- The unique ID for this entity.

  #### Returns string

  Inherited from EntityBase.id

### isDestroyed

- get isDestroyed(): boolean

- See support/InitializableBase!Initializable.isDestroyed.

  #### Returns boolean

  Inherited from EntityBase.isDestroyed

### isInitialized

- get isInitialized(): boolean

- See support/InitializableBase!Initializable.isInitialized.

  #### Returns boolean

  Inherited from EntityBase.isInitialized

### itemType

- get itemType(): string

- The item type for this entity when it participates in an App.

  #### Returns string

  Inherited from EntityBase.itemType

### mapExtension

- get mapExtension(): MapExtension

- The parent map extension.

  #### Returns MapExtension

### referenceLayerExtensions

- get referenceLayerExtensions(): LayerExtensionCollection<LayerExtensionProperties>

- The layer extensions associated with each reference layer of the basemap.

  #### Returns LayerExtensionCollection<LayerExtensionProperties>

##
Methods

### `Protected`_createTaskSettings

- _createTaskSettings(): TaskSettings

- Called to create the data/TaskSettings!TaskSettings.

  #### Returns TaskSettings

### `Protected`_getSerializableProperties

- _getSerializableProperties(): PropertyDefs<T>

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

  #### Returns PropertyDefs<T>

  Overrides EntityBase._getSerializableProperties

### `Protected`_initializableChildCollections

- _initializableChildCollections(): IterableIterator<Collection<InitializableBase<InitializableBaseProperties>>, any, any>

- Collections of child items to initialize. Items that fail to initialize are removed from the collection.

  #### Returns IterableIterator<Collection<InitializableBase<InitializableBaseProperties>>, any, any>

  Overrides EntityBase._initializableChildCollections

### `Protected`_initializeChildren

- _initializeChildren(): Promise<void>

- Initializes child entities.

  #### Returns Promise<void>

  Inherited from EntityBase._initializeChildren

### `Protected`_onBaseLayerAddedPostInitialize

- _onBaseLayerAddedPostInitialize(baseLayerExtension): Promise<void>

- A callback executed when a base layer is added to the basemap after the LayerExtension has been initialized.

  #### Parameters

  - baseLayerExtension: LayerExtension<LayerExtensionProperties>

    The base layer that was added.

  #### Returns Promise<void>

### `Protected`_onDestroy

- _onDestroy(): Promise<void>

- Called to perform cleanup. Subclasses should override this method rather than destroy() to perform custom cleanup.

  #### Returns Promise<void>

  Overrides EntityBase._onDestroy

### `Protected`_onInitialize

- _onInitialize(): Promise<void>

- Called to perform initialization of the support/InitializableBase!InitializableBase. Subclasses should override this method rather than initialize() to perform custom initialization.

  #### Returns Promise<void>

  Overrides EntityBase._onInitialize

### `Protected`_onReferenceLayerAddedPostInitialize

- _onReferenceLayerAddedPostInitialize(referenceLayerExtension): Promise<void>

- A callback executed when a reference layer is added to the basemap after the LayerExtension has been initialized.

  #### Parameters

  - referenceLayerExtension: LayerExtension<LayerExtensionProperties>

    The reference layer that was added.

  #### Returns Promise<void>

### `Protected`_postInitialize

- _postInitialize(): Promise<void>

- Called after normal initialization. Note: Child items are initialized before this is called.

  #### Returns Promise<void>

  Overrides EntityBase._postInitialize

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

### assignProperties

- assignProperties(properties): void

- #### Parameters

  - properties: Partial<T>

  #### Returns void

  #### Inherit Doc

  Inherited from EntityBase.assignProperties

### assignPropertiesAsync

- assignPropertiesAsync(properties): Promise<void>

- #### Parameters

  - properties: Partial<T>

  #### Returns Promise<void>

  #### Inherit Doc

  Inherited from EntityBase.assignPropertiesAsync

### destroy

- destroy(): Promise<void>

- A clean-up function that should get called whenever the item is disposed of.

  #### Returns Promise<void>

  Inherited from EntityBase.destroy

### finishAssignProperties

- finishAssignProperties(): Promise<void>

- #### Returns Promise<void>

  #### Inherit Doc

  Inherited from EntityBase.finishAssignProperties

### getDefault

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

- #### Type Parameters

  - K extends string | number | symbol

  #### Parameters

  - key: K

  #### Returns T[K]

  #### Inherit Doc

  Inherited from EntityBase.getDefault

### getDefaults

- getDefaults(): T

- #### Returns T

  #### Inherit Doc

  Inherited from EntityBase.getDefaults

### getSerializableProperties

- getSerializableProperties(serializeMode?): PropertyDefs<T>

- Returns the serializable properties.

  #### Parameters

  - `Optional` serializeMode: SerializeMode

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

  #### Returns PropertyDefs<T>

  Inherited from EntityBase.getSerializableProperties

### initialize

- initialize(): Promise<void>

- Initializes the item.

  #### Returns Promise<void>

  Inherited from EntityBase.initialize

### toItemUri

- toItemUri(): string

- Creates an item:// URI reference to this entity.

  #### Returns string

  Inherited from EntityBase.toItemUri

### toJSON

- toJSON(serializeMode?): T

- #### Parameters

  - serializeMode: SerializeMode = "all"

  #### Returns T

  #### Inherit Doc

  Inherited from EntityBase.toJSON

### `Static` create

- create(properties?): BasemapExtension<BasemapExtensionProperties>

- Creates the appropriate subclass of mapping/BasemapExtension!BasemapExtension based on the supplied properties. Applications can customize the default creation behavior by supplying a custom factory object (see mapping/BasemapExtension!BasemapExtension.factory).

  #### Parameters

  - `Optional` properties: BasemapExtensionProperties

    The BasemapExtension item properties.

  #### Returns BasemapExtension<BasemapExtensionProperties>