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 |
---|---|---|---|
Promise<Map<string, FeatureServiceResourcesBundle>> | Used to create an instance of FeatureService from an array of FeatureLayers. | utils |
Method Details
-
createFeatureServices
createFeatureServices(layers){Promise<Map<string, FeatureServiceResourcesBundle>>}
-
Used to create an instance of FeatureService from an array of FeatureLayers.
Parameterlayers FeatureLayer[]Layers used to construct the FeatureService.
ReturnsType Description Promise<Map<string, FeatureServiceResourcesBundle>> Exampleconst 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
FeatureServiceResourcesBundle Object
-
Results returned from the createFeatureService method.
- Properties
-
featureService FeatureService
Returns a featureService object.
layers FeatureLayer[]Returns an array of FeatureLayers