SpatialAnchorStore SpatialAnchorStore SpatialAnchorStore SpatialAnchorStore SpatialAnchorStore Class

Definition

Represents a collection of SpatialAnchor objects stored by Windows on behalf of an app.

public : sealed class SpatialAnchorStore
struct winrt::Windows::Perception::Spatial::SpatialAnchorStore
public sealed class SpatialAnchorStore
Public NotInheritable Class SpatialAnchorStore
// This class does not provide a public constructor.
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10586.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)

Remarks

This lets an app persist SpatialAnchors and then load them back again during a future app session. The app is responsible for keeping track of which identifiers represent which logical locations within the app, for example associating an anchor with a hologram that should be displayed there.

To request the app's SpatialAnchorStore, use the SpatialAnchorManager class.

Methods

Clear() Clear() Clear() Clear() Clear()

Clears all anchors in the app's anchor store.

GetAllSavedAnchors() GetAllSavedAnchors() GetAllSavedAnchors() GetAllSavedAnchors() GetAllSavedAnchors()

Gets a map of all anchors saved in the store, with their identifiers as the keys.

Remove(String) Remove(String) Remove(String) Remove(String) Remove(String)

Removes a specific anchor from the store. The anchor is specified by its identifier.

TrySave(String, SpatialAnchor) TrySave(String, SpatialAnchor) TrySave(String, SpatialAnchor) TrySave(String, SpatialAnchor) TrySave(String, SpatialAnchor)

Persists an anchor to the store.