import type { LoadableMixin } from "@arcgis/core/core/Loadable.js";- Subclasses
- Basemap, Basemap, Ground, Ground, WebDocument2D, WebScene, SharedTemplate, Mesh, Layer, Layer, BuildingComponentSublayer, BuildingSummaryStatistics, MediaElementBase, MediaElementBase, KMLSublayer, KMLSublayer, LocalMediaElementSource, Sublayer, Sublayer, SubtypeSublayer, SubtypeSublayer, Network, Network, Portal, Portal, PortalItem, PortalItem, FeatureService, FeatureService, VersionManagementService, VersionManagementService, VersioningState, VersioningState, BasemapGalleryViewModel, BasemapGalleryViewModel, PortalBasemapsSource, PrintViewModel
- Since
- ArcGIS Maps SDK for JavaScript 4.0
Loadable is a mixin class that provides a standardized way to load resources asynchronously. Many classes in the API that load resources from a remote source extend this class.
Properties
| Property | Type | Class |
|---|---|---|
| readonly | | |
| readonly | "not-loaded" | "loading" | "failed" | "loaded" | |
| readonly | any[] | |
loadStatus
- Type
- "not-loaded" | "loading" | "failed" | "loaded"
Represents the status of a load() operation.
| Value | Description |
|---|---|
| not-loaded | The object's resources have not loaded. |
| loading | The object's resources are currently loading. |
| loaded | The object's resources have loaded without errors. |
| failed | The object's resources failed to load. See loadError for more details. |
- Default value
- "not-loaded"
Methods
| Method | Signature | Class |
|---|---|---|
| cancelLoad(): this | | |
| load(options?: AbortOptions | null | undefined): Promise<this> | |
load
- Signature
-
load (options?: AbortOptions | null | undefined): Promise<this>
Loads the resources referenced by this class. This method automatically executes for a View and all of the resources it references in Map if the view is constructed with a map instance.
This method must be called by the developer when accessing a resource that will not be loaded in a View.
The load() method only triggers the loading of the resource the first time it is called. The subsequent calls return the same promise.
It's possible to provide a signal to stop being interested into a Loadable instance load status.
When the signal is aborted, the instance does not stop its loading process, only cancelLoad() can abort it.