Let's say that we added a point into to the map by using the code below:
const addInteraction = (source) => {
draw = new ol.interaction.Draw({
source: source,
type: "Point",
style: new ol.style.Style({
fill: fillStyle,
stroke: strokeStyle,
image: circleStyle,
}),
});
map.addInteraction(draw);
draw.setActive(false);
draw.on("drawend", (_event) => {
draw.setActive(false);
});
};
After clicking the left click this code add point into the map but I want to add an undo option or delete option for that point. Removing interaction did not work. How can I do this?