Reputation: 3083
How does one get a specific ol.control or ol.interaction from ol.Map? I have several dynamically added maps on a single page and I want to be able to access the ol.interaction.Select.
Upvotes: 10
Views: 7534
Reputation: 512
map.getInteractions().forEach(function (interaction) {
if(interaction instanceof ol.interaction.Select) { ... }
});
Same thing for controls.
Upvotes: 17