langdonx

Dynamic Clustering

Discussion created by langdonx on Apr 25, 2013
Latest reply on Apr 26, 2013 by langdonx
In looking at the ClusterLayer example and reading the forums, I gather that it was strictly written to handle a single chunk of static data.

However, in playing around with it, it seems that it is partially capable of handling dynamic data:
1. Preview this: http://plnkr.co/edit/NnWEBtpzllEZmwngSkX9?p=preview
2. Zoom out a few levels when you can and see how the existing clusters change
3. Also see the console ("didn't find exactly one LABEL:  []")

So it seems that:
1. If there's an existing cluster available, the point will be added to it
2. If no suitable cluster exists, and no interfering point has been created, one will be created
3. If an interfering point exists (and there's no existing cluster) it throws that error about ("didn't find exactly one LABEL:  []");

I made some super simple modifications to get dynamic adding/removing/clearing of points here:
- http://plnkr.co/edit/a2nKNFWQM0R7U8BOvJnl?p=preview (overwritten with new changes)

But having to redraw the points each time an add/remove/clear action occurs isn't optimal.

Has anyone spent some time tweaking ClusterLayers to get this kind of functionality without the redraw effect?  I'm going to attempt to do it, but I'd rather save myself the pain if someone else has already done so.

TIA!

Outcomes