[OpenLayers-Users] Highlighting Features in Vector Layers
Adam Ratcliffe
adam at prema.co.nz
Tue Aug 3 17:18:48 EDT 2010
Hi,
I have a map with several vector layers. The application allows the user to execute a proximity search around a point, targeting one or more of the vector layers on the map - this is implemented as a WFS request with a DWITHIN filter.
I would like to highlight all features displayed on the map that were matched by the proximity search. The highlight style should be different from the feature select style, and if a matched feature is selected upon being deselected it should revert to the highlight style.
I have a SelectFeature control added to the map which references all of the map's vector layers and I see that the SelectFeature control provides a highlight() method however this method would appear to highlight the feature using the control's selectStyle or renderIntent properties only which would not allow me to specify a highlight style different from the select style.
I could try changing the SelectFeature control's renderIntent property prior to using it to highlight the features and revert the property value after highlighting but that seems like a bit of a hack. Is there a better way of doing this?s
Cheers
Adam
More information about the Users
mailing list