Refreshing map after changing Feature's style in OpenLayers 3
By chance, I have stumbled upon the answer - it is to call changed()
on the features themselves after changing the style
property of their associated data. See: http://openlayers.org/en/v3.2.0/apidoc/ol.Feature.html?unstable=true#changed
This does require me to keep track of the ol.Feature
objects associated with each vectorData
object (formerly, I only ever needed to find the vectorData
from a feature, which could be done with get()
) but this isn't much of a cost.
(I found this by looking at setGeometry
and setStyle
and other methods on ol.Feature
to see what they do.)