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.
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.
An XRLayer
.
layer
propertyIn 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 } });
Specification |
---|
WebXR Layers API Level 1 # dom-xrlayerevent-layer |
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 |
© 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