-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infinite loop at add #4
Labels
Comments
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. |
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 (<anonymous>)
at i.getPossibleColliders (Leaflet.Quadtree.js:289)
at i.getPossibleColliders (Leaflet.Quadtree.js:289)
at i.getPossibleColliders (Leaflet.Quadtree.js:289)
at i.getColliders (Leaflet.Quadtree.js:310)
at i.updateChildNodesElements (Leaflet.Quadtree.js:185)
at i.add (Leaflet.Quadtree.js:104)
at Object.success (dashboard:928)
at c (jquery.min.js:2)
at Object.fireWith [as resolveWith] (jquery.min.js:2)
…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
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABPT5CFFBI7HILGHTUALWITTU5QZXANCNFSM47LCY5GQ>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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)
{
}
The text was updated successfully, but these errors were encountered: