This PR fixes #1798. It should also fix a bug that was reported on the mailing list.
The vector source now listens to both "change" and "propertychange" from its features. And with this there's no need to trigger a "change" event when the geometry is changed on the feature – the "propertychange" event is sufficient.
+1, this makes sense to me. Thanks for the fix!
Thanks @elemoine. Looks good to me (bonus points if you can add tests).
Re-render on feature changes
Thanks for the reviews. I am merging this although the Travis build doesn't pass, as it looks like the failure is a transient error due to some GitHub downtime.
This feature was working as expected after this check-in. However, since yesterday I think I'm seeing this exception being thrown and my animation obviously doesn't render. The issue is because I'm changing the property inside vectorSource.forEachFeature. I don't see why this exception should be thrown. Having to track another list and set the values will create a bit more lag for the amount of data I'm working with. Thanks!
Error, 3/16/2014 1:54:33 PM, Error: cannot update value while reading
at ol.structs.RBush.update (http://ol3js.org/en/master/build/ol-whitespace.js:25147:11)
at ol.source.Vector.handleFeatureChange_ (http://ol3js.org/en/master/build/ol-whitespace.js:25294:19)
at goog.events.EventTarget.fireListeners (http://ol3js.org/en/master/build/ol-whitespace.js:8504:23)
at Function.goog.events.EventTarget.dispatchEventInternal_ (http://ol3js.org/en/master/build/ol-whitespace.js:8548:26)
at goog.events.EventTarget.dispatchEvent (http://ol3js.org/en/master/build/ol-whitespace.js:8463:34)
at ol.Object.notifyInternal_ (http://ol3js.org/en/master/build/ol-whitespace.js:8731:8)
at ol.Object.set (http://ol3js.org/en/master/build/ol-whitespace.js:8750:10)
at ol.structs.RBush.forEach_ (http://ol3js.org/en/master/build/ol-whitespace.js:24990:27)
at ol.structs.RBush.forEach (http://ol3js.org/en/master/build/ol-whitespace.js:24973:19)