I would like to export the features drawn on my OpenLayers map in GeoJSON format.
So far everything is working apart from the properties section, which keeps coming with nothing, as you see below.
I would like to define something for every individual drawing I make on the map.
I found some nice approaches here:
but it doesn't work in my code:
var lineInteraction = new ol.interaction.Draw({ type: 'LineString', source: vectorLayer.getSource() }); lineInteraction.setActive(false); lineInteraction.on('drawend', onDrawend) { feature.setProperties({ 'id':1234, 'name': 'yourCustomName' }); console.log(feature, feature.getProperties()); }); Is it the OpenLayers library reason behind it? The aforementioned example refers to version 3.0.
My full JS fiddle is here: https://jsfiddle.net/fb9mtyz3/
