evCreate API 5.7 Help

AddLayer Function

Adds a new layer to a given page in an Envision document currently opened in the Canvas Envision Creator app.

AddLayer(page: [[[EvItem|canvas-envision-document-items.html#page-items]]], atIndex?: number, name?: string): Promise<[[[EvItem|canvas-envision-document-items.html#layer-items]]]>

Parameters

page: EvItem

A Page item object of a page in the Envision document currently opened in the Canvas Envision Creator app to which the new layer should be added.

atIndex?: number

A number, a position where the new layer will be added to the stack of layers on the page. If it is not specified, the new layer will be the topmost. The layer position in the stack is a zero-based index that is 0 for the topmost layer and increases by 1 for each following layer going down the stack.

name?: string

A string, the name of the new layer. If it is not specified, the system generates the layer name.

Return value

Promise<EvItem>

A Promise that, if fulfilled, resolves to a Layer item object of the layer successfully added to the given page in the current Envision document.

13 March 2025