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

Raster source cache size is incorrectly set #4313

Closed
chrisvoll opened this issue Feb 22, 2017 · 1 comment
Closed

Raster source cache size is incorrectly set #4313

chrisvoll opened this issue Feb 22, 2017 · 1 comment
Labels

Comments

@chrisvoll
Copy link
Contributor

Hello! As part of investigating #4311, I noticed that in some cases the source cache size for raster tiles may be set incorrectly.

To reproduce:

  1. Load this jsbin that includes a raster source; I've reproduced this on both retina and non-retina displays, using Chrome on macOS

  2. Open the console to see that the actual cache size is too small for the number of tiles

mapbox-gl-js version: 0.32.1

Expected Behavior

The cache should be able to accommodate 5 zoom levels of tiles (if I'm interpreting the line const commonZoomRange = 5; correctly)

Actual Behavior

The cache only accommodates ~1.5 zoom levels of tiles. SourceCache#updateCacheSize is using transform.tileSize, which has a value of 512px, when the tiles are actually 256px. As a result, it thinks that 1/4 as many tiles are being rendered.

Am I correct that the intent in SourceCache is to cache 5 zoom levels of tiles?

From what I can tell, this issue only affects raster sources, not vector sources (here's a vector jsbin for reference). Even with the limited cache size, the map still functions pretty well, so I don't think there's any rush to fix this before #2291 is complete.

@jfirebaugh
Copy link
Contributor

Good catch! We fixed the equivalent bug in mapbox-gl-native in mapbox/mapbox-gl-native@44b960f.

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

3 participants