Hierarchy
-
IObservable<View.View>
- View
Index
Properties
Readonly active
Readonly id
the unique id of the View
Readonly layers
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
the human-readable name of the View
Methods
addLayer
-
Add an existing Layer to this View
view.addLayer(layer);
Parameters
-
layer: View.Layer
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
-
layer: View.Layer
Returns boolean
-
removeLayer
-
Remove a Layer from this View
view.removeLayer(layer);
Parameters
-
layer: View.Layer
Returns Promise<void>
-
setActive
-
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
-
Subscribe to changes on this object. When this observable detects a change, the
observer
provided will be called with the data associated with this observable.Parameters
-
observer: IObserver<View.View> | ObserverCallback<View.View>
Returns ISubscription
A subscription that can be used to remove the subscribed observer.
-
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 thecondition
returns true, the returned Promise will be resolved.Parameters
-
condition: ICondition<View.View> | ConditionCallback<View.View>
Returns Promise<View.View>
A promise that is resolved when
condition
returns true. -
whether this is the active View or not