Skip to content

GridLayer.id

Summary

GridLayer.id is the unique key OverlaySystem uses to register and remove the grid layer. Use deterministic IDs to make layer replacement predictable.

Syntax

GridLayer.id: string
const id = layer.id;

Parameters

This property does not take parameters.

Returns

string - Layer identifier.

Type Details

// Read-only string property.

Example

const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);

const layer = wgpu.createOverlay.grid({ id: "grid-main" });
console.log(layer.id);

See Also