I have *ol.source.Cluster* with *ol.source.Vector* as a source with 
*ol.Collection* as features property of the vector source.

Every second a do a request to server to get some updates which leads to 
bulks of operations like  push/remove/geometry edits on given 
*ol.Collection*. 

The problem is because for every single(one by one) mentioned action, 
ol.Colection ol.Feature triggers an event(add, remove, change) which is 
caught eventualy by the cluster which makes an internal extensive task - 
ol.source.Cluster.prototype.refresh_(). A solution is to add methods(e.g. 
ol.Collection.silentPush(), ol.geom.*.silenceSetCoordinates()) which 
doesn't trigger these events or capabilities to remove the default events 
on  ol.Collection or ol.Feature, and let the user to manual make a refresh 
after all operations are made. In this case all changes would be processed *at 
once*, *not one by one* => reducing the number of 
ol.source.Cluster.refresh_() calls. 

I saw a similar problem here 
<https://github.com/openlayers/openlayers/issues/6768> but he might solve 
his problem using arrays instead of olCollection. I cannot do this, because 
i don't replace all features with new ones, but just edit a part of them.
I also posted on SO here 
<https://stackoverflow.com/questions/44257236/disable-ol4-some-default-event-listeners>,
 
where i tried to find out how to remove certain default event listeners.

Any other ideas, how to reduce this performance impact?

-- 
You received this message because you are subscribed to the Google Groups 
"OpenLayers Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to openlayers-dev+unsubscr...@googlegroups.com.
To post to this group, send email to openlayers-dev@googlegroups.com.
Visit this group at https://groups.google.com/group/openlayers-dev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/openlayers-dev/aae82dcb-a125-4093-aa86-ff931e56d715%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to