Class Category<T, S>

A category contains user based items and is a special container. The container should not be created directly, but via the requestCategory API on the categories collection. Do not use toJSON to retrieve the state of a category, since categories outlive modules and may be changed with mergeOptions to no longer reflect your initial state. Requestors should keep track of the requested options themselves.

Type Parameters

  • T extends VcsObject | object = VcsObject | object

    the type of objects in this category

  • S extends object = object

    the serialized state of the object in this category

Hierarchy (view full)

Accessors

  • get className(): string
  • Returns string

  • get layer(): null | VectorLayer
  • Returns the layer of this collection. Caution, do not use the layer API to add or remove items. When adding items to the collection, the features are added to the layer async (timeout of 0), since there is weird behavior when removing and adding a feature with the same id in the same sync call.

    Returns null | VectorLayer

Constructors

Methods

  • Throws if typed, featureProperty and keyProperty do not match. Merges other options. Only merges: style, highlightStyle, zIndex & vectorProperties from layerOptions.

    Parameters

    Returns void

  • Parameters

    • moduleId: string

    Returns null | {
        items: object[];
        name: string;
    }

  • When setting the category, it MUST use the same uniqueKey as the previous collection (default is "name"). All items in the current collection will be destroyed and the current collection will be destroyed. The category will take complete ownership of the collection and destroy it once the category is destroyed. The collection will be turned into an OverrideCollection

    Parameters

    Returns void

Properties

_app: null | VcsApp = null
_layer: null | VectorLayer
[moduleIdSymbol]?: string
isDestroyed: boolean
name: string

unique Name

properties: Record<string, unknown>
title: string