Skip to content
import { createVersioningStates, getVersioningStates } from "@arcgis/core/versionManagement/utils.js";
Since
ArcGIS Maps SDK for JavaScript 4.30

Provides utility methods for creating VersioningStates.

Functions

createVersioningStates

Function

Used to create a Collection of VersioningStates.

Signature
createVersioningStates (input: WebMap | VersionAdapter[], usePersistentReadSessions: boolean): Promise<Collection<VersioningState>>
Parameters
ParameterTypeDescriptionRequired
input

Input used to to create a Collection of VersioningStates.

usePersistentReadSessions

If set to true, the current version will have a read lock. Additionally, when switching versions, the new current version will also have a read lock.

Returns
Promise<Collection<VersioningState>>

When resolved, a Collection of VersioningStates is returned.

Example
const webmap = new WebMap({
portalItem: { // autocasts as new PortalItem()
id: "e691172598f04ea8881cd2a4adaa45ba"
}
});
const versioningStates = await utils.createVersioningStates(webmap, false);

getVersioningStates

Function

Used to get a Collection of VersioningStates from a View

Signature
getVersioningStates (view: View, usePersistentReadSessions?: boolean): Promise<Collection<VersioningState>>
Parameters
ParameterTypeDescriptionRequired
view

View used to get a Collection of VersioningStates.

usePersistentReadSessions

If set to true, the current version will have a read lock. Additionally, when switching versions, the new current version will also have a read lock.

Returns
Promise<Collection<VersioningState>>

When resolved, a Collection of VersioningStates is returned.

Example
const webmap = new WebMap({
portalItem: { // autocasts as new PortalItem()
id: "e691172598f04ea8881cd2a4adaa45ba"
}
});
const view = new View({
map: webmap,
container: "viewDiv",
});
const versioningStates = await utils.getVersioningStates(view, false);