I`m trying to run a function on clicking and highlighting of a vector
layer. the events do not seem to trigger..
what am i doing wrong here?
my code
var report = function(e) { // it will be called when event is trigered
from eventListeners
console.log(e.type, e.feature.id);
//alert(e.feature.id);
};
var highlightCtrl = new
OpenLayers.Control.SelectFeature(vector_layer, {
hover: true,
highlightOnly: true,
renderIntent: "highlight",
eventListeners: {
beforefeaturehighlighted: report,
featurehighlighted: report,
featureunhighlighted: report
}
});
var selectCtrl = new OpenLayers.Control.SelectFeature(vector_layer,
{clickout: true}
);
map.addControl(highlightCtrl); // add high lighting
map.addControl(selectCtrl); // add selection
highlightCtrl.activate();
selectCtrl.activate();
--
I.R
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users