XRLayerEvent: thuộc tính layer

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

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

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Thuộc tính layer của giao diện XRLayerEvent là một tham chiếu đến XRLayer đã tạo ra sự kiện.

Giá trị

Một XRLayer.

Ví dụ

Sử dụng thuộc tính layer

Trong ví dụ này, thuộc tính layer được sử dụng để lấy đối tượng XRLayer đã gửi sự kiện.

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

Thông số kỹ thuật

Specification
WebXR Layers API Level 1
# dom-xrlayerevent-layer

Tương thích trình duyệt

Xem thêm