60002149 I want to add a layer in vdWebLibrary using javascript code

Article 60002149
Type Wish
Product WebJS
Version 6027
Date Added 2/17/2014 12:00:00 AM
Fixed (2/17/2014 12:00:00 AM)
Submitted by Michael Feldman

Summary

I want to add a layer in vdWebLibrary using javascript code while using the library.

Solution

In version 6028 a new function was added to the web library with which a new layer can be added to the document, AddLayer().

Example

var vdcanvas = vdmanager.vdrawObject('canvas');
var layer = vdcanvas.AddLayer("layername");

var c = vdcanvas.AddCircle([0 ,0 ,0], 1, false);
c.Layer = "h_" + layer.HandleId.toString();
		
vdcanvas.redraw();

Send comments on this topic.