Example of using the ol.interaction.Draw interaction.
See the draw-features.js source to see how this is done.