I am starting to convert old code of OpenLayers 2 to OpenLayers 3. In the old version you could make polygon shape based of the amount of sides like in the example below:
http://jsfiddle.net/r9g1odce/4/
I was looking for the same functionality in OpenLayers 3 but couldn't find any... is there something I am missing?
The best example I found for drawing and modifying features is here but there is no square shape:
http://acanimal.github.io/thebookofopenlayers3/chapter07_07_editing_features.html
The code I am using for polygon drawing is:
drawInteraction = new ol.interaction.Draw({
features: featureOverlay.getFeatures(),
type: /** @type {ol.geom.GeometryType} */ ('Polygon')
});
map.addInteraction(drawInteraction);
The types can be found here: http://openlayers.org/en/v3.1.1/apidoc/ol.geom.html