[GIS] How to change the appearance of a Feature.Vector that’s already displayed

openlayers-2symbology

I've created a bunch of Feature.Vectors from Point objects and assigned them a Style. Now I want to dynamically change the appearance of one of the features in real time; e.g., change it from red to blue. (I am NOT hovering over the feature.) I've tried changing its Style, then doing refresh() on the layer, or redraw(), etc, and either nothing happens or the feature disappears. Any suggestions? Thanks.

Best Answer

Redraw method should solve your problem, see my little example: OpenLayers: modifying feature style

UPD: I've modified my example a little bit: OpenLayers: modifying one feature style