Backing implementation of mapping/support/_SublayerExtensionCollection!SublayerExtensionCollection. Used by LayerExtension and SublayerExtension.

Hierarchy (view full)

Implements

Constructors

Properties

_parent: Observable

The parent that owns this collection.

@eventTypes: CollectionEvents<SublayerExtension<SublayerExtensionProperties>>

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.

Accessors

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

  • Type Parameters

    • T

    Parameters

    • propertyName: string
    • value: T

    Returns this

    • Unsupported on CollectionProxy.
  • Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.

    // Manually manage handles
    const handle = reactiveUtils.when(
    () => !view.updating,
    () => {
    wkidSelect.disabled = false;
    },
    { once: true }
    );

    this.addHandles(handle);

    // Destroy the object
    this.destroy();

    Type Parameters

    • T

    Parameters

    • handles: IHandle | IHandle[]
    • OptionalgroupKey: Exclude<T, ResourceHandle>

      Key identifying the group to which the handles should be added. All the handles in the group can later be removed with removeHandles(). If no key is provided the handles are added to a default group.

    Returns void

    4.25

  • Adds multiple items to the collection.

    Parameters

    • items: ReadonlyArrayOrCollection<SublayerExtension<SublayerExtensionProperties>>

      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

  • Removes all event listeners and destroys the collection.

    Returns void

  • 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

    Returns number

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

  • Type Parameters

    • T

    Parameters

    • propertyPath: string

    Returns T

    • Unsupported on CollectionProxy.
  • Parameters

    • propertyPath: string

    Returns unknown

    • Unsupported on CollectionProxy.
  • Returns true if a named group of handles exist.

    Type Parameters

    • T

    Parameters

    • OptionalgroupKey: Exclude<T, ResourceHandle>

      A group key.

    Returns boolean

    Returns true if a named group of handles exist.

    4.25

    // Remove a named group of handles if they exist.
    if (obj.hasHandles("watch-view-updates")) {
    obj.removeHandles("watch-view-updates");
    }
  • Returns the index of an element in the collection.

    Parameters

    • searchElement: SublayerExtension<SublayerExtensionProperties>

      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: SublayerExtension<SublayerExtensionProperties>

      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

    Returns Collection<U>

  • Registers an event handler on the instance. Call this method to hook an event with a listener.

    Type Parameters

    Parameters

    Returns ResourceHandle

    Returns an event handler with a remove() method that should be called to stop listening for the event(s).

    Property Type Description
    remove Function When called, removes the listener from the event.
    view.on("click", function(event){
    // event is the event handle returned after the event fires.
    console.log(event.mapPoint);
    });
  • Invoked by the parent whenever the associated layer extension is updated.

    Returns void

  • Invoked by the parent object when it is initialized.

    Returns void

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

    Type Parameters

    • U

    Parameters

    Returns U

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

    Type Parameters

    • U

    Parameters

    Returns U

  • Removes a group of handles owned by the object.

    Type Parameters

    • T

    Parameters

    • OptionalgroupKey: Exclude<T, ResourceHandle>

      A group key or an array or collection of group keys to remove.

    Returns void

    4.25

    obj.removeHandles(); // removes handles from default group

    obj.removeHandles("handle-group");
    obj.removeHandles("other-handle-group");
  • Type Parameters

    • T

    Parameters

    • propertyPath: string
    • value: T

    Returns this

    • Unsupported on CollectionProxy.
  • Parameters

    • properties: HashMap<unknown>

    Returns this

    • Unsupported on CollectionProxy.
  • 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.