A read-only view of a data/FeatureSet!FeatureSet that supports sorting and filtering. This is a "live" view that is updated as the underlying feature set changes.

Hierarchy (view full)

Implements

Constructors

Properties

_handles: Handles<unknown, ResourceHandle>
@eventTypes: CollectionEvents<Feature>

Do not directly reference this property. Use EventNames and EventTypes helpers from @arcgis/core/Evented.

declaredClass: string = "esri.core.Collection"

The declared class name. This is always "esri.core.Collection" for compatibility with Esri's API.

featureSet: FeatureSet

The backing set of features contained in this list.

id: string

The unique ID for this entity.

title: string

A human-readable name for the feature list.

Accessors

  • get _collection(): Collection<T>
  • The underlying collection that this class delegates to.

    Returns Collection<T>

  • set _collection(collection): void
  • Parameters

    • collection: Collection<T>

    Returns void

  • get destroyed(): boolean
  • Whether the collection has been destroyed.

    Returns boolean

  • set destroyed(value): void
  • Parameters

    • value: boolean

    Returns void

  • get initialized(): boolean
  • Whether the collection has been initialized.

    Returns boolean

  • set initialized(value): void
  • Set to true once the initialize function has executed.

    Parameters

    • value: boolean

    Returns void

  • get itemType(): string
  • The item type for this entity when it participates in an App.

    Returns string

  • get length(): number
  • The number of items in the collection.

    Returns number

