-
Notifications
You must be signed in to change notification settings - Fork 182
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
Maximum Number of Markers #19
Comments
Yep, there is currently a limit of 64 markers: Line 132 in 75a46e4
It's tricky to work around it due to how shaders work, I'll keep this issue open for now. |
Ah, I see, thank you! What would happen if I was to fork the component and delete the limit, would things go crazy? |
Yes, the globe will be extremely slow if you change it to 6,000 (like 100x slower)... I think you can somehow try to merge these markers, because even if you are displaying all of them, those that are very near will be almost overlapped so can be maybe just one marker. |
@sampoder did you try removing the limits? How was your experience? @shuding |
It's mostly not just about the tech and how performant it is, but how our code was implemented. Basically we have:
And that loop makes things a lot slower and grows linearly. A reimplementation of turning markers into individual vertex fragments would solve this completely but that's a lot of work unfortunately. |
@shuding aha, ok I understand it better now. I didn't peak yet under the hood, and didn't assume it would be structured like this. Is the 64 currently used like a "safe" point to keep it performant, or you think it can be bumped a bit while still remaining acceptable in performance? I was also searching via ThreeJS and came to this package from globe.gl: They have some example based on polygons, it's not like your nice package but it does show a lot datapoints for every polygon while rendering still seems to be smooth. This one also looks very slick: https://globe.gl/example/airline-routes/us-international-outbound.html But this is also quite overkill for my simple use case. If I could raise the 64 to 3X~4x that number, it would already solve my use case. Anything I could help with to make your version into vertex fragments? Or what would you need to make this possible? |
@codeagencybe I think you can fork (or just inline this lib) to try it and bumping the number up, 170 might be fine! The 64 was something I picked as a safe bet but it can probably be a bit higher especially when the canvas dimensions are not huge. |
+1 200 limit seems more appropriate (there are 193 countries). |
Hey!
I'm trying to render around 6,000 but only 50 or so markers seem to be showing up on my map, code is here: https://github.com/hackclub/site/blob/10c57825053b4d6a12ba9fb7acaa03926150b971/pages/donate2.js#L48 and the preview is deployed here: https://v3-git-redesign-donate.hackclub.dev/donate2/ and my markers are here: https://github.com/hackclub/site/blob/redesign-donate/components/donate/locations.js
I was wondering if there's a max no. of markers?
Thanks so much!
The text was updated successfully, but these errors were encountered: