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.