I have following simple draw interaction:
draw = new ol.interaction.Draw({
features: featureOverlay.getFeatures(),
type: (type)
});
Now I would like to add attributes like a name and id to the feature. Is this possible? I couldn't find an awnser to this anywhere until now.
Does anyone know how to do this?
Best Answer
You just need to add an event listener on the
draw
variableBe aware that there is a a function
setId
one.feature
but this "id" is a bit different from the one you set in the attributes (see the API docs)