Layer

Vecta.Layer

new Vecta.Layer(id)

Creates a new layer or gets existing layer. Also adds a row to the layer dialog box.

NameTypeDescription
id

Methods

.delete(keep)

Deletes the layer. keep determines if we should move the shapes in the layer to the default layer, or simply remove them all. You cannot remove the default layer.

NameTypeDescription
keepboolean

.hidden(state) Returns: *

Get or set displaying of the layer.

NameTypeDescription
state

.name(val) Returns: string|Vecta.Layer

Set or get layer name. Automatically sets the name of the default layer regardless of what's passed in.

NameTypeDescription
val
Returns:

Returns the name when get or Vecta.Layer when set

.print(state) Returns: Vecta.Layer

Set or get printable status of the layer.

NameTypeDescription
state

.publish(state) Returns: *

Set layer to show or hide when a drawing is published. Also gets published status of layer.

NameTypeDescription
stateboolean

.select() Returns: Vecta.Layer

Select all shapes in the layer.