You can add a shape to the data source in the drawing tools by doing this:
var dataSource = drawingManager.getSource()
var shape = new atlas.data.Feature(
new atlas.data.Polygon([[
[-73.98235, 40.76799],
[-73.95785, 40.80044],
[-73.94928, 40.7968],
[-73.97317, 40.76437],
[-73.98235, 40.76799]
]])
)
dataSource.add(shape);
There isn't an official method yet to programmatically place this shape into edit mode, but it can be achieved by doing the following:
drawingManager.editHelper.edit(shape)
If you used the method above to programmatically put a shape into edit mode the ESC button won't work as the edit mode wasn't initiated as normal. To complete the edit, you can call the following undocumented method. You could even add a key press event handler on the map in the previous code block to add back support for ESC.
drawingManager.editHelper.finish()
Fully support for this scenario is planned to be added to the drawing tools this spring.