-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: by default fetch metadata and make query response readable
AFFECTS PACKAGES: @esri/arcgis-rest-feature-service @esri/arcgis-rest-request ISSUES CLOSED: #375
- Loading branch information
Showing
8 changed files
with
278 additions
and
137 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
packages/arcgis-rest-feature-service/src/getFeatureService.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* Copyright (c) 2018 Environmental Systems Research Institute, Inc. | ||
* Apache-2.0 */ | ||
|
||
import { | ||
request, | ||
IRequestOptions | ||
} from "@esri/arcgis-rest-request"; | ||
|
||
import { ILayerDefinition } from "@esri/arcgis-rest-common-types"; | ||
|
||
/** | ||
* Layer (Feature Service) request. See the [REST Documentation](https://developers.arcgis.com/rest/services-reference/layer-feature-service-.htm) for more information. | ||
* | ||
* ```js | ||
* import { getFeatureService } from '@esri/arcgis-rest-feature-service'; | ||
* | ||
* const url = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/ServiceRequest/FeatureServer/0"; | ||
* | ||
* getFeatureService(url) | ||
* .then(response) // { name: "311", id: 0, ... } | ||
* ``` | ||
* | ||
* @param requestOptions - Options for the request. | ||
* @returns A Promise that will resolve with the addFeatures response. | ||
*/ | ||
export function getFeatureService( | ||
url: string, | ||
requestOptions: IRequestOptions | ||
): Promise<ILayerDefinition> { | ||
return request(url, requestOptions); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters