Helper class to parse capabilities of WMS layers

CapabilitiesUtil

Constructors

Methods

  • Returns the Capabilities URL for the given layer.

    Parameters

    • layer: WmsLayer

      The layer to the get the Capabilities URL for.

    Returns string

    The Capabilities URL.

  • Returns the layers from a parsed WMS GetCapabilities object.

    Parameters

    • capabilities: any

      A capabilities object.

    • nameField: string = 'Name'

      Configure the field which should be set as the 'name' property in the openlayers layer.

    • Optional proxyFn: ((proxyUrl) => string)

      Optional proxy function which can be applied to GetMap, GetFeatureInfo and GetLegendGraphic requests to avoid CORS issues.

        • (proxyUrl): string
        • Parameters

          • proxyUrl: string

          Returns string

    Returns ImageLayer<ImageWMS>[]

    Array of OlLayerImage

  • Fetches and parses the WMS Capabilities document for the given URL.

    Parameters

    • capabilitiesUrl: string

      Url to WMS capabilities document.

    • fetchOpts: RequestInit = {}

      Optional fetch options to make use of while requesting the Capabilities.

    Returns Promise<any>

    An object representing the WMS capabilities.

  • Fetches and parses the WMS Capabilities document for the given layer.

    Parameters

    • layer: WmsLayer

      The layer to the get the Capabilites for.

    • fetchOpts: RequestInit = {}

      Optional fetch options to make use of while requesting the Capabilities.

    Returns Promise<any>

    An object representing the WMS capabilities.