# Implicit tiling: availableLevels

**URL:** <https://community.cesium.com/t/implicit-tiling-availablelevels/19559>\
**Category:** CesiumJS\
**Created:** [July 16, 2022, 7:47am UTC](https://community.cesium.com/t/implicit-tiling-availablelevels/19559 "2022-07-16T07:47:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bertt](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/bertt/32/2702_2.png) [@bertt](https://community.cesium.com/u/bertt)\
**Post date:** [July 16, 2022, 7:47am UTC](https://community.cesium.com/t/implicit-tiling-availablelevels/19559/1 "2022-07-16T07:47:35Z")

</div>

In implicit tiling there is a property ‘availableLevels’, what’s the purpose of this property?  
For example: [3d-tiles-samples/tileset.json at main · CesiumGS/3d-tiles-samples · GitHub](https://github.com/CesiumGS/3d-tiles-samples/blob/main/1.1/SparseImplicitQuadtree/tileset.json#L18)

I can set any value or remove the property, but I don’t observe any change in behaviour of the viewer (I’m using CesiumJS 1.95)

---

<div class="post-metadata">

**Author:** ![Marco13](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/marco13/32/2757_2.png) [@Marco13](https://community.cesium.com/u/Marco13)\
**Post date:** [July 17, 2022, 11:23am UTC](https://community.cesium.com/t/implicit-tiling-availablelevels/19559/2 "2022-07-17T11:23:14Z")

</div>

From a quick glance at the CesiumJS source code, this indeed seems to be a ‘write only’ property in the current implementation. Its value is assigned from the input JSON, but apparently, it’s never used.

However, the high-level answer is that it is an important piece of information that _may_ be used by other implementations, or via future optimizations in the current implementation of CesiumJS: One feature of the implicit tilesets is that they allow a form of ‘random access’ – namely, to (more or less directly) access certain tiles in a large implicit tree, solely based on their global coordinates.

In a dedicated implementation of this, there could be something like the early bailout based on the `availableLevels` as shown in this **pseudocode** :

```auto
class ImplicitTileset {
  constructor() {
    ...
    this.availableLevels = ... // Fetched from the input JSON
  }

  Tile getTile(level, x, y, z) {
    
    if (level >= this.availableLevels) {
      return undefined; // Your princess is in another castle...
    }
    
    // Now you don't have to...
    // - compute the 'subtree' that contains the given global coordinates
    // - compute the local coordinates within this subtree
    // - check the tile availability for these local coordinates
    // - load the tile and return it
  }
}

```

Maybe someone can give more specific insights about why the `availableLevels` is not used right now, or where it _might_ be used. This might be because CesiumJS does not (yet!) have a _dedicated_ implementation of this sort of ‘random access’, but that’s a gut feeling for now.
