[OpenLayers-Users] Removing features from a cluster

Xavier Mamano (jorix) xavier.mamano at gmail.com
Wed Jan 15 10:15:57 PST 2014


Hi,

This is not supported by the OL standard. Some time ago I wrote some code to
adjust issues in Cluster strategy, I think this problem is also solved in my
code.

Try use: 
 
https://github.com/jorix/OL-Ragbag/blob/gh-pages/lib/Ragbag/Strategy/CenteredCluster.js

See example: 
 
http://jorix.github.io/OL-Ragbag/examples/strategy-centered-cluster-add-remove.html
This example allows dynamically add points, and enable/disable the Cluster
strategy. But only deletes the entire cluster (while strategy is enabled),
otherwise it should work with the js (while Cluster strategy is active in
the layer are clusters that contains a array of features --named cluster--)

> but it seems the strategy itself keeps a cache of the features.
Yes, named teatures. In this aspect disable cluster works differently than
OL staqndad code, the features of the layer are restored.

Xavier


dnbphysicist wrote
> Hello all, I've done some searching on Google of this, but haven't found a
> good way to accomplish it yet. I have a map that allows other applications
> to add and remove layers and features from it dynamically. If a vector
> layer is clustered and another application goes to delete one or more of
> the features in the cluster, obviously the remove features function is not
> going to work. Is there a good way to do this? I tried iterating over all
> of the clusters, and then the features in that cluster but it seems the
> strategy itself keeps a cache of the features. I also tried deactivating
> the strategy, but it seems that just causes the layer to retain the
> clusters as features and no longer expands or contracts with zoom ins and
> outs (not surprisingly). Any help would be greatly appreciated.
> 
> Thanks in advance!
> 
> _______________________________________________
> Users mailing list

> Users at .osgeo

> http://lists.osgeo.org/mailman/listinfo/openlayers-users





--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Removing-features-from-a-cluster-tp5098224p5098245.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list