Pending tiles causes delay in scene rendering

In my app, I’m using multiple imagery layers, and terrain data ( custom terrain data served from a third party server), the problem is one of the imagery layers (wmts ) has some tiles that are pending, when triggering rendering events ( e.g zooming in / out) the whole scene wouldn’t update until the pending tiles are loaded or timed-out ( server time out is 120 seconds). Is there a way to set a timeout policy for pending tiles in cesium ? I can see a TileDiscardPolicy but I don’t know how to utilize it.

before zooming

after zooming in

waiting for almost 2 mins to resolve pending tiles, then the scene continue rendering

@baloola

Welcome to the community! Thank you for sharing some details about your issue. Do you have any idea why certain tiles are taking excessive amounts of time to load? I have not seen this behavior in the past.

TileDiscardPolicy seems like the correct tool to use here. Unfortunately, I do not have a sandcastle demo that showcases how to use this object. However, can share some documentation and a code snippet. According to the docs, TileDiscardPolicy should be called as such.

Cesium.TileDiscardPolicy(<ADD_YOUR_IMAGE_FILE>);

https://cesium.com/learn/cesiumjs/ref-doc/TileDiscardPolicy.html

How are you currently using TileDiscardPolicy? Let me know if you have any other questions or concerns. I am looking forward to learning more.

-Sam

Thank you @sam.rothstein for your reply,
the issue in generating tiles comes from our backend, we haven’t encounter this when we were using other mapping libraries ( openlayers). Basically it struggles to generate low zoom levels requested by cesium imagery providers.
I noticed - if I understand correctly - that high level tiles must wait for parents -starting from level zero to be loaded at least until it gets rendered,
I was wondering if there is a way not to wait for these tiles to load, or to set up a timeout for them or skip them even (e.g. use a dummy tile instead).

@baloola

Thank you for sharing an update with me! I do not think that our spec supports a way to set up a timeout for loading in tiles. However, your idea about using a dummy tile is intriguing. How exactly would you generate a tileset with these “dummy” tiles?

-Sam

@sam.rothstein
I had to ditch the dummy image approach and go with setting a timeout to the loading module, so by editing Resource._Implementations.loadWithXhr function in our specific case and adding these lines to the request (line 2089) :

            xhr.timeout = 5000;
            xhr.ontimeout = function (e) {
              deferred.reject(new RequestErrorEvent());
            };

Not sure if enabling a timeout option for imagery provides is a good idea - it was needed in our case - .

Thanks

@baloola

Thank you very much for sharing this update with me :grin:

I am happy to hear that you moved away from the dummy image approach. While that approach may have provided you with a temporary work-around, it was not a scalable solution.

-Sam

1 Like