QuadTree - Tiles


As you can see in the image, not all tiles that are rendered belong to the same level. There are tiles from level 4 (the ones in the center) and tiles from level 3 (the ones in the borders). I understand that what is done in the borders is more efficient than loading every tile from level 4, as less tiles are loaded.

However, due to my specific problem, I need every tile to belong to the same zoom level. Is there any easy way to do so?


Hi Juan,

Each LOD tile is selected for rendering based on the distance to the camera. In order to get the functionality you want, you’ll need to modify the source code in this and related functions: https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/QuadtreePrimitive.js#L443

In particular, you’ll need to factor out how the Screen Space Error (SSE) is calculated by factoring out distance and using your own metric here: https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/QuadtreePrimitive.js#L706

If you come up with something workable, it may be an option we could integrate into core Cesium! We’d be happy to review, just check out CONTRIBUTING.md and submit a pull request.



Ok, thanks for the reply! I’ll look into it and let you know if I come up with anything.

Hi Gabby,

I modified the function you mentioned (screenSpaceError, which is called by visitTile). I used a constant number, just to test it out.

For same-latitude tiles, it works fine: all are rendered for the same zoom level.

However, I still get this sort of thing for higher (or lower) latitudes:

Do you have any idea why this happens? I am debugging Cesium, and find that (in this specific case) for the parent tile L4X7Y5, the two southern children’s tile.data.imagery[0].readyImagery.level is 5 (correct), while for the northern ones, it’s 4. I don’t understand why.

Thanks a lot!

What constant number did you set it to?

If it’s too small, tiles will never refine. If it’s too big, they’ll constantly refine to the highest detail. From my test it looks like the refinement is triggered only when you move the camera, so that might be why you see those differences.

Actually, I changed where it checks for SSE completely (just for testing purposes). I went from:

if (screenSpaceError(primitive, frameState, tile) < primitive.maximumScreenSpaceError)



if (tile._level >= 5)


So I would expect every tile to up to level 5, right?

However, at some latitude I get level 4 tiles, and northern still, even level 3 ones!

I really don’t get why this happens. Thanks for your time!

I was actually unable to replicate this. I did the same change you proposed there, and while I do see some level 3 and 4 tiles, they will eventually refine into level 5 once the tiles load.

Are you seeing them stuck on level 3 or 4 regardless of how long you wait?

Yes, they don’t refine, though I believe that IS what should happen if they are in view!

I’ll update my Cesium version (1.49) just in case. Could you share an image with me? How do you know they refine?