Hello everyone,
I know that this is a common question, but I've searched on archives and
also tried the examples but I've been failing miserably.
All I need is to attach two layers to a SelectFeature control. I expect to
execute something when the user clicks on a feature of any of the layers.
---------------------------8<----------------------------------------------------------------------
/* Control to allow user to click on indicators */
var layers = [entities.layer_office, suburbs.suburbs_layer];
select_control = new OpenLayers.Control.SelectFeature(layers, {
clickout: true,
onSelect: function(e) {
console.log(e);
},
onUnselect: function(e) {
console.log(e);
}
});
map.addControl(select_control);
select_control.activate();
---------------------------8<----------------------------------------------------------------------
Entities.layer_office and suburbs.suburbs_layer are Vector Layers with
Feature.Vector attributes.
If I add just entities.layer_office, it works.
If I add just suburbs.suburbs_layer, it works.
If I add both (regardless of the order), the suburbs.suburbs_layer receive
the events, but entities.layer_office doesn't.
Any suggestion about what I might be doing wrong?
Thank you!
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users