import { getServerCollectionsPage, getServerLandingPage } from "@arcgis/core/layers/ogc/ogcFeatureUtils.js";const { getServerCollectionsPage, getServerLandingPage } = await $arcgis.import("@arcgis/core/layers/ogc/ogcFeatureUtils.js");- Since
- ArcGIS Maps SDK for JavaScript 5.0
Provides utility functions for the OGCFeatureLayer.
- See also
Functions
| Name | Return Type | Object |
|---|---|---|
| | ||
| |
getServerCollectionsPage
Function
Returns an array of feature collections available on the server.
- See also
- Signature
-
getServerCollectionsPage (landingPage: LandingPage, options?: QueryOptions): Promise<CollectionsPage>
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| landingPage | An OGC API-Feature server landing page. | | |
| options | Additional options. | |
- Returns
- Promise<CollectionsPage>
A promise that resolves to the server's collections page.
Example
// Print the ids and titles of all collections published to the ogc-api features server.const url = "https://demo.ldproxy.net/daraa";
const ogcFeatureUtils = await $arcgis.import("@arcgis/core/layers/ogc/ogcFeatureUtils.js");const landingPage = await ogcFeatureUtils.getServerLandingPage(url);const collectionsPage = await ogcFeatureUtils.getServerCollectionsPage(landingPage);for (const collection of collectionsPage.collections) { const { id, title } = collection; console.log(` Collection id: ${id} Collection title: ${title ?? "not specified"} `);} getServerLandingPage
Function
Returns the landing page for an OGC API-Features server.
- Signature
-
getServerLandingPage (url: string, options?: QueryOptions): Promise<LandingPage>
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| url | The URL to an OGC API-Features server. | | |
| options | Additional options. | |
- Returns
- Promise<LandingPage>
A promise that resolves to the server's landing page.
The url that returns the json representation of the landing page may or may not include query parameters, for example, "f=json". This function does not append any query parameters to the provided url. If the server requires specific query parameters to return the landing page, please ensure they are included in the provided url.
Example
// Print the title and description of the server landing page to console.const url = "https://demo.ldproxy.net/daraa";
const ogcFeatureUtils = await $arcgis.import("@arcgis/core/layers/ogc/ogcFeatureUtils.js");const landingPage = await ogcFeatureUtils.getServerLandingPage(url);const { description, title } = landingPage;console.log(` Title: ${title ?? "not specified"} Description: ${description ?? "not specified"}`);