utils

ESM: import * as versionManagementUtils from "@arcgis/core/versionManagement/utils.js";
CDN: const versionManagementUtils = await $arcgis.import("@arcgis/core/versionManagement/utils.js");
Object: @arcgis/core/versionManagement/utils
Since: ArcGIS Maps SDK for JavaScript 4.30

Provides utility methods for creating VersioningStates.

Method Overview

Name Return Type Summary Object

Used to create a Collection of VersioningStates.

utils

Used to get a Collection of VersioningStates from a View

utils

Method Details

createVersioningStates

Method
createVersioningStates(input, usePersistentReadSessions){Promise<Collection<VersioningState>>}

Used to create a Collection of VersioningStates.

Parameters

Input used to to create a Collection of VersioningStates.

usePersistentReadSessions Boolean

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
Type Description
Promise<Collection<VersioningState>>
Example
const webmap = new WebMap({
  portalItem: { // autocasts as new PortalItem()
    id: "e691172598f04ea8881cd2a4adaa45ba"
  }
});
const versioningStates = await utils.createVersioningStates(webmap, false);

getVersioningStates

Method
getVersioningStates(view, usePersistentReadSessions){Promise<Collection<VersioningState>>}

Used to get a Collection of VersioningStates from a View

Parameters
view View

View used to get a Collection of VersioningStates.

usePersistentReadSessions Boolean

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
Type Description
Promise<Collection<VersioningState>>
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);

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.