View | Matterport SDK
Usage of the SDK constitutes your agreement with the Matterport SDK Agreement. Email developers@matterport.com with any questions.

Index

Interfaces

Properties

Methods

Properties

current

earlyaccess

The currently active view

mpSdk.View.current.subscribe((currentView) => {
  console.log('the currently active view is', currentView.name);
});

layers

All layers associated with the current space.

Layers in inactive Views may not populate right away. Activating a View will trigger the Layers to populate.

mpSdk.View.layers.subscribe({
  onAdded(index, layer, collection) {
    console.log('a layer with id', layer.id, 'named', layer.name);
  },
  onCollectionUpdated(collection) {
    console.log('all layers', collection);
  },
});

views

earlyaccess

All views associated with the current space.

mpSdk.View.views.subscribe({
  onAdded(index, view, collection) {
    console.log('a view with id', view.id, 'named', view.name);
  },
  onCollectionUpdated(collection) {
    console.log('all views', collection);
  },
});

Methods

createLayer

  • Create a layer that can be later added to a View or Views

    const layer = await mpSdk.View.createLayer('my layer');
    

    Parameters

    • name: string

    Returns Promise<View.Layer>