geoview-core - v2.3.0
    Preparing search index...

    Class LegendsLayerSet

    A Layer-set working with the LayerSetController at handling a result set of registered layers and synchronizing events happening on them (in this case when the layers are going through the layer statuses and legend querying) with a store for UI updates.

    Hierarchy (View Summary)

    Index
    controllerRegistry: ControllerRegistry

    The controller registry to work with

    layerDomain: LayerDomain

    The LayerDomain to work with

    mapViewer: MapViewer

    The MapViewer to work with

    • Processes layer data to query features on it, if the layer path can be queried.

      Parameters

      • geoviewLayer: AbstractGVLayer

        The geoview layer

      • queryType: QueryType

        The query type

      • location: TypeLocation

        The location for the query

      • queryGeometry: boolean = true

        Optional whether to query geometry

      • language: TypeDisplayLanguage

        The display language to use for the query

      • OptionalabortController: AbortController

        Optional abort controller

      Returns Promise<TypeFeatureInfoResult>

      A promise that resolves with the query results

      When queryType is not one of the supported query types (propagated from getFeatureInfo())

      When the underlying layer type does not implement the requested queryType (propagated from getFeatureInfo())

    • Registers the layer in the layer-set.

      If the layer is already registered, the function returns immediately. If the layer hasn't reached the loaded status yet, this method subscribes to the layer config's status change event and waits until the status becomes loaded before registering. This await is important when devs call this method directly to register ad-hoc layers.

      Parameters

      Returns Promise<void>

      A promise that resolves once the layer has been registered (or skipped)

    • Waits for a layer config to be registered in the all-feature-info-layer-set.

      This method returns a promise that resolves when the given layerPath is included in the registered layer config paths of the set.

      Parameters

      • layerPath: string

        The unique path identifying the layer to check for registration

      Returns Promise<void>

      A promise that resolves when the layer is registered

    • Waits for the legend of the given layer path to be queried.

      Sync-checks the store first and resolves immediately when the legend query status is already queried. Otherwise, subscribes to the legend-queried event and resolves when a valid legend payload arrives. Payloads without a legend are ignored, and no data icon payloads are also ignored unless acceptNoData is true, allowing the waiter to keep listening until a real legend is available.

      Parameters

      • layerPath: string

        The layer path to wait on

      • acceptNoIconsOrNoData: boolean = false

        Optional flag. When true, a legend whose first icon is no data is treated as a valid resolution. Defaults to false

      Returns Promise<LegendQueriedEvent>

      A promise that resolves once the layer legend has been queried

    • Aligns records with information provided by OutFields from layer config.

      This will update fields in and delete unwanted fields from the arrayOfRecords.

      Parameters

      • layerEntryConfig: AbstractBaseLayerEntryConfig

        The layer entry config object

      • arrayOfRecords: TypeFeatureInfoEntry[]

        Features to delete fields from

      Returns void

    • Determines whether the retrieved feature info records contain real attribute fields

      (i.e., key-value properties) or whether they were returned in a fallback HTML/plain-text form, which commonly occurs with WMS GetFeatureInfo responses. This is used primarily to detect when a WMS service cannot return structured feature attributes and instead provides the feature data as a single HTML or plain-text block. Logic summary:

      • For WMS layers (OgcWmsLayerEntryConfig):
        • If the first record contains exactly one property and that property is either html or plain_text, the method considers the response not to contain actual fields.
      • For all other cases, the method assumes records contain valid structured attributes.

      Parameters

      • layerConfig: AbstractBaseLayerEntryConfig

        The layer configuration used to determine whether special WMS handling applies

      • arrayOfRecords: TypeFeatureInfoEntry[]

        The retrieved feature info entries representing attributes or raw text content

      Returns boolean

      true if the feature info records contain real attribute fields; false if they consist only of fallback HTML or plain-text content