utils

AMD: require(["esri/rest/featureService/utils"], (featureServiceUtils) => { /* code goes here */ });
ESM: import * as featureServiceUtils from "@arcgis/core/rest/featureService/utils.js";
Object: esri/rest/featureService/utils
Since: ArcGIS Maps SDK for JavaScript 4.28

Provides utility methods for creating FeatureServices.

Method Overview

Name Return Type Summary Object

Used to create an instance of FeatureService from an array of FeatureLayers.

utils

Method Details

createFeatureServices

Method
createFeatureServices(layers){Promise<Map<string, FeatureServiceResourcesBundle>>}

Used to create an instance of FeatureService from an array of FeatureLayers.

Parameter

Layers used to construct the FeatureService.

Returns
Type Description
Promise<Map<string, FeatureServiceResourcesBundle>>
Example
const layer1 = new FeatureLayer({url: `${defaultHost}/arcgis/rest/services/TestService/FeatureServer/12`});
const layer2 = new FeatureLayer({url: `${defaultHost}/arcgis/rest/services/TestService/FeatureServer/13`});
const layers = [layer1, layer2];
const mapOfServices = createFeatureServices(layers);

//loading featureService from map object.
const featureService = await mapOfServices.get(`yourFeatureServiceLink/arcgis/rest/services/TestService/FeatureServer`).featureService.load();

Type Definitions

FeatureServiceResourcesBundle

Type Definition
FeatureServiceResourcesBundle Object

Results returned from the createFeatureService method.

Properties
featureService FeatureService

Returns a featureService object.

Returns an array of FeatureLayers

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