Skip to content

Re-render on feature changes #1842

merged 1 commit into from Mar 12, 2014

4 participants

OpenLayers member

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.

twpayne commented Mar 11, 2014

+1, this makes sense to me. Thanks for the fix!

OpenLayers member
tschaub commented Mar 12, 2014

Thanks @elemoine. Looks good to me (bonus points if you can add tests).

OpenLayers member

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.

@elemoine elemoine merged commit 9346642 into openlayers:master Mar 12, 2014

1 check failed

Details default The Travis CI build could not complete due to an error
@elemoine elemoine deleted the elemoine:1798 branch Mar 12, 2014

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 (
at ol.source.Vector.handleFeatureChange_ (
at (
at (
at (
at ol.Object.notifyInternal_ (
at ol.Object.set (
at http://localhost:52264/IDM.Common.Client.Map.js:1401:21
at ol.structs.RBush.forEach_ (
at ol.structs.RBush.forEach (

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.