Compute Best Available Level Over Rectangle always returns 0

HI,

In my app, I am creating Terrain using ‘fromWorldTerrain’ and whenever the terrain is ready I am fetching the best terrain Level available for a rectangle.

using provider.availability.computeBestAvailableLevelOverRectangle

But for any rectangle it always returns 0, by default.

Sandcastle Demo

Thanks.

I did not yet dive into the details. (It may be complicated). But from a quick look at the only place where these functions are used, inside of CesiumJS, it looks like this is anticipated: cesium/packages/engine/Source/Core/sampleTerrainMostDetailed.js at d8a6d050db29f22dbe977675293f453a99d72d50 · CesiumGS/cesium · GitHub

There, the process will be to perform some sort of sampling and apparently load the levels incrementally, until it is “running out of levels”. Maybe someone can provide further hints here, or derive a function like reallyAndActuallyComputeBestAvailableLevelOverRectangle that really and actually computes the best available level instead of just returning 0.