@dmp/map-components
    Preparing search index...

    Class Collection

    Hierarchy

    Index

    Constructors

    • Parameters

      Returns Collection

    Properties

    disposed: boolean

    The object has already been disposed.

    on: CollectionOnSignature<Dataset | DatasetGroup, EventsKey>
    once: CollectionOnSignature<Dataset | DatasetGroup, EventsKey>
    un: CollectionOnSignature<Dataset | DatasetGroup, void>

    Accessors

    • get length(): number

      The length of the collection. Shorthand for getLength

      Returns number

    • set length(length: number): void

      Change the length of the collection

      Parameters

      • length: number

      Returns void

    Methods

    • Add a Dataset to the collection

      Parameters

      Returns number

      New length of the collection.

    • Parameters

      • key: string

        Key name.

      • listener: Listener

        Listener.

      Returns void

    • Parameters

      • type: string

        Type.

      • listener: Listener

        Listener.

      Returns void

    • Protected

      Apply any properties from another object without triggering events.

      Parameters

      • source: BaseObject

        The source object.

      Returns void

    • Increases the revision counter and dispatches a 'change' event.

      Returns void

    • Remove all elements from the collection.

      Returns void

    • Dispatches an event and calls all listeners listening for events of this type. The event parameter can either be a string or an Object with a type property.

      Parameters

      • event: string | BaseEvent

        Event object.

      Returns undefined | boolean

      false if anyone called preventDefault on the event object or if any of the listeners returned false.

    • Clean up.

      Returns void

    • Protected

      Extension point for disposable objects.

      Returns void

    • Iterate over each element, calling the provided callback.

      Parameters

      • f: (
            arg0: Dataset | DatasetGroup,
            arg1: number,
            arg2: (Dataset | DatasetGroup)[],
        ) => any

        The function to call for every element. This function takes 3 arguments (the element, the index and the array). The return value is ignored.

      Returns void

    • Gets a value.

      Parameters

      • key: string

        Key name.

      Returns any

      Value.

    • Get a reference to the underlying Array object. Warning: if the array is mutated, no events will be dispatched by the collection, and the collection's "length" property won't be in sync with the actual length of the array.

      Returns (Dataset | DatasetGroup)[]

      Array.

    • Get a list of object property names.

      Returns string[]

      List of property names.

    • Get the length of this collection.

      Returns number

      The length of the array.

    • Get the listeners for a specified event type. Listeners are returned in the order that they will be called in.

      Parameters

      • type: string

        Type.

      Returns undefined | Listener[]

      Listeners.

    • Get an object of all property names and values.

      Returns { [x: string]: any }

      Object.

    • Get an object of all property names and values.

      Returns null | { [x: string]: any }

      Object.

    • Get the version number for this object. Each time the object is modified, its version number will be incremented.

      Returns number

      Revision.

    • Parameters

      • Optionaltype: string

        Type. If not provided, true will be returned if this event target has any listeners.

      Returns boolean

      Has listeners.

    • Returns boolean

      The object has properties.

    • Insert an element at the provided index.

      Parameters

      Returns void

    • Get the element at the provided index.

      Parameters

      • index: number

        Index.

      Returns Dataset | DatasetGroup

      Element.

    • Move a Dataset in the collection to at specific postion

      Parameters

      • from: number

        Index of the Dataset to move

      • to: number

        The index the Dataset will be moved to

      Returns void

    • Parameters

      • key: string

        Key name.

      • oldValue: any

        Old value.

      Returns void

    • Protected

      Parameters

      • type: string | string[]

        Type.

      • listener: (arg0: Event | BaseEvent) => unknown

        Listener.

      Returns EventsKey | EventsKey[]

      Event key.

    • Protected

      Parameters

      • type: string | string[]

        Type.

      • listener: (arg0: Event | BaseEvent) => unknown

        Listener.

      Returns EventsKey | EventsKey[]

      Event key.

    • Remove the last element of the collection and return it. Return undefined if the collection is empty.

      Returns undefined | Dataset | DatasetGroup

      Element.

    • Insert the provided element at the end of the collection.

      Parameters

      Returns number

      New length of the collection.

    • Remove the element at the provided index and return it. Return undefined if the collection does not contain this index.

      Parameters

      • index: number

        Index.

      Returns undefined | Dataset | DatasetGroup

      Value.

    • Parameters

      • key: string

        Key name.

      • listener: Listener

        Listener.

      Returns void

    • Parameters

      • type: string

        Type.

      • listener: Listener

        Listener.

      Returns void

    • Sets a value.

      Parameters

      • key: string

        Key name.

      • value: any

        Value.

      • Optionalsilent: boolean

        Update without triggering an event.

      Returns void

    • Set the element at the provided index.

      Parameters

      Returns void

    • Sets a collection of key-value pairs. Note that this changes any existing properties and adds new ones (it does not remove any existing properties).

      Parameters

      • values: { [x: string]: any }

        Values.

      • Optionalsilent: boolean

        Update without triggering an event.

      Returns void

    • Protected

      Unlisten for a certain type of event.

      Parameters

      • type: string | string[]

        Type.

      • listener: (arg0: Event | BaseEvent) => unknown

        Listener.

      Returns void

    • Unsets a property.

      Parameters

      • key: string

        Key name.

      • Optionalsilent: boolean

        Unset without triggering an event.

      Returns void