Methods

  • Parameters

    • propertyName: string

    Returns any

    • Unsupported on CollectionProxy.
  • Type Parameters

    • T

    Parameters

    • propertyName: string

    Returns T

  • Invoked whenever the underlying feature set has changed.

    Parameters

    Returns void

  • Type Parameters

    • T

    Parameters

    • propertyName: string
    • value: T

    Returns this

    • Unsupported on CollectionProxy.
  • Adds a single item to the collection.

    Parameters

    • _item: Feature
    • Optional_index: number

    Returns this

  • Adds multiple items to the collection.

    Parameters

    • items: ReadonlyArrayOrCollection<Feature>

      An array or collection of items to add.

    • Optionalindex: number

      Zero-based index of where in the collection to add the items. If not specified, the items will be added at the end.

    Returns this

  • Filters the list in place to only include items that match the given criteria.

    Parameters

    Returns void

  • Sets the properties for this item.

    This version will also await any asynchronous logic that is needed to set the properties.

    Parameters

    • properties: Partial<FeatureListProperties>

      A plain object containing property values to set, keyed by property name.

    Returns Promise<void>

  • Returns the item at the specified index.

    Parameters

    • index: number

      Zero-based index of the item in the Collection to retrieve.

    Returns Feature

    The item in the Collection stored at the specified index.

  • Creates a deep clone of the Collection. To create a shallow clone of the collection, use slice().

    Returns Collection<Feature>

  • Creates a new Collection containing the items in the original Collection joined with the items in the input array or Collection.

    Parameters

    • value: Feature[] | Collection<Feature>

      The array or Collection to append to the existing Collection.

    Returns Collection<Feature>

  • Removes all event listeners and destroys the collection.

    Returns void

  • Parameters

    • callback: ItemCallback<Feature>
    • OptionalthisArg: any

    Returns void

  • Determines whether all items in the Collection pass a test defined by callback. Each item in the Collection is passed into the callback until one returns a value of false.

    Parameters

    Returns boolean

  • Filters the Collection's items based on a test defined by the callback function. Each item is passed into the callback function, which returns true if the item passes the test and false if it does not.

    Parameters

    • callback: ItemTestCallback<Feature>

      The function that defines a test for determining whether to return the item in a new Collection.

    Returns Collection<Feature>

  • Returns an item in the Collection if that item passes a test as defined in the callback function. Each item is passed into the callback function, which returns true if the item passes the test and false if it does not.

    Parameters

    • callback: ItemTestCallback<Feature>

      The testing function that will assess each item in the Collection. Returns true if an item passes the test and false if it fails.

    Returns Feature

  • Returns the index of an item in the Collection if that item passes a test as defined in the callback function. Each item is passed into the callback function, which returns true if the item passes the test and false if it does not.

    Parameters

    • callback: ItemTestCallback<Feature>

      The testing function that will assess each item in the Collection. Returns true if an item passes the test and false if it fails.

    Returns number

    Returns the index of the Collection item that satisfies the test function. If an item fails the test, -1 is returned.

  • Waits for all deserialization logic initiated thus far to finish, whether invoked by passing properties into the constructor, or by invoking assignProperties() or assignPropertiesAsync().

    Returns Promise<void>

  • Flattens a hierarchical Collection containing at least one child collection. Each item in the collection is passed into the callback function, which should check for child collections specified by the developer. A flat collection of all items (parent and children) is returned.

    Parameters

    Returns Collection<Feature>

  • Executes the input function for each item in the Collection.

    Parameters

    • callback: ItemCallback<Feature>

      The function to call for each item in the Collection.

    Returns void

  • Type Parameters

    • T

    Parameters

    • propertyPath: string

    Returns T

    • Unsupported on CollectionProxy.
  • Parameters

    • propertyPath: string

    Returns unknown

    • Unsupported on CollectionProxy.
  • Returns the item at the specified index.

    Parameters

    • index: number

      Zero-based index of the item in the Collection to retrieve.

    Returns Feature

    The item in the Collection stored at the specified index.

  • Type Parameters

    • T

    Parameters

    • OptionalgroupKey: Exclude<T, ResourceHandle>

    Returns boolean

  • Tests if an item is present in the Collection.

    Parameters

    • searchElement: Feature

      The item to search for in the collection.

    Returns boolean

  • Returns the index of an element in the collection.

    Parameters

    • searchElement: Feature

      Item to search for in the collection.

    • OptionalfromIndex: number

      Use if you don't want to search the whole collection or you don't want to search from the start.

    Returns number

  • Creates a string representation of the items in the Collection.

    Parameters

    • Optionalseparator: string

      The separator used between each item in the final string. The default is ",".

    Returns string

  • Returns the last index of an element in the collection.

    Parameters

    • searchElement: Feature

      Item to search for in the collection.

    • OptionalfromIndex: number

      Use if you don't want to search the whole collection, or you don't want to search from the end.

    Returns number

    The location of the last match found in the collection, or -1 if there is no match.

  • Passes each Collection item into the callback function and returns a new array of the returned values.

    Type Parameters

    • U

    Parameters

    • callback: ItemMapCallback<Feature, U>

      The function that processes each item in the Collection and returns a new value at the same index of the original item.

    Returns Collection<U>

  • Adds an item to the end of the collection.

    Parameters

    Returns number

  • Reduces all items in the collection (from left to right) into a single variable using callback.

    Type Parameters

    • U

    Parameters

    • callback: ItemReduceCallback<Feature, U>

      The function that processes each item in the Collection and appends it to the previous item.

    • OptionalinitialValue: U

      Item to use as the first element to process in callback.

    Returns U

  • Reduces all items in the collection (from right to left) into a single variable using callback.

    Type Parameters

    • U

    Parameters

    • callback: ItemReduceCallback<Feature, U>

      The function that processes each item in the Collection and appends it to the previous item.

    • OptionalinitialValue: U

      Item to use as the first element to process in callback.

    Returns U

  • Removes any filter that was applied via applyFilter.

    Returns void

  • Type Parameters

    • T

    Parameters

    • OptionalgroupKey: Exclude<T, ResourceHandle>

    Returns void

  • Removes each item in the input array. If an item is present multiple times in the collection, only the first occurrence is removed.

    Parameters

    • items: ReadonlyArrayOrCollection<Feature>

      The items to remove.

    Returns Feature[]

  • Moves an item in the Collection to a specified index. The change event is fired after an item is moved in the Collection.

    Parameters

    Returns Feature

  • Type Parameters

    • T

    Parameters

    • propertyPath: string
    • value: T

    Returns this

    • Unsupported on CollectionProxy.
  • Parameters

    • properties: HashMap<unknown>

    Returns this

    • Unsupported on CollectionProxy.
  • Removes the first item from the collection (at index 0), and returns it. The remaining items of the collection are then shifted down one index from their previous location.

    Returns Feature

  • Creates a new Collection comprised of a portion of the original Collection.

    Parameters

    • Optionalbegin: number

      The index of the first item to extract.

    • Optionalend: number

      The index of the last item to extract.

    Returns Collection<Feature>

  • Determines whether an item in the Collection passes a test defined by callback. Each item in the Collection is passed into the callback until one returns a value of true.

    Parameters

    Returns boolean

  • Removes existing items and/or adds new items to the collection.

    Parameters

    • _start: number
    • _deleteCount: number
    • Rest..._items: Feature[]

    Returns Feature[]

    An array of the deleted items formerly part of the collection.

  • Creates an item:// URI reference to this entity.

    Returns string

  • Adds an item to the beginning of the collection.

    Parameters

    Returns number

  • Parameters

    • path: string | string[]
    • callback: ((newValue: any, oldValue: any, propertyName: string, target: any) => void)
        • (newValue, oldValue, propertyName, target): void
        • Parameters

          • newValue: any
          • oldValue: any
          • propertyName: string
          • target: any

          Returns void

    • Optionalsync: boolean

    Returns IHandle

    • Unsupported on CollectionProxy.