Skip to content

@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 ​

UseWmsCapabilitiesOptions

MemberTypeDescription
enabled?Ref<boolean, boolean>Controls whether requests and automatic refreshes are enabled.
refresh?UseWmsRefreshOptionsConfiguration for automatic request refreshing.
webservice?PiWebserviceOptionsOptional webservice configuration for standalone usage. When omitted, the host-provided webservice context is used.

Request configuration. See UseWmsCapabilitiesOptions.

Returns ​

UseWmsCapabilitiesReturn

MemberTypeDescription
cancel() => voidCancels the currently running request, if any.
capabilitiesReadonly<Ref<GetCapabilitiesResponse | undefined>>The full WMS GetCapabilities response.
errorReadonly<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.
hasAttemptedReadonly<Ref<boolean>>Whether a request has completed for the current inputs, successfully or not.
hasLoadedReadonly<Ref<boolean>>Whether a successful response is available for the current inputs.
lastRefreshAtReadonly<Ref<Date | undefined>>Time at which the most recent refresh completed successfully.
lastTriggerPolicyReadonly<Ref<RefreshPolicy | undefined>>Policy that caused the most recent refresh.
loadingReadonly<Ref<boolean>>Whether the initial request is in progress.
pauseRefresh() => voidPauses automatic refreshes.
refreshingReadonly<Ref<boolean>>Whether a subsequent request is in progress.
requestRefresh() => voidRequests a refresh through the refresh coordinator.
resumeRefresh() => voidResumes 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 },
})