I want to add select and translate interaction by using something like addInteraction function. I know I can do something like this
const select = new ol.interaction.Select({});
const translate = new ol.interaction.Translate({
features: select.getFeatures(),
});
map = new ol.Map({
interactions: ol.interaction.defaults().extend([select, translate]),
target: 'map',
layers: layersCollections,
view: view,
});
But I don't want to add this interaction when I create map. I want to add them after I create the map. How can I do that?