W3cubDocs

/Web APIs

XRAnchorSet

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The XRAnchorSet interface exposes a collection of anchors. Its instances are returned by XRFrame.trackedAnchors and are Set-like objects.

Instance properties

See Set for details.

Instance methods

See Set for details.

Examples

Handling anchor tracking loss

js

const trackedAnchors = frame.trackedAnchors;

for (const anchor of previousFrameAnchors) {
  if (!trackedAnchors.has(anchor)) {
    // Handle anchor tracking loss
  }
}

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
@@iterator 85 85 No No 71 No No 85 No 60 No 14.0
XRAnchorSet 85 85 No No 71 No No 85 No 60 No 14.0
entries 85 85 No No 71 No No 85 No 60 No 14.0
forEach 85 85 No No 71 No No 85 No 60 No 14.0
has 85 85 No No 71 No No 85 No 60 No 14.0
keys 85 85 No No 71 No No 85 No 60 No 14.0
size 85 85 No No 71 No No 85 No 60 No 14.0
values 85 85 No No 71 No No 85 No 60 No 14.0

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/XRAnchorSet