W3cubDocs

/Web APIs

XRLayerEvent: layer property

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

The layer property of the XRLayerEvent interface is a reference to the XRLayer which generated the event.

Value

Examples

Using the layer property

In this example, the layer property is used to obtain the XRLayer object that sent the event.

js

myLayer.addEventListener("redraw", (e) => {
  if (typeof e.layer === "XRQuadLayer") {
    // redraw quad layer
  }
});

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
layer No No No No No No No No No No No No

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/XRLayerEvent/layer