How to get control or interaction with the card

How to get a specific ol.control or ol.interaction from ol.Map? I have several dynamically added maps on one page, and I want to have access to ol.interaction.Select.

+7
openlayers-3
source share
1 answer
map.getInteractions().forEach(function (interaction) { if(interaction instanceof ol.interaction.Select) { ... } }); 

The same goes for controls.

+10
source share

All Articles