Class LayerCollection

A collection of layers. Manages rendering order and layer exclusivity. Emits state changes for convenience. Passed to Map for layers available to said map. Layers must have unique names.

Hierarchy

Accessors

  • get previousIndexSymbol(): symbol
  • Get the symbol which is attached to an item prior to its removal. If an item is removed, the current index of the item is set on the item with this symbol.

    Returns symbol

  • get uniqueKey(): undefined | keyof T
  • The key by which to check uniqueness against. undefined if no uniqueness constraint is set.

    Returns undefined | keyof T

  • get zIndexSymbol(): symbol
  • A symbol to describe the local z index of a layer. The local z index must not equal the layers z index, but is always consistent in comparison to the neighbouring layers. If a layer is moved other then by z index, the collection ensures consistency by setting a new local z index if needed.

    Returns symbol

Constructors

Methods

  • Private

    Determines the location in the array before the first entry with a higher local z index or null if there is no such position

    Parameters

    • zIndex: number

    Returns null | number

  • Adds a layer to the collection. Can optionally be passed an index at which to insert the layer. The layer locale will be set to the same locale of the layerCollection. This will trigger a forceRedraw of the layer if the layer locale is different and the layer is locale aware.

    Parameters

    Returns null | number

    returns the layer index or null, if the layers name is not unique

  • Returns true, if the key exists. Returns undefined, if there is no uniqueness constraint.

    Parameters

    • value: unknown

    Returns undefined | boolean

Properties

_globalHider: GlobalHider

The global hider for this collection.

_layerEventListeners: Record<string, (() => void)[]>
_locale: string

Locale for this layerCollection, will be synchronized by the vcsApp, if part of an vcsApp. This Locale will be set on all Member Layers. On setting the Locale this will trigger a reload of all locale aware layers.

_zIndexSymbol: symbol

Event raised if an item is added. Is passed the added item.

exclusiveManager: ExclusiveManager

The exclusive manager for this collection. Layers within this collection are automatically added and tracked.

Event raised if an item is relocated within the collection. Is passed the moved item.

Event raised if an item is removed. Is passed the removed item.

Event raised, when a layer of this collection changes its state. Passed the layer.

Generated using TypeDoc