IObservableMap | Matterport SDK
Usage of the SDK constitutes your agreement with the Matterport SDK Agreement. Email with any questions.

A map that can have its changes observed via subscribing an IMapObserver

For each observer subscribed to this IObservableMap:

  • observer.onAdded will be called when an item is added to the collection
  • observer.onRemoved will be called when an item is removed from the collection
  • observer.onUpdated will be called when an item has some of its properties changed
  • observer.onCollectionUpdated will be called when some set of the above events have occured (item added/removed/updated)

When first subscribing, the observers' onAdded will be called for each item in the collection, and then again as items are added. Alternatively, the onCollectionUpdated will always give an up-to-date view of the collection. onCollectionUpdated, on first subscription, will be called once with the entire collection, and then again as changes to the collection occur.

Type parameters

  • ItemT

    The type of the items in the map being observed.


  • IObservableMap





  • Subscribe to changes in this map. When this observable detects a change, the observer provided will have its onAdded, onRemoved, and/or onUpdated called.


    Returns ISubscription

    A subscription that can be used to remove the subscribed observer.