2

I'm investigating OpenLayers and I'm trying to see if it's possible to filter down the number of displayed feature items.

Is it possible to display many nearby items as a single point item on a map when zoomed out. So instead of hundreds of nearly overlapping points I can filter them down a few dozen consolidated points? Or is this something that has to be in the Spatial server?

2 Answers 2

4

I am not too familiar with OpenLayers myself but I do know that the term for this is 'clustering' and it looks like there is a class in OpenLayers expressly for this: OpenLayers.Strategy.Cluster

Example page: http://openlayers.org/dev/examples/strategy-cluster.html

Try Googling around a bit for "openlayers" and "cluster" and you'll find a lot more.

1

Since version 6.0, MapServer has the ability to combine multiple features from a point layer into single (aggregated) features based on their relative positions. So if you are using Mapserver you can try it. I've used this feature in one of my project, you can see result here. Clustering on client side as mentioned above is not right way if your layer contains a lot of features.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.