I have a map rendering with Polygons on a Vector layer set up as features. I set up the features so they fire off a function when the feature is selected and this works fine. The issue I'm having is when I try to allow users to select multiple features using a box. This causes the function to fire for each feature that is selected. I understand why this is, but what I really need is to have a function that fires once all of the features are selected so I can run a function using all selected features instead of having it run once for each. Here is my selectFeature code:
window[mapName].addControl(control);
control.activate();
var selectCtrl = new OpenLayers.Control.SelectFeature(layerVector, {
clickout: true,
onSelect: onFeatureSelect,
onUnselect: onFeatureUnselect,
box: true
});
window[mapName].addControl(selectCtrl);
selectCtrl.activate();
}
});
It looks like there's away to attach Handlers to Boxes but so far I've been unsuccessful. Also, I'm afraid that if the function runs after the box selection is finished, it might not be getting the full list of selectedFeatures.
Any help would be GREATLY appreciated. Thanks