Vaadin Open Layers Wrapper ... Support for Clustering?

Vaadin Open Layers Wrapper … Support for Clustering?

The OL Javascript API supports clustering via the layer’s ‘strategy’ attribute.

Starting with an empty JS array of Vectors called ‘clusters’ we can hook up the cluster strategy:


                clusters.strategies = [strategy]
;
                strategy.layer = clusters;
                strategy.activate();

(this based on their "strategy-cluster-threshold.html’ example)

and then add the features all at once:

                clusters.addFeatures(features);

This works as expected: as you zoom in and out, it reclusters the features – nearby features get grouped into a single displayed vector.

Sadly, this seems to not work with the Vaadin Open Layers Wrapper. I think the reason is that VOL wants to add the features one at a time. This results in only a single feature being drawn. I can reproduce the failure in JS by adding the features that way:


                var i;
                for (i = 0; i < features.length; i++) {
                    clusters.addFeatures(features[i]
);
                }

(if you don’t use clustering, then this works as expected).

I’m looking for thoughts on how to get support for clustering.