Prevent Cesium from scaling up lower resolution tiles

I’m loading WMS tiles from GeoServer for a vector layer where the point style renders icons over a base map layer. Because the icons are rasterized onto the tiles on the server at specific zoom levels, when zooming in or panning around the view (especially on flyTo calls) where current resolution tiles are not yet available, Cesium will momentarily scale up lower resolution tiles of that vector layer—often by many levels—such that the icons could appear as large as the entire viewport! This annoying effect disappears in about a second, or until tiles with icons rasterized at the new resolution have been loaded.

Scaling up the base map layer is fine—or else there will just be void—but scaling up a rasterized vector layer is undesirable in this particular case. So I’m looking for a way to prevent Cesium from loading lower resolution tiles for a specific layer: it should just display nothing if the intended tile isn’t available yet.

I found a related discussion that desires the opposite behavior: preventing loading of higher level tiles when lower ones are unavailable, but saw no complementary solution.

I have experimented with using the minimumTerrainLevel constructor option for Cesium.ImageryLayer, but setting a static value when the layer extent is large only suppresses the lowest zoom levels, and doesn’t address panning around at the same scale.

Here’s a Sandcastle example that demonstrates this problem (you may need to copy the Gist separately into a new Sandcastle window if Sandcastle cannot load it: Cesium Sandcastle Icon Scaling Issue · GitHub and make sure to disable browser caching via debugger to see the problem exaggerated)

In the example referenced above, I have added an option to completely hide the layer while calling flyTo, but it’s not ideal if I have multiple vector layers visible that I’ll have to toggle visibility, and it won’t work if the user simply pans around.

Hi Erhhung, thanks for your detailed summary of the problem.

This gets into pretty core behavior of the terrain/imagery system and there isn’t a simple fix. It’s not really that CesiumJS scales up the tiles but rather CesiumJS shows the tiles that match the currently loaded LOD, which resolves as the scene loads. You’ll notice similar problems in 2D mapping libraries.

The problem with displaying nothing while new tiles are loading is that the imagery will constantly pop in and out. This might look worse in practice. Or maybe for vector imagery it would look ok.

As you mentioned minimumTerrainLevel is the closest workaround but is not a perfect solution when panning past the minimumTerrainLevel. Maybe minimumTerrainLevel could be dynamically set at runtime which would let the app adapt to the current zoom level. We’d need to figure out the scope of that change. We’ll put some more time into thinking about this after the upcoming CesiumJS release.