Provides logical grouping of Element objects.
Layers are commonly used to group objects in the drawing by function (e.g. walls, furniture, etc.), but in principle they can represent any type of virtual grouping. All objects in a layer share appearance, can be shown and hidden together. A drawing element can only belong to one layer.
The drawing layer holds an isVisible attribute, which is true by default.
new Layer(
name?):Layer
string
Added name.
Layer
isVisible:
boolean=true
Indicates whether the drawing layer is visible or not.
get id():
bigint
Returns object id.
bigint
get name():
string|null
Returns name of the drawing layer. null if the drawing layer has no name (by default).
string | null
set name(
name):void
Sets name of the drawing layer.
Name of the drawing layer.
string | null
void
get uuid():
`${string}-${string}-${string}-${string}-${string}`|null
Returns uuid of the drawing layer. null if the drawing layer has no assigned uuid (by default).
`${string}-${string}-${string}-${string}-${string}` | null
set uuid(
uuid):void
Sets uuid of the drawing layer.
Uuid of the drawing layer.
`${string}-${string}-${string}-${string}-${string}` | null
void
accept(
visitor):void
Applies a visitor for drawing elements.
Applied drawing element visitor.
void
add(
element):void
Adds element to the drawing layer.
Added drawing element.
void
contains(
element):boolean
Returns true if element has already been added to the drawing layer.
Drawing element.
boolean
remove(
element):boolean
Removes element from the drawing layer.
Removed drawing element.
boolean