import * as versionManagementUtils from "@arcgis/core/versionManagement/utils.js";
const versionManagementUtils = await $arcgis.import("@arcgis/core/versionManagement/utils.js");
@arcgis/core/versionManagement/utils
Provides utility methods for creating VersioningStates.
Method Overview
Name | Return Type | Summary | Object |
---|---|---|---|
Promise<Collection<VersioningState>> | Used to create a Collection of VersioningStates. | utils | |
Promise<Collection<VersioningState>> | Used to get a Collection of VersioningStates from a View | utils |
Method Details
-
createVersioningStates
createVersioningStates(input, usePersistentReadSessions){Promise<Collection<VersioningState>>}
-
Used to create a Collection of VersioningStates.
Parametersinput WebMap|VersionAdapter[]Input used to to create a Collection of VersioningStates.
usePersistentReadSessions BooleanIf 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, a Collection of VersioningStates is returned.
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 a Collection of VersioningStates from a View
Parametersview ViewView used to get a Collection of VersioningStates.
usePersistentReadSessions BooleanIf 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, a Collection of VersioningStates is returned.
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);