A map that is read-only and delegates operations to an underlying ObservableMap.

Type Parameters

  • K

    The type of the keys in the map.

  • V

    The type of the values in the map.

Hierarchy (view full)

Constructors

Properties

_handles: Handles<unknown, ResourceHandle>
_originalMap: ObservableMap<K, V>

The underlying map that this object is delegating to.

[toStringTag] = "ObservableMap"

Used by Object.toString().

@eventTypes: MapEvents<K, V>

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

Accessors

  • get size(): number
  • The number of elements.

    Returns number

Methods

  • Returns the [key, value] pairs for each element in the map in insertion order.

    Returns MapIterator<[K, V]>

  • Removes the specified element.

    Parameters

    • key: K

      The element's key.

    Returns boolean

    True if an element was deleted, otherwise false.

  • Emits an event on the instance. This method should only be used when creating subclasses of this class.

    Type Parameters

    Parameters

    Returns boolean

    true if a listener was notified

    4.5

  • Returns the [key, value] pairs for each element in the map in insertion order.

    Returns MapIterator<[K, V]>

  • Executes a provided function once per each key/value pair in the map.

    Parameters

    • callbackfn: ((value: V, key: K, map: Map<K, V>) => void)

      Function to execute for each element.

        • (value, key, map): void
        • Parameters

          • value: V
          • key: K
          • map: Map<K, V>

          Returns void

    • OptionalthisArg: unknown

      Value to use as this when executing callback.

    Returns void

  • Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.

    Parameters

    • key: K

    Returns V

    Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.

  • Indicates whether or not an element with the specified key exists.

    Parameters

    • key: K

      The key to test for.

    Returns boolean

  • Returns the keys for each element in the map in insertion order.

    Returns MapIterator<K>

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

    Type Parameters

    Parameters

    • type: Type

      An event or an array of events to listen for.

    • listener: EventedCallback<MapEvents<K, V>[Type]>

      The function to call when the event fires.

    Returns IHandle

    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);
    });
  • Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.

    Parameters

    • key: K
    • value: V

    Returns this

  • Returns a serializable representation of the map.

    Returns unknown

  • Returns the values for each element in the map in insertion order.

    Returns MapIterator<V>