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

Hierarchy

Index

Properties

Readonly active

active: boolean

whether this is the active View or not

Readonly id

id: string

the unique id of the View

Readonly layers

layers: IterableIterator<View.Layer>

An iterator over the set of Layers associated with this View

for (const layer of view.layers) {
  console.log(`${view.id} has layer ${layer.id}`);
}

Readonly name

name: string

the human-readable name of the View

Methods

addLayer

  • Add a Layer to this View

    view.addLayer(layer);
    

    Parameters

    Returns Promise<void>

hasLayer

  • Test if this View has a Layer associate with it

    if (view.hasLayer(layer)) {
      console.log(`${view.id} has layer ${layer.id}`);
    }
    

    Parameters

    Returns boolean

removeLayer

  • Remove a Layer from this View

    view.removeLayer(layer);
    

    Parameters

    Returns Promise<void>

setActive

  • setActive(returnToStart?: undefined | false | true): Promise<void>
  • Set this View as the currently active one optionally, returning to the start location for the new View.

    Only one View can be active at a time.

    const view: View; // ... acquired through previous usage of `mpSdk.View.views`
    await view.setActive(true); // set the active view and return to the start location
    

    Parameters

    • Optional returnToStart: undefined | false | true

    Returns Promise<void>

subscribe

waitUntil

  • Wait for a specific condition on this object to be met. When this observable detects a change, the condition provided will be called. When the condition returns true, the returned Promise will be resolved.

    Parameters

    Returns Promise<void>

    A promise that is resolved when condition returns true.