AMD:
require(["esri/versionManagement/utils"], (versionManagementUtils) => { /* code goes here */ });
ESM:
import * as versionManagementUtils from "@arcgis/core/versionManagement/utils.js";
Object:
esri/versionManagement/utils
Since: ArcGIS Maps SDK for JavaScript 4.30
Provides utility methods for creating VersioningStates.
Method Overview
Name | Return Type | Summary | Object |
---|---|---|---|
Promise<Collection<VersioningState>> | Used to generate an instance of VersioningState. | utils | |
Promise<Collection<VersioningState>> | Used to get an instance of VersioningState from a View | utils |
Method Details
-
createVersioningStates
createVersioningStates(input, usePersistentReadSessions){Promise<Collection<VersioningState>>}
-
Used to generate an instance of VersioningState.
Parametersinput WebMap|VersionAdapterInput used to generate VersioningStates.
usePersistentReadSessions BooleanIf the 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.ReturnsType Description Promise<Collection<VersioningState>> - When resolved returns a Collection of VersioningState instances.
Exampleconst webmap = new WebMap({ portalItem: { // autocasts as new PortalItem() id: "e691172598f04ea8881cd2a4adaa45ba" } }); const versioningStates = await utils.createVersioningStates(webmap, false);
-
getVersioningStates
getVersioningStates(view, usePersistentReadSessions){Promise<Collection<VersioningState>>}
-
Used to get an instance of VersioningState from a View
ParametersReturnsType Description Promise<Collection<VersioningState>> - When resolved returns a Collection of VersioningState instances.
Exampleconst 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);