Adding more points to my ClusterLayer

285
1
11-08-2013 08:07 AM
AndrewDavis
New Contributor
Hi,

I have been working with the clusterlayer examples and have had success with up to 10,000 points.  However, my database query which brings back my collection of JSON objects takes a while.

I want to start displaying results quickly, so I am trying to figure out how to start my clusterlayer with 1,000 points and then in a rolling fashion add an additional 1,000 to it.  I have the layer running (on a button click) and then I want to simulate the adding of other data points to the original clusterlayer through a button click.

So far I am having no luck with this.

Has anyone else tried something like this where you may be adding points dynamically, to an existing clusterlayer (which is on the map and has data in it)
0 Kudos
1 Reply
AndrewDavis
New Contributor
Hi, The answer is.. to go get some of the data and plunk it on the map.  Make sure you keep the original collection of objects in memory and then add more to that through subsequent db calls.

as the collection grows send it towards the clusterlayer.js in a rolling fashion.  You will have to programatically blow away the clusterlayer on the map and then replace it immediately after that.  The performance is good.

I have gotten 100K+ points on the map with no problem.
0 Kudos