Skip to content

Re-render on feature changes #1842

Merged
merged 1 commit into from Mar 12, 2014

4 participants

@elemoine
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
twpayne commented Mar 11, 2014

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

@tschaub
OpenLayers member
tschaub commented Mar 12, 2014

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

@elemoine
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
@theoutlander

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 http://localhost:52264/IDM.Common.Client.Map.js:1401:21
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)

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.