PilotGaea 2D O'view
    正在準備搜尋索引...

    類別 Collection<T>

    An expanded version of standard JS Array, adding convenience methods for manipulation. Add and remove changes to the Collection trigger a Collection event. Note that this does not cover changes to the objects within the Collection; they trigger events on the appropriate object, not on the Collection as a whole.

    ol.Collection.Event

    Array.

    stable

    類型參數

    • T

    層級 (查看層級一覽)

    索引

    方法

    • Removes an event listener using the key returned by on() or once().

      參數

      • key: Object | Object[]

        The key returned by on() or once() (or an array of keys).

      回傳 void

      stable

    • Remove all elements from the collection.

      回傳 void

      stable

    • Add elements to the collection. This pushes each item in the provided array to the end of the collection.

      參數

      • arr: T[]

        Array.

      回傳 ol.Collection<T>

      This collection.

      stable

    • Iterate over each element, calling the provided callback.

      類型參數

      • S

      參數

      • f: (item: T, index: number, array: T[]) => 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.

      • 可選opt_this: S

        The object to use as this in f.

      回傳 void

      stable

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

      回傳 T[]

      Array.

      stable

    • Get the element at the provided index.

      參數

      • index: number

        Index.

      回傳 T

      Element.

      stable

    • Get the length of this collection.

      回傳 number

      The length of the array.

      stable

    • Insert an element at the provided index.

      參數

      • index: number

        Index.

      • elem: T

        Element.

      回傳 void

      stable

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

      回傳 T

      Element.

      stable

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

      參數

      • elem: T

        Element.

      回傳 number

      Length.

      stable

    • Remove the first occurrence of an element from the collection.

      參數

      • elem: T

        Element.

      回傳 T

      The removed element or undefined if none found.

      stable

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

      參數

      • index: number

        Index.

      回傳 T

      Value.

      stable

    • Set the element at the provided index.

      參數

      • index: number

        Index.

      • elem: T

        Element.

      回傳 void

      stable

    • Gets a value.

      參數

      • key: string

        Key name.

      回傳 any

      Value.

      stable

    • Get a list of object property names.

      回傳 string[]

      List of property names.

      stable

    • Get an object of all property names and values.

      回傳 { [k: string]: any }

      Object.

      stable

    • Sets a value.

      參數

      • key: string

        Key name.

      • value: any

        Value.

      • 可選opt_silent: boolean

        Update without triggering an event.

      回傳 void

      stable

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

      參數

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

        Values.

      • 可選opt_silent: boolean

        Update without triggering an event.

      回傳 void

      stable

    • Unsets a property.

      參數

      • key: string

        Key name.

      • 可選opt_silent: boolean

        Unset without triggering an event.

      回傳 void

      stable

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

      回傳 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.

      參數

      回傳 void

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

      回傳 number

      Revision.

    • Listen for a certain type of event.

      參數

      • type: string | string[]

        The event type or array of event types.

      • listener: Function

        The listener function.

      • 可選opt_this: Object

        The object to use as this in listener.

      回傳 Object | Object[]

      Unique key for the listener. If called with an array of event types as the first argument, the return will be an array of keys.

      stable

    • Listen once for a certain type of event.

      參數

      • type: string | string[]

        The event type or array of event types.

      • listener: Function

        The listener function.

      • 可選opt_this: Object

        The object to use as this in listener.

      回傳 Object | Object[]

      Unique key for the listener. If called with an array of event types as the first argument, the return will be an array of keys.

      stable

    • Unlisten for a certain type of event.

      參數

      • type: string | string[]

        The event type or array of event types.

      • listener: Function

        The listener function.

      • 可選opt_this: Object

        The object which was used as this by the listener.

      回傳 void

      stable

    • 函數

      Removes an event listener using the key returned by on() or once(). Note that using the ol.Observable.unByKey static function is to be preferred.

      參數

      • key: Object | Object[]

        The key returned by on() or once() (or an array of keys).

      回傳 void

      stable

    構造函數

    • 類型參數

      • T

      參數

      • 可選opt_array: T[]

        Array.

      回傳 ol.Collection<T>

      An expanded version of standard JS Array, adding convenience methods for manipulation. Add and remove changes to the Collection trigger a Collection event. Note that this does not cover changes to the objects within the Collection; they trigger events on the appropriate object, not on the Collection as a whole.

      ol.Collection.Event

      stable