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

    Class GVGroupLayer

    Manages a Group Layer.

    GVGroupLayer

    Hierarchy (View Summary)

    Index

    Constructors

    • Constructs a Group layer to manage an OpenLayer Group Layer.

      Parameters

      • layerGroupOptions: Options

        The OpenLayer group layer.

      • layerConfig: GroupLayerEntryConfig

        The layer configuration.

      Returns GVGroupLayer

    Properties

    loadedOnce: boolean = false

    Indicates if the layer has become in loaded status at least once already

    Methods

    • Adds a layer to the group layer.

      Parameters

      Returns void

    • Gets the attributions for the layer by calling the overridable function 'onGetAttributions'. When the layer is a GVLayer, its layer attributions are returned. When the layer is a GVGroup, all layers attributions in the group are returned.

      Returns string[]

      The layer attributions.

    • Gets the bounds for the layer in the given projection. When the layer is a GVLayer, its layer bounds are returned. When the layer is a GVGroup, an Extent union of all layers bounds in the group is returned.

      Parameters

      • projection: Projection

        The projection to get the bounds into.

      • stops: number

        The number of stops to use to generate the extent.

      Returns Promise<Extent | undefined>

      A promise of layer bounding box.

    • A quick getter to help identify which layer class the current instance is coming from.

      Returns string

    • Returns the extent of the layer or undefined if it will be visible regardless of extent. The layer extent is an array of numbers representing an extent: [minx, miny, maxx, maxy]. The extent is used to clip the data displayed on the map.

      Returns Extent | undefined

      The layer extent.

    • Gets the Geoview layer id.

      Returns string

      The geoview layer id

    • Gets the geoview layer name.

      Returns string | undefined

      The layer name

    • Overrides the parent class's getter to provide a more specific return type (covariant return).

      Returns GroupLayerEntryConfig

      The strongly-typed layer configuration specific to this group layer.

    • Gets the layer name or falls back on the layer name in the layer configuration.

      Returns string

      The layer name

    • Gets the layer path associated with the layer.

      Returns string

      The layer path

    • Gets the immediate layers in the group.

      Returns AbstractBaseGVLayer[]

      The layers in the group.

    • Returns all layers contained within this group, including nested layers.

      Parameters

      • Optionalfilter: (layer: AbstractBaseGVLayer) => boolean

        Optional predicate function used to filter the returned layers. If provided, only layers matching the condition will be included in the result.

      Returns AbstractBaseGVLayer[]

      A flattened array of all descendant layers (including group layers), optionally filtered.

      This method performs a depth-first traversal of the group hierarchy, collecting all child layers recursively. If a filter function is provided, it is applied to each layer before inclusion in the result. Both GVGroupLayer instances and concrete layer types may be returned, depending on the filter criteria.

    • Returns all leaf layers (non-group layers) contained within this group, including those nested in child groups.

      Returns AbstractGVLayer[]

      An array of AbstractGVLayer instances representing all leaf layers in the group hierarchy.

      This is a convenience method that retrieves all descendant layers and filters them to include only concrete AbstractGVLayer instances (i.e., excluding GVGroupLayer containers). The returned collection is flattened and traversed depth-first.

    • Gets the layer status

      Returns TypeLayerStatus

      The layer status

    • Gets the max zoom of the layer.

      Returns number

      The max zoom of the layer.

    • Gets the min zoom of the layer.

      Returns number

      The min zoom of the layer.

    • Overrides the parent method to return a more specific OpenLayers layer type (covariant return).

      Returns LayerGroup

      The OpenLayers generic type for groups.

    • Gets the opacity of the layer (between 0 and 1).

      Returns number

      The opacity of the layer.

    • Returns the direct parent GVGroupLayer of this layer, if any.

      Returns GVGroupLayer | undefined

      The direct parent group layer, or undefined if this layer is not contained within any group.

      This method searches through the provided root group layer collection to determine which group directly contains this layer. If the layer is nested within multiple groups, only the immediate parent group is returned.

    • Returns the top-most (root) GVGroupLayer ancestor of this layer, if any.

      Returns GVGroupLayer | undefined

      The highest ancestor group layer in the hierarchy, or undefined if this layer does not belong to any group.

    • Retrieves all parent group layers of this layer in hierarchical order.

      The returned array starts with the immediate parent and continues up the hierarchy until the root group layer is reached or a group has already been visited (not supposed to happen).

      Returns GVGroupLayer[]

      An array of parent GVGroupLayer instances, ordered from the immediate parent to the top-most ancestor. Returns an empty array if the layer has no parent.

      This method traverses upward through the parent chain starting from the immediate parent of this layer. A protection mechanism prevents infinite loops in case of circular parent references.

    • Gets the visibility of the layer (true or false).

      Returns boolean

      The visibility of the layer.

    • Determines whether this layer is visible, taking into account the visibility of all its parent groups. A layer is considered visible only if:

      • the layer itself is visible, and
      • every parent GVGroupLayer up the hierarchy is also visible. This function walks upward through the group layer tree until it reaches the root, returning false immediately if any parent is not visible.

      Returns boolean

      true if this layer and all its parent groups are visible; otherwise false.

    • Checks if layer is visible at the given zoom

      Parameters

      • zoom: number

        Zoom level to be compared

      Returns boolean

      If the layer is visible at this zoom level

    • Unregisters a layer added event handler.

      Parameters

      • callback: LayerDelegate

        The callback to stop being called whenever the event is emitted

      Returns void

    • Unregisters a layer name changed event handler.

      Parameters

      • callback: LayerNameChangedDelegate

        The callback to stop being called whenever the event is emitted

      Returns void

    • Unregisters an opacity changed event handler.

      Parameters

      • callback: LayerOpacityChangedDelegate

        The callback to stop being called whenever the event is emitted

      Returns void

    • Unregisters a layer removed event handler.

      Parameters

      • callback: LayerDelegate

        The callback to stop being called whenever the event is emitted

      Returns void

    • Unregisters a visible changed event handler.

      Parameters

      • callback: VisibleChangedDelegate

        The callback to stop being called whenever the event is emitted

      Returns void

    • Overrides the way the attributions are retrieved.

      Returns string[]

      The layer attributions.

    • Overrides the way to get the bounds for this layer type.

      Parameters

      • projection: Projection

        The projection to get the bounds into.

      • stops: number

        The number of stops to use to generate the extent.

      Returns Promise<Extent | undefined>

      A promise of layer bounding box.

    • Registers a layer added event handler.

      Parameters

      • callback: LayerDelegate

        The callback to be executed whenever the event is emitted

      Returns void

    • Registers a layer name changed event handler.

      Parameters

      • callback: LayerNameChangedDelegate

        The callback to be executed whenever the event is emitted

      Returns void

    • Registers an opacity changed event handler.

      Parameters

      • callback: LayerOpacityChangedDelegate

        The callback to be executed whenever the event is emitted

      Returns void

    • Registers a layer removed event handler.

      Parameters

      • callback: LayerDelegate

        The callback to be executed whenever the event is emitted

      Returns void

    • Overrides the refresh function to refresh each layer in the group.

      Parameters

      • projection: Projection | undefined

        Optional, the projection to refresh to.

      Returns void

    • Overrides the set opacity function to set the opacity to all the children as well.

      Parameters

      • opacity: number

        The desired opacity for the layer, typically between 0 (fully transparent) and 1 (fully opaque).

      • emitOpacityChanged: boolean = true

        Optional, whether to emit a layer opacity change event after updating the opacity. Defaults to true.

      Returns void

    • Registers a visible changed event handler.

      Parameters

      • callback: VisibleChangedDelegate

        The callback to be executed whenever the event is emitted

      Returns void

    • Refreshes the layer by calling the overridable function 'onRefresh'. When the layer is a GVLayer its layer source is refreshed. When the layer is a GVGroup, all layers in the group are refreshed.

      Parameters

      • projection: Projection | undefined

        Optional, the projection to refresh to.

      Returns void

    • Removes a layer from the group layer.

      Parameters

      Returns void

    • Sets the extent of the layer. Use undefined if it will be visible regardless of extent. The layer extent is an array of numbers representing an extent: [minx, miny, maxx, maxy].

      Parameters

      • layerExtent: Extent

        The extent to assign to the layer.

      Returns void

    • Sets the layer name

      Parameters

      • name: string | undefined

        The layer name

      Returns void

    • Sets the max zoom of the layer.

      Parameters

      • maxZoom: number

        The max zoom of the layer.

      Returns void

    • Sets the min zoom of the layer.

      Parameters

      • minZoom: number

        The min zoom of the layer.

      Returns void

    • Sets the OpenLayers Layer

      Parameters

      • layer: BaseLayer

        The OpenLayers Layer

      Returns void

    • Sets the opacity of the layer while ensuring it does not exceed the opacity of its parent layer.

      If the layer has a parent, the provided opacity is clamped so that it cannot be greater than the parent's opacity. The resulting opacity is applied to the underlying OpenLayers layer.

      If the layer is a GVGroupLayer, the computed opacity is recursively applied to all child layers to maintain consistency within the layer hierarchy.

      Optionally emits a layer opacity change event.

      Parameters

      • opacity: number

        The desired opacity for the layer, typically between 0 (fully transparent) and 1 (fully opaque).

      • emitOpacityChanged: boolean = true

        Optional, whether to emit a layer opacity change event after updating the opacity. Defaults to true.

      Returns void

    • Sets the parent layer

      Parameters

      • parent: GVGroupLayer | undefined

        The parent layer for the current layer if any.

      Returns void

    • Sets the visibility of the layer (true or false).

      Parameters

      • layerVisibility: boolean

        The visibility of the layer.

      Returns void