One common action when working with features within a vector layer is its selection and, of course, OpenLayers has some feature selection controls.
OpenLayers.Control.SelectFeature control is specially useful as a selection control because the selection is made on the client side, that is, the selection is made through the features loaded in the browser. There is no request to a WFS server.
OpenLayers.Control.SelectFeature control can work in different ways. We can select a feature just by clicking on it or we can draw a box to select all the contained features.
In contrast, it does not allow the possibility to select features that intersect with a path.
In this recipe, we are going to see how we ...