Skip to content
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

Large sprite sheet .png pixel size + many symbols onscreen -> rbush.js error #933

Closed
kristfal opened this issue Jan 14, 2015 · 5 comments
Closed
Labels

Comments

@kristfal
Copy link

Environment:

OS X Yosemite
Chrome 39.0.2171.95 (64-bit)

Using a custom dataset (hosted @mapbox).
Using custom styling and sprite sheet generated by latest mapbox-gl-js release.

I can share the style, sprite sheet and dataset in a PM if needed.

Issue:
In regions (and at lower zoom levels) with a high amount of symbols (roughly 20-30 onscreen) rendered from the sprite sheet, symbols switch sprite source from the correct symbols to random symbols in the sprite sheet. Additionally, tiles with sprites do not render when viewing new areas and the console prints error:

rbush.js:252 Uncaught TypeError: Cannot read property 'leaf' of undefined

The sprite sheet contains 54 sprites.
The normal sheet is 35kb, at 814x814px.
The retina sheet is 80kb, at 1614x1614px.

Hotfix/workaround:

We reduced sprite sheet pixel size:

The sprite sheet still contains 54 sprites.
The normal sheet is now 30kb, at 482x442px.
The retina sheet is now 66kb, at 982x876px.

The issue is no longer present, even when forcing screen resolution to 3000x3000px and viewing 80+ symbols onscreen.

Let me know if you need more info.

@jfirebaugh
Copy link
Contributor

This is probably similar to #653 / #141 in that the sprite atlas (internal storage for sprite images) is overflowing.

@andrewsunglaekim
Copy link

@kristfal where did you change the sheet pixel size?

@kristfal
Copy link
Author

@andrewsunglaekim you'll have to reduce the size of the .pngs that you use to generate the sprite sheet. Remove any padding (or in worst case resuce icon size, and overscale them in you style).

@tmcw tmcw added the bug 🐞 label May 26, 2015
@mourner
Copy link
Member

mourner commented Feb 5, 2016

@kristfal is this still reproducible?

@kristfal
Copy link
Author

kristfal commented Mar 3, 2016

@mourner Sorry for slow reply. I'm unable to reproduce, feel free to close

@mourner mourner closed this as completed Mar 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants