@deltares/fews-web-oc-composables
@deltares/fews-web-oc-composables / useWmsCapabilities
Function: useWmsCapabilities()
useWmsCapabilities(
options):UseWmsCapabilitiesReturn
Defined in: useWms/useWmsCapabilities.ts:49
Alpha
This API is not yet stable and may change in future versions.
Loads the full WMS GetCapabilities response for all layers and refreshes it according to the configured refresh policies. Unlike useWmsLayerCapabilities, it does not require a layer name. By default, it fetches immediately but has no scheduled refresh policies.
Parameters
options
| Member | Type | Description |
|---|---|---|
enabled? | Ref<boolean, boolean> | Controls whether requests and automatic refreshes are enabled. |
refresh? | UseWmsRefreshOptions | Configuration for automatic request refreshing. |
webservice? | PiWebserviceOptions | Optional webservice configuration for standalone usage. When omitted, the host-provided webservice context is used. |
Request configuration. See UseWmsCapabilitiesOptions.
Returns
| Member | Type | Description |
|---|---|---|
cancel | () => void | Cancels the currently running request, if any. |
capabilities | Readonly<Ref<GetCapabilitiesResponse | undefined>> | The full WMS GetCapabilities response. |
error | Readonly<Ref<Error | null>> | Error from the most recent request, or null when there is no error. |
fetch | () => Promise<void> | Fetches the requested WMS data immediately. |
hasAttempted | Readonly<Ref<boolean>> | Whether a request has completed for the current inputs, successfully or not. |
hasLoaded | Readonly<Ref<boolean>> | Whether a successful response is available for the current inputs. |
lastRefreshAt | Readonly<Ref<Date | undefined>> | Time at which the most recent refresh completed successfully. |
lastTriggerPolicy | Readonly<Ref<RefreshPolicy | undefined>> | Policy that caused the most recent refresh. |
loading | Readonly<Ref<boolean>> | Whether the initial request is in progress. |
pauseRefresh | () => void | Pauses automatic refreshes. |
refreshing | Readonly<Ref<boolean>> | Whether a subsequent request is in progress. |
requestRefresh | () => void | Requests a refresh through the refresh coordinator. |
resumeRefresh | () => void | Resumes automatic refreshes. |
The capabilities and request state. See UseWmsCapabilitiesReturn.
Example
ts
import { useWmsCapabilities } from '@deltares/fews-web-oc-composables'
const { capabilities, loading, error } = useWmsCapabilities({
webservice: { baseUrl: 'https://example.localhost/fewswebservices' },
refresh: { policies: ['onInterval'], intervalMs: 30_000 },
})