[OpenLayers-Users] source of an event in openlayers3

Dave Potts dave.potts at pinan.co.uk
Thu Jun 25 16:15:02 PDT 2015


If I define a general purpose event listener in openlayers3 which is 
attached to two layers by saying something like


map.addInteraction(selectClick selectClickOn('select',function(e){
     console.log("Select items" + e.selected.length);
}

Where
var selectClick= new ol.interaction.Select({
     condition:ol.events.condition.click
});

When somebody select something the click handler will be invoke and the 
selected object may be accessed from e.selected, is there way within the 
event handler of finding out which layer the selected object comes from?

Dave


More information about the Users mailing list