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

    Class AbstractBaseGVLayerAbstract

    Abstract Base GV Layer managing an OpenLayer layer, including a layer group.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    loadedOnce: boolean = false

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

    Methods

    • 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.

    • 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.

    • 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.

    • 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.

    • 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.

    • Overridable method to set the opacity of the 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 changed event after updating the opacity. Defaults to true.

      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

    • 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 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