MDN self-hosted library · e01.org

XRLayerEvent: layer property

WebXR Device API

Open notebook · 1 cells web-api-instance-property upstream source

WebXR Device API

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

Value

An XRLayer.

Examples

Using the layer property

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

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

Specifications

Browser compatibility

See also

  • XRLayer