Fergus,
You can implement this with client part events (onSelect and onUnselect). Here is the codes for that.
Server Side Code:
Feature feature = new Feature(new RectangleShape(-110.22, 50, -80.03, 30));
feature.ColumnValues.Add("description", "this is description message.");
Map1.HighlightOverlay.Columns.Add(new FeatureSourceColumn("description"));
Map1.HighlightOverlay.HighlightStyle = Map1.HighlightOverlay.Style;
Map1.HighlightOverlay.Features.Add("feature", feature);
Client Side Code:
var OnMapCreated = function(map) {
var control = map.getControlsByClass("OpenLayers.Control.SelectFeature")[0];
// Implement its onSelect events, it occurs whenever mouse over the features.
control.onSelect = function(feature) {
SelectedFeature = feature;
// Here is custom implement code for select event.
onCustomFeatureSelect(feature);
}
// Here is custome implement code for unSelect event.
control.onUnselect = onCustomFeatureUnSelect;
}
var onCustomFeatureSelect = function(feature) {
var columnValues = '';
// feature.values is corresponding to the columnValues of the feature on the server side.
for (var key in feature.values) {
var columValue = feature.values[key];
columnValues = key + ':' + columValue + ';';
}
alert(columnValues);
}
var onCustomFeatureUnSelect = function(feature) {
alert("Feature Unselected");
}
Let me know for more queries.
Ben