This code works fine as it is, but it seems to depend on which layers are added to the map before adding controls. Is this always the case, or am I doing something wrong?
var highlightCtrl = new OpenLayers.Control.SelectFeature([a,b], { hover: true, highlightOnly: true, renderIntent: "temporary", eventListeners: { featurehighlighted: make_popup, featureunhighlighted: kill_popup } }); var selectControl = new OpenLayers.Control.SelectFeature([a,b,c,d], { clickout: true, toggle: false, multiple: false, hover: false }); map.addLayer(a); map.addLayer(b); map.addLayer(c); map.addLayer(d); map.addControl(highlightCtrl); map.addControl(selectControl); highlightCtrl.activate(); selectControl.activate();
source share