Skip to main content
1 of 3
Tommaso
  • 1k
  • 9
  • 13

You can pass an array of layers to the select control

selectControl = new OpenLayers.Control.SelectFeature(
    [lineLayer, pointLayer],
    {
        clickout: true, toggle: false,
        multiple: false, hover: false,
        toggleKey: "ctrlKey", // ctrl key removes from selection
        multipleKey: "shiftKey" // shift key adds to selection
    }
);
        
map.addControl(selectControl);
selectControl.activate();

See the openlayers documentation

Tommaso
  • 1k
  • 9
  • 13