Open vutle opened 3 years ago
I've created a demo adding 1 million circles here (the tab might report as not responding, just need to wait for it to finish) but I can't reproduce what you are seeing. Can you provide the whole code to reproduce it?
Interesting:
When I run the below code to create approximately 100k circles, after loading for sometimes, Chrome and Edge browser warn of an out of the memory. for(var i = 0; i < latlngs.length; ++i) { var circle = L.circle(latlngs[i], radius); quadtree.add(circle); }
The colliders inside Quadtree.js file grows to > 35 million objects at this loop.
//Append our own elements and if we have children, theirs colliders = colliders.concat(self.elements); for(var i=0, len=self.nodes.length; i<len; ++i) { colliders = colliders.concat(self.nodes[i].getPossibleColliders(bounds)); }
also number of element at line 123 grows without stopping: self.elements.push(elem);
After sometimes I get this error below:
Uncaught RangeError: Invalid array length
at Array.concat (
On Mon, Jun 28, 2021 at 3:55 AM Isaac Besora Vilardaga < @.***> wrote:
I've created a demo adding 1 million circles here https://ibesora.github.io/Leaflet.Quadtree/demos/1M/demo.html (the tab might report as hang but you just need to wait for it to finish) but I can't reproduce what you are seeing. Can you provide the whole code to reproduce it?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ibesora/Leaflet.Quadtree/issues/4#issuecomment-869202339, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPT5CFFBI7HILGHTUALWITTU5QZXANCNFSM47LCY5GQ .
I tried to add 100k markers and it seems the library is running in an infinite loop, it adds items forever.
More than 8 million objects... and still going before I stop the browser as it hang. I have to kill it.
I'm using the latest leaflet.
for(var i = 0; i < latlngs.length; ++i) {
}